Method for managing database in distributed environment and related equipment

By automatically detecting database instances in a distributed environment, and using operating system-specific tools and feature file verification, the problem of manual operation dependence in traditional methods is solved, and efficient and accurate database management is achieved.

CN119884071APending Publication Date: 2025-04-25NAT COMP NETWORK & INFORMATION SECURITY MANAGEMENT CENT +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411818236.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

Traditional database detection and identification methods rely on manual operations in distributed storage environments, making it difficult to adapt to complex storage layouts, resulting in reduced data management efficiency and accuracy.

Method used

It provides a method to manage databases in a distributed environment. By performing the detection tasks of database instances, obtaining physical storage locations and configuration information, using operating system-specific command tools for file system scanning, network port scanning and service process detection, and combining feature file verification, it automatically recognizes and manages database types and versions.

Benefits of technology

It realizes automatic identification and location of database instances and their storage locations in a distributed environment, reduces manual intervention, improves the efficiency and accuracy of database detection, reduces detection time by more than 30%, and the accuracy rate reaches more than 95%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884071A_ABST
    Figure CN119884071A_ABST
Patent Text Reader

Abstract

The invention provides a method for managing a database in a distributed environment and related equipment. The method comprises the steps of executing a detection task of a database instance to detect a target database instance, obtaining a physical storage position and configuration information of the target database instance, obtaining first feature information of a database corresponding to the target database instance based on the physical storage position and the configuration information, the method comprises the steps of obtaining first feature information in a database, obtaining second feature information in a preset database, determining whether the first feature information is matched with the second feature information or not, and obtaining the type and version of the database in response to matching of the first feature information and the second feature information so as to manage the database. Through the method, the database instance and the storage position thereof can be automatically identified and positioned in a distributed complex environment, manual intervention is reduced, and the database detection efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of database management, and in particular to a method and related equipment for managing a database in a distributed environment. Background Art

[0002] With the rapid development of cloud computing and big data technology, data storage has become distributed and diversified. Due to the diversity of operating systems, database versions, and storage locations, traditional database detection and identification methods often rely on manual operations and are difficult to adapt to the current complex distributed storage environment. This not only increases the difficulty of data management, but also reduces the efficiency and accuracy of data detection and identification. Therefore, there is an urgent need for a solution that can automatically detect and identify databases in a distributed environment to cope with complex database storage layouts and improve management efficiency. Summary of the invention

[0003] In view of this, the purpose of the present application is to propose a method and related devices for managing a database in a distributed environment, so as to solve or partially solve the above problems.

[0004] Based on the above purpose, a first aspect of the present application provides a method for managing a database in a distributed environment, comprising:

[0005] Execute a database instance detection task to detect a target database instance;

[0006] Obtaining the physical storage location and configuration information of the target database instance;

[0007] Based on the physical storage location and configuration information, obtaining first characteristic information of a database corresponding to the target database instance;

[0008] Acquire second characteristic information from a preset database;

[0009] Determining whether the first feature information matches the second feature information;

[0010] In response to the first feature information and the second feature information matching, the type and version of the database are acquired to manage the database.

[0011] In a second aspect of the present application, a device for managing a database in a distributed environment is provided, comprising:

[0012] An execution module is configured to execute a detection task of a database instance to detect a target database instance;

[0013] A first acquisition module is configured to acquire the physical storage location and configuration information of the detected target database instance;

[0014] A second acquisition module is configured to acquire first characteristic information of a database corresponding to the target database instance based on the physical storage location and the configuration information;

[0015] A third acquisition module is configured to acquire second feature information from a preset database;

[0016] a matching module, configured to determine whether the first feature information matches the second feature information;

[0017] The fourth acquisition module is configured to acquire the type and version of the database in response to the first feature information matching the second feature information, so as to manage the database.

[0018] In a third aspect of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect is implemented.

[0019] According to a fourth aspect of the present application, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in the first aspect.

[0020] As can be seen from the above, the present application provides a method and related equipment for managing a database in a distributed environment. The method includes: executing a database instance detection task to detect a target database instance, obtaining the physical storage location and configuration information of the target database instance, obtaining the first feature information of the database corresponding to the target database instance based on the physical storage location and configuration information, obtaining the second feature information in the preset database, determining whether the first feature information matches the second feature information, and in response to the first feature information matching the second feature information, obtaining the type and version of the database to manage the database. The above method can automatically identify and locate database instances and their storage locations in a distributed and complex environment, reduce manual intervention, and improve the efficiency and accuracy of database detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 A schematic diagram of an exemplary distributed environment according to an embodiment of the present application is shown.

