Database management method, apparatus, device, storage medium, and program product
By acquiring access behavior characteristic data of network operating system components, load trend prediction and conflict identification are performed, and a graph structure is constructed. This solves the problem that database management schemes in network operating systems are unable to cope with dynamic changes in business load, realizes dynamic autonomy and proactive prevention, and improves the flexibility and efficiency of database management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN FS COM TECHNOLOGY CO LTD
- Filing Date
- 2026-04-24
- Publication Date
- 2026-06-16
AI Technical Summary
Existing network operating systems struggle to perceive the database usage characteristics of components in real time during database management, making it impossible to dynamically switch or optimize storage strategies as needed, and unable to cope with dynamic changes in business load.
By acquiring access behavior data of network operating system components to related databases, load trend prediction and performance conflict identification are performed. A graph structure is constructed, and strategies are explored based on prediction and conflict information to achieve dynamic adjustment of database management.
It achieves dynamic autonomy in database management, solves the "lack of awareness" problem in traditional solutions, realizes the transformation from passive response to proactive prevention, avoids dependence on static configuration, and improves the flexibility and efficiency of database management.
Smart Images

Figure CN122220342A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to database management methods, apparatus, devices, storage media, and program products. Background Technology
[0002] Currently, mainstream network operating systems (NOS) generally use a single type of underlying database (such as Redis or a customized key-value store) to uniformly carry out the storage and management of all control plane data.
[0003] Currently, some network operating systems support changing the database backend through configuration, but the existing architecture cannot perceive the database usage characteristics of each component in real time (such as read / write ratio, key distribution, query complexity), nor does it support dynamic switching or optimization of storage strategies on demand. It relies heavily on static manual configuration and is difficult to cope with dynamic changes in business load. Summary of the Invention
[0004] The main objective of this application is to provide a database management method, apparatus, device, storage medium, and program product, which aims to solve the technical problem that existing database management solutions are unable to cope with the dynamic changes in business load.
[0005] To achieve the above objectives, this application proposes a database management method, which includes: Obtain access behavior characteristic data when network operating system components access related databases; Based on the access behavior feature data, load trend prediction is performed to obtain load prediction information for the associated database; A graph structure is constructed based on the access behavior feature data, and conflict identification is performed based on the graph structure to obtain performance conflict information; Based on the load prediction information and the performance conflict information, a strategy exploration is performed to obtain an associated database optimization strategy, and database management is performed based on the associated database optimization strategy.
[0006] In one embodiment, the step of managing the database based on the relational database optimization strategy includes: When the associated database optimization strategy includes database migration, the transaction log information of the associated database is obtained, and a consistent snapshot is created based on the transaction log information. The consistent snapshot is loaded into the target database to be migrated, and the data in the associated database and the target database are compared after loading is complete to obtain the consistency detection result; When the consistency detection result is inconsistent, the target database is automatically compensated based on the associated database.
[0007] In one embodiment, the method further includes: When the consistent snapshot is loaded into the target database to be migrated, an incremental change capture pipeline is started to obtain the written data in the associated database during the loading process; The written data is synchronously loaded into the target database.
[0008] In one embodiment, the method further includes: Upon receiving registration information for a network operating system component, determine the database to be associated with that network operating system component; Establish the association between the network operating system component and the database to be associated, and inject a monitoring agent into the network operating system component; wherein, the monitoring agent is used to obtain access behavior feature data when the network operating system component accesses the associated database.
[0009] In one embodiment, the step of performing load trend prediction based on the access behavior feature data to obtain load prediction information for the associated database includes: The access behavior feature data is arranged according to a time window to obtain a behavior feature sequence; Load trend prediction is performed on the behavioral feature sequence using a pre-trained long short-term memory network to obtain load prediction information for the associated database.
[0010] In one embodiment, the step of constructing a graph structure based on the access behavior feature data and performing conflict identification based on the graph structure to obtain performance conflict information includes: Obtain relational data from the access behavior feature data, and construct a graph structure based on the relational data; The graph structure is used to identify conflicts through a pre-trained graph neural network to obtain performance conflict information.
[0011] Furthermore, to achieve the above objectives, this application also proposes a database management device, which includes: The data acquisition module is used to acquire access behavior characteristic data when network operating system components access the associated database; The load prediction module is used to predict load trends based on the access behavior feature data to obtain load prediction information for the associated database. The conflict identification module is used to construct a graph structure based on the access behavior feature data, and to identify conflicts based on the graph structure to obtain performance conflict information; The strategy optimization module is used to explore strategies based on the load prediction information and the performance conflict information, obtain related database optimization strategies, and perform database management based on the related database optimization strategies.
[0012] In addition, to achieve the above objectives, this application also proposes a database management device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the database management method as described above.
[0013] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and which, when executed by a processor, implements the steps of the database management method described above.
[0014] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the database management method described above.
[0015] One or more technical solutions proposed in this application have at least the following technical effects: This application obtains access behavior characteristic data when network operating system components access related databases; performs load trend prediction based on the access behavior characteristic data to obtain load prediction information for the related databases; constructs a graph structure based on the access behavior characteristic data and identifies conflicts based on the graph structure to obtain performance conflict information; explores strategies based on the load prediction information and performance conflict information to obtain optimization strategies for the related databases, and manages the database based on these optimization strategies. By using access behavior characteristic data from network operating system components accessing related databases, a data foundation is provided for the entire intelligent control closed loop, solving the "unawareness" problem in traditional solutions. Load trend prediction based on access behavior characteristic data enables a shift from passive response to proactive prevention, providing a time-dimensional input for decision-making. Conflict identification based on the graph structure transforms scattered access behavior characteristics into structured conflict information. Strategy exploration based on load prediction information and performance conflict information enables automatic adjustment of database management strategies according to load changes and conflict situations, without manual intervention, achieving a leap from static configuration to dynamic autonomy. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating an embodiment of the database management method of this application. Figure 2 This is a flowchart illustrating Embodiment 2 of the database management method of this application; Figure 3 This is a schematic diagram of system modules in one implementation of the database management method of this application; Figure 4 This is a flowchart illustrating Embodiment 3 of the database management method of this application; Figure 5 This is a schematic diagram of the module structure of the database management device according to an embodiment of this application; Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the database management method in this application embodiment.
[0019] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0020] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0021] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0022] The main solution of this application embodiment is: to obtain access behavior feature data when network operating system components access the associated database; to perform load trend prediction based on the access behavior feature data to obtain load prediction information of the associated database; to construct a graph structure based on the access behavior feature data and to identify conflicts based on the graph structure to obtain performance conflict information; to explore strategies based on the load prediction information and performance conflict information to obtain an associated database optimization strategy, and to manage the database based on the associated database optimization strategy.
[0023] This application provides a solution that enables component-level differentiated optimization by allowing different NOS components to be independently bound to the most suitable associated database and by predicting and identifying the access behavior characteristics of different components. Through strategy exploration based on load prediction information and performance conflict information, dynamic adjustment of optimization strategies is achieved without relying on static configuration. Furthermore, by combining time trends and spatial conflicts, the optimized strategy becomes more comprehensive.
[0024] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a computer or server, or an electronic device or virtual device capable of performing the above functions. The following description uses a database management device (hereinafter referred to as the management device) as an example to illustrate this embodiment and the subsequent embodiments.
[0025] Based on this, embodiments of this application provide a database management method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the database management method of this application.
[0026] In this embodiment, the method is directed to network operating system components, and the database management method includes steps S10 to S40: Step S10: Obtain access behavior characteristic data when network operating system components access the associated database.
[0027] It is understandable that network operating system components are functional modules within the network operating system, such as the Border Gateway Protocol (BGP) routing engine, the Lossless Quality of Service (Lossless QoS) controller, and the NMI (gRPC Network Management Interface Telemetry, gNMI Telemetry) buffer module. These network operating system components undertake different functional responsibilities within the network operating system, and each network operating system component may have different database requirements (such as transactions, latency, and throughput).
[0028] It should be understood that the aforementioned associated databases are those actually accessed and used by the network operating system (ROS) components that are bound to them. For example, a BGP routing engine is bound to PostgreSQL, a Lossless QoS controller is bound to in-memory key-value stores, and the gNMI Telemetry buffer module is bound to RocksDB. Through the binding relationship between ROS components and databases, each ROS component can access its own associated database. Different ROS components may use different associated databases.
[0029] It should be noted that the aforementioned access behavior characteristic data are quantitative indicators used to quantify how network operating system components access their associated databases. The access behavior characteristic data may include any one or more of the following: read / write ratio, request latency distribution, key space distribution and access frequency, lock contention frequency, and write-ahead logging (WAL) throughput. This application embodiment does not impose any limitations on these data.
[0030] In this embodiment of the application, no restrictions are placed on the method of obtaining access behavior characteristics. It can be obtained by parsing the log files of the database or network operating system, or by obtaining them by traffic bypass monitoring, or by collecting them based on the system kernel of the network operating system, or by registering a monitoring module in the network operating system component, or other methods.
[0031] In a specific implementation, the management device in this application embodiment can obtain access behavior data when network operating system components access the associated database, providing a data foundation for component-level differentiated optimization and realizing dynamic perception of the associated database or network operating system components.
[0032] Step S20: Based on the access behavior feature data, perform load trend prediction to obtain load prediction information for the associated database.
[0033] It is understandable that by extracting access behavior characteristic data of network operating system components, time-series performance indicators can be determined. Modeling based on these time-series performance indicators can predict the direction and intensity of load changes over a future period, thus obtaining load trend prediction results, i.e., load prediction information, such as determining a sudden increase in traffic or that the write-ahead log throughput is about to exceed the threshold.
[0034] In this application embodiment, load trend prediction can be performed using a Long Short-Term Memory (LSTM) network, an autoregressive integral moving average (ARMA) model, or a temporal convolutional network; this application embodiment does not impose any limitations on this method. Load trend prediction allows for advance prediction of future loads, enabling proactive measures to be taken before performance issues arise. For example, if a traffic surge is predicted, the number of database connections can be increased, the cache expanded, or a higher-performance storage engine switched to in advance. Similarly, if write amplification risk is predicted, the write-ahead log strategy can be adjusted or data compression triggered in advance.
[0035] In a specific implementation, the management device can perform load trend prediction based on the access behavior feature data to obtain the load prediction information of the associated database, enabling the system to perform predictive resource adjustment actions, complete the expansion before the load increases, and promptly reduce the capacity after the load decreases, thereby achieving a precise match between resource supply and demand.
[0036] Step S30: Construct a graph structure based on the access behavior feature data, and perform conflict identification based on the graph structure to obtain performance conflict information.
[0037] It is understood that a graph structure is a data organization form composed of nodes and edges, which can be used to describe the relationships between entities. In the embodiments of this application, the nodes of the graph structure can be used to represent entity objects in the database, such as keys, users, resources, transactions, etc.; the edges of the graph structure can be used to represent the relationships between nodes, such as lock contention, access dependency, transaction dependency, etc. In the graph structure, additional information about nodes or edges can also be represented by attributes, such as access popularity, contention frequency, timestamp, etc.
[0038] It should be noted that the performance conflict information in the embodiments of this application may refer to information related to resource competition or access dependency problems that may lead to a decrease in database performance, such as lock contention, deadlock, lock wait timeout, access dependency conflict, etc. The embodiments of this application do not limit this.
[0039] For example, the embodiments of this application can perform conflict identification based on graph traversal algorithms, such as depth-first search algorithm, breadth-first search algorithm, etc.
[0040] For example, embodiments of this application can also perform statistical analysis based on graph structures to identify conflict hotspots through indicators such as node degree and centrality.
[0041] For example, embodiments of this application can also use a community detection algorithm to divide the graph structure into several clusters, thereby identifying clusters with frequent lock contention and realizing conflict cluster identification based on the community detection algorithm.
[0042] In a specific implementation, the management device constructs a graph structure based on the access behavior feature data and performs conflict identification based on the graph structure to obtain performance conflict information. This enables the access behavior feature data to be organized into a graph structure, allowing the system to understand the relationship between keys from a global perspective, rather than just observing from a single indicator dimension.
[0043] Step S40: Based on the load prediction information and the performance conflict information, a strategy exploration is performed to obtain the associated database optimization strategy, and database management is performed based on the associated database optimization strategy.
[0044] It should be noted that the associated database optimization strategy refers to the specific optimization strategy for the associated database bound to the network operating system component. Specifically, it may include one or more of the following strategies: recommending a better database (e.g., switching from Redis to RocksDB), triggering automatic index creation / deletion, adjusting cache eviction policies, and predictive scaling up or down. This application embodiment does not limit this.
[0045] In this application embodiment, the strategy exploration method can be reinforcement learning, large model inference, rule-based alerting, etc., and this application embodiment does not limit it. By optimizing database association based on relational database optimization strategies, a leap from static configuration to dynamic autonomy can be achieved, so that database management no longer depends on manual static configuration, but is automatically completed by the system according to real-time load and conflict situation. This avoids the problem in traditional network operating systems where database types, indexes, caching strategies, etc. are all manually pre-configured and cannot be dynamically adjusted.
[0046] This application embodiment acquires access behavior feature data when network operating system components access related databases; performs load trend prediction based on the access behavior feature data to obtain load prediction information for the related databases; constructs a graph structure based on the access behavior feature data and identifies conflicts based on the graph structure to obtain performance conflict information; explores strategies based on the load prediction information and performance conflict information to obtain optimization strategies for the related databases, and manages the database based on these optimization strategies. By using access behavior feature data from network operating system components accessing related databases, a data foundation is provided for the entire intelligent control closed loop, solving the "unnoticeable" problem in traditional solutions. Load trend prediction based on access behavior feature data enables a shift from passive response to proactive prevention, providing a time-dimensional input for decision-making. Conflict identification based on the graph structure transforms scattered access behavior features into structured conflict information. Strategy exploration based on load prediction information and performance conflict information enables automatic adjustment of database management strategies according to load changes and conflict situations, without manual intervention, achieving a leap from static configuration to dynamic autonomy.
[0047] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 , Figure 2 This is a flowchart illustrating Embodiment 2 of the database management method of this application.
[0048] In this embodiment of the application, the step of managing the database based on the associated database optimization strategy includes: Step S41: When the related database optimization strategy includes database migration, obtain the transaction log information of the related database and create a consistent snapshot based on the transaction log information. Step S42: Load the consistent snapshot into the target database to be migrated, and compare the data in the associated database and the target database when the loading is complete to obtain the consistency detection result; Step S43: When the consistency detection result is inconsistent, the target database is automatically compensated based on the associated database.
[0049] It should be noted that database migration can refer to the complete transfer of data, structure, and access paths from the source database (related database) currently bound to a network operating system component to the target database, and the switching of read and write requests from the source database to the target database. In this embodiment, when the related database currently bound to the network operating system component cannot meet the needs of its actual access mode and / or the resource requirements of the network operating system component do not match the resource consumption of the currently bound related database, and / or when load trend prediction reveals potential future performance risks and / or the source database experiences performance bottlenecks, insufficient capacity, or requires upgrades or maintenance, the related database optimization strategy may include database migration.
[0050] It's important to explain that during the operation of a relational database, the database can log every insert, update, and delete operation. This typically employs a write-ahead logging mechanism, where operations are written to a log file before the actual database modification. The transaction log information mentioned above refers to the information related to this log file, which may include the transaction identifier, operation type, operation time, data values before and after modification, and transaction commit status. During migration, a consistent snapshot can be created based on the source database's transaction log information, and an incremental change capture pipeline can be initiated to ensure that new writes during the migration process are captured and buffered in real time.
[0051] As can be understood, a consistent snapshot is a complete, readable, and transactionally consistent copy of all data in the source database at a specific point in time, corresponding to the data state of the source database at that point. After a consistent snapshot is created, its content will not change and will be used as baseline data for database migration.
[0052] It should be understood that the target database mentioned above is the database after data migration. When the consistency snapshot is fully loaded into the target database, the data in the source database (i.e., the initial related database) and the target database can be compared to obtain the consistency monitoring results. When the data in the source database and the target database are consistent, the consistency detection result can be considered consistent. When the data in the source database and the target database are inconsistent, the consistency detection result can be considered inconsistent, and in this case, automatic compensation can be performed on the target database based on the source database.
[0053] In some embodiments of this application, a database management system (hereinafter referred to as the system, illustrated as the NOS database system) is also proposed, such as... Figure 3 As shown, Figure 3 This is a schematic diagram of a system module in one implementation of the database management method of this application.
[0054] Reference Figure 3 The system in this application may include several network operating system components (shown as an application group in the diagram). These network operating system components can register / invoke based on a multimodal unified abstraction layer. Through the multimodal unified abstraction layer, the network operating system components can dynamically call related databases or data in the physical database, such as high-frequency throughput data, complex query data, document databases, low-latency databases, time-series databases, and columnar databases. The intelligent control system may have different local modules. By using feature acquisition to obtain access behavior feature data of different network operating system components, and through local models or intelligent platform large models, a control strategy (i.e., a related database optimization strategy) can be obtained. Based on this control strategy, database management can be achieved.
[0055] In some embodiments of this application, the multimodal unified abstraction layer of this application can provide a unified semantic interface to upper-layer network operating system components, define resource structures based on the YANG data model, and support a GraphQL-like declarative query language to implement standardized data operations (such as Create / Read / Update / Delete / Watch).
[0056] In some embodiments of this application, the multimodal unified abstraction layer may have a built-in YANG compiler, which can automatically map YANG models to the schema of the underlying database (e.g., mapping a YANG container to a PostgreSQL table, or a leaf to a Redis field). This mapping eliminates the need for applications to directly manipulate the physical schema.
[0057] In some embodiments of this application, the multimodal unified abstraction layer may further include a GraphQL parser. When the multimodal unified abstraction layer receives a query request, the GraphQL parser can decompose the query request into a native query for a specific data source, such as converting the GraphQL query{bgp{peer,as}} into an SQLite SELECT peer, as FROM bgp), and perform result aggregation in memory.
[0058] In some embodiments of this application, the multimodal unified abstraction layer can also have multiple built-in native databases and support dynamic registration, hot-plugging, and switching of multiple third-party databases (such as PostgreSQL, RocksDB, and Redis) at runtime. Each database implementation is a separate dynamic link library (.so / .dll). The system can load these databases through a service discovery mechanism to achieve runtime "hot-plugging." If a database crashes, the abstraction layer can also catch the exception and attempt to rebuild the connection. The image layer defines a set of standard interfaces, which can include methods such as Connect, Read, Write, and TxBegin.
[0059] In some embodiments of this application, each database in the physical database needs to declare its capability metadata, including: transaction isolation level, index type (such as B+ tree / LSM / Hash), persistence strategy (such as WAL / Checkpoint), maximum number of concurrent connections, delay SLA, etc., for use by upper-layer scheduling decisions.
[0060] In some embodiments of this application, in order to achieve seamless business operation and zero data loss during the database's runtime transition, this application also introduces a multi-stage consistency guarantee mechanism. The method further includes: when loading the consistency snapshot to the target database to be migrated, starting an incremental change capture pipeline to obtain the written data in the associated database during the loading process; and synchronously loading the written data to the target database.
[0061] It should be noted that in the initial stage of migration triggering, the system can create a consistent snapshot based on the transaction log information of the source database and start the incremental change capture pipeline to ensure that new writes to the source database are captured and buffered during the consistent snapshot loading process.
[0062] Understandably, an incremental change capture pipeline can be a data channel established during database migration to capture and transmit incremental changes to the source database in real time.
[0063] It should be noted that during the switching window, the system can also enable dual-write mode. In this case, changes will be written to both the source and target databases simultaneously. Combined with the idempotent write design, this can avoid data anomalies caused by repeated operations. The target database can apply changes in sequence through the transaction replay queue, ensuring the consistency of the operation sequence.
[0064] Understandably, during an atomic switch, the system can pause component write requests at the switch moment, wait for the incremental queue to be cleared, and then atomically switch the logical data pointer from the source database instance to the target database instance to ensure global consistency of data state. Upon completion of the migration, a data comparison task can be automatically triggered, i.e., the step of comparing the data in the associated database and the target database upon completion of loading is executed.
[0065] In this embodiment, the system can support deep collaboration with external intelligent platforms to achieve cross-device and cross-level data consistency management. Specifically, the intelligent platform can maintain a global logical namespace, through which data on any node can be transparently accessed; the management device (system) can synchronize information such as the binding relationships of network operating system components, database status, and migration history to the intelligent platform locally, ensuring global consistency. Figure 1 To the point of being responsive.
[0066] In some implementations, the system of this application can adopt eventual consistency by default. The system uses asynchronous message queues or log aggregation technology to stream and synchronize local data to the platform. Although there is a delay of a few seconds, it ensures high-throughput writing of massive amounts of data and decoupling between systems, meeting the needs of big data analysis. If there are more precise requirements, strong consistency control can also be enabled, and the embodiments of this application do not limit this.
[0067] This application's embodiments, during database migration, include acquiring transaction log information from the associated database in the database optimization strategy and creating a consistent snapshot based on this information. The consistent snapshot is then loaded into the target database to be migrated, and upon completion of loading, the data in the associated and target databases is compared to obtain a consistency detection result. If the consistency detection result indicates inconsistency, automatic compensation is performed on the target database based on the associated database. Because the baseline data for migration is established by acquiring transaction log information from the associated database and creating a consistent snapshot based on this information, a consistent starting point for all data is ensured, avoiding data errors during synchronization and switching. By performing a consistency comparison on the loaded database, the system can promptly detect problems, preventing data loss, corruption, or omissions during the loading process.
[0068] Based on the first and / or second embodiments of this application, in the third embodiment of this application, the content that is the same as or similar to the first and / or second embodiments described above can be referred to the above description and will not be repeated hereafter. Based on this, please refer to... Figure 4 , Figure 4 This is a flowchart illustrating Embodiment 3 of the database management method of this application.
[0069] like Figure 4 As shown in the embodiments of this application, the method further includes: Step S100: Upon receiving the registration information of the network operating system component, determine the database to be associated with the network operating system component; Step S200: Establish the association between the network operating system component and the database to be associated, and inject a monitoring agent into the network operating system component; wherein, the monitoring agent is used to obtain access behavior feature data when the network operating system component accesses the associated database.
[0070] It should be noted that when a network operating system component starts up, it can send a request to the multimodal unified abstraction layer to declare its own data model and performance requirements. This request information is the registration information of the network operating system component. Based on this registration information, the management device can determine the database to be associated with the network operating system component.
[0071] In some embodiments of this application, each network operating system component within the network operating system may independently declare its database requirements and, when initiating a registration request to the multimodal unified abstraction layer, include these database requirements as part of the registration information, so that the management device can determine the database to be associated with the network operating system based on the received registration information.
[0072] For example: the BGP routing engine is bound to highly consistent PostgreSQL, supporting complex routing table join queries and ACID transactions; the Lossless QoS controller is bound to low-latency in-memory KV storage, ensuring microsecond-level policy updates; and the gNMITelemetry buffer module is bound to high-throughput RocksDB for temporary storage of high-frequency streaming data.
[0073] It should be noted that the aforementioned monitoring agent can be a low-overhead monitoring program injected into each registered network operating system component, responsible for continuously collecting behavioral characteristic data when the network operating system component accesses the associated database. It can be a lightweight behavioral probe or other program, and this application embodiment does not impose any limitations on this. Through the injected monitoring agent, access behavior characteristic data such as read / write ratio, request latency distribution (P50 / P99 / P999), key space distribution and access popularity, lock contention frequency, and WAL write throughput can be collected.
[0074] In some embodiments of this application, time-series performance indicators can be modeled to predict future load trends (such as traffic surges and write amplification risks). Specifically, the step of predicting load trends based on the access behavior feature data to obtain load prediction information for the associated database includes: arranging the access behavior feature data according to time windows to obtain a behavior feature sequence; and performing load trend prediction on the behavior feature sequence using a pre-trained long short-term memory network to obtain load prediction information for the associated database.
[0075] It should be noted that in this embodiment, a fixed time window length (e.g., 10 seconds, 30 seconds, 1 minute) can be set to divide continuous time into discrete time windows. Within each time window, the original access behavior feature data of the monitoring agent in standby mode can be aggregated to obtain the feature vector corresponding to that time window. By arranging the feature vectors from multiple consecutive time windows in chronological order, a behavior feature sequence can be constructed.
[0076] In this embodiment, to achieve load trend prediction, a long short-term memory (LSTM) network can be pre-trained. Behavioral feature sequences are input into the LTM network sequentially, time step by time. The LTM network selectively memorizes historical information through its forget gate, input gate, and output gate to update cell states. By capturing the temporal dependencies in the behavioral feature sequences, the pattern of load changes is identified, thereby outputting load prediction information for several future time windows.
[0077] In some embodiments of this application, to achieve conflict identification, this application embodiment can model the access dependency relationship and lock contention graph between keys, identify potential performance conflict points, and thus optimize the index structure and data layout. Specifically, the step of constructing a graph structure based on the access behavior feature data and performing conflict identification based on the graph structure to obtain performance conflict information includes: obtaining relational data from the access behavior feature data and constructing a graph structure based on the relational data; and performing conflict identification on the graph structure using a pre-trained graph neural network to obtain performance conflict information.
[0078] It should be noted that the access behavior feature data can include relational data such as key spatial distribution and access popularity, lock contention frequency, etc. Based on this relational data, a graph structure of the database can be constructed. The nodes of the graph structure can be the keys in the database, and the edges of the graph structure can be the relationships between the keys, such as lock contention relationships, key co-occurrence access relationships, etc.
[0079] For example, if there is lock contention between key A and key B (transaction 1 holds lock A and waits for lock B, and transaction 2 holds lock B and waits for lock A), then an edge is established between A and B, and the edge feature records the contention frequency.
[0080] For example, if key A and key B are accessed sequentially in the same transaction (the number of co-occurrences exceeds a threshold), then an edge is established between A and B, and the edge feature records the co-occurrence frequency.
[0081] It should be noted that a graph neural network can be pre-trained in this embodiment. By inputting the constructed graph structure into the graph neural network, the feature vectors (access popularity, read / write ratio, etc.) of each node in the graph structure can be used as initial embeddings. Each node can collect information from its neighbors and, through multi-layer propagation, enable the node to perceive the state of multi-hop neighbors. Based on the node embeddings, the graph neural network predicts whether each node is a conflicting node, the type of conflict, and the intensity of conflict. In this embodiment, no restrictions are placed on the specific training method and structure of the graph neural network; it can be selected according to the needs of the actual application.
[0082] This application embodiment determines the database to be associated with a network operating system component upon receiving its registration information; establishes the association between the network operating system component and the database to be associated; and injects a monitoring agent into the network operating system component. Because the database to be associated is determined upon receiving the network operating system component's registration information, the most suitable database type is determined during the component's startup phase, allowing each component to bind to its corresponding dedicated database as needed. By injecting a monitoring agent into the network operating system component to obtain access behavior characteristic data, the system possesses the ability to continuously perceive component database access behavior, providing a data foundation for intelligent control.
[0083] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the database management method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0084] This application also provides a database management device; please refer to... Figure 5 , Figure 5 This is a schematic diagram of the module structure of a database management device according to an embodiment of this application. The database management device includes: Data acquisition module 10 is used to acquire access behavior characteristic data when network operating system components access the associated database; The load prediction module 20 is used to predict the load trend based on the access behavior feature data to obtain the load prediction information of the associated database. The conflict identification module 30 is used to construct a graph structure based on the access behavior feature data, and to identify conflicts based on the graph structure to obtain performance conflict information; The strategy optimization module 40 is used to explore strategies based on the load prediction information and the performance conflict information, obtain related database optimization strategies, and perform database management based on the related database optimization strategies.
[0085] The database management device provided in this application, employing the database management method described in the above embodiments, can solve the technical problem that existing database management solutions struggle to cope with dynamic changes in business load. Compared with the prior art, the beneficial effects of the database management device provided in this application are the same as those of the database management method provided in the above embodiments, and other technical features in the database management device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0086] This application provides a database management device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the database management method in Embodiment 1 above.
[0087] The following is for reference. Figure 6 The diagram illustrates a structural schematic of a database management device suitable for implementing embodiments of this application. The database management device in these embodiments may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The database management device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0088] like Figure 6 As shown, the database management device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1002 or a program loaded from storage device 1003 into random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the database management device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the database management device to communicate wirelessly or wiredly with other devices to exchange data. Although the figures show database management devices with various systems, it should be understood that implementing or having all of the systems shown is not required. More or fewer systems may be implemented alternatively.
[0089] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0090] The database management device provided in this application, employing the database management method described in the above embodiments, can solve the technical problem that existing database management solutions struggle to cope with dynamic changes in business load. Compared with the prior art, the beneficial effects of the database management device provided in this application are the same as those of the database management method provided in the above embodiments, and other technical features of this database management device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0091] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0092] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0093] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the database management method in the above embodiments.
[0094] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory, optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0095] The aforementioned computer-readable storage medium may be included in the database management device; or it may exist independently and not be assembled into the database management device.
[0096] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the database management device, cause the database management device to: Obtain access behavior characteristic data when network operating system components access related databases; Based on the access behavior feature data, load trend prediction is performed to obtain load prediction information for the associated database; A graph structure is constructed based on the access behavior feature data, and conflict identification is performed based on the graph structure to obtain performance conflict information; Based on the load prediction information and the performance conflict information, a strategy exploration is performed to obtain an associated database optimization strategy, and database management is performed based on the associated database optimization strategy.
[0097] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0098] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0099] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0100] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., computer programs) for executing the above-described database management method. This solves the technical problem that existing database management solutions struggle to cope with dynamic changes in business load. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the database management method provided in the above embodiments, and will not be repeated here.
[0101] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the database management method described above.
[0102] The computer program product provided in this application can solve the technical problem that existing database management solutions are unable to cope with dynamic changes in business load. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the database management method provided in the above embodiments, and will not be repeated here.
[0103] The above description is only a part of the embodiments of this application and does not limit the scope of protection of this application. All equivalent structural transformations made under the technical concept of this application and using the content of this application specification and drawings, or direct / indirect applications in other related technical fields, are included in the scope of protection of this application.
Claims
1. A database management method, characterized in that, The method includes: Obtain access behavior characteristic data when network operating system components access related databases; Based on the access behavior feature data, load trend prediction is performed to obtain load prediction information for the associated database; A graph structure is constructed based on the access behavior feature data, and conflict identification is performed based on the graph structure to obtain performance conflict information; Based on the load prediction information and the performance conflict information, a strategy exploration is performed to obtain an associated database optimization strategy, and database management is performed based on the associated database optimization strategy.
2. The database management method as described in claim 1, characterized in that, The steps for database management based on the relational database optimization strategy include: When the associated database optimization strategy includes database migration, the transaction log information of the associated database is obtained, and a consistent snapshot is created based on the transaction log information. The consistent snapshot is loaded into the target database to be migrated, and the data in the associated database and the target database are compared after loading is complete to obtain the consistency detection result; When the consistency detection result is inconsistent, the target database is automatically compensated based on the associated database.
3. The database management method as described in claim 2, characterized in that, The method further includes: When the consistent snapshot is loaded into the target database to be migrated, an incremental change capture pipeline is started to obtain the written data in the associated database during the loading process; The written data is synchronously loaded into the target database.
4. The database management method as described in claim 1, characterized in that, The method further includes: Upon receiving registration information for a network operating system component, determine the database to be associated with that network operating system component; Establish the association between the network operating system component and the database to be associated, and inject a monitoring agent into the network operating system component; wherein, the monitoring agent is used to obtain access behavior feature data when the network operating system component accesses the associated database.
5. The database management method as described in claim 1, characterized in that, The step of performing load trend prediction based on the access behavior feature data to obtain load prediction information for the associated database includes: The access behavior feature data is arranged according to a time window to obtain a behavior feature sequence; Load trend prediction is performed on the behavioral feature sequence using a pre-trained long short-term memory network to obtain load prediction information for the associated database.
6. The database management method as described in claim 1, characterized in that, The step of constructing a graph structure based on the access behavior feature data and identifying conflicts based on the graph structure to obtain performance conflict information includes: Obtain relational data from the access behavior feature data, and construct a graph structure based on the relational data; The graph structure is used to identify conflicts through a pre-trained graph neural network to obtain performance conflict information.
7. A database management device, characterized in that, The database management device includes: The data acquisition module is used to acquire access behavior characteristic data when network operating system components access the associated database; The load prediction module is used to predict load trends based on the access behavior feature data to obtain load prediction information for the associated database. The conflict identification module is used to construct a graph structure based on the access behavior feature data, and to identify conflicts based on the graph structure to obtain performance conflict information; The strategy optimization module is used to explore strategies based on the load prediction information and the performance conflict information, obtain related database optimization strategies, and perform database management based on the related database optimization strategies.
8. A database management device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the database management method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the database management method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the database management method as described in any one of claims 1 to 6.