Database schema determination method and apparatus
By running the business system in a sandbox, generating database operation logs, determining log characteristics and pressure detection of candidate database architectures, the problem of difficult configuration and matching database architectures in the existing technology is solved, and high-performance database applications are realized.
Patent Information
- Application Number
- CN202210103993.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-27
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2042-01-27
AI Technical Summary
The existing technology is difficult to configure a database architecture that matches the business system for the business system, resulting in problems such as degradation in database application performance, degradation in query performance, and inability to respond to user requests.
By running the business system in a sandbox, generating database operation logs, determining log characteristics, pressure detection of candidate database architectures, and determining the target database architecture from the candidate architecture based on log characteristics and pressure detection results.
It realizes that before the business system is actually running, the matching database architecture is automatically selected to improve the database application performance and ensure that the database can effectively respond to user requests.
Smart Images

Figure CN114546986B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to artificial intelligence technology and database technology, and in particular to a method and device for determining a database architecture. Background Art
[0002] Before running a business system, you need to configure a corresponding database architecture for the business system. If the database architecture configured for the business system does not match the business system, it will lead to a decline in the application performance of the database architecture, such as a decline in the query performance of the database architecture, and an inability to respond to user requests. Therefore, configuring a database architecture that matches the business system is a problem that needs to be solved. Summary of the invention
[0003] The embodiments of the present application provide a method and device for determining a database architecture, which can configure a database architecture that matches the business system for a business system.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] The present application provides a method for determining a database architecture, the method comprising:
[0006] Running the object based on the sandbox database to generate a database operation log of the object;
[0007] Determining characteristics of the database operation log;
[0008] Perform stress testing on the candidate database architecture and obtain stress testing results;
[0009] Based on the characteristics of the database operation log and the pressure detection result, a target database architecture corresponding to the object is determined from the candidate database architectures.
[0010] In some embodiments, the database architecture is determined based on a database architecture model; the method further comprises:
[0011] Get the database operation sample log generated by running the sample object;
[0012] Determining sample characteristics of the database operation sample log;
[0013] Perform stress testing on the sample candidate database architecture to obtain sample stress testing results;
[0014] The database architecture model is trained based on the sample features of the database operation sample log and the sample stress detection results.
[0015] In some embodiments, the method further comprises: adjusting the parameters of the database architecture model based on the performance of the database architecture
[0016] In some embodiments, the performance of the database architecture is determined by at least one of the following:
[0017] The business characteristics corresponding to the sample objects, the data volume of the database table and the data increment of the database table.
[0018] In some embodiments, the method further comprises:
[0019] Determine the business requirements corresponding to the object;
[0020] The memory and / or number of connections of the target database architecture are adjusted according to the business requirements.
[0021] In some embodiments, the method further comprises:
[0022] Determine information of an application template corresponding to the object and service information of the object;
[0023] Based on the information of the application template and the business information of the object, a database table corresponding to the object is determined.
[0024] In some embodiments, the determining, based on the information of the application template and the business information of the object, a database table corresponding to the object comprises:
[0025] Determine the entity relationship diagram and data lineage relationship of the database architecture based on the information of the application template and the business information of the object;
[0026] The database table corresponding to the object is determined based on the entity relationship diagram and the data lineage relationship.
[0027] In some embodiments, the database table is determined based on the database table model; the method further comprises:
[0028] Get the sample application template corresponding to the sample object;
[0029] Determine information of the sample application template and sample service information of the sample object;
[0030] Determining a sample database table corresponding to the sample object based on the information of the sample application template and the sample service information;
[0031] Based on the sample database table and the real database table corresponding to the sample object, the parameters of the database table model are adjusted.
[0032] The embodiment of the present application further provides a database architecture determination device, the database architecture determination device comprising:
[0033] A generation module, used to run an object based on a sandbox database and generate a database operation log of the object;
[0034] A feature determination module, used to determine the features of the database operation log;
[0035] The stress detection module is used to perform stress detection on the candidate database architecture and obtain stress detection results;
[0036] A database architecture determination module is used to determine a target database architecture corresponding to the object from the candidate database architectures based on the characteristics of the database operation log and the pressure detection result.
[0037] In some embodiments, the database architecture is determined based on a database architecture model; the database architecture determination device further includes:
[0038] The database architecture model training module is used to obtain the database operation sample logs generated by running the sample objects;
[0039] Determining sample characteristics of the database operation sample log;
[0040] Perform stress testing on the sample candidate database architecture to obtain sample stress testing results;
[0041] The database architecture model is trained based on the sample features of the database operation sample log and the sample stress detection results.
[0042] In some embodiments, the database architecture model training module is further used to adjust parameters of the database architecture model based on the performance of the database architecture.
[0043] In some embodiments, the performance of the database architecture is determined by at least one of the following:
[0044] The business characteristics corresponding to the sample objects, the data volume of the database table and the data increment of the database table.
[0045] In some embodiments, the database architecture determination module is further used to determine the business requirements corresponding to the object;
[0046] The memory and / or number of connections of the target database architecture are adjusted according to the business requirements.
[0047] In some embodiments, the database architecture determination device further includes:
[0048] A database table determination module, used to determine information of an application template corresponding to the object and business information of the object;
[0049] Based on the information of the application template and the business information of the object, a database table corresponding to the object is determined.
[0050] In some embodiments, the database table determination module is further used to determine the entity relationship diagram and data lineage relationship of the database architecture based on the information of the application template and the business information of the object;
[0051] The database table corresponding to the object is determined based on the entity relationship diagram and the data lineage relationship.
[0052] In some embodiments, the database table is determined based on the database table model; the database architecture determination device further comprises: a database table model training module, which is used to obtain a sample application template corresponding to a sample object;
[0053] Determine information of the sample application template and sample service information of the sample object;
[0054] Determining a sample database table corresponding to the sample object based on the information of the sample application template and the sample service information;
[0055] Based on the sample database table and the real database table corresponding to the sample object, the parameters of the database table model are adjusted.
[0056] An embodiment of the present application provides an electronic device, including:
[0057] A memory for storing executable instructions;
[0058] The processor is used to implement the database architecture determination method provided in the embodiment of the present application when executing the executable instructions stored in the memory.
[0059] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for implementing the database architecture determination method provided in the embodiment of the present application when executed by a processor.
[0060] The database architecture determination method provided in the embodiment of the present application generates a database operation log of the object based on the sandbox database operation object; determines the characteristics of the database operation log; performs stress detection on the candidate database architecture to obtain the stress detection result; and determines the target database architecture corresponding to the object from the candidate database architecture based on the characteristics of the database operation log and the stress detection result. In this way, by running the object in the sandbox, the object is run in the virtual system program before the object is actually run, and a matching database is selected for the object in combination with the data generated by the virtual running object and the stress detection data of the candidate database architecture when the object is run. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 It is a flowchart of a method for determining a database architecture provided in an embodiment of the present application;
[0062] Figure 2 It is a schematic diagram of an optional processing flow of a training database architecture model provided in an embodiment of the present application;
[0063] Figure 3 It is a schematic diagram of the overall processing flow of the database architecture determination method provided in an embodiment of the present application;
[0064] Figure 4 This is an optional flow chart of a database table for determining an object provided in an embodiment of the present application.
[0065] Figure 5 This is a schematic diagram of an optional processing flow of a training database table model provided in an embodiment of the present application;
[0066] Figure 6 It is a schematic diagram of the overall processing flow of the method for determining the database table corresponding to the object provided in the embodiment of the present application;
[0067] Figure 7 It is a schematic diagram of the composition structure of the database architecture determination device provided in an embodiment of the present application;
[0068] Figure 8 It is a schematic diagram of the hardware composition structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0070] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0071] In the following description, the terms "first\second\third" are only used to distinguish similar objects, and do not represent a specific order of the objects. It is understandable that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here. In the following description, the term "multiple" refers to at least two.
[0072] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0073] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0074] 1) Sandboxie, also known as sandbox, is a virtual system program that allows browsers or other programs to be run in a sandbox environment. The changes made by running browsers or other programs can be deleted. Sandbox creates an independent operating environment similar to a sandbox. Programs running inside the sandbox cannot have a permanent impact on the hard disk.
[0075] In network security, a sandbox is a tool used to test the behavior of untrusted files or applications in an isolated environment.
[0076] 2) Low-code platform, low-code is a visual, highly abstract, and highly automated software development method. The low-code platform defines the required tasks at a high level and then relies on tools to generate many underlying code bases. Professional developers and line-of-business employees who understand business problems can use low-code concepts and practices to solve various daily programming chores.
[0077] 3) Low-code technology is the technology used to implement low-code platforms; low-code technology abstracts and encapsulates a lot of other programming knowledge required to create software. Users can select from a menu of reusable functional components through a drag-and-drop visual interface without having to write individual lines of code. Arrange and organize the available functional components to form the expected software process, similar to creating a flowchart to solve a business problem or task. Users can easily add, move, or delete functional components to build the final process. Low-code tools include basic code and supporting tasks such as testing and deployment.
[0078] 4) Database architecture, used for database design, development, implementation and maintenance; database architecture can include at least three forms: 1-tier structure, 2-tier architecture and 3-tier architecture. For 1-tier architecture, the client, server and database all reside on the same machine. 2-tier architecture includes presentation layer and server (or application layer), the presentation layer runs on the client (PC, mobile device, tablet, etc.), and the data is stored on the server. 3-tier architecture includes presentation layer, application layer and database server.
[0079] In the related art, low-code platforms usually rely on the personal experience of engineers or architects when selecting database architecture for business systems. This is not only time-consuming, but the design of the database architecture requires a long period of testing and verification, and it is impossible to automatically select the database architecture for the business system. If the selected database architecture does not match the actual business scenario of the business system, the query performance of the database architecture will be reduced (such as increasing the response time of the database architecture to concurrent requests), which will lead to catastrophic problems such as the inability to respond to requests from the upstream and downstream systems of the business system. In addition, it is difficult to modify the database architecture after the business system is launched or released. Therefore, the applicant proposes a database architecture method that can virtually run a business system before the actual operation of the business system, and select the database architecture corresponding to the business system based on the data generated by the operation of the business system.
[0080] The following will illustrate the database architecture determination method provided by the embodiment of the present application with reference to the accompanying drawings.
[0081] See also Figure 1 , Figure 1 This is an optional flow chart of the method for determining the database architecture provided in the embodiment of the present application, which will be combined with Figure 1 The steps shown are explained.
[0082] Step S101 : running an object based on a sandbox database to generate a database operation log of the object.
[0083] In some embodiments, the object may be a business system or application; the business system or application may be generated or developed based on a low-code platform.
[0084] In some embodiments, the database operation log of the object is a file used to record update operations of a transaction on the database; wherein a transaction may refer to a transaction generated when the object is run based on the sandbox database.
[0085] Step S102: determining the characteristics of the database operation log.
[0086] In some embodiments, features of the database operation log may be extracted based on the database operation log generated in step S101.
[0087] In some embodiments, the characteristics of the database operation log may include at least one or more of the following: the number of database reads and writes per second, the type of each request, the result set generated by the request, the request type, the most accessed schema, the field length of the table, and the size of the table.
[0088] In some embodiments, when the object is run based on the sandbox database in step S101, database operation data such as database memory, IO and CPU load can also be determined; the database operation data when the object is run based on the sandbox database can be associated with the characteristics of the database operation log to determine the performance of the corresponding database when the object is running.
[0089] Step S103, performing stress testing on the candidate database architecture to obtain stress testing results.
[0090] In some embodiments, the purpose of stress testing the candidate database architecture is to determine whether the database can effectively withstand concurrent access from multiple users; specifically, to determine whether the indexes, triggers, stored procedures, and locks in the database can effectively withstand concurrent access from multiple users. The number of candidate database architectures is one or more.
[0091] Step S104: determining a target database architecture corresponding to the object from the candidate database architectures based on the characteristics of the database operation log and the pressure detection result.
[0092] In some embodiments, the performance data of the database when the database operation log is generated is determined based on the characteristics of the database operation log; a candidate database architecture that matches the performance data of the database is searched in the stress testing results of each candidate database architecture, and the matching candidate database architecture is determined to be the target database architecture.
[0093] In some embodiments, after determining the target database architecture, the method may further include:
[0094] Step S105, determining the business requirements corresponding to the object, and adjusting the memory and / or number of connections of the target database architecture according to the business requirements.
[0095] In some embodiments, the object can be run based on the target database architecture determined in step S104. However, in some special scenarios, it can be determined that the object has a high running frequency or a large number of operation transactions, and the memory and / or number of connections of the target database architecture can be adjusted according to the business requirements corresponding to the object. In this way, it is possible to avoid database architecture response delays caused by insufficient database memory and / or number of connections when the amount of data access is large.
[0096] As an example, for the database architecture corresponding to applications such as e-commerce, the database memory and / or number of connections can be increased a preset number of days before the e-commerce anniversary date, traditional holidays, etc., to improve the response delay of the database architecture when the data access volume is large.
[0097] In some embodiments, the target database architecture corresponding to the object can be determined based on a database architecture model. Accordingly, the database architecture determination method provided in the embodiment of the present application further includes: training the database architecture model.
[0098] In some embodiments, an optional process flow for training a database architecture model is as follows: Figure 2 As shown, it may specifically include:
[0099] Step S201, obtaining a database operation sample log generated by running a sample object.
[0100] In some embodiments, the database operation sample log is data generated by running a sample object based on a real database architecture.
[0101] In some embodiments, sample database operation data such as database memory, IO and CPU load when running the sample object can also be recorded.
[0102] Step S202: determine the sample characteristics of the database operation sample log.
[0103] In some embodiments, sample features of the database operation sample log may include at least one or more of the following: database read and write times per second, the type of each request, the result set generated by the request, the request type, the most accessed schema, the field length of the table, and the size of the table.
[0104] In some embodiments, after determining the characteristics of the sample database operation log, an association relationship between the sample database operation data and the characteristics of the sample database operation log may be established to determine the performance of the sample database corresponding to the sample object when the sample object is running.
[0105] Step S203, performing stress testing on the sample candidate database architecture to obtain a sample stress testing result.
[0106] In some embodiments, by performing stress testing on the sample candidate database, it is possible to determine the ability of each sample database to effectively withstand concurrent access from multiple users.
[0107] Step S204: training the database architecture model based on the sample features of the database operation sample log and the sample stress detection result.
[0108] In some embodiments, based on the sample characteristics of the database operation sample log and the sample stress detection result, the sample target database architecture is determined; based on the sample target database architecture and the real target database architecture of the sample object, the parameters of the database architecture model are adjusted to realize the training of the database architecture model.
[0109] In some embodiments, after the database architecture model is trained, the parameters of the database architecture model can also be adjusted based on the performance of the database architecture. As an example, the parameters of the database architecture model can be adjusted according to one or more of the business characteristics corresponding to the sample object, the amount of data in the database table, and the data increment of the database table within a preset time. For example, if slow queries frequently occur when the amount of data in a table in the database reaches one million, and the number of concurrent connections to the database increases after the slow query occurs, the database architecture characteristics can be estimated based on the amount of data in the table and the number of concurrent connections to the database, and the parameters of the database architecture model can be adjusted based on the estimated database architecture characteristics.
[0110] In specific implementation, if the function of the database architecture model is Y=f(x), Y represents the output variable (database architecture), and x represents the input variable; x can be the characteristics of the database operation log, the performance parameters of the database, etc. Correspondingly, for example, x includes 20 database queries per second, 0.3 CPU consumption when querying the database, and 400MB memory consumption when querying data, and Y is database architecture example 2; representing that the number of database queries per second for the input variables is 20, the CPU consumption when querying the database is 0.3, and the memory consumption when querying data is 400MB, the target database architecture recommended by the database architecture model is database architecture 2.
[0111] As an example, f(x) = θ0 + θ1x1 + θ2x2 + θ3x3, then x1, x2 and x3 are three variables: the number of database queries per second, CPU consumption when querying the database, and memory consumption when querying data. θ0, θ1, θ2 and θ3 are four parameters of the database architecture model. The database architecture model is trained by adjusting θ0, θ1, θ2 and θ3.
[0112] Based on Figure 1 and Figure 2 The overall processing flow of the database architecture determination method provided by the embodiment of the present application is as follows: Figure 3 As shown, including at least:
[0113] Step a: determine sample characteristics of the database operation sample log and stress test results of the candidate database architecture.
[0114] Step b: training a database architecture model based on sample features of the database operation sample logs and stress test results of the candidate database architecture.
[0115] Generate a database architecture model through step b, input the database operation sample log into the database architecture model, and the database architecture model can output a database architecture that matches the database operation sample log.
[0116] Step c: Run the application in the sandbox database to generate a database operation log.
[0117] Among them, the application running in the sandbox database can be an application developed based on the low-code platform.
[0118] Step d: Input the features of the database operation log into the database architecture model, perform stress testing on the candidate database architecture corresponding to the database architecture model, and obtain the database stress testing result; the database architecture model outputs the target database architecture corresponding to the application based on the database operation log and the database stress testing result.
[0119] The above describes the specific implementation process of determining the database architecture of an object. In the actual application process, it is also necessary to configure a database table for the object. The following describes the process of determining the database table of an object provided in the embodiment of the present application.
[0120] like Figure 4 As shown, Figure 4 An optional flow chart of determining a database table of an object provided in an embodiment of the present application includes at least the following steps:
[0121] Step S401: Determine information of an application template corresponding to an object and business information of the object.
[0122] In some embodiments, the information of the application template corresponding to the object may include: the type of the application template, the names of the components constituting the application, the attribute information of each component, and the association relationship between the components. The business information of the object may refer to a business field.
[0123] Step S402: determining a database table corresponding to the object based on the information of the application template and the business information of the object.
[0124] In some embodiments, based on the information of the application template and the business information of the object, the specific implementation process of determining the database table corresponding to the object may include: determining the entity relationship diagram and data lineage relationship of the database architecture based on the information of the application template and the business information of the object; determining the database table corresponding to the object based on the entity relationship diagram and the data lineage relationship. Among them, the data lineage relationship refers to the multiple relationships formed between data, and the data lineage relationship records the entire cycle of data processing, including the source and starting point of the data, the processing summary of the data, the subsequent application of the data, etc.
[0125] In some embodiments, the database table corresponding to the object can be determined based on the database table model; accordingly, an optional processing flow for training the database table model is as follows: Figure 5 As shown, at least the following steps are included:
[0126] Step S501: Acquire a sample application template corresponding to a sample object.
[0127] In some embodiments, the sample may correspond to a sample application, the sample application may be developed based on a low-code platform, and the sample application template is used to develop the sample application.
[0128] Step S502: Determine the information of the sample application template and the sample service information of the sample object.
[0129] In some embodiments, the information of the sample application template may include: the type of the sample application template, the names of the sample components constituting the sample application, the attribute information of each sample component, and the association relationship between each sample component. The business information of the sample object may refer to the business fields included in the sample application.
[0130] Step S503: determining a sample database table corresponding to the sample object based on the information of the sample application template and the sample service information.
[0131] In some embodiments, information of a sample application template and sample business information are input into a database table model, and the database table model outputs a sample database table.
[0132] Step S504: adjusting the parameters of the database table model based on the sample database table and the real database table corresponding to the sample object.
[0133] In some embodiments, the sample database table and the real database table corresponding to the sample object are compared to obtain the difference between the sample database table and the real database table corresponding to the sample object; based on the difference between the sample database table and the real database table corresponding to the sample object, the parameters of the database table model are adjusted to train the database table model.
[0134] In some embodiments, based on Figure 5 In the process of training the database table model, the features of the database table can also be manually annotated. For example, if a business field included in an application template does not appear in the form field of the database table that needs to be associated, a database table containing the business field included in the application target can be manually annotated.
[0135] In the embodiment of the present application, the database table corresponding to the object is determined according to the corresponding application template information and the corresponding business information, which can avoid human input errors and time costs caused by manually establishing the database table based on the engineer's experience, and create a matching database table for the object.
[0136] Based on Figure 4 and Figure 5The overall processing flow of the method for determining the database table corresponding to the object provided in the embodiment of the present application is as follows: Figure 6 As shown, including at least:
[0137] Step f: Determine the sample application template information and sample service information.
[0138] Step g: training a database table model based on the information of the sample application template and the sample business information.
[0139] Step h: Determine the application template information corresponding to the application and the service information of the application.
[0140] Among them, the application can be an application developed based on a low-code platform.
[0141] Step i: input the application template information and the application business information into the database table model, and obtain the database table corresponding to the application output by the database table model.
[0142] The embodiment of the present application also provides a database architecture determination device, the composition structure diagram of the database architecture determination device is as follows: Figure 7 As shown, the database architecture determination device includes:
[0143] A generating module 801 is used to run an object based on a sandbox database and generate a database operation log of the object;
[0144] A feature determination module 802, used to determine the features of the database operation log;
[0145] The pressure detection module 803 is used to perform pressure detection on the candidate database architecture and obtain the pressure detection result;
[0146] The database architecture determination module 804 is used to determine the target database architecture corresponding to the object from the candidate database architectures based on the characteristics of the database operation log and the pressure detection result.
[0147] In some embodiments, the database architecture is determined based on a database architecture model; the database architecture determination device further includes:
[0148] The database architecture model training module 805 is used to obtain the database operation sample log generated by running the sample object;
[0149] Determining sample characteristics of the database operation sample log;
[0150] Perform stress testing on the sample candidate database architecture to obtain sample stress testing results;
[0151] The database architecture model is trained based on the sample features of the database operation sample log and the sample stress detection results.
[0152] In some embodiments, the database architecture model training module 805 is further used to adjust the parameters of the database architecture model based on the performance of the database architecture.
[0153] In some embodiments, the performance of the database architecture is determined by at least one of the following:
[0154] The business characteristics corresponding to the sample objects, the data volume of the database table and the data increment of the database table.
[0155] In some embodiments, the database architecture determination module is further used to determine the business requirements corresponding to the object;
[0156] The memory and / or number of connections of the target database architecture are adjusted according to the business requirements.
[0157] In some embodiments, the database architecture determination device further includes:
[0158] A database table determination module 806, used to determine information of an application template corresponding to the object and business information of the object;
[0159] Based on the information of the application template and the business information of the object, a database table corresponding to the object is determined.
[0160] In some embodiments, the database table determination module 806 is further used to determine the entity relationship diagram and data lineage relationship of the database architecture based on the information of the application template and the business information of the object;
[0161] The database table corresponding to the object is determined based on the entity relationship diagram and the data lineage relationship.
[0162] In some embodiments, the database table is determined based on the database table model; the database architecture determination device further includes: a database table model training module 807, which is used to obtain a sample application template corresponding to a sample object;
[0163] Determine information of the sample application template and sample service information of the sample object;
[0164] Determining a sample database table corresponding to the sample object based on the information of the sample application template and the sample service information;
[0165] Based on the sample database table and the real database table corresponding to the sample object, the parameters of the database table model are adjusted.
[0166] The embodiments of the present application provide a method, device, electronic device and computer-readable storage medium for determining a database architecture. By running an object in a sandbox, the object can be run in a virtual system program before the object is actually run; the matching database can be selected for the object in combination with the data generated by the virtual running object and the stress detection data of the candidate database architecture when the object is run. In addition, the embodiments of the present application determine the database table corresponding to the object based on the corresponding application template information and the corresponding business information, which can avoid the human input errors and time costs caused by manually establishing the database table based on the experience of engineers, and create a matching database table for the object.
[0167] In some embodiments, the database architecture determination method provided in the embodiments of the present application can be implemented by a terminal device or a server. Specifically, the terminal device or server can implement the database architecture determination method provided in the embodiments of the present application by running a computer program. For example, the computer program can be a native program or software module in the operating system; it can be a local (Native) application (APP, Application), that is, a program that needs to be installed in the operating system to run; it can also be a small program, that is, a program that can be run only by downloading it to a browser environment; it can also be a small program that can be embedded in any APP. In short, the above-mentioned computer program can be any form of application, module or plug-in.
[0168] In some embodiments, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms, where cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks in a wide area network or a local area network to achieve data calculation, storage, processing, and sharing. The terminal device can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited to this. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.
[0169] Taking the data processing method provided in the embodiment of the present application as an electronic device as an example, the hardware composition structure diagram of the electronic device 700 provided in the embodiment of the present application is as follows: Figure 8The electronic device 700 shown includes: at least one processor 701, a memory 702 and at least one network interface 704. The various components in the electronic device 700 are coupled together via a bus system 705. It is understood that the bus system 705 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 705 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 705 is not described in detail. Figure 8 Various buses are labeled as bus system 705.
[0170] It can be understood that the memory 702 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be ROM, programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), ferromagnetic random access memory, flash memory, magnetic surface memory, optical disk, or compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), direct memory bus random access memory (DRRAM). The memory 702 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memory.
[0171] The memory 702 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device 700. Examples of such data include: any computer program used to operate on the electronic device 700, such as the application 7022. The program implementing the database architecture determination method of the embodiment of the present application may be included in the application 7022.
[0172] The method disclosed in the above embodiment of the present application can be applied to the processor 701, or implemented by the processor 701. The processor 701 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of the hardware in the processor 701 or an instruction in the form of software. The above processor 701 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 701 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the database architecture determination method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 702, and the processor 701 reads the information in the memory 702, and completes the steps of the aforementioned database architecture determination method in combination with its hardware.
[0173] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), FPGAs, general purpose processors, controllers, MCUs, MPUs, or other electronic components to execute the aforementioned database architecture determination method.
[0174] The embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the database architecture determination method described in the embodiment of the present application.
[0175] The present application embodiment provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will be caused to execute the method provided by the present application embodiment, for example, Figures 1 to 6 The database architecture determination method is shown.
[0176] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EP ROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.
[0177] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0178] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0179] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0180] The above are only embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A method for determining a database architecture, the method comprising: Running the object based on the sandbox database to generate a database operation log of the object; Determining characteristics of the database operation log; Perform stress testing on the candidate database architecture and obtain stress testing results; Based on the characteristics of the database operation log and the pressure detection result, a target database architecture corresponding to the object is determined from the candidate database architectures.
2. According to the method of claim 1, the database architecture is determined based on a database architecture model; the method further comprises: Get the database operation sample log generated by running the sample object; Determining sample characteristics of the database operation sample log; Perform stress testing on the sample candidate database architecture to obtain sample stress testing results; The database architecture model is trained based on the sample features of the database operation sample log and the sample stress detection results.
3. The method according to claim 2, further comprising: Parameters of the database schema model are adjusted based on the performance of the database schema.
4. The method of claim 3, wherein the performance of the database architecture is determined by at least one of the following: The business characteristics corresponding to the sample objects, the data volume of the database table and the data increment of the database table.
5. The method according to any one of claims 1 to 4, further comprising: Determine the business requirements corresponding to the object; The memory and / or number of connections of the target database architecture are adjusted according to the business requirements.
6. The method according to any one of claims 1 to 4, further comprising: Determine information of an application template corresponding to the object and service information of the object; Based on the information of the application template and the business information of the object, a database table corresponding to the object is determined.
7. The method according to claim 6, wherein the determining the database table corresponding to the object based on the information of the application template and the business information of the object comprises: Determine the entity relationship diagram and data lineage relationship of the database architecture based on the information of the application template and the business information of the object; The database table corresponding to the object is determined based on the entity relationship diagram and the data lineage relationship.
8. The method according to claim 6 or 7, wherein the database table is determined based on the database table model; the method further comprises: Get the sample application template corresponding to the sample object; Determine information of the sample application template and sample service information of the sample object; Determining a sample database table corresponding to the sample object based on the information of the sample application template and the sample service information; Based on the sample database table and the real database table corresponding to the sample object, the parameters of the database table model are adjusted.
9. A database architecture determination device, the device comprising: A generation module, used to run an object based on a sandbox database and generate a database operation log of the object; A feature determination module, used to determine the features of the database operation log; The stress detection module is used to perform stress detection on the candidate database architecture and obtain stress detection results; A database architecture determination module is used to determine a target database architecture corresponding to the object from the candidate database architectures based on the characteristics of the database operation log and the pressure detection result.
10. The database architecture determination device according to claim 9, wherein the database architecture is determined based on a database architecture model; the database architecture determination device further comprises: The database architecture model training module is used to obtain the database operation sample logs generated by running the sample objects; Determining sample characteristics of the database operation sample log; Perform stress testing on the sample candidate database architecture to obtain sample stress testing results; The database architecture model is trained based on the sample features of the database operation sample log and the sample stress detection results.
Citation Information
Patent Citations
Database deployment method, database deployment device, control equipment and system
CN107818104A
Sandbox simulation test method and device, computer equipment and storage medium
CN111666565A