[0023] Figure 2 A flow chart of an exemplary method for managing a database in a distributed environment according to an embodiment of the present application is shown.

[0024] Figure 3 A schematic diagram of an exemplary device for managing a database in a distributed environment according to an embodiment of the present application is shown.

[0025] Figure 4 A schematic diagram of an exemplary electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0026] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0027] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0028] As described in the background technology section, with the rapid development of cloud computing and big data technology, data storage methods have gradually become distributed and diversified. Due to the different types of operating systems, different database versions, and the variability of database storage locations, traditional database detection and identification methods often need to rely on manual operations, which is difficult to cope with the current complex distributed storage environment. In this context, there is an urgent need for a solution that can automatically detect and identify databases to cope with complex database storage layouts and improve the efficiency of data management.

[0029] In order to at least solve the above problems, the present invention proposes a method and related equipment for managing a database in a distributed environment. The method includes: executing a database instance detection task to detect a target database instance, obtaining the physical storage location and configuration information of the target database instance, obtaining the first feature information of the database corresponding to the target database instance based on the physical storage location and configuration information, obtaining the second feature information in a preset database, determining whether the first feature information matches the second feature information, and in response to the first feature information matching the second feature information, obtaining the type and version of the database to manage the database. The above method can automatically identify and locate database instances and their storage locations in a distributed and complex environment, reduce manual intervention, and improve the efficiency and accuracy of database detection.

[0030] Figure 1 A schematic diagram of an exemplary distributed environment 100 according to an embodiment of the present application is shown.

[0031] like Figure 1 As shown, the distributed environment 100 may include multiple databases 102 and terminal devices 104, 106, and 108. The terminal devices 104, 106, and 108 are connected to the multiple databases 102 via a network, such as a wired or wireless network connection. In the embodiment of the present application, the apparatus for managing a database in a distributed environment may be integrated in the terminal devices 104, 106, and 108.

[0032] The operating systems running on the multiple databases 102 may include but are not limited to Android, IOS, Linux, Windows, Ubuntu, CentOS, etc. The database versions supported by the multiple databases 102 may include but are not limited to MySQL, Hive, Oracle, SQL Server, PostgreSQL, etc. The multiple databases 102 may provide data storage services for the terminal devices 104, 106, and 108.

[0033] The terminal device 104, the terminal device 106, and the terminal device 108 may include physical devices such as smart phones, desktop computers, tablet computers, laptop computers, smart speakers, vehicle-mounted terminals, digital assistants, augmented reality (AR) or virtual reality (VR) devices, smart wearable devices, etc., and may also include software running in the physical devices, such as applications, etc. In the embodiments of the present application, the operating systems running on the above-mentioned terminal devices 104, the terminal devices 106, and the terminal devices 108 may include, but are not limited to, Android systems, IOS systems, Linux systems, Windows systems, etc.

[0034] Various applications (Application, APP, Chinese abbreviation: application) can be installed on terminal device 104, terminal device 106, and terminal device 108, such as image processing applications, video conferencing applications, reading applications, video applications, social applications, payment applications, web browsers, and instant messaging tools.

[0035] In the distributed environment 100 constructed by the above-mentioned terminal devices 104, terminal devices 106, terminal devices 108 and multiple databases 102, the number of terminal devices and the number of databases are only exemplary, and the embodiments of the present application do not limit this. The distributed environment 100 can be formed by multiple nodes and terminal devices, and the nodes communicate and transmit through a network protocol. In the distributed environment 100, any machine such as a server, a terminal device, and a database can join and become a node.

[0036] A method for managing a database in a distributed environment provided in an embodiment of the present application can be applied to a distributed environment 100. In order to automatically identify and locate database instances and their storage locations in a distributed complex environment, reduce manual intervention, and improve the efficiency and accuracy of database detection, in some embodiments, a detection task of a database instance can be performed. Automatic detection of database instances is performed in a multi-operating system environment, and the type of the current operating system is automatically identified and adapted through the operating system adapter module in the terminal device. In some embodiments, detection tasks such as file system scanning, network port scanning, and service process detection are performed using commands or tools specific to the current operating system to identify the physical storage location of the database instance and its configuration information.

