Database upgrading method and device, electronic device, and storage medium
By converting database upgrade steps into preset jobs and building upgrade flowcharts, and using authorized accounts to automatically submit jobs, the problem of long database upgrade times was solved, achieving efficient business continuity and risk control.
Patent Information
- Application Number
- CN202310827824.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-06
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2043-07-06
AI Technical Summary
Existing technologies involve large manual workloads, high risks, and require highly experienced personnel during database upgrades, resulting in lengthy upgrade times and impacting business continuity.
The database upgrade process is converted into a preset job, an upgrade flowchart is built, and the job is automatically submitted to the host through authorized accounts. A combination of serial and parallel operations is used to achieve fine-grained access control and process monitoring.
It effectively reduced database upgrade time, minimized business downtime, improved business continuity, and reduced operational risks.
Smart Images

Figure CN116860719B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial technology, and more specifically, to a database upgrade method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, financial institutions often deploy databases to support their core business. According to the software maintenance lifecycle, databases require regular upgrades and maintenance to address the expiration of older versions. A standard database upgrade process involves hundreds of steps, some of which are crucial and must be implemented in a downtime database environment, meaning business operations are suspended during the upgrade.
[0003] In related technologies, the upgrade method adopted is to convert each step into a job implementation, then manually submit the jobs in sequence, and then manually judge the job return information to control the subsequent job submission process.
[0004] However, the upgrade methods in the relevant technologies have the following problems: (1) Manually submitting jobs in sequence is generally a serial operation, which involves a large workload and high operational risks; (2) Manually judging the job return information to control subsequent processes requires a high level of human experience; (3) The overall upgrade process takes a long time, and the business is suspended for a long time, which has a significant impact on business continuity.
[0005] There is currently no effective solution to the above problems. Summary of the Invention
[0006] This invention provides a database upgrade method, apparatus, electronic device, and storage medium to at least solve the technical problem in related technologies where database upgrades take a long time, resulting in prolonged business interruption and affecting business continuity.
[0007] According to one aspect of the present invention, a database upgrade method is provided, applied to a preset platform, comprising: determining a set of upgrade steps for the database to be upgraded, wherein the set of upgrade steps includes N upgrade steps, where N is a positive integer; converting each upgrade step into a preset job to obtain a set of preset jobs, wherein each preset job is configured with user information, and the user information corresponds to a permission account; constructing an upgrade flowchart based on the set of preset jobs; and, according to the upgrade flowchart, sequentially submitting the preset jobs to a preset host using the permission account corresponding to each preset job, wherein the preset host executes the preset jobs to complete the upgrade operation of the database to be upgraded.
[0008] Optionally, the step of converting each of the upgrade steps into a preset job to obtain a preset job set includes: obtaining preset function information for each of the upgrade steps, wherein the preset function information is used to indicate the function of the upgrade step; using a preset programming language, converting the preset function information into the preset job, and adding the preset job to the preset job set.
[0009] Optionally, the step of constructing an upgrade flowchart based on the preset job set includes: determining the operation order between every two preset jobs in the preset job set, wherein the operation order includes at least one of the following: serial operation order and parallel operation order; determining the job execution order based on the operation order between all the preset jobs; representing each preset job as a job node; combining all the job nodes based on the job execution order to obtain an initial upgrade flowchart; adding a start node at the top of the initial upgrade flowchart and adding an end node at the bottom of the initial upgrade flowchart to obtain the upgrade flowchart.
[0010] Optionally, after converting each of the upgrade steps into a preset job to obtain a preset job set, the method further includes: determining the permission requirements of the preset job, wherein the permission requirements include at least one of the following: operating system operation permission requirements, database operation permission requirements, and application operation permission requirements; and configuring the user information of the preset job based on the permission requirements.
[0011] Optionally, after constructing the upgrade flowchart based on the preset job set, the method further includes: determining the job type of each preset job in the upgrade flowchart; configuring response terminal information for the current preset job if the job type is interactive; sending a response request to the response terminal indicated by the response terminal information when executing the current preset job, wherein the response terminal processes the response request and returns a processing result; continuing to execute the next preset job according to the upgrade flowchart if the processing result is confirmation of execution; and interrupting the execution of the current preset job if the processing result is confirmation of non-execution or if the processing result is not received within a preset time period.
[0012] Optionally, after converting each of the upgrade steps into a preset job to obtain a set of preset jobs, the method further includes: determining the job level of the preset job; configuring a preset return code for the preset job according to the job level; and associating the preset return code with the job identifier corresponding to the preset job.
[0013] Optionally, during the execution of the preset job on the preset host, the process further includes: obtaining job execution information returned by the preset host according to a preset time interval, wherein the job execution information includes at least: a job identifier and a job return code; comparing the job return code with the preset return code associated with the job identifier to obtain a comparison result; if the comparison result indicates that the job return code is less than or equal to the preset return code, determining that the execution status is normal and continuing to execute the next preset job; if the comparison result indicates that the job return code is greater than the preset return code, determining that the execution status is abnormal and stopping the execution of the current preset job.
[0014] According to another aspect of the present invention, a database upgrade apparatus is also provided, applied to a preset platform, comprising: a determining unit, configured to determine a set of upgrade steps for the database to be upgraded, wherein the set of upgrade steps includes N upgrade steps, where N is a positive integer; a conversion unit, configured to convert each upgrade step into a preset job to obtain a set of preset jobs, wherein each preset job is configured with user information, the user information corresponding to a permission account; a constructing unit, configured to construct an upgrade flowchart based on the set of preset jobs; and a submitting unit, configured to submit the preset jobs sequentially to a preset host based on the upgrade flowchart and the permission account corresponding to each preset job, wherein the preset host executes the preset jobs to complete the upgrade operation of the database to be upgraded.
[0015] Optionally, the conversion unit includes: a first acquisition module, configured to acquire preset function information for each upgrade step, wherein the preset function information is used to indicate the function of the upgrade step; and a first conversion module, configured to use a preset programming language to convert the preset function information into the preset job, and add the preset job to the preset job set.
[0016] Optionally, the construction unit includes: a first determining module, configured to determine the operation order between every two preset jobs in the preset job set, wherein the operation order includes at least one of the following: serial operation order and parallel operation order; a second determining module, configured to determine the job execution order based on the operation order between all the preset jobs; a first characterization module, configured to characterize each preset job as a job node; a first combining module, configured to combine all the job nodes based on the job execution order to obtain an initial upgrade flowchart; and a first adding module, configured to add a start node at the top of the initial upgrade flowchart and an end node at the bottom of the initial upgrade flowchart to obtain the upgrade flowchart.
[0017] Optionally, the upgrade device further includes: a third determining module, configured to determine the permission requirements of the preset jobs after converting each upgrade step into a preset job and obtaining a preset job set, wherein the permission requirements include at least one of the following: operating system operation permission requirements, database operation permission requirements, and application operation permission requirements; and a first configuration module, configured to configure the user information of the preset jobs based on the permission requirements.
[0018] Optionally, the upgrade device further includes: a fourth determining module, configured to determine the job type of each preset job in the upgrade flowchart after constructing the upgrade flowchart based on the preset job set; a second configuring module, configured to configure response terminal information for the current preset job when the job type is interactive; a first sending module, configured to send a response request to the response terminal indicated by the response terminal information when executing the current preset job, wherein the response terminal processes the response request and returns a processing result; a first execution module, configured to continue executing the next preset job according to the upgrade flowchart when the processing result is confirmed to execute; and a first interruption module, configured to interrupt the execution of the current preset job when the processing result is confirmed not to execute or the processing result is not received within a preset time period.
[0019] Optionally, the upgrade device further includes: a fifth determining module, used to determine the job level of the preset job after converting each upgrade step into a preset job and obtaining a preset job set; a third configuring module, used to configure a preset return code for the preset job according to the job level; and a first association module, used to associate the preset return code with the job identifier corresponding to the preset job.
[0020] Optionally, the upgrade device further includes: a second acquisition module, configured to acquire job execution information returned by the preset host terminal according to a preset time interval during the execution of the preset job on the preset host terminal, wherein the job execution information includes at least: a job identifier and a job return code; a first comparison module, configured to compare the job return code with the preset return code associated with the job identifier to obtain a comparison result; a sixth determination module, configured to determine the execution status as normal and continue executing the next preset job if the comparison result indicates that the job return code is less than or equal to the preset return code; and a seventh determination module, configured to determine the execution status as abnormal and terminate the execution of the current preset job if the comparison result indicates that the job return code is greater than the preset return code.
[0021] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform any of the above-described database upgrade methods.
[0022] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement any of the above-described database upgrade methods.
[0023] In this disclosure, a set of upgrade steps for the database to be upgraded is determined, each upgrade step is converted into a preset job, resulting in a set of preset jobs. Based on the set of preset jobs, an upgrade flowchart is constructed. According to the upgrade flowchart, using the authorized account corresponding to each preset job, the preset jobs are submitted sequentially to a preset host. The preset jobs are then executed sequentially on the preset host to complete the upgrade operation of the database to be upgraded. This disclosure first determines the set of upgrade steps for the database to be upgraded, then converts each upgrade step into a preset job, and then constructs an upgrade flowchart. Following this, based on the upgrade flowchart, the preset jobs are automatically submitted to the preset host using the authorized account corresponding to each preset job. The preset jobs are then executed sequentially on the preset host to complete the upgrade of the database to be upgraded. By constructing an automated upgrade flowchart, business continuity can be improved. Furthermore, through fine-grained permission control of jobs, frequent permission switching during manual submission can be avoided, effectively reducing upgrade time. This solves the technical problem in related technologies where long database upgrade times lead to prolonged business downtime and affect business continuity. Attached Figure Description
[0024] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0025] Figure 1 This is a flowchart of an optional database upgrade method according to an embodiment of the present invention;
[0026] Figure 2 This is a flowchart of an optional build and upgrade process according to an embodiment of the present invention;
[0027] Figure 3 This is a schematic diagram of an optional database upgrade device according to an embodiment of the present invention;
[0028] Figure 4This is a hardware structure block diagram of an electronic device (or mobile device) for a database upgrade method according to an embodiment of the present invention. Detailed Implementation
[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0031] It should be noted that the database upgrade method and apparatus disclosed herein can be used in the fintech field for database upgrades, and can also be used in any field other than the fintech field for database upgrades. This disclosure does not limit the application areas of the database upgrade method and apparatus.
[0032] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, and displayed data) disclosed herein are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of such data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding access points are provided for users to choose to authorize or refuse. For example, this system has interfaces with relevant users or organizations. Before obtaining relevant information, a request to obtain the information must be sent to the aforementioned user or organization through the interface, and the relevant information will be obtained only after receiving consent from the aforementioned user or organization.
[0033] The following embodiments of the present invention can be applied to various systems / applications / devices that upgrade databases. The present invention proposes an automated database upgrade method that can reduce the workload of upgrade implementation, lower upgrade implementation risks, shorten business downtime during upgrades, and improve business continuity.
[0034] This invention defines an automated process based on the database upgrade procedure, using a combination of serial and parallel methods, and sets up user information for job submission to achieve fine-grained access control. In addition, it can automatically control the overall process by monitoring job execution and achieve automated database upgrades through automatic interaction between the platform and the host.
[0035] The present invention will now be described in detail with reference to various embodiments.
[0036] Example 1
[0037] According to an embodiment of the present invention, an embodiment of a database upgrade method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0038] Figure 1 This is a flowchart of an optional database upgrade method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0039] Step S101: Determine the set of upgrade steps for the database to be upgraded, wherein the set of upgrade steps includes N upgrade steps, where N is a positive integer.
[0040] Step S102: Convert each upgrade step into a preset job to obtain a preset job set. Each preset job is configured with user information, and the user information corresponds to a permission account.
[0041] Step S103: Construct an upgrade flowchart based on a preset set of tasks.
[0042] Step S104: According to the upgrade flowchart, the preset jobs are submitted to the preset host in sequence using the permission account corresponding to each preset job. The preset host executes the preset job to complete the upgrade operation of the database to be upgraded.
[0043] Through the above steps, the set of upgrade steps for the database to be upgraded can be determined. Each upgrade step is converted into a preset job, resulting in a set of preset jobs. Based on the set of preset jobs, an upgrade flowchart is constructed. According to the upgrade flowchart, using the authorized account corresponding to each preset job, the preset jobs are submitted sequentially to the preset host. The preset jobs are then executed sequentially by the preset host to complete the upgrade operation of the database to be upgraded. In this embodiment of the invention, the set of upgrade steps for the database to be upgraded can be determined first, then each upgrade step can be converted into a preset job, and then an upgrade flowchart can be constructed. Subsequently, according to the upgrade flowchart, the preset jobs are automatically submitted to the preset host using the authorized account corresponding to each preset job. The preset jobs are then executed sequentially by the preset host to complete the upgrade of the database to be upgraded. By constructing an automated upgrade flowchart, business continuity can be improved. And through fine-grained permission control of jobs, frequent permission switching during manual submission can be avoided, effectively reducing the upgrade time. This solves the technical problem in related technologies where the database upgrade time is long, resulting in long business interruption time and affecting business continuity.
[0044] The embodiments of the present invention will be described in detail below with reference to the steps described above. The following steps can be applied to a preset platform.
[0045] In this embodiment of the invention, the preset platform is a pre-established platform that interacts with the preset host through the host platform interaction interface. The preset platform is used for process configuration (including job writing, job concatenation, manual response, etc.), status configuration, and user configuration. The preset host is used to execute the jobs submitted by the preset platform.
[0046] Step S101: Determine the set of upgrade steps for the database to be upgraded, wherein the set of upgrade steps includes N upgrade steps, where N is a positive integer.
[0047] In this embodiment of the invention, N steps of the database upgrade process can be determined first (i.e., the set of upgrade steps for the database to be upgraded is determined, which includes N (N is a positive integer) upgrade steps).
[0048] Step S102: Convert each upgrade step into a preset job to obtain a preset job set. Each preset job is configured with user information, and the user information corresponds to a permission account.
[0049] Optionally, the step of converting each upgrade step into a preset job to obtain a set of preset jobs includes: obtaining preset function information for each upgrade step, wherein the preset function information is used to indicate the function of the upgrade step; using a preset programming language, converting the preset function information into a preset job, and adding the preset job to the set of preset jobs.
[0050] In this embodiment of the invention, for the N upgrade steps in the database upgrade process, each upgrade step can be converted into a preset job to obtain a preset job set. Specifically, the preset function information of each upgrade step can be obtained first (this preset function information is used to indicate the function of the upgrade step; for example, the function of the database shutdown operation step is to shut down the database, so the preset function information of the database shutdown operation step includes some parameter information required when shutting down the database). Then, using a preset programming language (for example, the host programming language JCL (job control language)), the preset function information is converted into a preset job (that is, a host job corresponding to the function of the upgrade step can be written using the host programming language JCL), and the preset job is added to the preset job set. For example, operations such as database shutdown, checking environment status, creating new files, and backing up files can all be automatically implemented using the JCL language.
[0051] In this embodiment of the invention, each preset job is pre-configured with user information (including username, password, etc.), and the user information corresponds to a permission account (that is, the permission account indicated by each user information has corresponding operation permissions).
[0052] Optionally, after converting each upgrade step into a preset job and obtaining a set of preset jobs, the method further includes: determining the permission requirements of the preset jobs, wherein the permission requirements include at least one of the following: operating system operation permission requirements, database operation permission requirements, and application operation permission requirements; and configuring user information for the preset jobs based on the permission requirements.
[0053] In this embodiment of the invention, the database upgrade step involves operations at multiple levels, including the operating system, database, and applications. Since host user permissions are hierarchically managed, a user may only have access to a single level of operation. Therefore, after converting each upgrade step into a preset job, user configuration is required for each preset job (i.e., the N jobs in the upgrade process need to be configured with users possessing corresponding permissions based on their permission requirements). Specifically, the permission requirements for the preset jobs can be determined first (permission requirements include: operating system operation permission requirements, database operation permission requirements, application operation permission requirements, etc.). Then, user information for the preset jobs is configured according to these permission requirements. For example, operating system-side operation steps require configuring an operating system user, and database-side operation steps require configuring a database user, etc. Through the configuration relationship between jobs and users, jobs in the automated process can be submitted with specified users, achieving fine-grained permission control and avoiding frequent user switching during manual operations.
[0054] Step S103: Construct an upgrade flowchart based on a preset set of tasks.
[0055] Optionally, the step of constructing an upgrade flowchart based on a preset job set includes: determining the operation order between every two preset jobs in the preset job set, wherein the operation order includes at least one of the following: serial operation order and parallel operation order; determining the job execution order based on the operation order between all preset jobs; representing each preset job as a job node; combining all job nodes based on the job execution order to obtain an initial upgrade flowchart; adding a start node at the top of the initial upgrade flowchart and an end node at the bottom of the initial upgrade flowchart to obtain the upgrade flowchart.
[0056] Figure 2 This is a flowchart of an optional build and upgrade process according to an embodiment of the present invention, such as... Figure 2 As shown, the method includes the following steps:
[0057] Step S201: Determine the operation order between every two preset jobs in the preset job set, wherein the operation order includes at least one of the following: serial operation order and parallel operation order;
[0058] Step S202: Determine the job execution order based on the operation sequence among all preset jobs;
[0059] Step S203: Represent each preset job as a job node;
[0060] Step S204: Based on the job execution order, combine all job nodes to obtain the initial upgrade flowchart;
[0061] Step S205: Add a start node at the top of the initial upgrade flowchart and an end node at the bottom of the initial upgrade flowchart to obtain the upgrade flowchart.
[0062] In this embodiment of the invention, an upgrade flowchart can be constructed based on a preset job set. Specifically, based on the generated N jobs, the execution order of the jobs can be sorted out one by one, and the process can be arranged in a combination of serial and parallel methods (that is, the operation order between every two preset jobs in the preset job set can be determined first (the operation order includes: serial operation order, parallel operation order, etc.), and then the job execution order can be determined according to the operation order between all preset jobs). Under the premise of ensuring the correctness of the operation logic, the concurrency can be maximized. For example, steps with strict precedence relationships can be arranged as serial operations, and steps without strict precedence relationships can be arranged as parallel operations. Therefore, the N jobs can be arranged into a directed graph (i.e., an upgrade flowchart), with each job corresponding to a node on the graph. The next node of the current job is the successor job of the current job. Only after the current node job has finished running normally can the next node start executing normally (that is, each preset job is represented as a job node, and all job nodes are combined based on the job execution order to obtain the initial upgrade flowchart). At the very beginning and the very end of the diagram, an empty task is added as the opening and closing task of the process (that is, a start node is added at the top of the initial upgrade flowchart and an end node is added at the bottom of the initial upgrade flowchart to obtain the upgrade flowchart), which is used to control the overall process.
[0063] Optionally, after constructing the upgrade flowchart based on the set of preset jobs, the process further includes: determining the job type of each preset job in the upgrade flowchart; configuring response terminal information for the current preset job if the job type is interactive; sending a response request to the response terminal indicated by the response terminal information when executing the current preset job, wherein the response terminal processes the response request and returns a processing result; continuing to execute the next preset job according to the upgrade flowchart if the processing result is confirmation of execution; and interrupting the execution of the current preset job if the processing result is confirmation of non-execution or no processing result is received within a preset time.
[0064] In this embodiment of the invention, for upgrade steps that cannot be automatically implemented or are difficult to implement using a preset programming language (these steps generally require interaction), such as the step of checking if the database is occupied by an application before shutting down the database, manual communication is required to confirm the subsequent processing flow. In this case, a manual response job is introduced to control the flow. That is, a job is written to generate an automatic host response operation. When the response is confirmed and executed, the job ends normally and the flow continues; when the response is not confirmed and executed, the job ends abnormally and is interrupted; when there is no response, the job remains in the execution state, and the flow is stuck. Therefore, manual communication can be prompted after a response is generated, and the flow can be controlled as needed after confirmation. Before a response, the flow will not be interrupted or continued and will always be in a controllable state.
[0065] In this embodiment of the invention, after constructing the upgrade flowchart, the job type of each preset job in the upgrade flowchart can be determined first. If there is a job of interactive type, response terminal information can be configured for the current preset job. When executing the current preset job, a response request can be sent to the response terminal indicated by the corresponding response terminal information. The response terminal processes the response request and returns the processing result. If the processing result is confirmation of execution, the next preset job can be executed according to the upgrade flowchart; if the processing result is confirmation of non-execution or no processing result is received within a preset time period (e.g., within 10 minutes) (i.e., no response for a long time), the execution of the current preset job can be interrupted.
[0066] Step S104: According to the upgrade flowchart, the preset jobs are submitted to the preset host in sequence using the permission account corresponding to each preset job. The preset host executes the preset job to complete the upgrade operation of the database to be upgraded.
[0067] In this embodiment of the invention, after the configured process (i.e., the upgrade flowchart) is deployed on the platform (i.e., the preset platform), the username and password information of the host user used in the process can be configured on the platform. Through the host platform interaction interface, the process is triggered from the platform to the host (i.e., the preset host). The process can automatically submit jobs in sequence according to the specified process relationship (i.e., the job order in the upgrade flowchart) with the specified account based on the configured user information, thereby realizing the triggering function of the process (i.e., according to the upgrade flowchart, using the permission account corresponding to each preset job, the preset jobs are submitted to the preset host in sequence). Then, the preset host can execute the preset jobs in sequence to complete the upgrade operation of the database to be upgraded.
[0068] Optionally, after converting each upgrade step into a preset job and obtaining a set of preset jobs, the method further includes: determining the job level of the preset jobs; configuring a preset return code for the preset jobs according to the job level; and associating the preset return code with the job identifier corresponding to the preset job.
[0069] In this embodiment of the invention, in order to control the process to execute according to specified logic, in addition to process configuration, status configuration is also required, that is, defining the job execution return code attribute (i.e., preset return code). The return code reflects the execution status of the job or program. For example, under normal circumstances, the job return code is 0; under alarm conditions, the return code may be 4; and under error conditions, the return code is 8. From a strict control perspective, a job can only be considered to be running normally if the return code is 0. However, there are some cases where the existence of alarms can be tolerated. To avoid process interruption due to alarms, the return codes of jobs in the process can be adjusted appropriately, changing the return codes of some jobs from 0 to 4. That is, even if alarms exist, the automated process can still continue.
[0070] In this embodiment of the invention, the job level of each preset job can be determined first (e.g., divided into strict control level and non-strict control level). Then, according to the job level of the preset job, a preset return code is configured for the preset job (e.g., the return code of a job with strict control level can be configured as 0, and the return code of a job with non-strict control level can be configured as 4). After that, the preset return code is associated with the job identifier corresponding to the preset job.
[0071] Optionally, during the execution of a preset job on a preset host, the process further includes: obtaining job execution information returned by the preset host according to a preset time interval, wherein the job execution information includes at least: a job identifier and a job return code; comparing the job return code with a preset return code associated with the job identifier to obtain a comparison result; if the comparison result indicates that the job return code is less than or equal to the preset return code, determining that the execution status is normal and continuing to execute the next preset job; if the comparison result indicates that the job return code is greater than the preset return code, determining that the execution status is abnormal and stopping the execution of the current preset job on the terminal.
[0072] In this embodiment of the invention, the platform automatically captures job execution information from the host at regular intervals (i.e., according to a preset time interval (e.g., 1 second), obtains preset job execution information returned by the host, which includes: job identifier, job return code (i.e., actual return code), etc.), and compares the actual return code in the job execution information with the preset return code in the status configuration information (i.e., compares the job return code with the preset return code associated with the job identifier to obtain a comparison result). If the actual job return code is less than or equal to the preset return code, it displays "normal termination" and the process continues (i.e., if the comparison result indicates that the job return code is less than or equal to the preset return code, the execution status is determined to be normal, and the next preset job is executed). If the actual job return code is greater than the preset return code, it displays "abnormal termination" and the process is interrupted (i.e., if the comparison result indicates that the job return code is greater than the preset return code, the execution status is determined to be abnormal, and the current preset job is executed). After the process is interrupted, this step can be selectively set to normal termination or re-operation after the problem is resolved, and the process continues. The overall process can also be controlled by monitoring the opening and closing operations.
[0073] The following describes in detail another optional implementation method.
[0074] In this embodiment of the invention, a database upgrade method is proposed. It defines an automated process using a combination of serial and parallel methods, achieves fine-grained access control by setting user information for job submission, and automatically controls the overall process by monitoring job execution. Finally, a fully automated upgrade is achieved through automatic interaction between the platform and the host. The specific implementation is as follows:
[0075] 1) Process configuration.
[0076] The process configuration is achieved through three steps: task writing, task connection, and manual response.
[0077] (1) Job Writing: For the N (N is a positive integer) steps of the standard database upgrade process, host jobs corresponding to the functions of each step can be written using the host programming language JCL (Job Control Language). For example, steps such as database shutdown, checking environment status, creating new files, and backing up files can all be automatically implemented using JCL. Therefore, the N steps can be converted into N standard JCL jobs (i.e., host jobs).
[0078] (2) Job Chaining: For the N host jobs generated in (1), the execution order of each job is analyzed one by one, and the process is arranged in a combination of serial and parallel methods to maximize concurrency while ensuring the correctness of the operation logic. For example, steps with strict successor-successor relationships are arranged as serial operations, and steps without strict successor-successor relationships are arranged as parallel operations. Therefore, the N host jobs can be arranged into a directed graph, with each host job corresponding to a node on the directed graph. The next node of the current host job is the successor of the current host job. Only after the current node job has finished running normally can the next node start executing normally. An empty job is chained at the beginning and end of the directed graph as the opening and closing jobs of the process to control the overall process.
[0079] (3) Manual Response: For upgrade steps in (1) that cannot be automatically implemented using the JCL language, such as checking if the database is occupied by an application before shutting down the database, manual communication is required to confirm the subsequent processing flow. In this case, a manual response job is introduced to control the flow. That is, a host job is written to generate an automatic host response operation. When the response is confirmed and executed, the job ends normally and the flow continues; when the response is not confirmed and executed, the job ends abnormally and the job is interrupted; when there is no response, the job remains in the execution state and the flow is stuck. Therefore, manual communication can be reminded after a response is generated. After confirmation, the process is controlled by responding as needed. The process will not be interrupted or continued before the response, and it will always be in a controllable state.
[0080] 2), Status Configuration.
[0081] To ensure the workflow executes logically, in addition to workflow configuration, status configuration is also required, which involves defining the job execution return code attribute. The return code reflects the execution status of a job or program. For example, a normal job return code is 0, an alarm might result in a return code of 4, and an error might result in a return code of 8. From a strict control perspective, a job can only be considered to be running normally if its return code is 0. However, there are some cases where alarms are tolerable. To avoid workflow interruptions due to alarms, the return codes of jobs in the workflow can be adjusted appropriately based on experience. For example, some job return codes can be changed from 0 to 4, meaning that the automated workflow can continue even in the presence of alarms.
[0082] 3) User configuration.
[0083] Database upgrades involve operations at three levels: operating system, database, and application. Host user permissions are hierarchically managed, and a user may only have permissions at a single level. Therefore, the N jobs in the upgrade process need to be configured with users possessing the corresponding permissions based on their needs. For example, operating system-side operations require users with operating system permissions, database-side operations require users with database permissions, and so on. By configuring the relationship between jobs and users, jobs in the automated process can be submitted with specified users, achieving fine-grained permission control and avoiding frequent user switching during manual operations.
[0084] 4) Process triggering.
[0085] Deploy the processes configured in 1) to 3) on the platform. Configure the username and password information of the host users used in the process on the platform. Trigger the process from the platform to the host through the host platform interaction interface. The process can automatically submit jobs in the specified order by the specified user according to the specified process relationship based on the configured user information, thereby realizing the process triggering function.
[0086] 5) Process monitoring.
[0087] The platform automatically and periodically captures job execution information from the host machine, comparing the actual return code in the job execution information with the pre-configured job return codes. If the actual return code is less than or equal to the pre-configured return code, it displays "Normal End" and the process continues; if the actual return code is greater than the pre-configured return code, it displays "Abnormal End" and the process is interrupted. After the process is interrupted, this step can be selectively reset to "Normal End" or re-engaged after the problem is resolved, and the process can continue. Overall process control can be achieved by monitoring opening and closing operations.
[0088] In this embodiment of the invention, an automated upgrade schedule is arranged according to the upgrade step logic, enabling the automatic sequential submission of hundreds of upgrade steps. This maximizes concurrent implementation, reduces the workload of upgrade implementation, lowers the risk of manual operation, effectively shortens business downtime, and improves business continuity. Furthermore, by finely controlling the user accounts submitting each step according to the permission requirements of the upgrade steps, frequent user account switching during manual submission is avoided, achieving on-demand control of user permissions.
[0089] The following is a detailed description with reference to another embodiment.
[0090] Example 2
[0091] The database upgrade device provided in this embodiment includes multiple implementation units, each of which corresponds to a specific implementation step in Embodiment 1 above.
[0092] Figure 3 This is a schematic diagram of an optional database upgrade apparatus according to an embodiment of the present invention, such as... Figure 3 As shown, the upgrade device may include: a determining unit 30, a conversion unit 31, a building unit 32, and a submitting unit 33, wherein,
[0093] The determining unit 30 is used to determine the set of upgrade steps for the database to be upgraded, wherein the set of upgrade steps includes N upgrade steps, where N is a positive integer;
[0094] The conversion unit 31 is used to convert each upgrade step into a preset job to obtain a set of preset jobs, wherein each preset job is configured with user information and the user information corresponds to a permission account;
[0095] Building unit 32 is used to build an upgrade flowchart based on a preset set of tasks;
[0096] Submission unit 33 is used to submit preset jobs to preset host terminals in sequence according to the upgrade flowchart and the permission account corresponding to each preset job. The preset host terminal executes the preset jobs to complete the upgrade operation of the database to be upgraded.
[0097] The aforementioned upgrade device can determine the set of upgrade steps for the database to be upgraded by the determining unit 30, convert each upgrade step into a preset job by the conversion unit 31 to obtain a set of preset jobs, construct an upgrade flowchart based on the set of preset jobs by the construction unit 32, and submit the preset jobs to a preset host terminal sequentially by the submission unit 33 according to the upgrade flowchart and using the permission account corresponding to each preset job. The preset jobs are then executed by the preset host terminal to complete the upgrade operation of the database to be upgraded. In this embodiment of the invention, the set of upgrade steps for the database to be upgraded can be determined first, then each upgrade step can be converted into a preset job, and then an upgrade flowchart can be constructed. After that, the preset jobs can be automatically submitted to the preset host terminal according to the upgrade flowchart and using the permission account corresponding to each preset job. The preset jobs are then executed sequentially by the preset host terminal to complete the upgrade of the database to be upgraded. By constructing an automated upgrade flowchart, business continuity can be improved, and by fine-grained permission control of jobs, frequent permission switching during manual submission can be avoided, effectively reducing the upgrade time. This solves the technical problem in related technologies where the database upgrade time is long, resulting in long business interruption time and affecting business continuity.
[0098] Optionally, the conversion unit includes: a first acquisition module, used to acquire preset function information for each upgrade step, wherein the preset function information is used to indicate the function of the upgrade step; and a first conversion module, used to convert the preset function information into preset jobs using a preset programming language, and add the preset jobs to a preset job set.
[0099] Optionally, the construction unit includes: a first determining module, used to determine the operation order between every two preset jobs in the preset job set, wherein the operation order includes at least one of the following: serial operation order and parallel operation order; a second determining module, used to determine the job execution order based on the operation order between all preset jobs; a first characterizing module, used to characterize each preset job as a job node; a first combining module, used to combine all job nodes based on the job execution order to obtain an initial upgrade flowchart; and a first adding module, used to add a start node at the top of the initial upgrade flowchart and an end node at the bottom of the initial upgrade flowchart to obtain an upgrade flowchart.
[0100] Optionally, the upgrade device further includes: a third determining module, used to determine the permission requirements of the preset jobs after converting each upgrade step into a preset job and obtaining a set of preset jobs, wherein the permission requirements include at least one of the following: operating system operation permission requirements, database operation permission requirements, and application operation permission requirements; and a first configuration module, used to configure user information for the preset jobs based on the permission requirements.
[0101] Optionally, the upgrade device further includes: a fourth determining module, used to determine the job type of each preset job in the upgrade flowchart after constructing the upgrade flowchart based on the preset job set; a second configuring module, used to configure response terminal information for the current preset job when the job type is interactive; a first sending module, used to send a response request to the response terminal indicated by the response terminal information when executing the current preset job, wherein the response terminal processes the response request and returns a processing result; a first execution module, used to continue executing the next preset job according to the upgrade flowchart when the processing result is confirmed to execute; and a first interruption module, used to interrupt the execution of the current preset job when the processing result is confirmed not to execute or no processing result is received within a preset time period.
[0102] Optionally, the upgrade device further includes: a fifth determining module, used to determine the job level of the preset job after converting each upgrade step into a preset job and obtaining a set of preset jobs; a third configuring module, used to configure a preset return code for the preset job according to the job level; and a first associating module, used to associate the preset return code with the job identifier corresponding to the preset job.
[0103] Optionally, the upgrade device further includes: a second acquisition module, used to acquire job execution information returned by the preset host according to a preset time interval during the execution of a preset job on the preset host, wherein the job execution information includes at least: job identifier and job return code; a first comparison module, used to compare the job return code with a preset return code associated with the job identifier to obtain a comparison result; a sixth determination module, used to determine the execution status as normal and continue to execute the next preset job if the comparison result indicates that the job return code is less than or equal to the preset return code; and a seventh determination module, used to determine the execution status as abnormal and terminate the execution of the current preset job if the comparison result indicates that the job return code is greater than the preset return code.
[0104] The aforementioned upgrade device may also include a processor and a memory. The aforementioned determining unit 30, conversion unit 31, construction unit 32, submission unit 33, etc., are all stored in the memory as program units, and the processor executes the aforementioned program units stored in the memory to realize the corresponding functions.
[0105] The aforementioned processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured. By adjusting kernel parameters, and following the upgrade flowchart, each preset job is submitted to its corresponding authorized account sequentially to the preset host.
[0106] The aforementioned memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0107] This application also provides a computer program product that, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: determining a set of upgrade steps for the database to be upgraded, converting each upgrade step into a preset job to obtain a set of preset jobs, constructing an upgrade flowchart based on the set of preset jobs, and, according to the upgrade flowchart, using the permission account corresponding to each preset job, sequentially submitting the preset jobs to a preset host, wherein the preset host executes the preset jobs to complete the upgrade operation of the database to be upgraded.
[0108] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the above-described database upgrade method.
[0109] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the database upgrade method described above.
[0110] Figure 4 This is a hardware structure block diagram of an electronic device (or mobile device) for a database upgrade method according to an embodiment of the present invention. Figure 4 As shown, an electronic device may include one or more ( Figure 4 The processor 402 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and the memory 404 for storing data may also be included. In addition, it may include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 4 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, the electronic device may also include components that are more... Figure 4 The more or fewer components shown, or having the same Figure 4 The different configurations shown.
[0111] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0112] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0113] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0114] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0115] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0116] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0117] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for upgrading a database, characterized in that, Applied to preset platform terminals, including: Determine the set of upgrade steps for the database to be upgraded, wherein the set of upgrade steps includes N upgrade steps, where N is a positive integer; Each upgrade step is converted into a preset job to obtain a preset job set, wherein each preset job is configured with user information, and the user information corresponds to a permissioned account; the job level of the preset job is determined; a preset return code is configured for the preset job according to the job level; the preset return code is associated with the job identifier corresponding to the preset job; an upgrade flowchart is constructed based on the preset job set, wherein the operation order between every two preset jobs in the preset job set is determined, wherein the operation order includes at least one of the following: serial operation order, parallel operation order; the job execution order is determined based on the operation order between all preset jobs; the upgrade flowchart is constructed based on the job execution order; According to the upgrade flowchart, the preset jobs are submitted to the preset host in sequence by the authorized account corresponding to each preset job. The preset host executes the preset job to complete the upgrade operation of the database to be upgraded. During the execution of the preset job on the preset host, the process further includes: obtaining job execution information returned by the preset host according to a preset time interval, wherein the job execution information includes at least: a job identifier and a job return code; comparing the job return code with the preset return code associated with the job identifier to obtain a comparison result; if the comparison result indicates that the job return code is less than or equal to the preset return code, determining that the execution status is normal and continuing to execute the next preset job; if the comparison result indicates that the job return code is greater than the preset return code, determining that the execution status is abnormal and stopping the execution of the current preset job.
2. The upgrade method according to claim 1, characterized in that, The step of converting each of the upgrade steps into a preset job to obtain a set of preset jobs includes: Obtain preset function information for each of the upgrade steps, wherein the preset function information is used to indicate the function of the upgrade step; Using a preset programming language, the preset function information is converted into the preset job, and the preset job is added to the preset job set.
3. The upgrade method according to claim 1, characterized in that, The step of constructing the upgrade flowchart based on the preset job set further includes: Each of the preset jobs is represented as a job node; Based on the job execution order, all the job nodes are combined to obtain the initial upgrade flowchart; Add a start node at the top of the initial upgrade flowchart and an end node at the bottom of the initial upgrade flowchart to obtain the upgrade flowchart.
4. The upgrade method according to claim 1, characterized in that, After converting each of the upgrade steps into a preset job to obtain a set of preset jobs, the process further includes: Determine the permission requirements for the preset job, wherein the permission requirements include at least one of the following: operating system operation permission requirements, database operation permission requirements, and application operation permission requirements; Based on the aforementioned permission requirements, configure the user information for the preset job.
5. The upgrade method according to claim 1, characterized in that, After constructing the upgrade flowchart based on the preset job set, the process also includes: Determine the job type for each preset job in the upgrade flowchart; When the job type is interactive, configure response terminal information for the current preset job; When performing the current preset task, a response request is sent to the response terminal indicated by the response terminal information, wherein the response terminal processes the response request and returns a processing result; If the processing result is confirmation of execution, the next preset task will be executed according to the upgrade flowchart. If the processing result is a confirmation not to execute or if no processing result is received within a preset time period, the execution of the current preset job is interrupted.
6. A database upgrade device, characterized in that, Applied to preset platform terminals, including: A determining unit is used to determine a set of upgrade steps for the database to be upgraded, wherein the set of upgrade steps includes N upgrade steps, where N is a positive integer; A conversion unit is used to convert each of the upgrade steps into a preset job to obtain a preset job set, wherein each preset job is configured with user information, and the user information corresponds to a permissioned account; determine the job level of the preset job; configure a preset return code for the preset job according to the job level; and associate the preset return code with the job identifier corresponding to the preset job. A construction unit is configured to construct an upgrade flowchart based on the preset job set, wherein the operation order between every two preset jobs in the preset job set is determined, wherein the operation order includes at least one of the following: serial operation order and parallel operation order; the job execution order is determined based on the operation order between all the preset jobs; and the upgrade flowchart is constructed based on the job execution order. The submission unit is used to submit the preset jobs to the preset host terminal in sequence according to the upgrade flowchart and the permission account corresponding to each preset job, wherein the preset host terminal executes the preset job to complete the upgrade operation of the database to be upgraded. The upgrade device further includes: a second acquisition module, used to acquire job execution information returned by the preset host terminal according to a preset time interval during the execution of the preset job on the preset host terminal, wherein the job execution information includes at least: job identifier and job return code; a first comparison module, used to compare the job return code with the preset return code associated with the job identifier to obtain a comparison result; a sixth determination module, used to determine the execution status as normal and continue to execute the next preset job if the comparison result indicates that the job return code is less than or equal to the preset return code; and a seventh determination module, used to determine the execution status as abnormal and terminate the execution of the current preset job if the comparison result indicates that the job return code is greater than the preset return code.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the database upgrade method according to any one of claims 1 to 5.
8. An electronic device, characterized in that, It includes one or more processors and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the database upgrade method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Database cluster upgrading method and device, electronic equipment and storage medium
CN115269544A
Cloud database upgrading method and device, equipment and storage medium
CN115794164A