User-oriented database synchronization upgrade method, system and storage medium
By performing dependency analysis on the user's database and synchronous upgrade fitness analysis, a parallel upgrade sorting sequence is generated, which solves the problem of low database upgrade efficiency in the existing technology and realizes efficient and stable database upgrades.
Patent Information
- Application Number
- CN202411721060.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-11-28
AI Technical Summary
In the prior art, database upgrade efficiency is low, especially when the user needs to maintain high availability and business continuity, traditional database upgrade methods are prone to data inconsistency or system crashes.
By making local data calls to multiple users, the historical application records of the database to be upgraded are obtained, dependency analysis and the associated database group are performed, and the synchronous upgrade fitness analysis is performed based on the free window and associated database, and the parallel upgrade sorting sequence is generated. Return to upgrade notification.
Improve database upgrade efficiency, ensure data consistency and system stability during database upgrade process, and reduce business interruptions and upgrade time.
Smart Images

Figure CN119226266B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method, system and storage medium for synchronously upgrading a database facing a user end. Background Art
[0002] In the current information environment, efficient operation of databases is the key to supporting the normal operation of various applications and business systems. However, with the changes in user needs and the continuous growth of data scale, database systems need to be frequently upgraded and maintained to maintain their performance, functionality and security. However, traditional database upgrade methods often face many challenges: on the one hand, databases on different user ends may have complex dependencies due to business differences, and direct upgrades may lead to data inconsistency or system crashes; on the other hand, the user end needs to maintain high availability during operation. If the upgrade operation is not reasonably planned, it will seriously affect user experience and business continuity. Summary of the invention
[0003] The present application provides a method, system and storage medium for synchronously upgrading a database for a user end, which solves the technical problem of low efficiency of upgrading a database in the prior art.
[0004] In view of the above problems, the present application provides a method, system and storage medium for synchronously upgrading a database for a user terminal.
[0005] In a first aspect of the present application, a method for synchronously upgrading a database facing a user terminal is provided, the method comprising:
[0006] Perform local data calls on multiple user terminals to obtain multiple historical application records of multiple databases to be upgraded; perform dependency analysis on the multiple databases to be upgraded according to the multiple historical application records, and divide the multiple databases to be upgraded into K groups of related databases based on the analysis results; perform usage analysis based on the multiple historical application records to obtain multiple idle windows; perform synchronous upgrade fitness analysis based on the multiple idle windows and the K groups of related databases to obtain K synchronous upgrade windows; interactively obtain K upgrade tasks of the K groups of related databases, and obtain K upgrade times by performing upgrade simulation on the K upgrade tasks; perform parallel upgrade sorting according to the K synchronous upgrade windows and the K upgrade times to obtain an upgrade scheduling sequence; extract multiple upgrade notifications from the upgrade scheduling sequence, and transmit the multiple upgrade notifications back to the multiple user terminals.
[0007] The second aspect of the present application provides a user-oriented database synchronization upgrade system, the system comprising:
[0008] Data acquisition module: performs local data calls on multiple user terminals to obtain multiple historical application records of multiple databases to be upgraded; first analysis module: performs dependency analysis on the multiple databases to be upgraded according to the multiple historical application records, and divides the multiple databases to be upgraded into K groups of related databases based on the analysis results; second analysis module: performs usage analysis based on the multiple historical application records to obtain multiple idle windows; third analysis module: performs synchronous upgrade fitness analysis based on the multiple idle windows and K groups of related databases to obtain K synchronous upgrade windows; upgrade simulation module: interactively obtains K upgrade tasks of the K groups of related databases, and obtains K upgrade times by performing upgrade simulation on the K upgrade tasks; sorting module: performs parallel upgrade sorting according to the K synchronous upgrade windows and the K upgrade times to obtain an upgrade scheduling sequence; notification feedback module: extracts multiple upgrade notifications from the upgrade scheduling sequence, and transmits the multiple upgrade notifications back to the multiple user terminals.
[0009] The third aspect of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the user-side database synchronization upgrade method provided in the present application.
[0010] One or more technical solutions provided in this application have at least the following technical effects or advantages:
[0011] First, local data calls are made to multiple user terminals to obtain multiple historical application records of multiple databases to be upgraded. Next, dependency analysis is performed on multiple databases to be upgraded based on multiple historical application records, and multiple databases to be upgraded are divided into K groups of related databases based on the analysis results; usage analysis is performed based on multiple historical application records to obtain multiple idle windows. Further, synchronous upgrade fitness analysis is performed based on multiple idle windows and K groups of related databases to obtain K synchronous upgrade windows. At the same time, K upgrade tasks of K groups of related databases are interactively obtained, and K upgrade times are obtained by performing upgrade simulation on K upgrade tasks. Then, parallel upgrade sorting is performed based on K synchronous upgrade windows and K upgrade times to obtain an upgrade scheduling sequence. Finally, multiple upgrade notifications are extracted from the upgrade scheduling sequence, and multiple upgrade notifications are transmitted back to multiple user terminals. The technical problem of low database upgrade efficiency in the prior art is solved, and the technical effect of improving database upgrade efficiency is achieved by optimizing database synchronous upgrade. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0013] Figure 1 A schematic diagram of a user-side database synchronization upgrade method flow provided in an embodiment of the present application;
[0014] Figure 2 A schematic diagram of the structure of a user-side database synchronization upgrade system provided in an embodiment of the present application.
[0015] Explanation of reference numerals: data acquisition module 11 , first analysis module 12 , second analysis module 13 , third analysis module 14 , upgrade simulation module 15 , sorting module 16 , notification feedback module 17 . DETAILED DESCRIPTION
[0016] The present application solves the technical problem of low database upgrade efficiency in the prior art by providing a user-side oriented database synchronization upgrade method, system and storage medium.
[0017] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0018] It should be noted that the terms "including" and "having" are intended to cover non-exclusive inclusions. For example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or modules that are not explicitly listed or are inherent to these processes, methods, products or devices.
[0019] Embodiment 1, as Figure 1 As shown, the present application provides a method for synchronously upgrading a database for a user terminal, wherein the method includes:
[0020] Local data calls are made to multiple user terminals to obtain multiple historical application records of multiple databases to be upgraded.
[0021] It establishes a connection with the client through a preset communication protocol (such as HTTP, WebSocket or RPC) and performs identity authentication to ensure the legitimacy and security of the call. Subsequently, it sends a clear data call request to the client, specifying the historical application records that need to be collected, such as database operation timestamps, SQL query types, data table and field operation frequencies, and system events triggered by users.
[0022] Dependency analysis is performed on the multiple databases to be upgraded according to the multiple historical application records, and the multiple databases to be upgraded are divided into K groups of related databases based on the analysis result.
[0023] First, we extract the database operation features involved in the historical application records, such as table reference relationships, transaction call chains, cross-database operation logs, etc., and classify and organize these features. Then, we use the graph structure analysis method to construct a database dependency graph, treating the database as a node and the dependency relationship as an edge to clarify the degree of association between databases. By analyzing the dependency graph, we identify strongly dependent database groups and weakly coupled databases, thereby dividing the association clusters of multiple databases to be upgraded. Finally, based on the division results, multiple databases to be upgraded are divided into K groups of associated databases. Each group has a high degree of internal dependency, while the inter-group dependency is weak, which provides an optimization basis for the grouping and scheduling of subsequent synchronous upgrade tasks.
[0024] Further, performing dependency analysis on the multiple databases to be upgraded according to the multiple historical application records, and dividing the multiple databases to be upgraded into K groups of related databases based on the analysis results, the method includes:
[0025] The data of the multiple historical application records are screened based on the cross-library call relationship as a constraint to obtain multiple cross-library call records; N types of cross-library call behaviors are predefined, and the multiple cross-library call records are decomposed according to the N types of cross-library call behaviors to obtain N groups of single-dimensional call records; the multiple databases to be upgraded are used as topological nodes, and the predefined out-degree connection rules are used as node connection constraints to construct N single-dimensional topological networks based on the N groups of single-dimensional call records; the dependency analysis of the multiple databases to be upgraded is performed based on the N single-dimensional topological networks to obtain the K groups of associated databases.
[0026] Preferably, based on historical application records, cross-database call relationships are used as constraints to screen out cross-database call records involving multiple databases, ensuring that only operation data with cross-database dependencies are retained; N types of cross-database call behaviors (such as cross-database access, query, copy, insert, update, and delete) are predefined, and the screened cross-database call records are classified and decomposed according to these behavior types to generate N groups of single-dimensional call records, each group of records corresponding to a specific cross-database dependency behavior; multiple databases to be upgraded are regarded as topological nodes, combined with predefined out-degree connection rules (such as cross-database operation frequency, call direction, etc.) as node connection constraints, and N single-dimensional topological networks are constructed using N groups of single-dimensional call records, each network reflects a database dependency structure under a cross-database call behavior; the constructed N single-dimensional topological networks are comprehensively analyzed to identify strong and weak dependencies between databases, for example, by calculating indicators such as connection weights and call frequencies between nodes, the dependency strength of the databases is evaluated; according to the dependency analysis results, multiple databases to be upgraded are divided into K groups of associated databases, each group of associated databases has a strong internal dependency, while the inter-group dependency is weak.
[0027] Furthermore, performing dependency analysis on the multiple databases to be upgraded according to the N single-dimensional topology networks to obtain the K groups of associated databases, the method includes:
[0028] N one-dimensional interaction behavior sets of the first database to be upgraded and the second database to be upgraded are obtained from the N one-dimensional topological network calls; N one-dimensional dependency coefficients are obtained by quantifying cross-library interaction behaviors of the N one-dimensional interaction behavior sets; N behavior weight coefficients are preconfigured for the N cross-library call behaviors, and the N behavior weight coefficients are used to perform a first-level weighted quantization of the N one-dimensional dependency coefficients to obtain a first association dependency coefficient; if the first association dependency coefficient meets the association dependency threshold, the first database to be upgraded and the second database to be upgraded are divided into the same group of associated databases; and so on, dependency analysis is performed on the multiple databases to be upgraded according to the N one-dimensional topological networks, and databases are merged based on the analysis results to obtain the K groups of associated databases.
[0029] Specifically, N one-dimensional interaction behavior sets between the first database to be upgraded and the second database to be upgraded are extracted from N one-dimensional topological networks; the N one-dimensional interaction behavior sets are quantitatively analyzed (which can be evaluated based on the call frequency), the interaction intensity of each behavior is calculated, and the corresponding N one-dimensional dependency coefficients are generated; the behavior weight coefficients of N cross-library call behaviors are pre-configured to reflect the relative importance of different behaviors in the dependency relationship; the N one-dimensional dependency coefficients are weighted, and the weight coefficients are used for first-level weighted quantization to calculate the first correlation dependency coefficient as a measure of the overall dependency intensity between the two databases; the first correlation dependency coefficients are compared. If the first correlation dependency coefficient is greater than or equal to the preset correlation dependency threshold, it is determined that the first database to be upgraded and the second database to be upgraded have a significant dependency relationship, and the two are divided into the same group of associated databases; if it is lower than the threshold, their independence is retained and no merging is performed; the above dependency analysis is performed on all databases to be upgraded, and the databases that meet the correlation dependency conditions are continuously merged to gradually form multiple associated database groups; combined with all analysis results, multiple groups of independent or partially merged databases are sorted out, and finally K groups of associated databases are generated, each group has a significant internal dependency and a weak inter-group dependency.
[0030] Furthermore, by quantifying the cross-library interaction behaviors of the N single-dimensional interaction behavior sets, N single-dimensional dependency coefficients are obtained, and the method includes:
[0031] Disassemble the first one-dimensional interaction behavior set to obtain multiple interaction behavior records, wherein each interaction behavior record includes a first operation time, a first operation duration, a first number of affected rows, and a first resource occupancy; obtain multiple interaction dependency coefficients of the multiple interaction behavior records by performing secondary weighted quantization on the first operation duration, the first number of affected rows, and the first resource occupancy; after extracting multiple first operation times from the multiple interaction behavior records, use the multiple first operation times to perform tertiary weighted quantization on the multiple interaction dependency coefficients to obtain a first one-dimensional dependency coefficient; and so on, analyze the N one-dimensional interaction behavior sets to obtain the N one-dimensional dependency coefficients.
[0032] Specifically, the first single-dimensional interaction behavior set is disassembled to extract multiple interaction behavior records, each of which contains the following features: first operation time (timestamp of the interaction behavior), first operation duration (time taken from initiation to completion of the interaction behavior), first number of affected rows (number of database record rows involved in the interaction behavior) and first resource occupancy (amount of system resources used by the interaction behavior); the first operation duration, first number of affected rows and first resource occupancy in each interaction behavior record are weighted, and the three indicators are quantified and weighted according to preset weights to generate an interaction dependency coefficient for each interaction behavior record; the first operation duration is extracted from multiple interaction behavior records. Time set, and use these operation times to further weight the calculated interaction dependency coefficients in the time dimension. According to the distribution characteristics of the operation time (for example, whether it is concentrated in the high-load period), different weights are given to the interaction behaviors in different time periods. Through three-level weighted quantization, multiple interaction dependency coefficients are comprehensively calculated as the first single-dimensional dependency coefficient, which reflects the overall dependency intensity of the current single-dimensional interaction behavior. The above process is repeated for other single-dimensional interaction behavior sets (the second to the Nth single-dimensional interaction behavior sets), the interaction behavior records are disassembled one by one, and the second-level and third-level weighted quantization are performed in turn to generate the corresponding single-dimensional dependency coefficients. After completing the quantitative analysis of N single-dimensional interaction behavior sets, N single-dimensional dependency coefficients are obtained.
[0033] A usage analysis is performed based on the multiple historical application records to obtain multiple idle windows.
[0034] Usage analysis is performed based on multiple historical application records to identify multiple idle windows, where an idle window refers to a period of time during which an application is not used or has very low activity within a specific time period.
[0035] Furthermore, the method of performing usage analysis based on the multiple historical application records to obtain multiple idle windows includes:
[0036] Disassemble the first historical application record to obtain multiple first node application data of multiple application nodes in the first application sequence, wherein the data structure of the first node application data includes access timestamp, access frequency, access data volume and CPU occupancy; predefine an idle standard, and use the idle standard to traverse the multiple first node application data to obtain M idle nodes, wherein the idle standard includes an operation frequency interval, a data load interval and a CPU occupancy interval related to a gate; continuously merge adjacent idle points according to the M access timestamps of the M idle nodes to obtain an idle time period list; use time series decomposition to perform cyclic pattern recognition of the idle time period list to obtain a cyclic idle sequence; output the single-cycle cyclic idle sequence as a first idle window; and so on, perform usage analysis based on the multiple historical application records to obtain the multiple idle windows.
[0037] Specifically, the first historical application record is disassembled, and multiple first node application data of multiple application nodes in the first application sequence are extracted. The data structure of the first node application data includes access timestamp (the specific time when the node access operation occurs), access frequency (the number of accesses per unit time), access data volume (the amount of data processed by the node) and CPU occupancy (the occupancy rate of the system CPU resources for node operations); pre-defined no-load standards include the following indicators related to gates: operation frequency range (specify the operation frequency range within a certain time period, and it is considered no-load if it is lower than this range), data load range (limit the node data processing volume, and it is considered no-load if it is lower than this range) and CPU occupancy range (set the lower limit of the system CPU resource utilization rate, and it is considered no-load if it is lower than this range); traverse multiple first Based on the application data of a node, M idle nodes that meet the conditions are screened out according to the idle standard; based on the access timestamps of the M idle nodes, the idle nodes that are adjacent in time are identified (the timestamp difference of the idle nodes is less than the preset time threshold, and they are determined to be adjacent nodes), and they are continuously merged into idle time periods to generate an idle time period list; the cyclic pattern recognition method (such as Fourier transform, periodic analysis, etc.) is used to identify the periodic characteristics of the idle time periods; the single-cycle idle time period sequence in the cyclic pattern is extracted to form a cyclic idle sequence; the single-cycle cyclic idle sequence is output as the first idle window; according to the above steps, the remaining historical application records are analyzed to obtain their respective idle windows in turn, and all the generated idle windows are summarized to form a complete set of multiple idle windows.
[0038] A synchronous upgrade fitness analysis is performed according to the plurality of idle windows and the K groups of associated databases to obtain K synchronous upgrade windows.
[0039] By evaluating all idle windows and each group of associated databases, the fitness value of each group of associated databases in each idle window is calculated, and the idle window with the highest fitness value is selected as the candidate synchronization upgrade window. According to the fitness analysis results, a corresponding synchronization upgrade window is assigned to each group of associated databases, and K synchronization upgrade windows are obtained.
[0040] Further, performing synchronous upgrade fitness analysis according to the plurality of idle windows and K groups of associated databases to obtain K synchronous upgrade windows includes:
[0041] A first group of idle windows corresponding to a first group of associated databases is called from the multiple idle windows; an intersection solution is performed on multiple cyclic idle sequences in the first group of idle windows to obtain a first synchronous idle sequence; multiple groups of SQL script execution times of multiple associated databases in the first group of associated databases are obtained through local data calls; extreme value calls are performed on the multiple groups of SQL script execution times to obtain standard execution times; the first synchronous idle sequence is traversed using the standard execution time to locate a first group of standby upgrade windows; and so on, synchronous upgrade association analysis is performed based on the multiple idle windows and K groups of associated databases to obtain K groups of standby upgrade windows; the K synchronous upgrade windows are output by performing memory occupancy fitness analysis on the K groups of standby upgrade windows.
[0042] Specifically, from multiple idle windows, idle windows corresponding to the first group of associated databases are screened, and the time ranges and resource characteristics of these windows are extracted to form a first group of idle windows; an intersection operation is performed on multiple cyclic idle sequences in the first group of idle windows to identify a common idle time period that satisfies all window conditions at the same time, and a first synchronous idle sequence is obtained, and the first synchronous idle sequence represents a potential upgrade time period suitable for the first group of associated databases; multiple groups of SQL script execution time records are extracted from the first group of associated databases through local data calls; extreme value calls are performed on the execution time of multiple groups of SQL scripts (such as using statistical methods to eliminate values outside 3 times the standard deviation), and the standard execution time is calculated after eliminating abnormal values; the first synchronous idle sequence is traversed using the standard execution time to screen out standby upgrade windows that can meet the upgrade task of the first group of associated databases, that is, the length of the idle sequence is greater than or equal to the standard execution time; in the same way, the remaining associated database groups are analyzed in turn to obtain K groups of standby upgrade windows; memory occupancy fitness analysis is performed on the K groups of standby upgrade windows to evaluate the matching degree between the upgrade task's demand for system memory and the standby upgrade window's memory availability, and the comprehensive analysis results are output to output K synchronous upgrade windows.
[0043] Furthermore, by performing memory occupancy fitness analysis on the K groups of standby upgrade windows, the K synchronous upgrade windows are outputted, and the method includes:
[0044] The K groups of standby upgrade windows are arranged and combined to obtain multiple synchronous upgrade sequences; the K upgrade tasks are used to perform upgrade simulation on the multiple synchronous upgrade sequences to obtain multiple memory occupancy trends; a conflict condition is preset, and the conflict condition is used to traverse the multiple memory occupancy trends to screen and obtain H memory occupancy trends of H synchronous upgrade sequences; a memory pressure correlation index is preset, and data collection is performed on the H memory occupancy trends with the memory pressure correlation index as a constraint to obtain H groups of memory pressure correlation data; a parallel upgrade fitness function is pre-constructed; after evaluating the H groups of memory pressure correlation data through the parallel upgrade fitness function, the K synchronous upgrade windows are extracted from the H synchronous upgrade sequences according to the evaluation result.
[0045] Specifically, K groups of standby upgrade windows are arranged and combined to generate multiple synchronous upgrade sequences, each of which includes K upgrade time allocations for K synchronous upgrades; for each synchronous upgrade sequence, corresponding K upgrade tasks are used to perform upgrade simulation to predict the memory usage trend in each time period; memory conflict conditions are preset (for example, memory usage exceeds a certain threshold, system response time times out, etc.), and multiple memory usage trends are traversed based on this standard to screen out H synchronous upgrade sequences that meet the conditions and their corresponding H memory usage trends, and the memory usage change curve during the upgrade period is recorded for the memory usage trend corresponding to each synchronous upgrade sequence; memory pressure related indicators are preset (such as average memory occupancy rate, memory peak value, memory fluctuation range), and data is collected for the H memory occupancy trends based on these indicators to generate H groups of memory pressure related data; a parallel upgrade fitness function is constructed to quantify the degree of adaptation of each group of memory pressure related data; the H groups of memory pressure related data are evaluated by the fitness function, sorted by fitness score, and the H synchronous upgrade sequences with the highest fitness are selected, and K synchronous upgrade windows are determined from each preferred synchronous upgrade sequence.
[0046] Further, the method comprises:
[0047] The first group of memory pressure-related data is called from the H group of memory pressure-related data, wherein the first group of memory pressure-related data includes a memory occupancy peak value, a memory occupancy valley value, an average memory occupancy rate, a synchronization upgrade time, and an average memory recovery time; the first group of memory pressure-related data is synchronized to the parallel upgrade fitness function to obtain a first parallel fitness coefficient, wherein the parallel upgrade fitness function is as follows:
[0048] ;
[0049] Among them, F is the parallel fitness coefficient, M peak is the peak memory usage, M valley is the valley value of memory usage, M avgis the average memory usage, T sync It takes time to upgrade synchronously, T rec is the mean time consumption of memory recovery; and by analogy, the H groups of memory pressure-related data are evaluated by the parallel upgrade fitness function to obtain H parallel fitness coefficients; after the H parallel fitness coefficients are serialized, the K synchronous upgrade windows are extracted from the H synchronous upgrade sequences according to the sorting result.
[0050] Extract the first group of memory pressure-related data from the H group of memory pressure-related data, the first group of memory pressure-related data including the peak value of memory usage (the highest memory usage during the upgrade process), the valley value of memory usage (the lowest memory usage during the upgrade process), the average memory usage rate (the average value of memory usage during the entire upgrade process), the synchronous upgrade time (the total time required to complete the synchronous upgrade task), and the average memory recovery time (the average time required for the system memory to recover to a stable state after the upgrade is completed); input the first group of memory pressure-related data into the parallel upgrade fitness function to calculate the first parallel fitness coefficient, where F is the parallel fitness coefficient, M is the average value of memory recovery time (the average value of memory recovery time after the upgrade is completed). peak is the peak memory usage, M valley is the valley value of memory usage, M avg is the average memory usage, T sync It takes time to upgrade synchronously, T rec is the mean time consumption for memory recovery; according to the above fitness function, H groups of memory pressure-related data are synchronized to the fitness function one by one, and H parallel fitness coefficients are calculated and obtained; the H parallel fitness coefficients are serialized and sorted from high to low according to the fitness score, and the upgrade sequence with a higher score is considered to have a stronger adaptability; according to the sorting result, the top K synchronous upgrade windows are extracted from the H synchronous upgrade sequences.
[0051] K upgrade tasks of the K groups of associated databases are interactively obtained, and K upgrade times are obtained by performing upgrade simulation on the K upgrade tasks.
[0052] K upgrade tasks of K groups of associated databases are obtained interactively, and these tasks include specific upgrade content, steps, and expected goals. In order to evaluate the feasibility and time consumption of the upgrade tasks, each upgrade task can be executed in a simulation environment, and the time consumption of each operation in the actual upgrade process can be recorded to obtain K upgrade time consumptions.
[0053] Parallel upgrades are sorted according to the K synchronous upgrade windows and the K upgrade times to obtain an upgrade scheduling sequence.
[0054] Match K upgrade tasks with K synchronous upgrade windows to ensure that the execution time of the task does not exceed the window length; based on the matching results of tasks and windows, the upgrade tasks are sorted according to indicators such as independence, time priority, and resource occupancy rate. Unrelated tasks are assigned to the same window for parallel execution because they do not need to be synchronized or waited for, while related tasks are serially scheduled while ensuring data consistency and avoiding resource conflicts. Through parallel upgrade sorting, the upgrade scheduling sequence is obtained, which ensures that each group of related databases can complete the upgrade in their respective idle windows with minimal business interruption and the shortest time.
[0055] Extracting a plurality of upgrade notifications from the upgrade scheduling sequence, and returning the plurality of upgrade notifications to the plurality of user terminals.
[0056] Extract key information such as task ID, upgrade time, resource usage information, upgrade content, and user-side operation suggestions from the scheduling sequence, and format it into notification content that is easy for users to understand, supporting text notifications, detailed reports, or multi-language notifications. According to the receiving preferences of the user, the notification is distributed through instant messaging, task center push, or logging. Before the task starts, a synchronous notification is sent to remind the user to prepare, and during the task execution, a phased progress update or completion notification is sent to ensure that the user is aware of the upgrade status in real time. Through the interactive mechanism, the user can confirm that the notification has been received or submit a feedback request on the upgrade time and task content.
[0057] In summary, the embodiments of the present application have at least the following technical effects:
[0058] First, local data calls are made to multiple user terminals to obtain multiple historical application records of multiple databases to be upgraded. Next, dependency analysis is performed on multiple databases to be upgraded based on multiple historical application records, and multiple databases to be upgraded are divided into K groups of related databases based on the analysis results; usage analysis is performed based on multiple historical application records to obtain multiple idle windows. Further, synchronous upgrade fitness analysis is performed based on multiple idle windows and K groups of related databases to obtain K synchronous upgrade windows. At the same time, K upgrade tasks of K groups of related databases are interactively obtained, and K upgrade times are obtained by performing upgrade simulation on K upgrade tasks. Then, parallel upgrade sorting is performed based on K synchronous upgrade windows and K upgrade times to obtain an upgrade scheduling sequence. Finally, multiple upgrade notifications are extracted from the upgrade scheduling sequence, and multiple upgrade notifications are transmitted back to multiple user terminals. The technical problem of low database upgrade efficiency in the prior art is solved, and the technical effect of improving database upgrade efficiency is achieved by optimizing database synchronous upgrade.
[0059] Embodiment 2 is based on the same inventive concept as the method for synchronously upgrading a database facing a user end in the aforementioned embodiment. Figure 2 As shown, the present application provides a database synchronization upgrade system for a user terminal, wherein the system includes:
[0060] Data acquisition module 11: performs local data calls on multiple user terminals to obtain multiple historical application records of multiple databases to be upgraded; first analysis module 12: performs dependency analysis on the multiple databases to be upgraded according to the multiple historical application records, and divides the multiple databases to be upgraded into K groups of related databases based on the analysis results; second analysis module 13: performs usage analysis based on the multiple historical application records to obtain multiple idle windows; third analysis module 14: performs synchronous upgrade fitness analysis based on the multiple idle windows and K groups of related databases to obtain K synchronous upgrade windows; upgrade simulation module 15: interactively obtains K upgrade tasks of the K groups of related databases, and obtains K upgrade times by performing upgrade simulation on the K upgrade tasks; sorting module 16: performs parallel upgrade sorting according to the K synchronous upgrade windows and the K upgrade times to obtain an upgrade scheduling sequence; notification return module 17: extracts multiple upgrade notifications from the upgrade scheduling sequence, and returns the multiple upgrade notifications to the multiple user terminals.
[0061] Furthermore, the first analysis module 12 is used to perform the following method:
[0062] The data of the multiple historical application records are screened based on the cross-library call relationship as a constraint to obtain multiple cross-library call records; N types of cross-library call behaviors are predefined, and the multiple cross-library call records are decomposed according to the N types of cross-library call behaviors to obtain N groups of single-dimensional call records; the multiple databases to be upgraded are used as topological nodes, and the predefined out-degree connection rules are used as node connection constraints to construct N single-dimensional topological networks based on the N groups of single-dimensional call records; the dependency analysis of the multiple databases to be upgraded is performed based on the N single-dimensional topological networks to obtain the K groups of associated databases.
[0063] Furthermore, the second analysis module 13 is used to perform the following method:
[0064] Disassemble the first historical application record to obtain multiple first node application data of multiple application nodes in the first application sequence, wherein the data structure of the first node application data includes access timestamp, access frequency, access data volume and CPU occupancy; predefine an idle standard, and use the idle standard to traverse the multiple first node application data to obtain M idle nodes, wherein the idle standard includes an operation frequency interval, a data load interval and a CPU occupancy interval related to a gate; continuously merge adjacent idle points according to the M access timestamps of the M idle nodes to obtain an idle time period list; use time series decomposition to perform cyclic pattern recognition of the idle time period list to obtain a cyclic idle sequence; output the single-cycle cyclic idle sequence as a first idle window; and so on, perform usage analysis based on the multiple historical application records to obtain the multiple idle windows.
[0065] Furthermore, the third analysis module 14 is used to perform the following method:
[0066] A first group of idle windows corresponding to a first group of associated databases is called from the multiple idle windows; an intersection solution is performed on multiple cyclic idle sequences in the first group of idle windows to obtain a first synchronous idle sequence; multiple groups of SQL script execution times of multiple associated databases in the first group of associated databases are obtained through local data calls; extreme value calls are performed on the multiple groups of SQL script execution times to obtain standard execution times; the first synchronous idle sequence is traversed using the standard execution time to locate a first group of standby upgrade windows; and so on, synchronous upgrade association analysis is performed based on the multiple idle windows and K groups of associated databases to obtain K groups of standby upgrade windows; the K synchronous upgrade windows are output by performing memory occupancy fitness analysis on the K groups of standby upgrade windows.
[0067] Furthermore, the third analysis module 14 is used to perform the following method:
[0068] The K groups of standby upgrade windows are arranged and combined to obtain multiple synchronous upgrade sequences; the K upgrade tasks are used to perform upgrade simulation on the multiple synchronous upgrade sequences to obtain multiple memory occupancy trends; a conflict condition is preset, and the conflict condition is used to traverse the multiple memory occupancy trends to screen and obtain H memory occupancy trends of H synchronous upgrade sequences; a memory pressure correlation index is preset, and data collection is performed on the H memory occupancy trends with the memory pressure correlation index as a constraint to obtain H groups of memory pressure correlation data; a parallel upgrade fitness function is pre-constructed; after evaluating the H groups of memory pressure correlation data through the parallel upgrade fitness function, the K synchronous upgrade windows are extracted from the H synchronous upgrade sequences according to the evaluation result.
[0069] Furthermore, the third analysis module 14 is used to perform the following method:
[0070] The first group of memory pressure-related data is called from the H group of memory pressure-related data, wherein the first group of memory pressure-related data includes a memory occupancy peak value, a memory occupancy valley value, an average memory occupancy rate, a synchronization upgrade time, and an average memory recovery time; the first group of memory pressure-related data is synchronized to the parallel upgrade fitness function to obtain a first parallel fitness coefficient, wherein the parallel upgrade fitness function is as follows:
[0071] ;
[0072] Among them, F is the parallel fitness coefficient, M peak is the peak memory usage, M valley is the valley value of memory usage, M avg is the average memory usage, T sync It takes time to upgrade synchronously, T rec is the mean time consumption of memory recovery; and by analogy, the H groups of memory pressure-related data are evaluated by the parallel upgrade fitness function to obtain H parallel fitness coefficients; after the H parallel fitness coefficients are serialized, the K synchronous upgrade windows are extracted from the H synchronous upgrade sequences according to the sorting result.
[0073] Furthermore, the first analysis module 12 is used to perform the following method:
[0074] N one-dimensional interaction behavior sets of the first database to be upgraded and the second database to be upgraded are obtained from the N one-dimensional topological network calls; N one-dimensional dependency coefficients are obtained by quantifying cross-library interaction behaviors of the N one-dimensional interaction behavior sets; N behavior weight coefficients are preconfigured for the N cross-library call behaviors, and the N behavior weight coefficients are used to perform a first-level weighted quantization of the N one-dimensional dependency coefficients to obtain a first association dependency coefficient; if the first association dependency coefficient meets the association dependency threshold, the first database to be upgraded and the second database to be upgraded are divided into the same group of associated databases; and so on, dependency analysis is performed on the multiple databases to be upgraded according to the N one-dimensional topological networks, and databases are merged based on the analysis results to obtain the K groups of associated databases.
[0075] Furthermore, the first analysis module 12 is used to perform the following method:
[0076] Disassemble the first one-dimensional interaction behavior set to obtain multiple interaction behavior records, wherein each interaction behavior record includes a first operation time, a first operation duration, a first number of affected rows, and a first resource occupancy; obtain multiple interaction dependency coefficients of the multiple interaction behavior records by performing secondary weighted quantization on the first operation duration, the first number of affected rows, and the first resource occupancy; after extracting multiple first operation times from the multiple interaction behavior records, use the multiple first operation times to perform tertiary weighted quantization on the multiple interaction dependency coefficients to obtain a first one-dimensional dependency coefficient; and so on, analyze the N one-dimensional interaction behavior sets to obtain the N one-dimensional dependency coefficients.
[0077] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description and does not represent the advantages and disadvantages of the embodiments. And the above-mentioned specific embodiments of this specification are described. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0078] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
[0079] This specification and drawings are merely exemplary illustrations of the present application and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, a person skilled in the art may make various modifications and variations to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the present application and its equivalents, the present application intends to include these modifications and variations.
Claims
1. A method for synchronously upgrading a database on a user side, characterized in that: The method comprises: Call local data on multiple user terminals to obtain multiple historical application records of multiple databases to be upgraded; Performing dependency analysis on the multiple databases to be upgraded according to the multiple historical application records, and dividing the multiple databases to be upgraded into K groups of related databases based on the analysis results; Perform usage analysis based on the multiple historical application records to obtain multiple idle windows; Performing a synchronous upgrade fitness analysis according to the plurality of idle windows and the K groups of associated databases to obtain K synchronous upgrade windows; Interactively obtain K upgrade tasks of the K groups of associated databases, and obtain K upgrade times by performing upgrade simulation on the K upgrade tasks; Perform parallel upgrade sorting according to the K synchronous upgrade windows and the K upgrade durations to obtain an upgrade scheduling sequence; Extracting a plurality of upgrade notifications from the upgrade scheduling sequence, and transmitting the plurality of upgrade notifications back to the plurality of user terminals; Performing a synchronous upgrade fitness analysis according to the plurality of idle windows and K groups of associated databases to obtain K synchronous upgrade windows, the method comprising: calling a first group of idle windows corresponding to a first group of associated databases from the plurality of idle windows; Perform intersection solving on a plurality of cyclic idle sequences in the first group of idle windows to obtain a first synchronous idle sequence; Obtaining multiple sets of SQL script execution times of multiple associated databases in the first set of associated databases through local data calls; Perform extreme value calls on the execution time of the multiple groups of SQL scripts to obtain standard execution time; Using the standard execution time to traverse the first synchronous idle sequence, and locate a first group of standby upgrade windows; Similarly, synchronous upgrade association analysis is performed according to the plurality of idle windows and K group association databases to obtain K groups of standby upgrade windows; Outputting the K synchronous upgrade windows by performing memory occupancy fitness analysis on the K groups of standby upgrade windows; By performing memory occupancy fitness analysis on the K groups of standby upgrade windows, the K synchronous upgrade windows are outputted, and the method includes: Arrange and combine the K groups of standby upgrade windows to obtain multiple synchronous upgrade sequences; Using the K upgrade tasks to perform upgrade simulation on the multiple synchronous upgrade sequences to obtain multiple memory usage trends; Preset a conflict condition, and use the conflict condition to traverse the multiple memory usage trends, and screen and obtain H memory usage trends of H synchronous upgrade sequences; Preset a memory pressure correlation index, and collect data on the H memory occupancy trends based on the memory pressure correlation index as a constraint to obtain H groups of memory pressure correlation data; Pre-built parallel upgrade fitness function; After the H groups of memory pressure-related data are evaluated by the parallel upgrade fitness function, the K synchronous upgrade windows are extracted from the H synchronous upgrade sequences according to the evaluation result.
2. The method for synchronously upgrading a database for a user terminal according to claim 1, characterized in that: Performing dependency analysis on the multiple databases to be upgraded according to the multiple historical application records, and dividing the multiple databases to be upgraded into K groups of related databases based on the analysis results, the method comprising: Performing data screening of the plurality of historical application records based on the cross-library call relationship as a constraint to obtain a plurality of cross-library call records; Predefine N cross-library call behaviors, and decompose the multiple cross-library call records according to the N cross-library call behaviors to obtain N groups of single-dimensional call records; Taking the multiple databases to be upgraded as topological nodes, using predefined out-degree connection rules as node connection constraints, and constructing N single-dimensional topological networks according to the N groups of single-dimensional call records; Dependency analysis is performed on the multiple databases to be upgraded according to the N single-dimensional topology networks to obtain the K groups of associated databases.
3. The method for synchronously upgrading a database for a user terminal as claimed in claim 1, characterized in that: Performing usage analysis based on the multiple historical application records to obtain multiple idle windows, the method comprising: Disassembling the first historical application record to obtain a plurality of first node application data of a plurality of application nodes in the first application sequence, wherein the data composition of the first node application data includes an access timestamp, an access frequency, an access data volume, and a CPU occupancy; Predefine an idle standard, and use the idle standard to traverse the plurality of first node application data to obtain M idle nodes, wherein the idle standard includes an operation frequency interval, a data load interval, and a CPU occupancy interval related to a gate; Continuously merge adjacent no-load points according to the M access timestamps of the M no-load nodes to obtain a no-load time period list; Using time series decomposition to perform cyclic pattern recognition of the idle time period list to obtain a cyclic idle sequence; Outputting the single-cycle cyclic idle sequence as a first idle window; By analogy, the plurality of idle windows are obtained by performing usage analysis based on the plurality of historical application records.
4. The method for synchronously upgrading a database for a user terminal as claimed in claim 1, characterized in that: The method comprises: Calling a first group of memory pressure-related data from the H group of memory pressure-related data, the first group of memory pressure-related data including a peak value of memory occupancy, a valley value of memory occupancy, an average memory occupancy rate, a synchronous upgrade time, and an average value of a memory recovery time; The first set of memory pressure-related data is synchronized to the parallel upgrade fitness function to obtain a first parallel fitness coefficient, wherein the parallel upgrade fitness function is as follows: ; Among them, F is the parallel fitness coefficient, M peak is the peak memory usage, M valley is the valley value of memory usage, M avg is the average memory usage, T sync It takes time to upgrade synchronously, T rec The average time consumed for memory recovery; Similarly, the H groups of memory pressure-related data are evaluated by the parallel upgrade fitness function to obtain H parallel fitness coefficients; After the H parallel fitness coefficients are serialized, the K synchronous upgrade windows are extracted from the H synchronous upgrade sequences according to the sorting result.
5. The method for synchronously upgrading a database facing a user end as claimed in claim 2, characterized in that: Dependency analysis is performed on the multiple databases to be upgraded according to the N single-dimensional topology networks to obtain the K groups of associated databases, and the method includes: Obtaining N single-dimensional interaction behavior sets of the first database to be upgraded and the second database to be upgraded from the N single-dimensional topology networks; By quantifying the cross-library interaction behaviors of the N single-dimensional interaction behavior sets, N single-dimensional dependency coefficients are obtained; Preconfiguring N behavior weight coefficients for the N cross-library call behaviors, and using the N behavior weight coefficients to perform primary weighted quantization of the N single-dimensional dependency coefficients to obtain a first correlation dependency coefficient; If the first association dependency coefficient meets the association dependency threshold, dividing the first database to be upgraded and the second database to be upgraded into the same group of associated databases; By analogy, dependency analysis is performed on the multiple databases to be upgraded according to the N single-dimensional topology networks, and databases are merged based on the analysis results to obtain the K groups of associated databases.
6. The method for synchronously upgrading a database facing a user end as claimed in claim 5, characterized in that: By quantifying the cross-library interaction behaviors of the N single-dimensional interaction behavior sets, N single-dimensional dependency coefficients are obtained, and the method includes: Disassembling the first single-dimensional interaction behavior set to obtain multiple interaction behavior records, wherein each interaction behavior record includes a first operation time, a first operation time consumption, a first number of affected rows, and a first resource occupancy; Obtaining multiple interaction dependency coefficients of the multiple interaction behavior records by performing secondary weighted quantification on the first operation time consumption, the first number of affected rows, and the first resource occupancy; After extracting a plurality of first operation times from the plurality of interaction behavior records, performing three-level weighted quantization of the plurality of interaction dependency coefficients using the plurality of first operation times to obtain a first single-dimensional dependency coefficient; By analogy, the N one-dimensional interaction behavior sets are analyzed to obtain the N one-dimensional dependency coefficients.
7. The user-oriented database synchronization upgrade system is characterized by: The system is used to implement the user-side database synchronization upgrade method according to any one of claims 1 to 6, and comprises: Data acquisition module: calls local data on multiple user terminals to obtain multiple historical application records of multiple databases to be upgraded; A first analysis module: performing dependency analysis on the multiple databases to be upgraded according to the multiple historical application records, and dividing the multiple databases to be upgraded into K groups of related databases based on the analysis results; A second analysis module: performing usage analysis based on the multiple historical application records to obtain multiple idle windows; The third analysis module: performs synchronous upgrade fitness analysis according to the plurality of idle windows and the K groups of associated databases to obtain K synchronous upgrade windows; Upgrade simulation module: interactively obtain K upgrade tasks of the K groups of associated databases, and obtain K upgrade times by performing upgrade simulation on the K upgrade tasks; Sorting module: performs parallel upgrade sorting according to the K synchronous upgrade windows and the K upgrade durations to obtain an upgrade scheduling sequence; A notification feedback module extracts a plurality of upgrade notifications from the upgrade scheduling sequence, and feedbacks the plurality of upgrade notifications to the plurality of user terminals.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the user-side database synchronization upgrade method as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Firmware upgrading method and device
CN116841585A
Power grid resource service method based on GIS platform
CN118246680A
Upgrade of heterogeneous multi-instance database clusters
US20150142728A1