[0037] By adapting to different operating systems, it is possible to automatically detect database instances in operating system environments including Linux systems, Windows systems, etc. In Linux systems, in some embodiments, command line tools such as lsof (List Open Files), netstat (Network Statistics), and ps (Process Status) can be called to obtain the running database service and its corresponding storage path; in Windows systems, in some embodiments, command line tools such as tasklist and netstat can be used to complete the corresponding detection tasks.

[0038] Among them, the lsof command is a tool for listing the files opened in the current system. In database detection, it can be used to find out whether a specific database file is opened and which process has opened these files. The netstat command in the Linux system is used to display network information such as network connections, routing tables, and interface statistics. In database detection, it can be used to identify the ports and network connection status that the database service listens on. The ps command is used to display the status of the currently running process. In database detection, it can be used to find the running database service process. The tasklist command is used to display the list of currently running processes in the Windows system. It can help users understand which programs are running, as well as their process identifiers (PID), processors (CPU), and memory usage. The netstat command in the Windows system is used to display network information such as network connections, routing tables, and interface statistics in the Windows system. It can help users understand which network ports are in use and which processes are listening to or using these ports.

[0039] To adapt to more distributed storage environments, in some embodiments, the existence of the database can be identified through multi-dimensional methods such as network port detection and process monitoring, and the specific storage location of the database can be determined in combination with recursive scanning of the file system.

[0040] In order to ensure the accuracy of the detection results, after detecting the target database instance, in some embodiments, a multi-level verification mechanism can be used to perform multiple verifications on the detection results. For example, by cross-checking information such as port numbers, service processes, and file paths, erroneous or redundant detection results can be effectively filtered out to ensure that the database instance information finally obtained is accurate. In addition, in some embodiments, verification can also be performed through feature files, and the existence and location of these feature files will serve as the basis for the final verification.

[0041] In some embodiments, by constructing a database version feature library, multiple database versions and their specific configuration files or storage structures can be automatically identified and matched. Based on the detected target database instance, the physical storage location and configuration information of the target database instance can be obtained, and based on the physical storage location and configuration information, the first feature information of the database corresponding to the target database instance can be obtained. By matching the first feature information with the second feature information in the constructed database version feature library, false positive information can be filtered out, further improving the accuracy of the detection results. Among them, the feature information of the database (for example, the first feature information and the second feature information) may include feature information such as file system features, service process features, port features, and version-specific instruction interaction features.

[0042] By identifying database instances in multiple operating systems, it automatically detects and obtains their storage paths and configuration information. Combined with operating system-specific command line tools (such as file system scanning, network port scanning, etc.), it can ensure high accuracy of detection results.

[0043] If the first characteristic information and the second characteristic information match successfully, it can be determined that the detection result is relatively accurate, and the type and version of the database can be further verified and determined through version-specific instructions of the database to ensure accurate identification of the database instance.

[0044] In some embodiments, after detecting the database instance and successfully verifying it, the system further identifies the type and version of the database. For mainstream database systems, such as MySQL database, PostgreSQL database, SQL Server database, etc., the system simply interacts with the database instance through preset instructions to obtain version information. For example, the version information of the MySQL database can be obtained by executing the SELECT VERSION() instruction, and the SQL Server database can obtain version data by querying the system view SELECT@@VERSION instruction. Through this direct interaction combined with preset instructions, the system can quickly identify the type and version of the database, and classify and store it, providing a basis for subsequent management and analysis.

[0045] In order to cope with large-scale database instances that may exist in a distributed environment, in some embodiments, a parallel task scheduling mechanism can be used to improve detection efficiency. Specifically, multiple detection tasks can be executed simultaneously, including file system scanning, network port detection, process monitoring, etc. In the process of executing tasks, the priority of tasks and the depth and breadth of scanning can be dynamically adjusted according to the current hardware resources, network conditions and operating system type. For example, under a high-load environment, the system will reduce the priority of certain non-critical tasks to ensure the stable operation of key database detection tasks. Through this flexible scheduling mechanism, the system can efficiently handle large-scale distributed database detection tasks. An optimized parallel scanning strategy is adopted to perform parallel detection at different levels of file systems, network ports and service processes, dynamically adjust the scanning depth and breadth, and combine multi-level data fusion analysis to ensure that databases are quickly located in complex distributed environments and improve detection efficiency and accuracy.

