Knowledge graph construction method, device, electronic device and storage medium
By building a knowledge graph of database performance problems, using historical operation logs and solution strategies, the high cost and low efficiency problems caused by the dependence of labor on database performance optimization in the existing technology are solved, and automatic optimization of database performance and operation and maintenance efficiency are achieved. .
Patent Information
- Application Number
- CN202210564378.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-23
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2042-05-23
AI Technical Summary
Optimization of database performance problems in the prior art usually depends on operation and maintenance and developer experience and early warning of monitoring systems, resulting in high labor costs and low problem handling efficiency.
By collecting the historical operation log of the target database, identify the performance problems to be solved, and build a knowledge graph based on these problems and their corresponding solution strategies, thereby achieving automatic optimization.
Quickly determine the solution, realize automatic optimization of database performance, improve database operation and maintenance efficiency, and reduce human resources costs.
Smart Images

Figure CN114896418B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of database technology, and in particular to a knowledge graph construction method, device, electronic device and storage medium. Background Art
[0002] With the increasing application of network databases, more and more data needs to be stored and queried. The efficiency of database queries will directly affect the use of system users. When the amount of data in the database reaches hundreds of thousands or even more, database performance problems will arise. Therefore, it is very necessary to optimize the relevant performance of the database.
[0003] Currently, the optimization of database performance issues is usually done by operations and developers using early warnings from the monitoring system and their own experience to discover and resolve performance issues. Summary of the invention
[0004] The present invention provides a knowledge graph construction method, device, electronic device and storage medium to achieve the effect of timely discovering database performance problems and performing automatic optimization.
[0005] According to one aspect of the present invention, a method for constructing a knowledge graph is provided, the method comprising:
[0006] Collecting historical operation logs of the target database, and determining at least one performance problem to be solved based on the historical operation logs;
[0007] Determine each solution strategy corresponding to each of the performance issues to be solved, and construct a knowledge graph based on each of the performance issues to be solved and the corresponding solution strategy.
[0008] According to another aspect of the present invention, a knowledge graph construction device is provided, the device comprising:
[0009] A historical operation log collection module, used to collect historical operation logs of a target database and determine at least one performance problem to be solved based on the historical operation logs;
[0010] The knowledge graph construction module is used to determine the solution strategies corresponding to the performance problems to be solved, and to construct a knowledge graph based on the performance problems to be solved and the corresponding solution strategies.
[0011] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0012] at least one processor; and
[0013] a memory communicatively connected to the at least one processor; wherein,
[0014] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the knowledge graph construction method described in any embodiment of the present invention.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the knowledge graph construction method described in any embodiment of the present invention when executed.
[0016] The technical solution of the embodiment of the present invention first collects the historical operation log of the target database, and determines at least one performance problem to be solved based on the historical operation log, then determines the solution strategies corresponding to the performance problems to be solved, and constructs a knowledge graph based on the performance problems to be solved and the corresponding solution strategies. The optimization of database performance problems in the prior art is solved, which is usually discovered and processed by operation and maintenance and developers relying on the early warning of the monitoring system and their own experience, resulting in high labor costs and low problem handling efficiency. By constructing a knowledge graph of database performance problems, a solution can be quickly determined to achieve the effect of automatic optimization of database performance, thereby improving database operation and maintenance efficiency and reducing human resource costs.
[0017] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] 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.
[0019] Figure 1 is a flowchart of a knowledge graph construction method provided according to Embodiment 1 of the present invention;
[0020] Figure 2 is a structural diagram of a database performance optimization system provided according to Embodiment 1 of the present invention;
[0021] Figure 3 is a flowchart of a knowledge graph construction method provided according to Embodiment 2 of the present invention;
[0022] Figure 4 is a schematic diagram of the structure of a knowledge graph construction device provided according to Embodiment 3 of the present invention;
[0023] Figure 5 It is a structural schematic diagram of an electronic device that implements the knowledge graph construction method of an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] Before introducing this technical solution, an example application scenario can be first described. This technical solution can be applied to any database performance problem optimization scenario. When any database in the cloud system has a performance problem, the method provided by this technical solution can be used to handle it to achieve the effect of automatic database performance optimization.
[0027] Embodiment 1
[0028] Figure 1 A flowchart of a knowledge graph construction method is provided for the first embodiment of the present invention. This embodiment is applicable to situations where there are performance problems in the cloud database. The method can be executed by a knowledge graph construction device. The knowledge graph construction device can be implemented in the form of hardware and / or software. The knowledge graph construction device can be configured in a terminal and / or a server. Figure 1 As shown, the method includes:
[0029] S110: Collect historical operation logs of the target database, and determine at least one performance problem to be solved based on the historical operation logs.
[0030] In this embodiment, the target database may be a database that needs to be optimized due to performance problems, or a database that performs periodic performance optimization in a cloud system. Exemplarily, the target database may be a MySQL database. MySQL is a secure, cross-platform, efficient database system that is closely integrated with mainstream programming languages. MySQL is widely used in major systems due to its small size, fast running speed, support for various development languages, powerful functions, large storage capacity, and support for powerful built-in functions. The historical operation log may be a file that records the operation of the database. The historical operation log is an important part of the database, which is used to record the client connection status of the database, the execution status of database statements, and error information. In practical applications, when the database is accidentally damaged, the cause of the file error can be viewed through the historical operation log, and data can be restored through the log file. The performance problem to be solved may be the performance problem of the target database during the historical operation process. Exemplarily, the performance problem to be solved may be a slow query, excessive memory usage, or error information.
[0031] In a specific implementation, when the performance of a target database needs to be optimized, it is first necessary to collect historical operation logs of the target database, and to identify at least one performance problem to be solved by screening key information in the historical operation logs.
[0032] S120: Determine each solution strategy corresponding to each performance problem to be solved, and construct a knowledge graph based on each performance problem to be solved and the corresponding solution strategy.
[0033] Generally, when a target database has a performance problem to be solved, there are corresponding coping methods to solve each performance problem, and the coping methods corresponding to each performance problem to be solved can be used as a solution strategy. Exemplary solution strategies may include creating joint indexes, optimizing database structure, and decomposing associated queries.
[0034] Among them, the knowledge graph is essentially a semantic network composed of nodes and edges, which aims to describe the relationship between various concepts in the real world. From the perspective of the graph, the entities in the knowledge graph correspond to the nodes in the graph, and the relationships in the knowledge graph correspond to the edges in the graph. In this embodiment, each performance problem to be solved and each solution strategy are nodes in the knowledge graph, and for one of the technical problems to be solved, the technical problem to be solved and its corresponding solution strategy are connected by an edge.
[0035] In actual applications, after determining each performance problem to be solved based on historical operation logs, in order to construct a knowledge graph for describing database performance problems, it is necessary to first determine each solution strategy corresponding to each performance problem to be solved. Optionally, determining each solution strategy corresponding to each performance problem to be solved includes: determining each solution strategy corresponding to each performance problem to be solved based on a pre-constructed correspondence between the performance problem to be solved and the solution strategy.
[0036] Specifically, a correspondence between the performance problems to be solved and the solution strategies of the target database may be pre-constructed, so that when determining each performance problem to be solved, each solution strategy corresponding to each performance problem to be solved may be determined based on the correspondence.
[0037] Furthermore, by extracting key information from each performance problem to be solved, expanding the association between the performance problem to be solved and the solution strategy, the original one-to-one relationship is expanded to a many-to-many relationship, thereby constructing a knowledge graph based on each association relationship. For example, when a target performance problem contains three key information A, B, and C, in the original case, the target performance problem has a unique solution strategy corresponding to it. If a knowledge graph is constructed based on the target performance problem, other solution strategies corresponding to the keywords contained in the target performance problem can be determined respectively. Furthermore, these solution strategies may also correspond to other performance problems to be solved, so that a knowledge graph centered on the target performance problem can be constructed.
[0038] It should be noted that after constructing the knowledge graph, in order to verify the efficiency and accuracy of the knowledge graph in solving the performance problems of the target database, the knowledge graph can be used to receive the newly emerged performance problems, determine the solution strategy corresponding to the performance problem based on the knowledge graph, and execute it to determine the matching effect of the knowledge graph on the solution strategy of the database performance problem. On the basis of the above technical solution, it also includes: receiving the performance problem to be tested, extracting the key information of the performance problem to be tested, and determining at least one solution strategy to be verified associated with the performance problem to be tested based on the key information of the problem and the knowledge graph and displaying it on the target terminal.
[0039] In this embodiment, the performance problem to be tested may be a performance problem that has not appeared in the historical operation log of the target database, or may be a performance problem that is highly similar to the performance problem to be solved. The key information of the problem may be a string used to determine the performance problem in the operation log. Exemplarily, the key information of the problem may include "slow" or "error". The key information of the problem may also be the memory usage and disk operation status displayed in the operation log. The target terminal may be an intelligent terminal device with a visual interface, such as a mobile phone, a tablet computer or a desktop computer.
[0040] Specifically, when verifying the knowledge graph, first, the performance problem to be tested is received, and the key information of the performance problem to be tested is extracted. Then, based on the key information of the problem, the performance problems to be solved that have the same key information as the performance problem to be tested and their corresponding solutions are determined in the knowledge graph. Furthermore, based on the determined performance problems to be solved and their corresponding solutions, at least one solution strategy to be verified associated with the performance problem to be tested is determined and displayed on the target terminal, so that the user can repair the database where the performance problem to be tested occurs based on the solution strategy displayed on the target terminal, and then the knowledge graph can be verified according to the repair result.
[0041] On the basis of the above technical solution, it also includes: when a verification trigger operation based on the target user input of the target terminal is detected, the database table information of the performance problem to be tested is obtained; based on each solution strategy to be verified and the database table information, each target instruction corresponding to each solution strategy to be verified is generated and executed; based on the historical operation log, the target statement of the performance problem to be tested is obtained and executed to determine the problem repair status of the performance problem to be tested.
[0042] The target user may be a system developer or operator of the target database. The verification trigger operation may be an operation caused by clicking or controlling the cursor to stay at the target position for a preset time period through an input device or touch input, or an operation caused by inputting a preset instruction or code through an input device, wherein the input device may be a mouse or a keyboard. Exemplarily, the verification trigger operation may include opening a specific page, entering a specific search term, or clicking a specific location on the page, etc., which is not specifically limited in this embodiment.
[0043] The database table information may be data information stored in the target database corresponding to the performance problem to be tested. The database table information may be used to indicate the specific storage situation of the performance problem to be tested in the target database. The target instruction may be a program code for indicating the solution strategy to be verified. The target statement may be an operation statement in the historical operation log for indicating the performance problem to be tested, and the target statement may be used to re-run the performance problem to be tested.
[0044] In a specific implementation, after determining at least one solution strategy to be verified associated with the performance problem to be tested and displaying it on the target terminal, at least one verification trigger operation for verifying the solution strategy can be pre-set. When the verification trigger operation input by the target user on the target terminal is detected, the database table information of the performance problem to be tested is obtained, and then, based on the database table information and each solution strategy to be verified, each target instruction corresponding to each solution strategy to be verified is generated and executed in sequence. Furthermore, in order to verify the solution effect of each solution strategy to be verified on the performance problem to be tested, the target statement used to represent the performance problem to be tested can be obtained through the historical operation log and executed to re-run the performance problem to be tested in the target database, and the problem repair status of the performance problem to be tested by the solution strategy to be verified is determined through the running status of the performance problem to be tested.
[0045] It should be noted that when each solution strategy to be verified is displayed on the target terminal, the matching score between each solution strategy to be verified and the performance problem to be tested can also be displayed, and then a solution strategy to be verified that is most suitable for the performance problem to be tested can be determined based on the matching score. Exemplarily, the matching scores of each solution strategy to be verified associated with it can be determined by the key information of the problem to be tested. For example, the performance problem to be tested includes three key information of problems A, B, and C. If one of the solution strategies to be verified has a corresponding relationship with all three of the above problem information, the matching score of the solution test is 100; if one of the solution strategies to be verified has a corresponding relationship with two of the above three key information of problems, the matching score of the solution strategy is 66; if one of the solution strategies to be verified has a corresponding relationship with one of the above three key information of problems, the matching score of the solution strategy is 33.
[0046] Furthermore, the target user can select the to-be-verified solution strategy with the highest score to perform an operation based on the matching score displayed on the target terminal.
[0047] For example, Figure 2As shown, the knowledge graph construction method provided by the above technical solution can be implemented by the following target database performance optimization system, for example, the system includes: a log collection and filtering module, a solution strategy formulation module, a knowledge graph construction module, a target terminal and an automatic repair verification module, wherein the log collection and filtering module is used to collect the historical operation logs of the target database for persistent storage, and screen the historical operation logs for performance problems to determine at least one performance problem to be solved; the solution strategy formulation module is used to determine the solution strategy corresponding to each performance problem to be solved, and send each performance problem to be solved and its corresponding solution strategy to the knowledge graph construction module; the knowledge graph construction module is used to construct a knowledge graph according to each performance problem to be solved and its corresponding solution strategy; the target terminal is used to provide a retrieval function, receive the performance problem to be tested, and send the performance problem to be tested to the knowledge graph construction module, so that the knowledge graph construction module determines the corresponding solution strategy to be verified based on the performance problem to be tested, and sends each solution strategy to be verified to the target terminal; the automatic repair verification module is used to execute the solution strategy to be verified displayed on the target terminal, and re-execute the operation statement of the performance problem to be tested to verify whether the solution strategy to be verified is valid.
[0048] The technical solution of the embodiment of the present invention first collects the historical operation log of the target database, and determines at least one performance problem to be solved based on the historical operation log, then determines the solution strategies corresponding to the performance problems to be solved, and constructs a knowledge graph based on the performance problems to be solved and the corresponding solution strategies. The optimization of database performance problems in the prior art is solved, which is usually discovered and processed by operation and maintenance and developers relying on the early warning of the monitoring system and their own experience, resulting in high labor costs and low problem handling efficiency. By constructing a knowledge graph of database performance problems, a solution can be quickly determined to achieve the effect of automatic optimization of database performance, thereby improving database operation and maintenance efficiency and reducing human resource costs.
[0049] Embodiment 2
[0050] Figure 3 This is a flowchart of a knowledge graph construction method provided in the second embodiment of the present invention. Based on the above embodiment, this embodiment further refines the update of the knowledge graph. Among them, the technical terms that are the same or corresponding to the above embodiment are not repeated here. Figure 3 As shown, the method includes:
[0051] S210: Collect historical operation logs of the target database, filter the historical operation logs according to preset problem filtering conditions, and determine at least one performance problem to be solved.
[0052] In this embodiment, the preset problem screening conditions may be pre-set conditions for determining various performance problems in the historical operation log. Optionally, the preset problem screening conditions include instruction execution time and problem key information. Among them, the instruction execution time may be the execution time of each operation statement of the target database. The problem key information may be a keyword displayed in the historical operation log for indicating a performance problem. For example, slow or error, etc. In actual applications, when the execution time of an operation statement in the target database exceeds the standard execution time, or when the problem key information about the performance problem is found in the historical operation log, the corresponding performance problem to be solved can be determined based on the above situation.
[0053] Specifically, when the performance of the target database needs to be optimized, the historical operation logs of the target database need to be collected first, and then the historical operation logs are screened according to pre-set performance problem screening conditions to determine at least one performance problem to be solved.
[0054] S220: Determine each solution strategy corresponding to each of the performance problems to be solved, and construct a knowledge graph based on each of the performance problems to be solved and the corresponding solution strategy.
[0055] S230. When it is determined based on the historical operation log that the target database has a performance problem, determine based on the knowledge graph whether there is a solution strategy corresponding to the performance problem. If so, execute S240; if not, execute S250.
[0056] In actual applications, after constructing the knowledge graph of the target database about each performance problem to be solved, the performance problems to be solved contained in the knowledge graph are only screened based on the historical operation logs of the target database within a historical period of time. There may be incomplete information on the performance problems of the target database. Based on this, the target database will generate new historical operation logs when it is in operation. When it is determined that the target database has a performance problem based on the newly generated historical operation logs, the performance problems to be solved in the performance problem knowledge graph can be compared first to determine whether there are performance problems to be solved in the knowledge graph that contain the same key information as the performance problem and the corresponding solution strategies. Furthermore, the handling of the performance problem is determined based on the judgment result.
[0057] S240. Execute the solution strategy.
[0058] Specifically, if there is an unresolved performance problem in the knowledge graph that has the same key information as the newly emerged performance problem, a solution strategy corresponding to the unresolved performance problem can be further determined and executed to achieve the effect of repairing the performance problem.
[0059] S250: Determine a solution strategy corresponding to the performance issue, and update the knowledge graph based on the solution strategy.
[0060] Specifically, if there is no unresolved performance problem with the same key information as the newly emerged performance problem in the knowledge graph, that is, there is no solution strategy corresponding to the performance problem, the solution strategy corresponding to the performance problem can be determined again based on the pre-set correspondence between the performance problem and the solution strategy. Furthermore, in order to make the target database's knowledge graph about performance problems more complete, the knowledge graph can be updated based on the newly emerged performance problems and their corresponding solution tests to obtain a knowledge graph containing more performance problem solution strategies.
[0061] The technical solution of the embodiment of the present invention is as follows: first, historical operation logs of the target database are collected, and the historical operation logs are screened according to preset problem screening conditions to determine at least one performance problem to be solved; then, each solution strategy corresponding to each of the performance problems to be solved is determined, and a knowledge graph is constructed based on each of the performance problems to be solved and the corresponding solution strategy; further, when it is determined based on the historical operation log that the target database has a performance problem, it is determined based on the knowledge graph whether there is a solution strategy corresponding to the performance problem; if so, the solution strategy is executed; if not, the solution strategy corresponding to the performance problem is determined, and the knowledge graph is updated based on the solution strategy, which solves the optimization of database performance problems in the prior art, which is usually performed by operation and maintenance and developers relying on the early warning of the monitoring system and their own experience to discover and handle performance problems, resulting in high labor costs and low problem handling efficiency. By constructing and updating the database performance problem knowledge graph, a solution can be quickly determined to achieve the effect of automatic optimization of database performance, thereby improving database operation and maintenance efficiency and reducing human resource costs.
[0062] Embodiment 3
[0063] Figure 4 This is a schematic diagram of the structure of a knowledge graph construction device provided in Embodiment 3 of the present invention. Figure 4 As shown, the device includes: a historical operation log collection module 310 and a knowledge graph construction module 320.
[0064] The historical operation log collection module 310 is used to collect the historical operation logs of the target database and determine at least one performance problem to be solved according to the historical operation logs;
[0065] The knowledge graph construction module 320 is used to determine the solution strategies corresponding to each performance problem to be solved, and to construct a knowledge graph based on each performance problem to be solved and the corresponding solution strategy.
[0066] The technical solution of the embodiment of the present invention first collects the historical operation log of the target database, and determines at least one performance problem to be solved based on the historical operation log, then determines the solution strategies corresponding to the performance problems to be solved, and constructs a knowledge graph based on the performance problems to be solved and the corresponding solution strategies. The optimization of database performance problems in the prior art is solved, which is usually discovered and processed by operation and maintenance and developers relying on the early warning of the monitoring system and their own experience, resulting in high labor costs and low problem handling efficiency. By constructing a knowledge graph of database performance problems, a solution can be quickly determined to achieve the effect of automatic optimization of database performance, thereby improving database operation and maintenance efficiency and reducing human resource costs.
[0067] Optionally, the historical operation log collection module 310 is further used to filter the historical operation log according to preset problem filtering conditions to determine at least one performance problem to be solved, wherein the preset problem filtering conditions include instruction execution time and problem key information.
[0068] Optionally, the knowledge graph construction module 320 is further used to determine each solution strategy corresponding to each performance problem to be solved based on a preset correspondence between the performance problem to be solved and the solution strategy.
[0069] Optionally, the device also includes: a module for determining a solution strategy to be verified, which is used to receive the performance problem to be tested, extract key information of the performance problem to be tested, and determine at least one solution strategy to be verified associated with the performance problem to be tested based on the key information and the knowledge graph, and display it on the target terminal.
[0070] Optionally, after determining at least one to-be-verified solution strategy associated with the to-be-tested performance problem and displaying it on the target terminal, the apparatus further comprises: a database table information acquisition module, a target instruction generation module and a target statement execution module.
[0071] The database table information acquisition module is used to acquire the database table information of the performance problem to be tested when a verification trigger operation based on the target terminal input by the target user is detected;
[0072] A target instruction generation module, used to generate and execute target instructions corresponding to each solution strategy to be verified based on each solution strategy to be verified and database table information;
[0073] The target statement execution module is used to obtain and execute the target statement of the performance problem to be tested based on the historical operation log to determine the problem repair status of the performance problem to be tested.
[0074] Optionally, after constructing a knowledge graph based on each performance problem to be solved and the corresponding solution strategy, the device further includes: a performance problem determination module and a solution strategy execution module.
[0075] Among them, the performance problem determination module is used to determine whether there is a solution strategy corresponding to the performance problem based on the knowledge graph when it is determined that the target database has a performance problem based on the historical operation log;
[0076] The solution strategy execution module is used to execute the solution strategy if yes.
[0077] Optionally, the device also includes: a knowledge graph updating module, which is used to determine a solution strategy corresponding to the performance problem and update the knowledge graph based on the solution strategy.
[0078] The knowledge graph construction device provided in the embodiment of the present invention can execute the knowledge graph construction method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0079] Embodiment 4
[0080] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0081] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0082] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0083] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as the knowledge graph construction method.
[0084] In some embodiments, the knowledge graph construction method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the knowledge graph construction method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the knowledge graph construction method in any other appropriate manner (e.g., by means of firmware).
[0085] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0086] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0087] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0088] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0089] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0090] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0091] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0092] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A knowledge graph construction method, applied to a database, characterized in that: include: Collecting historical operation logs of the target database, and determining at least one performance problem to be solved based on the historical operation logs; Determine each solution strategy corresponding to each of the performance problems to be solved, and construct a knowledge graph based on each of the performance problems to be solved and the corresponding solution strategy; Wherein, after constructing the knowledge graph based on each of the performance problems to be solved and the corresponding solution strategies, it also includes: when it is determined based on the historical operation log that the target database has a performance problem, determining based on the knowledge graph whether there is a solution strategy corresponding to the performance problem; if so, executing the solution strategy; if not, determining the solution strategy corresponding to the performance problem, and updating the knowledge graph based on the solution strategy; The determining of the solution strategy corresponding to the performance problem includes: determining the solution strategy corresponding to the performance problem according to a preset corresponding relationship between the performance problem and the solution strategy.
2. The method according to claim 1, characterized in that The determining at least one unresolved performance problem according to the historical operation log includes: The historical operation log is screened according to preset problem screening conditions to determine at least one of the unresolved performance problems, wherein the preset problem screening conditions include instruction execution time and problem key information.
3. The method according to claim 1, characterized in that The determining of each solution strategy corresponding to each of the performance issues to be solved includes: According to the preset correspondence between the performance problems to be solved and the solution strategies, the solution strategies corresponding to the performance problems to be solved are determined.
4. The method according to claim 1, characterized in that: Also includes: Receive a performance problem to be tested, extract key information of the performance problem to be tested, and based on the key information and the knowledge graph, determine at least one to-be-verified solution strategy associated with the performance problem to be tested and display it on a target terminal.
5. The method according to claim 4, characterized in that After determining at least one to-be-verified solution strategy associated with the to-be-tested performance problem and displaying it on the target terminal, the method further includes: When a verification trigger operation based on the input of the target terminal by the target user is detected, obtaining database table information of the performance problem to be tested; Based on each of the to-be-verified solution strategies and the database table information, generating and executing each of the target instructions corresponding to each of the to-be-verified solution strategies; Based on the historical operation log, the target statement of the performance problem to be tested is obtained and executed to determine the problem repair status of the performance problem to be tested.
6. A knowledge graph construction device, characterized in that: include: A historical operation log collection module, used to collect historical operation logs of a target database and determine at least one performance problem to be solved based on the historical operation logs; A knowledge graph construction module, used to determine each solution strategy corresponding to each of the performance problems to be solved, and to construct a knowledge graph based on each of the performance problems to be solved and the corresponding solution strategy; The device also includes: a performance problem determination module and a solution strategy execution module; The performance problem determination module is used to determine whether there is a solution strategy corresponding to the performance problem based on the knowledge graph after the knowledge graph is constructed based on the performance problems to be solved and the corresponding solution strategies, when it is determined based on the historical operation log that the target database has a performance problem; the solution strategy execution module is used to execute the solution strategy if so; The device also includes: a knowledge graph updating module, which is used to determine the solution strategy corresponding to the performance problem according to the preset correspondence between the performance problem and the solution strategy, and update the knowledge graph based on the solution strategy.
7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the knowledge graph construction method described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the knowledge graph construction method described in any one of claims 1 to 5 when executed.
Citation Information
Patent Citations
Problem library analysis method and device
CN112115234A
Data statistics method and device, electronic equipment, storage medium and product
CN114356862A