A database stress testing method based on medical data and computer equipment
Through the database stress testing method based on medical data, the problem that the existing technology cannot effectively reflect the hospital's diagnosis and treatment business needs and the inability to compare the test results is solved, and an accurate assessment of database performance and stability is achieved.
Patent Information
- Application Number
- CN202411916576.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-08
AI Technical Summary
The existing database stress testing methods cannot effectively reflect the actual needs of hospital diagnosis and treatment business, and the test results of different databases cannot be effectively compared, resulting in the inability to accurately evaluate the analysis performance and stability of the database.
Provide a database stress testing method based on medical data. By obtaining the use case configuration file of a preset medical institution, converting it into a structured query language dialect that conforms to different databases, generating a set of query use case tests, and generating simulated medical test data in each database, performing stress tests to obtain results.
By testing different databases using the same simulated medical test data, the accuracy and reliability of the test are improved, and the standardization and comparability of the results are ensured, thereby more effectively evaluating the analytical performance and stability of the database.
Smart Images

Figure CN119782338A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information technology, and in particular to a database stress testing method and computer equipment based on medical data. Background Art
[0002] With the development of the information and communication technology industry and the requirements of information and communication technology policies, the medical informatization of the hospital industry must also gradually achieve domestic replacement. As the "foundation" of basic software, the database is the top priority for achieving domestic replacement. At present, domestic databases in the hospital industry are gradually transitioning from launching non-core business systems to launching core diagnosis and treatment systems. However, there are many types of domestic databases, and medical business scenarios are complex and changeable. They are faced with massive medical business data and real-time query and analysis needs. All of these require a quick and accurate evaluation of the analysis performance and stability of different domestic databases when selecting a database.
[0003] Currently, TPC-H (Business Intelligence Computing Test) performance test is a benchmark tool for evaluating online analytical processing performance. By simulating complex transaction behaviors between suppliers and buyers, it provides eight standardized test data tables and 22 query templates, covering a variety of data analysis scenarios. Domestic databases usually use unique performance stress testing methods and tools. These tools can not only simulate multi-user concurrent access, but also execute complex structured query language queries against performance test data sets to test the database's response time, concurrent processing capabilities, system stability and resource utilization, thereby helping users identify performance bottlenecks and providing a basis for database tuning.
[0004] However, the existing data sets cannot reflect the actual requirements of hospital diagnosis and treatment services. There is no medical-oriented test data set, and different databases are tested using different test data sets. It is impossible to compare stress testing and evaluation results, making it impossible to analyze different databases. Summary of the invention
[0005] The purpose of this application is to provide a database stress testing method and computer equipment based on medical data to address the deficiencies in the above-mentioned prior art, so as to analyze different databases through the same simulated medical test data and improve the reliability and objectivity of database analysis.
[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0007] In a first aspect, an embodiment of the present application provides a database stress testing method based on medical data, the method comprising:
[0008] Obtaining a use case configuration file of a preset medical institution, the use case configuration file comprising: a plurality of preset structured query statements, the plurality of preset structured query statements respectively corresponding to a plurality of data business analysis scenarios of a data center application of the preset medical institution;
[0009] According to the structured query language dialect corresponding to each database among the multiple databases to be tested, each preset structured query statement in the use case configuration file is converted into a target structured query statement that conforms to the structured query language dialect, and a query case test set for each database is generated, wherein the query case test set includes: multiple target structured query statements;
[0010] According to the structured query language dialect corresponding to each database, using a preset medical test data model, generating simulated medical test data for the preset medical institution in each database;
[0011] According to the preset concurrency of the preset medical institution, the target structured query statement that meets the preset concurrency is loaded and executed from the query case test set to perform corresponding data query operations on the simulated medical test data to obtain the stress test results of each database for the preset medical institution.
[0012] Optionally, obtaining a use case configuration file of a preset medical institution includes:
[0013] Obtaining all structured query statements applied by the data center and the usage frequency of each structured query statement;
[0014] According to the usage frequencies of the structured query statements, the plurality of preset structured query statements with the highest frequencies are determined from all the structured query statements.
[0015] Optionally, before converting each preset structured query statement in the use case configuration file into a target structured query statement conforming to the structured query language dialect according to the structured query language dialect corresponding to each database among the multiple databases to be tested and generating the query case test set for each database, the method further comprises:
[0016] Acquire test configuration information of the multiple databases, where the test configuration information of each database includes: the type of each database;
[0017] According to the type of each database, a structured query language dialect corresponding to each database is determined.
[0018] Optionally, the test configuration information of each database includes: connection information of each database;
[0019] According to the structured query language dialect corresponding to each database and the preset medical test data model, before generating the simulated medical test data for the preset medical institution in each database, the method further includes:
[0020] A connection is established with each database according to the connection information of each database.
[0021] Optionally, the preset medical test data model includes: data master table and sub-table models of multiple business domains;
[0022] The method of generating simulated medical test data for the preset medical institution in each database by using a preset medical test data model according to the structured query language dialect corresponding to each database includes:
[0023] Generating a data definition language script for each database according to the structured query language dialect corresponding to each database;
[0024] According to the data main table sub-table models of the multiple business domains in the preset medical test data model, a data definition language script for each database is executed to generate test tables of the multiple business domains in each database respectively, and indexes of the test tables of the multiple business domains are established;
[0025] Generate a data manipulation language script for each database according to the pre-generated volume of the preset medical institutions and the structured query language dialect corresponding to each database;
[0026] According to the data configuration information of the multiple business domains, the data manipulation language script of each database is executed, and the test data of the multiple business domains are respectively generated in the test tables of the multiple business domains. The simulated medical test data includes: the test data of the multiple business domains.
[0027] Optionally, before generating a data manipulation language script for each database according to the pre-generated volume of the preset medical institution and the structured query language dialect corresponding to each database, the method further includes:
[0028] According to the level information of each medical institution, a data storage period is preset, and the pre-generated volume is calculated;
[0029] Alternatively, the pre-generated volume is obtained as input.
[0030] Optionally, before executing the data manipulation language script of each database according to the data configuration information of the multiple business domains and respectively generating the test data of the multiple business domains in the test tables of the multiple business domains, the method further comprises:
[0031] The data configuration information of the multiple business domains is obtained from the data configuration file of the preset medical institution, wherein the data configuration information of the multiple business domains includes: an association relationship between the multiple business domains and a data ratio relationship between the multiple business domains.
[0032] Optionally, according to the preset concurrency of the preset medical institution, loading and executing a target structured query statement that meets the preset concurrency from the query case test set includes:
[0033] The preset test task is executed according to the preset concurrency of the preset medical institution and the execution configuration information of the preset test task. During the execution of the preset test task, a target structured query statement that meets the preset concurrency is loaded and executed from the query case test set, wherein the execution configuration information is used to indicate the task execution mode of the preset test task.
[0034] Optionally, the method further comprises: generating a test result file according to the stress test results of the multiple databases, the test result file comprising: data query information of the multiple databases, and execution time information of each target structured query statement for the multiple databases;
[0035] According to the test result file, a test chart for the multiple databases is generated and displayed.
[0036] In a second aspect, another embodiment of the present application provides a database stress testing device based on medical data, the device comprising:
[0037] An acquisition module, used to acquire a use case configuration file of a preset medical institution, wherein the use case configuration file includes: a plurality of preset structured query statements, wherein the plurality of preset structured query statements respectively correspond to a plurality of data business analysis scenarios of a data center application of the preset medical institution;
[0038] A conversion module is used to convert each preset structured query statement in the use case configuration file into a target structured query statement that conforms to the structured query language dialect according to the structured query language dialect corresponding to each database among the multiple databases to be tested, and generate a query case test set for each database, wherein the query case test set includes: multiple target structured query statements;
[0039] A generating module, configured to generate simulated medical test data for the preset medical institution in each database according to the structured query language dialect corresponding to each database and using a preset medical test data model;
[0040] An execution module is used to load and execute a target structured query statement that meets the preset concurrency of the preset medical institution from the query case test set, so as to perform corresponding data query operations on the simulated medical test data and obtain stress test results for each database of the preset medical institution.
[0041] In the third aspect, another embodiment of the present application provides a computer device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the computer device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the database stress testing method based on medical data as described in any of the first aspects above.
[0042] In a fourth aspect, another embodiment of the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the database stress testing method based on medical data as described in any one of the first aspects above are executed.
[0043] The beneficial effects of this application are:
[0044] The present application provides a database stress testing method and computer equipment based on medical data, which obtains a use case configuration file of a preset medical institution, and according to the structured query language dialect corresponding to each database in multiple databases to be tested, converts each preset structured query statement in the use case configuration file into a target structured query statement that conforms to the structured query language dialect, generates a query case test set for each database, and according to the structured query language dialect corresponding to each database, uses a preset medical test data model to generate simulated medical test data for the preset medical institution in each database; according to the preset concurrency of the preset medical institution, loads and executes the target structured query statement that meets the preset concurrency from the query case test set, so as to perform the corresponding data query operation on the simulated medical test data, and obtains the stress test result for each database of the preset medical institution. In the present application, the corresponding simulated medical test data is generated according to the preset medical institution, which can ensure that the simulated medical test data is more in line with the current application scenario, and different databases are tested with the same preset concurrency through the same simulated medical test data, which can ensure standardized comparison and improve the accuracy of database testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 A flowchart of a database stress testing method based on medical data provided in an embodiment of the present application;
[0047] Figure 2 A schematic diagram of a flow chart of determining a use case configuration file in a database stress testing method based on medical data provided in an embodiment of the present application;
[0048] Figure 3 A schematic diagram of a process for determining a target data query statement in a database stress testing method based on medical data provided in an embodiment of the present application;
[0049] Figure 4 A schematic diagram of a process for determining test data in a database stress testing method based on medical data provided in an embodiment of the present application;
[0050] Figure 5 A schematic diagram of a flow chart for generating a test chart in a database stress testing method based on medical data provided in an embodiment of the present application;
[0051] Figure 6 A schematic diagram of the structure of a database stress testing device based on medical data provided in an embodiment of the present application;
[0052] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0054] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0055] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0056] In order to clearly describe a database stress testing method based on medical data provided in an embodiment of the present application, the method provided in an embodiment of the present application is described below in conjunction with multiple drawings. Figure 1 A flowchart of a database stress testing method based on medical data provided by an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:
[0057] Step 101: Obtain a use case configuration file of a preset medical institution.
[0058] The use case configuration file includes: multiple preset structured query statements, and the multiple preset structured query statements correspond to multiple data business analysis scenarios of the data center application of the preset medical institution.
[0059] Among them, the preset medical institutions can be medical institutions of multiple different levels, for example, community health service centers, township hospitals, general hospitals, specialist hospitals, large general hospitals, rehabilitation centers and other medical institutions, and the embodiments of the present application do not limit this. The data center application is the front-end display software, and the medical staff displays the queried data by performing query operations in the data center application. The data business analysis scenarios can be data analysis business scenarios such as clinical decision support, patient health management, medical service quality monitoring, personalized medical services, etc., and the embodiments of the present application do not limit this. Structured query statements are a programming language for managing and using databases, which are used to perform various operations, such as querying, updating, inserting, deleting data, etc., or complex operations that combine multiple separate operations. The use case configuration file includes different business analysis scenarios such as multi-table complex association queries and single-table point queries.
[0060] Optionally, multiple data business analysis scenarios are applied in the data center, or the data center applies multiple preset structured query statements for preset medical institutions.
[0061] Step 102: According to the structured query language dialect corresponding to each database in the multiple databases to be tested, each preset structured query statement in the use case configuration file is converted into a target structured query statement that conforms to the structured query language dialect, and a query case test set for each database is generated.
[0062] The query case test set includes: multiple target structured query statements.
[0063] Among them, the target structured query statements corresponding to each database are different, and the target structured query statements of different databases are determined according to the language of the database and the preset structured query statements. The multiple databases to be tested can be the DAMO database, the JINCANG database, the HAOLAI database, the GAUSS database, etc., and the embodiments of the present application do not limit this. When there is a new database, the driver of the new domestic database can be connected through the extension interface, the connection properties can be configured, and the structured data dialect can be added to realize the addition of the new domestic database. The structured query language dialect is the SQL (Structured Query Language) dialect, and SQL includes data definition language, data manipulation language, data control language, data transaction control language, etc., and the embodiments of the present application do not limit this.
[0064] Optionally, different databases correspond to different structured query language dialects. To ensure that the preset structured query statements can be used in different databases, it is necessary to convert each preset structured query statement in the use case configuration file into a target structured query statement that conforms to the structured query language dialect of the corresponding database according to the structured query language dialect corresponding to each database, and use a collection of multiple targeted structured query statements as a query case test set for the database.
[0065] Specifically, converting the preset structured query statement into the target structured query statement of the structured query language dialect of the corresponding database can be achieved by replacing keywords, adjusting functions, mapping data types, etc., which is not limited in the embodiments of the present application.
[0066] Step 103: According to the structured query language dialect corresponding to each database, a preset medical test data model is used to generate simulated medical test data for the preset medical institution in each database.
[0067] Among them, the preset medical test data model can be a snowflake model, which is specifically determined according to the preset medical institution, and the simulated medical test data is the test data randomly generated according to the target query statement of each database. The simulated medical test data in different databases are the same. The simulated medical test data includes patient information, outpatient visits, inpatient visits, examination reports, test reports, diagnoses, outpatient prescriptions, inpatient medical orders, charges, outpatient medical records, inpatient medical records and other information, which is not limited in the embodiments of the present application.
[0068] Optionally, according to each database, the structured query language dialect corresponding to the database is determined, and through a preset medical test data model, simulated medical test data of a preset medical institution is generated in the corresponding database.
[0069] Step 104: According to the preset concurrency of the preset medical institution, load and execute the target structured query statement that meets the preset concurrency from the query case test set to perform corresponding data query operations on the simulated medical test data to obtain the stress test results for each database of the preset medical institution.
[0070] The preset concurrency is the number of target structured query language statements executed simultaneously during the stress test. The preset concurrency can be determined according to the level of the preset medical institution or can be the preset concurrency. The stress test results may include information such as response time, throughput, error rate, resource utilization, and stability.
[0071] Optionally, the cardinality of concurrency and the first proportional factor are determined according to the level of the preset medical institution. The cardinality of concurrency is the number of doctors scheduled in the preset medical institution, which is used to indicate how many doctors work at the same time. The first proportional factor is divided into four levels, namely 0.9, 1.2, 1.6, and 2.1. The first proportional factor is determined according to the sum of the number of outpatient and emergency departments and the number of inpatient beds. When the above four levels are not met, the corresponding first proportional factor is rounded up to determine the integer. The product of the cardinality of the concurrency of the level of the preset medical institution and the first proportional factor is used as the concurrency.
[0072] Optionally, according to the preset concurrency of the preset medical institution, the target structured query statements that meet the preset concurrency are loaded and executed from the query case test set for different databases respectively, and the corresponding data query operations are performed on the simulated medical test data of the database corresponding to the target structured query statements with the preset concurrency to obtain the stress test results for each database of the preset medical institution.
[0073] In an embodiment of the present application, a use case configuration file of a preset medical institution is obtained, and according to the structured query language dialect corresponding to each database in the multiple databases to be tested, each preset structured query statement in the use case configuration file is converted into a target structured query statement that conforms to the structured query language dialect, and a query case test set for each database is generated. According to the structured query language dialect corresponding to each database, a preset medical test data model is used to generate simulated medical test data for the preset medical institution in each database; according to the preset concurrency of the preset medical institution, the target structured query statement that meets the preset concurrency is loaded and executed from the query case test set to perform corresponding data query operations on the simulated medical test data, and the stress test results for each database of the preset medical institution are obtained. In the present application, the corresponding simulated medical test data is generated according to the preset medical institution, which can ensure that the simulated medical test data is more in line with the current application scenario. By testing different databases with the same preset concurrency through the same simulated medical test data, standardized comparison can be ensured to improve the accuracy of database testing.
[0074] Based on the above embodiments, the present application also provides a process for determining a use case configuration file in a database stress testing method based on medical data. Figure 2 A schematic diagram of a flow chart of determining a use case configuration file in a database stress testing method based on medical data provided in an embodiment of the present application, such as Figure 2 As shown, in the above step 101, obtaining the use case configuration file of the preset medical institution includes:
[0075] Step 201: Obtain all structured query statements of data center applications and the usage frequency of each structured query statement.
[0076] Optionally, all structured query statements of the data center application are all structured query statements generated during the use of the data center application, and the usage frequency of each structured query statement is the number of times each structured query statement is used during the application of the data center application. According to the usage of the data center application, all structured query statements of the data center application and the usage frequency of each structured query statement are obtained respectively.
[0077] Step 202: According to the usage frequency of each structured query statement, a plurality of preset structured query statements with the highest frequency are determined from all structured query statements.
[0078] Optionally, each structured data is sorted according to the usage frequency of each structured query statement, and multiple preset structured query statements with the highest frequency are determined according to the sorting of each structured data. Specifically, a preset threshold can be set, and when the usage frequency of a structured query statement exceeds the preset threshold, the structured data is considered to be a preset structured query statement.
[0079] In the embodiment of the present application, all structured query statements of data center applications and the usage frequency of each structured query statement are obtained, and multiple preset structured query statements with the highest frequency are determined from all structured query statements. The data can be stress tested in a targeted manner, thereby improving the testing efficiency of the database and reducing resource waste.
[0080] Based on the above embodiments, the present application also provides a process for determining a target data query statement in a database stress testing method based on medical data. Figure 3 A schematic diagram of a process for determining a target data query statement in a database stress testing method based on medical data provided in an embodiment of the present application, such as Figure 3 As shown, in the above step 102, according to the structured query language dialect corresponding to each database in the multiple databases to be tested, each preset structured query statement in the use case configuration file is converted into a target structured query statement that conforms to the structured query language dialect, and before generating a query case test set for each database, the method further includes:
[0081] Step 301: Obtain test configuration information of multiple databases.
[0082] The test configuration information of each database includes: the type of each database. The type of database is a relational database, a document database, a NewSQL database, etc., which is not limited in the embodiment of the present application.
[0083] Optionally, the type of each database is determined separately according to each database, and different database types correspond to different target data query statements.
[0084] Step 302: Determine the structured query language dialect corresponding to each database according to the type of each database.
[0085] The target data query statement is a query statement written according to a specific database. The query statements for different databases are different.
[0086] Optionally, each database supports different query language types. First, the type of the database is obtained, and the target query language of the corresponding database is determined according to the type of the database, so as to achieve conversion of the use case configuration file.
[0087] In an embodiment of the present application, test configuration information of multiple databases is obtained, and the structured query language dialect corresponding to each database is determined according to the type of each database. The present application can quickly generate corresponding query statements for different databases, improve work efficiency, ensure that all database queries follow certain standards and formats, and improve the accuracy of database stress testing.
[0088] On the basis of the above embodiment, the test configuration information of each database includes: connection information of each database; the present application also provides a process for establishing database connection in a database stress testing method based on medical data. In the above step 103, according to the structured query language dialect corresponding to each database and the preset medical test data model, before generating simulated medical test data for a preset medical institution in each database, the method further includes:
[0089] A connection is established with each database according to the connection information of each database.
[0090] The connection information includes: the database driver and the database configuration connection data.
[0091] Optionally, a connection is established with each database according to the driver and configuration connection information of each database, and the connection database is automatically allocated according to the connection pool to ensure the connectivity with the database. When generating simulated medical test data, a connection is directly obtained from the database connection pool, the database is connected, and simulated medical test data is generated in the database.
[0092] In the embodiment of the present application, a connection with each database is established according to the connection information of each database, so that the connection with the database can be established quickly, reducing the time of manual input and configuration, and improving the efficiency of data query, update and integration operations for each database.
[0093] Based on the above embodiment, the preset medical test data model includes: data main table sub-table models of multiple business domains; the present application also provides a process for determining test data in a database stress testing method based on medical data, Figure 4 A schematic diagram of a process for determining test data in a database stress testing method based on medical data provided in an embodiment of the present application, such as Figure 4 As shown, in the above step 103, according to the structured query language dialect corresponding to each database, a preset medical test data model is used to generate simulated medical test data for a preset medical institution in each database, including:
[0094] Step 401: Generate a data definition language script for each database according to the structured query language dialect corresponding to each database.
[0095] Among them, the data definition language script is used to define the structure of the database, including the creation, modification and deletion of databases, tables, views, indexes and other database objects.
[0096] Optionally, the data definition language scripts of databases corresponding to different data are different, so it is necessary to determine the data definition language script of each database from the structured query language dialect corresponding to the database according to the structured query language dialect corresponding to the database.
[0097] Step 402: execute the data definition language script for each database according to the data main table sub-table models of multiple business domains in the preset medical test data model, generate test tables of multiple business domains in each database respectively, and establish indexes of the test tables of multiple business domains.
[0098] Among them, the preset medical test data model also includes the main table and sub-table model of the patient domain. When the business domain is the visit domain, the test table is the inpatient visit table and the outpatient visit table; when the business domain is the charging domain, the test table is the charging main table and the charging details table; when the business domain is the diagnosis domain, the test table is the diagnosis main table and the diagnosis item table; when the business domain is the prescription order domain, the test table is the prescription order main table and the prescription order details table; when the business domain is the inspection and testing domain, the test table is the report main table and the report details table; when the business domain is the medical record domain, the test table is the medical record main table, the medical record content table, and the medical record paragraph table. The test table corresponding to the patient domain is the patient information table. The test tables are mainly associated through the patient identifier, the visit identifier, and the primary key of the table in each business domain. The main table sub-table model is used to represent the relationship between entities. The main table usually contains the information of the main entity or record, and each main table record can be associated with multiple sub-table records. Each record in the main table usually has a unique identifier, called the primary key, which is used to reference in the sub-table. The child table contains detailed information related to the main table records, and each child table record is associated with a record in the main table. There is usually a foreign key in the child table to point to the corresponding record in the main table.
[0099] Optionally, according to the data main table sub-table models of multiple business domains and patient domains in the preset medical test data model, a data definition language script is executed for each database, and test tables of multiple business domains are generated in each database respectively through the data definition language script, and indexes of the test tables of multiple business domains are established.
[0100] Step 403: Generate a data manipulation language script for each database based on the pre-generated volume of the preset medical institutions and the structured query language dialect corresponding to each database.
[0101] Among them, the pre-generated volume is controlled by the proportional factor, which is related to the level of the preset medical institution and the storage year of the data center.
[0102] Optionally, the data manipulation language scripts corresponding to different databases are different, so it is necessary to determine the data manipulation language script of each database from the structured query language dialect corresponding to the database according to the structured query language dialect corresponding to the database.
[0103] Step 404: Execute the data manipulation language script of each database according to the data configuration information of the multiple business domains, and generate test data of the multiple business domains in the test tables of the multiple business domains respectively.
[0104] The simulated medical test data includes: test data of multiple business domains. The data configuration information of the business domain is used to indicate the data relationship of the test tables in the multiple business domains.
[0105] Optionally, corresponding test data is generated in the patient domain of each database by executing a data manipulation language script, and test data is generated in the business domain according to the data configuration information of the patient domain and the business domain, as well as the master table data and primary key of the business domain. The specific quantity of test data in the test table in the patient domain is determined according to the pre-generated volume, and the test data in the test table in the business domain is determined according to the data configuration information. The business domain includes: diagnosis domain, charging domain, prescription domain, examination and inspection domain, medical record domain, etc., which is not limited in the embodiments of the present application.
[0106] Specifically, in the process of generating test data, a random character generation function is used to generate patient names, visit descriptions, prescription information, billing information, diagnosis instructions, inspection report texts, medical record content paragraph texts, etc., so that the generated character data is as consistent as possible with the actual table field length. The generated test data is verified according to the data configuration information of the business domain to determine whether the number of test data meets the set pre-generated volume and whether the data configuration information meets the preset requirements. If not, the program will trigger a warning prompt and identify the table that does not meet the requirements in the log.
[0107] In the embodiment of the present application, the data definition language script and the data manipulation language script of each database are determined according to the structured query language dialect, a test table is generated in each database, and test data is generated in the test table. It can ensure that the test data for the stress test of each database is the same, so that the test results of the database can be compared, the performance of different databases can be compared more accurately, and the test efficiency can be improved.
[0108] Based on the above embodiment, the present application further provides a process for determining a pre-generated volume in a database stress testing method based on medical data. Before generating a data manipulation language script for each database according to the pre-generated volume of the preset medical institution and the structured query language dialect corresponding to each database in the above step 403, the method further includes:
[0109] According to the level information of each medical institution, the data storage period is preset and the pre-generated volume is calculated.
[0110] Alternatively, obtain a pregenerated mass for input.
[0111] Optionally, the cardinality information and the first proportional factor are determined according to the level information of each medical institution, the second proportional factor is determined according to the preset data storage period, and the product of the cardinality information, the first proportional factor and the second proportional factor is used as the pre-generated volume. Among them, the cardinality information is the preset storage capacity of the data of the preset medical institution, which can be 1TB. The first proportional factor is determined based on the sum of the number of outpatients and the number of beds in the preset medical institution, and is divided into four levels, with S1 taking values of 0.5, 1, 2, and 3. The second proportional factor is twice the data storage period. Alternatively, the preset generation volume can be determined based on the actual usage scenario, and the embodiments of the present application are not limited to this.
[0112] In an embodiment of the present application, based on the level information of each medical institution, the data storage period is preset and the pre-generated volume is calculated, which can ensure that the generated test data meets the current usage scenario, so that the test results of different databases based on the test data are more accurate and more referenceable.
[0113] On the basis of the above embodiment, the present application further provides a process for determining data configuration information in a database stress testing method based on medical data. In the above step 103, according to the data configuration information of multiple business domains, a data manipulation language script of each database is executed, and before test data of multiple business domains are respectively generated in the test tables of the multiple business domains, the method further includes:
[0114] The data configuration information of multiple business domains is obtained from the data configuration file of the preset medical institution.
[0115] The data configuration information of the multiple business domains includes: the association relationship of the multiple business domains and the data ratio relationship of the multiple business domains. The association relationship of the multiple business domains is determined according to the actual business of the preset medical institution, and the data ratio relationship of the business domain is determined according to the level of the preset medical institution and the data storage year.
[0116] Optionally, data configuration information of multiple business domains is obtained from a data configuration file of a preset medical institution. The data configuration file is determined according to the actual business of the preset medical institution, the level of the preset medical institution, and the data storage year of the preset medical institution.
[0117] In an embodiment of the present application, data configuration information of multiple business domains is obtained from a data configuration file of a preset medical institution, and test data is generated based on the data configuration information, so that the generated test data is similar to the actual data of the preset medical institution, thereby improving the accuracy of testing each database.
[0118] On the basis of the above embodiment, the present application further provides a process for executing a test task in a database stress testing method based on medical data. In the above step 104, according to the preset concurrency of the preset medical institution, a target structured query statement that meets the preset concurrency is loaded and executed from a query case test set, including:
[0119] The preset test task is executed according to the preset concurrency of the preset medical institution and the execution configuration information of the preset test task. In the process of executing the preset test task, the target structured query statement that meets the preset concurrency is loaded and executed from the query case test set.
[0120] The execution configuration information is used to indicate the task execution mode of the preset test task. The task execution mode includes: a task execution mode based on the number of times and a task execution mode based on time. The task execution mode based on the number of times means that the test task is completed after a fixed number of times, and the task execution mode based on time means that the test task is repeatedly executed within a preset time range.
[0121] Optionally, according to the task execution mode of the preset test task with the preset concurrency of the preset medical institution, the preset test task is executed, and the target structured query statement that meets the preset concurrency is loaded and executed from the query case test set. No manual monitoring is required during the execution of the test task. When the end condition is met, the tool will end the stress testing task after the target structured query statement ends. During the execution of the test task, the operation log will be printed, and the log will be saved in a file for troubleshooting. The performance results will also be recorded. After the test task is completed, the test task is saved as a task configuration file. When it is re-executed later, the task file can be directly selected without repeating the above configuration steps. Multiple test tasks can also be composed of a test task group for batch execution, or they can be saved as a whole test task file for subsequent use.
[0122] In the embodiment of the present application, the preset test task is executed according to the preset concurrency of the preset medical institution and the execution configuration information of the preset test task. In the process of executing the preset test task, the target structured query statement that meets the preset concurrency is loaded and executed from the query case test set. The performance of different databases can be tested through different task execution modes, the accuracy and stability of the database can be evaluated, and the comprehensiveness of the database test can be improved.
[0123] Based on the above embodiments, the present application also provides a process for generating a test chart in a database stress testing method based on medical data. Figure 5 A schematic diagram of a flow chart for generating a test chart in a database stress testing method based on medical data provided in an embodiment of the present application, such as Figure 5 As shown, based on the above steps 101 to 104, the method further includes:
[0124] Step 501: Generate a test result file based on the stress test results of multiple databases.
[0125] The test result file includes: data query information of multiple databases, and execution time information of each target structured query statement for multiple databases; data query information includes: concurrency, throughput, number of requests processed per second, etc., and execution time information includes: minimum execution time, maximum execution time, average execution time, etc. The test result file is a lightweight data exchange format file in a standard format (JavaScript Object Notation, abbreviated as JSON), and the file is named, classified and stored according to the database name and date.
[0126] Optionally, a lightweight data exchange format file is generated according to the stress test result of each database, and is named and stored in a classified manner according to the database name and date.
[0127] Step 502: Generate and display test charts for multiple databases based on the test result file.
[0128] The test chart includes a statistical table and a histogram. The statistical table includes the execution results of multiple target structured query statements in the same database, each row represents the value of the same target structured query statement in different test result dimensions, and each column represents the value of different target structured query statements in the same test result dimension. The histogram includes the execution results of multiple target structured query statements in different databases, the horizontal axis represents the target structured query statement, and the vertical axis represents time.
[0129] Optionally, based on the test result file of the same database, display the number of concurrent queries, throughput, number of requests processed per second, average query time, minimum time, maximum time, median query time, time for 90% of the query times, error rate, etc. in the test results of the target structured query statement in the same database. Based on the test result files of multiple databases, use different colored histograms in the histogram to identify the average time, median time, time for 90% of the query times, etc. of different databases based on the test results of multiple databases. Export the statistical table and histogram as a worksheet or an image in a conventional format for display and archiving.
[0130] In the embodiment of the present application, a test result file is generated based on the stress test results of multiple databases, and a test chart for multiple databases is generated and displayed. The present application can intuitively compare the performance and stability of the same target structured query statement in different databases through the test chart, making the comparison result more intuitive.
[0131] Based on the same inventive concept, the embodiments of the present application also provide a database stress testing device based on medical data corresponding to the database stress testing method based on medical data. Since the principle of solving the problem by the device in the embodiments of the present application is similar to the above-mentioned database stress testing method based on medical data in the embodiments of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0132] Figure 6 A schematic diagram of a database stress testing device based on medical data provided in an embodiment of the present application, the device comprising:
[0133] An acquisition module 601 is used to acquire a use case configuration file of a preset medical institution, wherein the use case configuration file includes: a plurality of preset structured query statements, wherein the plurality of preset structured query statements respectively correspond to a plurality of data business analysis scenarios of a data center application of the preset medical institution;
[0134] The conversion module 602 is used to convert each preset structured query statement in the use case configuration file into a target structured query statement that conforms to the structured query language dialect according to the structured query language dialect corresponding to each of the multiple databases to be tested, and generate a query case test set for each database, wherein the query case test set includes: multiple target structured query statements;
[0135] A generating module 603, configured to generate simulated medical test data for the preset medical institution in each database according to the structured query language dialect corresponding to each database and using a preset medical test data model;
[0136] The execution module 604 is used to load and execute the target structured query statement that meets the preset concurrency of the preset medical institution from the query case test set, so as to perform corresponding data query operations on the simulated medical test data and obtain the stress test results of each database for the preset medical institution.
[0137] Optionally, the acquisition module 601 is specifically used to: acquire all structured query statements applied by the data center, and the usage frequency of each structured query statement;
[0138] According to the usage frequencies of the structured query statements, the plurality of preset structured query statements with the highest frequencies are determined from all the structured query statements.
[0139] Optionally, the conversion module 602 is specifically configured to: obtain test configuration information of the multiple databases, the test configuration information of each database including: the type of each database;
[0140] According to the type of each database, a structured query language dialect corresponding to each database is determined.
[0141] Optionally, the test configuration information of each database includes: connection information of each database; the generating module 603 is specifically used to: establish a connection with each database according to the connection information of each database.
[0142] Optionally, the preset medical test data model includes: data main table sub-table models of multiple business domains; a generation module 603, specifically used to: generate a data definition language script for each database according to the structured query language dialect corresponding to each database;
[0143] According to the data main table sub-table models of the multiple business domains in the preset medical test data model, a data definition language script for each database is executed to generate test tables of the multiple business domains in each database respectively, and indexes of the test tables of the multiple business domains are established;
[0144] Generate a data manipulation language script for each database according to the pre-generated volume of the preset medical institutions and the structured query language dialect corresponding to each database;
[0145] According to the data configuration information of the multiple business domains, the data manipulation language script of each database is executed, and the test data of the multiple business domains are respectively generated in the test tables of the multiple business domains. The simulated medical test data includes: the test data of the multiple business domains.
[0146] Optionally, the generating module 603 is further used to: preset a data storage period according to the level information of each medical institution, and calculate the pre-generated volume;
[0147] Alternatively, the pre-generated volume is obtained as input.
[0148] Optionally, the generation module 603 is further used to: obtain data configuration information of the multiple business domains from the data configuration file of the preset medical institution, and the data configuration information of the multiple business domains includes: the association relationship between the multiple business domains and the data proportion relationship between the multiple business domains.
[0149] Optionally, the execution module 604 is specifically used to: execute the preset test task according to the preset concurrency of the preset medical institution and the execution configuration information of the preset test task, and in the process of executing the preset test task, load and execute the target structured query statement that meets the preset concurrency from the query case test set, wherein the execution configuration information is used to indicate the task execution mode of the preset test task.
[0150] Optionally, the device further comprises: a display module; specifically used to: generate a test result file according to the stress test results of the multiple databases, the test result file comprising: data query information of the multiple databases, and execution time information of each target structured query statement for the multiple databases;
[0151] According to the test result file, a test chart for the multiple databases is generated and displayed.
[0152] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0153] The present application also provides a computer device, Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application, the computer device includes: a processor 701, a memory 702, and optionally, a bus 703. The memory 702 stores machine-readable instructions executable by the processor 701. When the computer device is running, the processor 701 communicates with the memory 702 through the bus 703. When the machine-readable instructions are executed by the processor 701, the steps of the above-mentioned database stress testing method based on medical data are executed.
[0154] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned database stress testing method for medical data are executed.
[0155] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0156] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or part of the technical solution that contributes to the prior art or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk and other media that can store program code.
[0157] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A database stress testing method based on medical data, characterized in that: The method includes: Obtaining a use case configuration file of a preset medical institution, the use case configuration file comprising: a plurality of preset structured query statements, the plurality of preset structured query statements respectively corresponding to a plurality of data business analysis scenarios of a data center application of the preset medical institution; According to the structured query language dialect corresponding to each database among the multiple databases to be tested, each preset structured query statement in the use case configuration file is converted into a target structured query statement that conforms to the structured query language dialect, and a query case test set for each database is generated, wherein the query case test set includes: multiple target structured query statements; According to the structured query language dialect corresponding to each database, using a preset medical test data model, generating simulated medical test data for the preset medical institution in each database; According to the preset concurrency of the preset medical institution, the target structured query statement that meets the preset concurrency is loaded and executed from the query case test set to perform corresponding data query operations on the simulated medical test data to obtain the stress test results of each database for the preset medical institution.
2. The method according to claim 1, characterized in that The step of obtaining the use case configuration file of the preset medical institution includes: Obtaining all structured query statements applied by the data center and the usage frequency of each structured query statement; According to the usage frequencies of the structured query statements, the plurality of preset structured query statements with the highest frequencies are determined from all the structured query statements.
3. The method according to claim 1, characterized in that: According to the structured query language dialect corresponding to each database in the multiple databases to be tested, converting each preset structured query statement in the use case configuration file into a target structured query statement that conforms to the structured query language dialect, and generating a query case test set for each database, the method further includes: Acquire test configuration information of the multiple databases, where the test configuration information of each database includes: the type of each database; According to the type of each database, a structured query language dialect corresponding to each database is determined.
4. The method according to claim 3, characterized in that The test configuration information of each database includes: connection information of each database; According to the structured query language dialect corresponding to each database and the preset medical test data model, before generating the simulated medical test data for the preset medical institution in each database, the method further includes: A connection is established with each database according to the connection information of each database.
5. The method according to claim 1, characterized in that The preset medical test data model includes: data master table and sub-table models of multiple business domains; The method of generating simulated medical test data for the preset medical institution in each database by using a preset medical test data model according to the structured query language dialect corresponding to each database includes: Generating a data definition language script for each database according to the structured query language dialect corresponding to each database; According to the data main table sub-table models of the multiple business domains in the preset medical test data model, a data definition language script for each database is executed to generate test tables of the multiple business domains in each database respectively, and indexes of the test tables of the multiple business domains are established; Generate a data manipulation language script for each database according to the pre-generated volume of the preset medical institutions and the structured query language dialect corresponding to each database; According to the data configuration information of the multiple business domains, the data manipulation language script of each database is executed, and the test data of the multiple business domains are respectively generated in the test tables of the multiple business domains. The simulated medical test data includes: the test data of the multiple business domains.
6. The method according to claim 5, characterized in that Before generating a data manipulation language script for each database according to the pre-generated volume of the preset medical institutions and the structured query language dialect corresponding to each database, the method further includes: According to the level information of each medical institution, the data storage period is preset and the pre-generated volume is calculated; or, Get the pre-generated volume as input.
7. The method according to claim 5, characterized in that Before executing the data manipulation language script of each database according to the data configuration information of the multiple business domains and respectively generating the test data of the multiple business domains in the test tables of the multiple business domains, the method further comprises: The data configuration information of the multiple business domains is obtained from the data configuration file of the preset medical institution, wherein the data configuration information of the multiple business domains includes: an association relationship between the multiple business domains and a data ratio relationship between the multiple business domains.
8. The method according to claim 1, characterized in that According to the preset concurrency of the preset medical institution, loading and executing a target structured query statement that meets the preset concurrency from the query case test set includes: The preset test task is executed according to the preset concurrency of the preset medical institution and the execution configuration information of the preset test task. During the execution of the preset test task, a target structured query statement that meets the preset concurrency is loaded and executed from the query case test set, wherein the execution configuration information is used to indicate the task execution mode of the preset test task.
9. The method according to claim 1, characterized in that: The method further comprises: Generate a test result file according to the stress test results of the multiple databases, the test result file including: data query information of the multiple databases, and execution time information of each target structured query statement for the multiple databases; According to the test result file, a test chart for the multiple databases is generated and displayed.
10. A computer device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor executes the machine-readable instructions to perform the steps of the database stress testing method based on medical data as described in any one of claims 1 to 9.