[0046] The optimized detection algorithm in the embodiment of the present application is implemented through parallel multi-level scanning, and can simultaneously execute multiple detection tasks such as file systems, network ports, and service processes. The database storage location is quickly located by comprehensive analysis of the scanning results. The detection time is reduced by more than 30% compared to traditional means, and the detection accuracy rate reaches more than 95%.

[0047] During the detection process, in some embodiments, an exception handling mechanism can also be built in to ensure that the detection task can be automatically recovered in the event of network fluctuations or insufficient permissions. When some tasks fail due to network instability and other reasons, detailed error logs are recorded and the detection task is automatically re-executed. At the same time, the database administrator can manually adjust the parameters based on the recorded logs to further optimize the detection strategy and ensure the integrity and accuracy of the detection results.

[0048] Figure 2 FIG. 2 is a flow chart of an exemplary method 200 for managing a database in a distributed environment according to an embodiment of the present application. The method 200 may be executed in the distributed environment 100. Figure 2 As shown, method 200 may include the following steps.

[0049] In step 202, a database instance detection task is executed to detect a target database instance.

[0050] In some embodiments, the distributed environment includes multiple operating systems, and the detection task of executing the database instance to detect the target database instance further includes: determining the type of the current operating system; using the command line tool of the current operating system to execute the detection task to detect the target database instance, and the detection task includes file system scanning, network port scanning and service process scanning.

[0051] In some embodiments, the execution of the detection task of the database instance to detect the target database instance further includes: in response to executing multiple detection tasks of the database instance, determining information of the current operating system, the information of the current operating system including the type of the current operating system, hardware resources and network conditions; according to the information of the current operating system, adjusting the priorities of the multiple detection tasks to detect the target database instance.

[0052] In some embodiments, executing the detection task of the database instance to detect the target database instance further includes: adjusting the scanning depth and breadth of the multiple detection tasks according to the information of the current operating system to detect the target database instance.

[0053] In some embodiments, the execution of a detection task of a database instance to detect a target database instance further includes: in response to the failure of the detection task to execute, recording an error log of the detection task and re-executing the detection task to detect the target database instance, the error log including the port number, time and reason for failure.

[0054] In step 204, the physical storage location and configuration information of the target database instance is obtained.

[0055] In step 206, first characteristic information of a database corresponding to the target database instance is obtained based on the physical storage location and configuration information.

[0056] In step 208, second feature information in a preset database is obtained.

[0057] In some embodiments, the second feature information includes file system features, service process features, port features, and version-specific instruction interaction features.

[0058] In step 210, it is determined whether the first feature information matches the second feature information.

[0059] In step 212, in response to the first feature information and the second feature information matching, the type and version of the database are acquired to manage the database.

[0060] In some embodiments, obtaining the type and version of the database to manage the database further includes: determining the type of the database based on the physical storage location and configuration information; executing instructions corresponding to the type of the database to obtain the version of the database; and managing the database based on the type and version of the database.

[0061] The present application provides a method and related equipment for managing a database in a distributed environment. The method includes: executing a database instance detection task to detect a target database instance, obtaining the physical storage location and configuration information of the target database instance, obtaining the first characteristic information of the database corresponding to the target database instance based on the physical storage location and configuration information, obtaining the second characteristic information in a preset database, determining whether the first characteristic information matches the second characteristic information, and in response to the first characteristic information matching the second characteristic information, obtaining the type and version of the database to manage the database. The above method can automatically identify and locate database instances and their storage locations in a distributed complex environment, reduce manual intervention, and improve the efficiency and accuracy of database detection.

[0062] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.

[0063] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0064] Based on the same technical concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a device for managing a database in a distributed environment.

[0065] refer to Figure 3 , the device for managing a database in a distributed environment comprises:

[0066] The execution module 301 is configured to execute a database instance detection task to detect a target database instance.

[0067] The execution module 301 is also configured to determine the type of the current operating system; use the command line tool of the current operating system to execute the detection task to detect the target database instance, and the detection task includes file system scanning, network port scanning and service process scanning.

[0068] The execution module 301 is also configured to determine the information of the current operating system in response to executing multiple detection tasks of the database instance, and the information of the current operating system includes the type of the current operating system, hardware resources and network conditions; according to the information of the current operating system, adjust the priority of the multiple detection tasks to detect the target database instance.

