Medical data intelligent generation method, device, computer equipment and storage medium
Through the method of analyzing and sampling to generate medical data, the problems of inefficient and high cost of medical data generation in the prior art are solved, and efficient and low-cost automatic generation of medical data is realized, which is suitable for software testing.
Patent Information
- Application Number
- CN202210025733.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-11
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2042-01-11
AI Technical Summary
The prior art is difficult to efficiently generate medical data in real environments, resulting in the lack of test data in software testing that does not meet business scenarios, which is inefficient and costly.
By obtaining data table information related to the medical data that needs to be generated, analyzing the field meaning and association relationship, sampling and generating data rules, and finally generating medical data based on the rules. The method includes converting the field name into an undirected graph, using a breadth-first search and depth-first algorithm combined with a KMP algorithm to determine the association information, and random sampling to form data generation rules.
It realizes automatic generation of medical data, improves the efficiency of software testing, reduces costs, and can generate high-quality test data that meets business scenarios.
Smart Images

Figure CN114386405B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a data generation method, and more specifically to a medical data intelligent generation method, device, computer equipment and storage medium. Background Art
[0002] When software manufacturers develop applications for medical scenarios, they need to use a large amount of medical data for testing. However, current technology cannot obtain sensitive data in the real environment, and they often face problems such as lack of test data, test data that does not meet business scenarios, and small amount of test data.
[0003] The existing method is to manually and automatically assemble historical data to form medical test data for software testing, but this method of generating medical data has the problems of low efficiency and high cost.
[0004] Therefore, it is necessary to design a new method to automatically generate medical data for software testing with high efficiency and low cost. Summary of the invention
[0005] The purpose of the present invention is to overcome the defects of the prior art and provide a method, device, computer equipment and storage medium for intelligent generation of medical data.
[0006] To achieve the above-mentioned purpose, the present invention adopts the following technical scheme: a method for intelligently generating medical data, comprising:
[0007] Obtain data table information related to the medical data to be generated;
[0008] Analyze the meaning of the fields and the field association relationship of the corresponding table according to the data table information;
[0009] Sampling is performed in the data set according to the meaning of the fields and the field association relationship to obtain data generation rules;
[0010] Generate medical data according to the data generation rule.
[0011] A further technical solution is: parsing the meaning of the fields and the field association relationship of the corresponding table according to the data table information includes:
[0012] Convert all field names of each table into an undirected graph according to the data table information;
[0013] Traversing the associated information, and using a breadth-first search algorithm that optimizes the search range to determine associated nodes of the field to obtain the associated information, and saving the associated information;
[0014] The depth-first algorithm and the KMP algorithm of the adapted graph structure are combined with the associated information to search for matching fields to obtain the field meanings and field association relationships.
[0015] A further technical solution is: traversing the associated information and using a breadth-first search algorithm with an optimized search range to determine the associated nodes of the field to obtain the associated information and save the associated information, including:
[0016] Sorting the nodes in the undirected graph and using a binary search method to perform a breadth-first search for associated nodes;
[0017] All undirected graphs are merged through associated nodes to obtain associated information, and the associated information is saved.
[0018] A further technical solution is: the depth-first algorithm and the KMP algorithm of the adaptation graph structure are combined with the associated information to search for matching fields to obtain the meaning of the fields and the field association relationship, including:
[0019] The depth-first algorithm and the KMP algorithm of the adaptation graph structure are combined with the associated information to perform field matching in the preset medical database, and the location of the field is determined. Combined with the associated information, the field meaning and the field association relationship are obtained.
[0020] A further technical solution is: sampling in the data set according to the meaning of the field and the field association relationship to obtain data generation rules, including:
[0021] Using a breadth-first search algorithm to traverse the associated information;
[0022] A sampling formula is established according to the meaning of the field, and random sampling is performed in the data set according to the parameters input by the terminal in combination with the sampling formula to obtain a sampling result;
[0023] After each node in the association information is traversed, the sampling result is determined to be a data generation rule.
[0024] A further technical solution is: the data generation rules include field information, field types, association relationships and medical data dictionary sources of the data to be generated.
[0025] A further technical solution is: generating medical data according to the data generation rule includes:
[0026] Traversing the field information in the data generation rule, when the field information has fields with associated relationships, adding an associated rule to the field information;
[0027] Add data generation rules to related fields based on field type and field information;
[0028] Constructing and generating data according to the generation rules, and when a field needs to use medical-related data, connecting to a medical data dictionary, extracting and generating data, so as to obtain intermediate data;
[0029] Organizing the intermediate data into a corresponding format according to a data generation rule to obtain medical data;
[0030] The medical data is exported.
[0031] The present invention also provides a medical data intelligent generation device, comprising:
[0032] An information acquisition unit, used for acquiring data table information related to the medical data to be generated;
[0033] A parsing unit, used for parsing the meaning of the fields and the field association relationship of the corresponding table according to the data table information;
[0034] A sampling unit, used to perform sampling in the data set according to the meaning of the field and the field association relationship to obtain a data generation rule;
[0035] A generating unit is used to generate medical data according to the data generating rule.
[0036] The present invention further provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above method when executing the computer program.
[0037] The present invention also provides a storage medium, wherein the storage medium stores a computer program, and the computer program implements the above method when executed by a processor.
[0038] The beneficial effects of the present invention compared with the prior art are: the present invention parses the meaning of fields and field associations of the data table through the data table information input by the terminal, and samples in the data set according to the content obtained by the analysis to obtain data generation rules, generates medical data according to the rules, and realizes automatic generation of medical data for software testing, which is highly efficient and low-cost.
[0039] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0041] Figure 1 A schematic diagram of an application scenario of the medical data intelligent generation method provided by an embodiment of the present invention;
[0042] Figure 2 A schematic diagram of a process flow of a medical data intelligent generation method provided by an embodiment of the present invention;
[0043] Figure 3 A schematic diagram of a sub-process of a method for intelligently generating medical data provided by an embodiment of the present invention;
[0044] Figure 4 A schematic diagram of a sub-process of a method for intelligently generating medical data provided by an embodiment of the present invention;
[0045] Figure 5 A schematic diagram of a sub-process of a method for intelligently generating medical data provided by an embodiment of the present invention;
[0046] Figure 6 A schematic diagram of a sub-process of a method for intelligently generating medical data provided by an embodiment of the present invention;
[0047] Figure 7 A schematic block diagram of a medical data intelligent generation device provided by an embodiment of the present invention;
[0048] Figure 8 A schematic block diagram of a parsing unit of the medical data intelligent generation device provided in an embodiment of the present invention;
[0049] Fig. 9 A schematic block diagram of an associated node determination subunit of a medical data intelligent generation device provided in an embodiment of the present invention;
[0050] Fig.10 A schematic block diagram of a sampling unit of the medical data intelligent generation device provided in an embodiment of the present invention;
[0051] Fig.11 A schematic block diagram of a generating unit of the medical data intelligent generating device provided in an embodiment of the present invention;
[0052] Fig.12 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0055] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0056] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0057] See also Figure 1 and Figure 2 , Figure 1 A schematic diagram of an application scenario of the medical data intelligent generation method provided in an embodiment of the present invention. Figure 2 A schematic flow chart of a medical data intelligent generation method provided by an embodiment of the present invention. The medical data intelligent generation method is applied in a server. The server interacts with a terminal, inputs data table information related to the medical data to be generated through the terminal, analyzes the meaning of the fields and the field association relationship according to the data table information, samples the corresponding data, forms a data generation rule, and generates the corresponding medical data according to the rule.
[0058] Figure 2 FIG. 1 is a flow chart of a method for intelligently generating medical data provided by an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S140.
[0059] S110. Obtain data table information related to the medical data to be generated.
[0060] In this embodiment, the generation of medical data is based on the intelligent generation such as assembly of multiple existing data tables. Therefore, when medical data needs to be generated, the terminal needs to input the set of table names, database connection information, generation quantity and other information that need to be automatically generated. The server determines the fields and associations in the table based on the input information and database connection information, and generates the corresponding data using the generation quantity. No manual assembly generation is required, and the efficiency is high.
[0061] S120: Analyze the meaning of the fields and the field association relationship of the corresponding table according to the data table information.
[0062] In this embodiment, the field meaning refers to the meaning of each field in each related data table, and the field association relationship refers to the relationship between the fields in these related data tables.
[0063] In one embodiment, see Figure 3 , the above-mentioned step S120 may include steps S121 to S123.
[0064] S121, converting all field names of each table into an undirected graph according to the data table information;
[0065] In this embodiment, the undirected graph refers to a graph formed by all fields of each table as nodes.
[0066] Specifically, the existing technology can be used to take the fields in the table as nodes to form tree nodes, so that each table corresponds to a tree, and the tree becomes an undirected graph. By converting to an undirected graph, the meaning of the field and the associated fields can be quickly and accurately determined.
[0067] In this embodiment, all the field names of each table are converted into an undirected graph. Let the undirected graph be g x =〈v,e〉, where v is the node of the undirected graph and e is the edge of the undirected graph. Then we get an undirected graph array L = {g1,g2,…g n}, where n is the number of tables, that is, the number of undirected graphs.
[0068] S122: traverse the associated information, and use a breadth-first search algorithm that optimizes the search range to determine associated nodes of the field to obtain the associated information, and save the associated information.
[0069] In this embodiment, the association information refers to a graph obtained by merging all undirected graphs using nodes associated with all undirected graphs.
[0070] The breadth-first search algorithm for optimizing the search range first sorts the nodes in each undirected graph according to a certain feature, and then uses a binary search method to perform a breadth-first search for associated content.
[0071] In one embodiment, see Figure 4 , the above-mentioned step S122 may include steps S1221 to S1222.
[0072] S1221, sorting the nodes in the undirected graph, and performing a breadth-first search for associated nodes using a binary search method;
[0073] S1222. Merge all undirected graphs through associated nodes to obtain associated information, and save the associated information.
[0074] Specifically, in the undirected graph g x =<v,e> Find the node v in x First, g x Sort the set of v in , and then use the binary search method to perform breadth-first search to find the associated nodes.
[0075] All undirected graphs g are connected by their associated nodes x =<v,e> Merge into an undirected graph g =<v,e> , and remove duplicate nodes, thereby determining the association relationship between fields.
[0076] S123, using a depth-first algorithm and a KMP algorithm of an adapted graph structure in combination with the associated information to search for matching fields, so as to obtain field meanings and field association relationships.
[0077] In this embodiment, a depth-first algorithm and a KMP (Knuth-Morris-Pratt Algorithm) algorithm of an adaptation graph structure are used in combination with the associated information to perform field matching in a preset medical database, and the location of the field is determined. In combination with the associated information, the field meaning and the field association relationship are obtained.
[0078] In this embodiment, the medical database refers to a historical database.
[0079] Specifically, the KMP algorithm is a string search algorithm that can find the position of a substring w in a string S. In order to make it possible to<v,e> Search on g=<v,e> Search for string w on the . Traverse the set of nodes and set m n Represents the node v n The current search position of the matching string w, i n Represents the character position of the current comparison in the matching string w. If each match fails, m n Set to i n +len(w),i n Set to the number of characters matched before the match fails, where len(w) is the length of string w.
[0080] Field matching can obtain the defined meaning in the existing medical database, while association information can determine the field association relationship.
[0081] S130: Sampling is performed in the data set according to the field meanings and field association relationships to obtain data generation rules.
[0082] Specifically, the algorithm optimized for positive feedback sampling based on the Monte Carlo algorithm continuously samples within the data set, and the sampling is close to the ideal medical real data.
[0083] In this embodiment, the data generation rule refers to the information required for data generation, including field information, field type, association relationship and medical data dictionary source of the data to be generated.
[0084] In one embodiment, see Figure 5 , the above-mentioned step S130 may include steps S131 to S133.
[0085] S131, traversing the associated information using a breadth-first search algorithm.
[0086] In this embodiment, a breadth-first search is used to traverse the graph g=<v,e> , and data sampling is performed on each node according to step S132.
[0087] S132: Establish a sampling formula according to the meaning of the field, and perform random sampling in the data set according to the parameters input by the terminal in combination with the sampling formula to obtain a sampling result.
[0088] In this embodiment, the sampling result refers to data generated by sampling within an existing data set according to the limiting conditions input by the terminal in combination with the sampling formula.
[0089] Specifically, the meaning of each saved node, that is, the field meaning, is retrieved and the formula y=f(x1,x2…x n ), where y is the final result that approximates the real world, that is, the sampling result, f(x) is the sampling process, x1, x2…x n is the parameter used in the sampling process, that is, the limiting conditions input by the terminal, such as which type of data to sample, or the purpose of the sampled data. Random sampling is performed in the data set based on the input parameters. Let the sampling result be y n , the last sampling result is y n-1 , then we get a function y=jy optimized based on positive feedback sampling n +ky n-1 , where j and k are feedback parameters. In this embodiment, the data set can be an existing large medical data set, a database that collects all real medical data. In the first sampling, assuming that the first two sampling results are both final values, set j = k = 1. Since the two samplings cannot approach the real result, set j = ky n-1 / y n After a large number of samples, j and k will converge to a certain value, and then a value y close to the true result will be obtained.
[0090] S133: After each node in the association information is traversed, determine that the sampling result is a data generation rule.
[0091] In this embodiment, after ensuring that each node is visited, all values y that are close to the true result are saved to form a data generation rule.
[0092] S140, generating medical data according to the data generation rule.
[0093] In one embodiment, see Figure 6 , the above-mentioned step S140 may include steps S141 to S145.
[0094] S141, traversing the field information in the data generation rule, and when the field information has fields with associated relationships, adding an associated rule to the field information.
[0095] In this embodiment, the field information in the data generation rule is traversed to determine whether the field information is associated with other fields. If the field information is associated with other fields, an association rule is added for the field information, that is, the field associated with the field information is added.
[0096] When the field information has a field with an associated relationship, after adding the association rule, the formed field information executes step S142; when the field information has no field with an associated relationship, the field information is used to execute step S142.
[0097] S142. Add generation rules for constructing data to related fields according to field types and field information.
[0098] In this embodiment, the generation rule refers to a rule on how to construct data according to fields related to field type and field information.
[0099] In this embodiment, the field type and the field information are combined according to the characteristics of the medical data to be generated to form a generation rule.
[0100] S143. Construct and generate data according to the generation rules, and when a field needs to use medical-related data, connect to the medical data dictionary, extract and generate data to obtain intermediate data.
[0101] In this embodiment, intermediate data refers to data constructed according to generation rules. When the construction process needs to refer to medical-related data, the medical data dictionary is connected according to the actual situation, and the corresponding data is extracted to form the combined data.
[0102] S144. Organize the intermediate data into a corresponding format according to data generation rules to obtain medical data.
[0103] In this embodiment, the data generation rules also include the output format, and the intermediate data is converted into medical data according to the format and then exported.
[0104] S145. Export the medical data.
[0105] The above-mentioned intelligent medical data generation method parses the meaning of fields and field associations of the data table through the data table information input by the terminal, and samples the data set according to the content obtained by the analysis to obtain data generation rules, and generates medical data according to the rules, thereby realizing automatic generation of medical data for software testing, which is highly efficient and low-cost.
[0106] Figure 7 FIG. 3 is a schematic block diagram of a medical data intelligent generation device 300 provided in an embodiment of the present invention. Figure 7 As shown, corresponding to the above medical data intelligent generation method, the present invention also provides a medical data intelligent generation device 300. The medical data intelligent generation device 300 includes a unit for executing the above medical data intelligent generation method, and the device can be configured in a server. Figure 7 The medical data intelligent generation device 300 includes an information acquisition unit 301, a parsing unit 302, a sampling unit 303 and a generation unit 304.
[0107] The information acquisition unit 301 is used to acquire data table information related to the medical data to be generated; the parsing unit 302 is used to parse the field meanings and field associations of the corresponding table according to the data table information; the sampling unit 303 is used to sample within the data set according to the field meanings and field associations to obtain data generation rules; the generation unit 304 is used to generate medical data according to the data generation rules.
[0108] In one embodiment, if Figure 8 As shown, the parsing unit 302 includes a conversion subunit 3021 , an associated node determination subunit 3022 , and a search subunit 3023 .
[0109] The conversion subunit 3021 is used to convert all the field names of each table into an undirected graph according to the data table information; the association node determination subunit 3022 is used to traverse the association information and use a breadth-first search algorithm with an optimized search range to determine the association nodes of the field to obtain the association information and save the association information; the search subunit 3023 is used to use a depth-first algorithm and a KMP algorithm adapted to the graph structure in combination with the association information to search for matching fields to obtain the field meaning and the field association relationship.
[0110] In one embodiment, if Fig. 9As shown, the associated node determination subunit 3022 includes a sorting module 30221 and a merging module 30222 .
[0111] The sorting module 30221 is used to sort the nodes in the undirected graph and use the binary search method to perform breadth-first search for associated nodes; the merging module 30222 is used to merge all undirected graphs through associated nodes to obtain associated information and save the associated information.
[0112] In one embodiment, the search subunit 3023 is used to use a depth-first algorithm and a KMP algorithm of an adaptation graph structure in combination with the associated information to perform field matching in a preset medical database, and determine the location of the field, and in combination with the associated information, obtain the field meaning and field association relationship.
[0113] In one embodiment, if Fig.10 As shown, the sampling unit 303 includes a traversal subunit 3031 , a random sampling subunit 3032 and a rule determination subunit 3033 .
[0114] The traversal subunit 3031 is used to traverse the associated information using a breadth-first search algorithm; the random sampling subunit 3032 is used to establish a sampling formula according to the meaning of the field, and perform random sampling in the data set according to the parameters input by the terminal in combination with the sampling formula to obtain a sampling result; the rule determination subunit 3033 is used to determine that the sampling result is a data generation rule after each node in the associated information has been traversed.
[0115] In one embodiment, if Fig.11 As shown, the generating unit 304 includes an adding subunit 3041 , a generating rule constructing subunit 3042 , an intermediate data generating subunit 3043 , an organizing subunit 3044 and a deriving subunit 3045 .
[0116] An adding subunit 3041 is used to traverse the field information in the data generation rule, and when the field information has a field with an associated relationship, an association rule is added to the field information; a generation rule construction subunit 3042 is used to add a generation rule for constructing data to the related fields according to the field type and field information; an intermediate data generation subunit 3043 is used to construct and generate data according to the generation rule, and when the field needs to use medical-related data, the medical data dictionary is connected to extract and generate data to obtain intermediate data; an organizing subunit 3044 is used to organize the intermediate data into a corresponding format according to the data generation rule to obtain medical data; an exporting subunit 3045 is used to export the medical data.
[0117] It should be noted that technical personnel in the relevant field can clearly understand that the specific implementation process of the above-mentioned medical data intelligent generation device 300 and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.
[0118] The medical data intelligent generation device 300 can be implemented in the form of a computer program. Fig.12 Runs on the computer device shown.
[0119] See also Fig.12 , Fig.12 5 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a server, wherein the server may be an independent server or a server cluster composed of multiple servers.
[0120] See also Fig.12 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .
[0121] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a medical data intelligent generation method.
[0122] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
[0123] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a medical data intelligent generation method.
[0124] The network interface 505 is used to communicate with other devices over the network. Fig.12 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0125] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:
[0126] Acquire data table information related to the medical data to be generated; parse the field meanings and field associations of the corresponding table according to the data table information; perform sampling in the data set according to the field meanings and field associations to obtain data generation rules; generate medical data according to the data generation rules.
[0127] In one embodiment, when the processor 502 implements the step of parsing the meaning of the fields and the field association relationship of the corresponding table according to the data table information, the processor 502 specifically implements the following steps:
[0128] According to the data table information, all field names of each table are converted into an undirected graph; the associated information is traversed, and the associated nodes of the fields are determined by using a breadth-first search algorithm with an optimized search range to obtain the associated information, and the associated information is saved; a depth-first algorithm and a KMP algorithm adapted to the graph structure are used in combination with the associated information to search for matching fields to obtain the field meaning and the field association relationship.
[0129] In one embodiment, when the processor 502 implements the steps of traversing the association information, determining the association nodes of the field using a breadth-first search algorithm that optimizes the search range to obtain the association information, and saving the association information, the processor 502 specifically implements the following steps:
[0130] The nodes in the undirected graph are sorted, and a binary search method is used to perform a breadth-first search for associated nodes; all undirected graphs are merged through associated nodes to obtain associated information, and the associated information is saved.
[0131] In one embodiment, when the processor 502 implements the step of using the depth-first algorithm and the KMP algorithm of the adaptation graph structure in combination with the association information to search for matching fields to obtain field meanings and field association relationships, the processor 502 specifically implements the following steps:
[0132] The depth-first algorithm and the KMP algorithm of the adaptation graph structure are combined with the associated information to perform field matching in the preset medical database, and the location of the field is determined. Combined with the associated information, the field meaning and the field association relationship are obtained.
[0133] In one embodiment, when the processor 502 implements the step of sampling in the data set according to the field meaning and the field association relationship to obtain the data generation rule, the processor 502 specifically implements the following steps:
[0134] The association information is traversed using a breadth-first search algorithm; a sampling formula is established according to the meaning of the field, and random sampling is performed in the data set according to the parameters input by the terminal combined with the sampling formula to obtain a sampling result; when each node in the association information is traversed, the sampling result is determined as a data generation rule.
[0135] The data generation rules include field information, field types, association relationships and medical data dictionary sources of the data to be generated.
[0136] In one embodiment, when the processor 502 implements the step of generating medical data according to the data generation rule, the processor 502 specifically implements the following steps:
[0137] Traverse the field information in the data generation rules, and when the field information has fields with associated relationships, add association rules to the field information; add generation rules for constructing data to related fields according to field types and field information; construct and generate data according to the generation rules, and when the field needs to use medical-related data, connect the medical data dictionary, extract and generate data to obtain intermediate data; organize the intermediate data into a corresponding format according to the data generation rules to obtain medical data; and export the medical data.
[0138] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0139] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0140] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein when the computer program is executed by a processor, the processor executes the following steps:
[0141] Acquire data table information related to the medical data to be generated; parse the field meanings and field associations of the corresponding table according to the data table information; perform sampling in the data set according to the field meanings and field associations to obtain data generation rules; generate medical data according to the data generation rules.
[0142] In one embodiment, when the processor executes the computer program to implement the step of parsing the meaning of the fields and the field association relationship of the corresponding table according to the data table information, the processor specifically implements the following steps:
[0143] According to the data table information, all field names of each table are converted into an undirected graph; the associated information is traversed, and the associated nodes of the fields are determined by using a breadth-first search algorithm with an optimized search range to obtain the associated information, and the associated information is saved; a depth-first algorithm and a KMP algorithm adapted to the graph structure are used in combination with the associated information to search for matching fields to obtain the field meaning and the field association relationship.
[0144] In one embodiment, when the processor executes the computer program to implement the steps of traversing the association information, determining the associated nodes of the field using a breadth-first search algorithm that optimizes the search range to obtain the association information, and saving the association information, the processor specifically implements the following steps:
[0145] The nodes in the undirected graph are sorted, and a binary search method is used to perform a breadth-first search for associated nodes; all undirected graphs are merged through associated nodes to obtain associated information, and the associated information is saved.
[0146] In one embodiment, when the processor executes the computer program to implement the step of using the depth-first algorithm and the KMP algorithm of the adaptation graph structure in combination with the association information to search for matching fields to obtain field meanings and field association relationships, the processor specifically implements the following steps:
[0147] The depth-first algorithm and the KMP algorithm of the adaptation graph structure are combined with the associated information to perform field matching in the preset medical database, and the location of the field is determined. Combined with the associated information, the field meaning and the field association relationship are obtained.
[0148] In one embodiment, when the processor executes the computer program to implement the step of sampling in the data set according to the field meaning and the field association relationship to obtain the data generation rule, the processor specifically implements the following steps:
[0149] The association information is traversed using a breadth-first search algorithm; a sampling formula is established according to the meaning of the field, and random sampling is performed in the data set according to the parameters input by the terminal combined with the sampling formula to obtain a sampling result; when each node in the association information is traversed, the sampling result is determined as a data generation rule.
[0150] The data generation rules include field information, field types, association relationships and medical data dictionary sources of the data to be generated.
[0151] In one embodiment, when the processor executes the computer program to implement the step of generating medical data according to the data generation rule, the processor specifically implements the following steps:
[0152] Traverse the field information in the data generation rules, and when the field information has fields with associated relationships, add association rules to the field information; add generation rules for constructing data to related fields according to field types and field information; construct and generate data according to the generation rules, and when the field needs to use medical-related data, connect the medical data dictionary, extract and generate data to obtain intermediate data; organize the intermediate data into a corresponding format according to the data generation rules to obtain medical data; and export the medical data.
[0153] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.
[0154] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0155] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0156] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0157] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all 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 a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.
[0158] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for intelligently generating medical data, characterized in that: include: Obtain data table information related to the medical data to be generated; Analyze the meaning of the fields and the field association relationship of the corresponding table according to the data table information; Sampling is performed in the data set according to the meaning of the fields and the field association relationship to obtain a data generation rule; wherein the data generation rule refers to information required for data generation, including field information, field type, association relationship and medical data dictionary source of the data to be generated; Generate medical data according to the data generation rule; The step of analyzing the meaning of the fields and the field association relationship of the corresponding table according to the data table information includes: Convert all field names of each table into an undirected graph according to the data table information; Traversing the undirected graph, and using a breadth-first search algorithm with an optimized search range to determine associated nodes of the field, so as to obtain associated information, and saving the associated information; the associated information refers to a graph obtained by merging all undirected graphs using nodes associated with all undirected graphs; A depth-first algorithm and a KMP algorithm of an adaptation graph structure are used in combination with the association information to search for matching fields to obtain field meanings and field association relationships; The traversing the undirected graph and using a breadth-first search algorithm that optimizes the search range to determine the associated nodes of the field to obtain associated information, and saving the associated information, includes: Sorting the nodes in the undirected graph and using a binary search method to perform a breadth-first search for associated nodes; All undirected graphs are merged through associated nodes to obtain associated information, and the associated information is saved.
2. The medical data intelligent generation method according to claim 1, characterized in that: The depth-first algorithm and the KMP algorithm of the adaptation graph structure are combined with the association information to search for matching fields to obtain field meanings and field association relationships, including: The depth-first algorithm and the KMP algorithm of the adaptation graph structure are combined with the associated information to perform field matching in the preset medical database, and the location of the field is determined. Combined with the associated information, the field meaning and the field association relationship are obtained.
3. The medical data intelligent generation method according to claim 1, characterized in that: The sampling is performed in the data set according to the field meaning and the field association relationship to obtain the data generation rule, including: Using a breadth-first search algorithm to traverse the associated information; A sampling formula is established according to the meaning of the field, and random sampling is performed in the data set according to the parameters input by the terminal in combination with the sampling formula to obtain a sampling result; After each node in the association information is traversed, the sampling result is determined to be a data generation rule.
4. The medical data intelligent generation method according to claim 3, characterized in that: Generating medical data according to the data generation rule includes: Traversing the field information in the data generation rule, when the field information has fields with associated relationships, adding an associated rule to the field information; Add data generation rules to related fields based on field type and field information; Constructing and generating data according to the generation rules, and when a field needs to use medical-related data, connecting to a medical data dictionary, extracting and generating data, so as to obtain intermediate data; Organizing the intermediate data into a corresponding format according to a data generation rule to obtain medical data; The medical data is exported.
5. A medical data intelligent generation device, characterized in that: include: An information acquisition unit, used for acquiring data table information related to the medical data to be generated; A parsing unit, used for parsing the meaning of the fields and the field association relationship of the corresponding table according to the data table information; A sampling unit, used for sampling in a data set according to the meaning of the field and the field association relationship to obtain a data generation rule; wherein the data generation rule refers to the information required for data generation, including field information, field type, association relationship and medical data dictionary source of the data to be generated; A generating unit, used for generating medical data according to the data generating rule; The parsing unit includes a conversion subunit, an associated node determination subunit and a search subunit; A conversion subunit is used to convert all the field names of each table into an undirected graph according to the data table information; an association node determination subunit is used to traverse the undirected graph and use a breadth-first search algorithm that optimizes the search range to determine the association nodes of the field to obtain association information and save the association information; a search subunit is used to use a depth-first algorithm and a KMP algorithm adapted to the graph structure in combination with the association information to search for matching fields to obtain field meanings and field association relationships; The associated node determination subunit includes a sorting module and a merging module; A sorting module is used to sort the nodes in the undirected graph and use a binary search method to perform a breadth-first search for associated nodes; a merging module is used to merge all undirected graphs through associated nodes to obtain associated information and save the associated information; the associated information refers to a graph that merges all undirected graphs using the nodes associated with all undirected graphs.
6. A computer device, characterized in that: The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 4 when executing the computer program.
7. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Data processing method and device, electronic equipment and storage medium
CN109491989A
Test data generation method and device, equipment and medium
CN112328499A