[0069] The execution module 301 is further configured to adjust the scanning depth and breadth of the multiple detection tasks according to the information of the current operating system, so as to detect the target database instance.

[0070] The execution module 301 is further configured to record an error log of the detection task and re-execute the detection task in response to the failure of the detection task to detect the target database instance, wherein the error log includes the port number, time and failure reason.

[0071] The first acquisition module 302 is configured to acquire the physical storage location and configuration information of the target database instance.

[0072] The second acquisition module 303 is configured to acquire first characteristic information of a database corresponding to the target database instance based on the physical storage location and configuration information.

[0073] The third acquisition module 304 is configured to acquire second feature information from a preset database.

[0074] The second feature information includes file system features, service process features, port features and version-specific instruction interaction features.

[0075] The matching module 305 is configured to determine whether the first feature information matches the second feature information.

[0076] The fourth acquisition module 306 is configured to acquire the type and version of the database in response to the first feature information matching the second feature information, so as to manage the database.

[0077] The fourth acquisition module 306 is further configured to determine the type of the database based on the physical storage location and configuration information; execute instructions corresponding to the type of the database to obtain the version of the database; and manage the database based on the type and version of the database.

[0078] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0079] The device of the above embodiment is used to implement the corresponding method 200 in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0080] Based on the same technical concept, corresponding to any of the above-mentioned embodiments, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method 200 described in any of the above embodiments when executing the program.

[0081] Figure 4 A schematic diagram of an exemplary electronic device according to an embodiment of the present application is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other in communication within the device through the bus 1050.

[0082] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0083] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0084] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0085] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0086] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0087] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0088] The electronic device of the above embodiment is used to implement the corresponding method 200 in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0089] Based on the same technical concept, corresponding to any of the above-mentioned embodiments, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute method 200 described in any of the above embodiments.

[0090] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0091] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the method 200 described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0092] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0093] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.

[0094] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0095] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.

Claims

1. A method for managing a database in a distributed environment, comprising: Execute a database instance detection task to detect a target database instance; Obtaining the physical storage location and configuration information of the target database instance; Based on the physical storage location and configuration information, obtaining first characteristic information of a database corresponding to the target database instance; Acquire second characteristic information from a preset database; Determining whether the first feature information matches the second feature information; In response to the first feature information and the second feature information matching, the type and version of the database are acquired to manage the database.

2. The method of claim 1, wherein: The distributed environment includes multiple operating systems, and the performing of the database instance detection task to detect the target database instance further includes: Determine the type of the current operating system; The detection task is executed by using a command line tool of the current operating system to detect the target database instance, wherein the detection task includes file system scanning, network port scanning and service process scanning.

3. The method of claim 1, wherein: The obtaining the type and version of the database to manage the database further comprises: Determining the type of the database based on the physical storage location and the configuration information; Executing an instruction corresponding to the type of the database to obtain a version of the database; Based on the type and version of the database, the database is managed.

4. The method of claim 1, wherein: The performing of the database instance detection task to detect the target database instance further includes: In response to executing a plurality of detection tasks of the database instance, determining information of a current operating system, wherein the information of the current operating system includes a type of the current operating system, hardware resources, and network status; According to the information of the current operating system, the priorities of the multiple detection tasks are adjusted to detect the target database instance.

5. The method of claim 4, wherein: The performing of the database instance detection task to detect the target database instance further includes: According to the information of the current operating system, the scanning depth and breadth of the multiple detection tasks are adjusted to detect the target database instance.

6. The method of claim 1, wherein: The second feature information includes file system features, service process features, port features and version-specific instruction interaction features.

7. The method of claim 1, wherein: The performing of the database instance detection task to detect the target database instance further includes: In response to the failure of the detection task to be executed, an error log of the detection task is recorded and the detection task is re-executed to detect the target database instance, wherein the error log includes a port number, time and a failure reason.

8. An apparatus for managing a database in a distributed environment, comprising: An execution module is configured to execute a detection task of a database instance to detect a target database instance; A first acquisition module is configured to acquire the physical storage location and configuration information of the detected target database instance; A second acquisition module is configured to acquire first characteristic information of a database corresponding to the target database instance based on the physical storage location and the configuration information; A third acquisition module is configured to acquire second feature information from a preset database; a matching module, configured to determine whether the first feature information matches the second feature information; The fourth acquisition module is configured to acquire the type and version of the database in response to the first feature information matching the second feature information, so as to manage the database.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.