Data query method and device based on dynamically configured label inverted index

By dynamically configuring tag inverted index and RoaringBitmap technology, the problems of low data query efficiency and high maintenance cost in the medical data system are solved, and efficient and flexible data management and retrieval are realized, adapting to changes in the data structure of multiple hospitals and reducing system maintenance. Cost and hardware requirements.

CN118585528BActive Publication Date: 2024-10-25HANGZHOU COOPER MEDICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411068805.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-10-25
Estimated Expiration
2044-08-06

AI Technical Summary

Technical Problem

Facing the complex and large data volume conditions of multiple hospitals, the existing medical data system uses traditional SQL for data query with low efficiency, high data conversion and maintenance costs, and difficulty in adapting to changes in data structure and type in different hospitals.

Method used

A data query method based on dynamically configured tag inverted index is adopted, and data tags are stored and processed through RoaringBitmap technology to achieve efficient query and positioning of data, avoiding data format conversion and structural adjustment, and processing directly on the vertical table.

Benefits of technology

It significantly improves query efficiency and system flexibility, reduces maintenance costs, ensures the accuracy and consistency of data retrieval, adapts to diverse data structures, supports multi-user high-concurrency queries, and reduces human resource investment and hardware requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118585528B_ABST
    Figure CN118585528B_ABST
Patent Text Reader

Abstract

The present invention discloses a data query method and device based on a dynamically configured tag inverted index, comprising a configuration module, a data processing module, and a data storage module, wherein the configuration module is used to visualize the relevant information of the inverted index task of configuring the data tag, including source-end database information, incremental data reading mode, source-end data table and its tag field related information for building an inverted index, target-end database information, and inserted target-end data table and its related field information; the data processing module is used to read medical data from the source-end database according to the configured relevant information, and process and assemble the read medical data into a form suitable for the data tag inverted index, and use it as assembly result data; the data storage module is used to store the assembly result data in the target-end data table based on RoaringBitmap, which can simplify data processing and improve retrieval efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of medical data processing, and in particular relates to a data query method and device based on a dynamically configured tag inverted index. Background Art

[0002] Glossary: ​​Kafka: a high-throughput, persistent, distributed publish-subscribe message queue system; Topic: a logical concept for storing messages in Kafka, which can be considered as a message collection; PostgreSQL: Postgres, an open source relational database management system; pg_roaringbitmap plug-in: a PostgreSQL plug-in that provides support for the RoaringBitmap data type; RoaringBitmap: an efficient compressed bitmap data structure used to represent large-scale bit sets. It has a small memory footprint and fast bit operations, and is suitable for processing large-scale data sets; JDBC (Java DataBase Connectivity): a Java language database connection, an application programming interface for client programs to access the database; SQL: a standardized query language for managing relational database systems (RDBMS), used to define, operate, and manage data in relational databases, and can perform various operations, including data query, data update, data deletion, etc.

[0003] In the face of the complex, diverse and large-scale conditional retrieval and data relationship analysis characteristics of multiple hospitals in the field of medical big data, most systems still use traditional database systems such as MySQL and Oracle for data storage, and use SQL to connect multiple tables and query data. However, for database systems that gather large amounts of data from multiple hospitals and complex data formats, using traditional SQL to query tables faces many challenges.

[0004] First, the data needs to be preprocessed and unified in multiple dimensions, and the same type of data from different hospitals needs to be aggregated into one table. Since the data of most hospitals is stored in text or vertical table form, the data needs to be converted into corresponding horizontal table fields to facilitate data query. However, due to the connection to many different hospitals, the table data and structure of each hospital are different, resulting in the fact that most of the collected data is in a vertical table structure. Vertical table data is not convenient for data retrieval. Converting it to horizontal table data not only requires real-time data updates, but also requires modifying the horizontal table structure and rebuilding the data when a new hospital is connected or the hospital data format changes. In this case, a lot of manpower costs are required for data maintenance, and frequent table structure changes and data conversions also bring great instability to data accuracy. In addition, the complex SQL table search performance and query efficiency of large-scale horizontal tables are also very low. In short, the current existing solutions have the following shortcomings:

[0005] 1. Complex SQL search based on vertical table: extremely inefficient, and may not be able to complete the search when the amount of data is huge;

[0006] 2. The vertical table has many data types and different structures: If all are converted into horizontal tables, a large wide table will be formed, and many fields may have no values, and the table structure may change frequently;

[0007] 3. High labor costs for data conversion and updating: a large amount of manpower is required for maintenance;

[0008] 4. Complex SQL table search efficiency is low: When the amount of horizontal table data is large, complex SQL search performance is low. Summary of the invention

[0009] In view of the above, the purpose of the present invention is to provide a data query method and device based on a dynamically configured label inverted index. Starting from the data application dimension, by configuring the relevant information of the inverted index task of the data label, and storing the inverted index of the data label based on the dynamic RoaringBitmap technology, the data label based on the inverted index is searched and located to the individual user, and then the vertical table data is accurately located through the individual.

[0010] To achieve the above-mentioned purpose of the invention, the embodiment provides a data query method based on a dynamically configured tag inverted index, including a configuration module, a data processing module, and a data storage module;

[0011] The configuration module is used to visualize the relevant information of the inverted index task of configuring the data tag, including source database information, incremental data reading method, source data table and tag-related information of the inverted index, target database information, and inserted target data table and related field information;

[0012] The data processing module is used to read medical data from the source database according to the configured relevant information, and process and assemble the read medical data into a form suitable for the data tag inverted index as the assembly result data;

[0013] The data storage module is used to store the assembly result data in the target end data table based on RoaringBitmap.

[0014] Preferably, the incremental data reading method includes a kafka synchronization method, a primary key incremental method, and a time incremental method;

[0015] The source data table and the tag-related information for constructing the inverted index, including the source data table, the user primary key, the tag that needs to complete the inverted index, the data type of the tag, and the field key and field value corresponding to the tag;

[0016] The inserted target data table and its related field information include the table and field where the data tag inverted index data is inserted, the field name of the specified key storage and the value field name of the RoaringBitmap type.

[0017] Preferably, the reading of medical data from a source database according to the configured relevant information includes:

[0018] Full data reading, specifically generating a source JDBC connection based on the source database information, generating SQL statements based on the source data table and its tag-related information for building an inverted index, and reading medical data from the source database connected to the JDBC based on the SQL statements.

[0019] Preferably, the reading of medical data from a source database according to the configured relevant information includes:

[0020] Incremental data reading, including Kafka synchronous reading, primary key incremental reading, and time incremental reading;

[0021] For Kafka synchronous reading, Kafka monitors topic messages in real time according to the configuration information, and parses the messages according to the table and label, obtains the table and table name, and searches the table to determine the field information and corresponding medical data that need to be inverted indexed according to the label, and establishes two layers of key-value pair objects, where the key in the inner key-value pair is the column field, and the value is the medical data corresponding to the column, and the key in the outer key-value pair is the table name, and the value is the column key-value pair data set corresponding to the table;

[0022] For incremental reading of primary keys, read the incremental primary key field and the starting point of the primary key in the temporary table, obtain the field information that needs to be inverted indexed based on the label in the temporary table and splice it into the query statement, detect the newly added data in the source table in real time based on the query statement, and read the medical data whose primary key is greater than the starting point from the source table;

[0023] For time increment reading, read the table increment time field and start time value in the temporary table, obtain the field information in the temporary table that needs to implement the inverted index determined by the label and splice it into the query statement, detect the data in the source table in real time based on the query statement, and read the medical data from the starting point corresponding to the start time value.

[0024] Preferably, the processing and assembling of the read medical data into a form suitable for data tag inverted indexing includes:

[0025] The processing and assembly of the full data specifically involves obtaining the source data table information of the full read, and obtaining a set of original key-value pairs consisting of field keys and field values ​​corresponding to the labels, assembling the user primary key set corresponding to each field value into a new key-value pair with the label as the new key and the user primary key set as the new value, and storing the new key-value pair in the source data table information to form an object with two layers of key-value pairs, namely the original key-value pair and the new key-value pair. The object is in a form suitable for the inverted index of the data label, and the medical data read in full are all used as newly added grouped data.

[0026] Preferably, the processing and assembling of the read medical data into a form suitable for data tag inverted indexing includes:

[0027] Processing and assembly of incremental data, including data analysis, data inversion, and data integration;

[0028] For data analysis, the analysis results of the kafka synchronous reading step are further analyzed to obtain data flags, where data flags include new flags, modified flags, and deleted flags. The corresponding new data, modified data, and deleted data are determined based on the data flags; all data read based on the primary key increment are considered new data; among the data read based on the time increment, except for the deleted data marked by the delete flag, the rest of the data are considered modified data;

[0029] For data inversion, it specifically includes grouping the newly added data according to the configured tags and the corresponding field values ​​of the tags, and dividing them into newly added groups, and adding all the newly added data into the newly added groups; grouping the modified data according to the configured tags and the corresponding field values ​​of the fields, specifically divided into newly added groups corresponding to the presence of newly added data and deleted groups corresponding to the presence of deleted data; grouping the deleted data according to the configured tags and the corresponding field values ​​of the tags, and dividing them into deleted groups; marking the data in all data groups with the key of the configured tag and the value of the user primary key corresponding to the field value;

[0030] For data integration, data integration is performed specifically according to the labels and data groups corresponding to the field values ​​in the group, and a set of user primary keys is obtained as a form suitable for data label inverted index.

[0031] Preferably, storing the assembly result data in the target end data table based on RoaringBitmap includes:

[0032] Read the configured target data table and its related field information, and perform the following data operations on the assembled result data according to the data grouping and the key of each field in the grouping:

[0033] Add data in the target data table, and query whether there is corresponding data for the key of each field in the assembly result data according to the relevant field information in the target data table. If there is no corresponding data, add a new data in the target data table. If there is corresponding data, add the user primary key in the group to the original RoaringBitmap data.

[0034] Delete in the target data table, query in the target data table whether there is corresponding data for the key of each field in the assembly result data according to the relevant field information, if there is no corresponding data, do not operate, if there is corresponding data, delete the user primary key in the group on the original RoaringBitmap primary key data.

[0035] Preferably, the device further includes a breakpoint update module, which is used to update data breakpoints and perform data reading, specifically including:

[0036] In the Kafka synchronization mode, the RoaringBitmap tag inverted index is built, that is, after the data is successfully stored in the warehouse, the offset is manually updated to record the consumption progress. If the data construction is interrupted, the data is read from the recorded progress;

[0037] After the primary key incremental data is successfully stored in the database, check whether there is a breakpoint record stored in the temporary table. If not, insert a primary key breakpoint data and save it. If yes, update the user primary key of the data in the breakpoint record. If the data construction is interrupted, re-read the data from the breakpoint record position.

[0038] After the time increment data is successfully stored in the database, the temporary table is queried to see whether there is a breakpoint record stored. If not, a time breakpoint data is inserted. If so, the time value of the data in the breakpoint record is updated. If the data construction is interrupted, the data is read again from the breakpoint record position.

[0039] To achieve the above-mentioned purpose of the invention, an embodiment of the present invention further provides a data query method based on a dynamically configured label inverted index, using the above-mentioned device, the method comprising the following steps:

[0040] Use the configuration module to configure the inverted index of data labels to build the relevant information of the task;

[0041] Using the data processing module to read medical data from the source database according to the configured relevant information, and processing and assembling the read medical data into a form suitable for label indexing as assembly result data;

[0042] The data storage module is used to store the assembly result data in the target data table based on RoaringBitmap.

[0043] Preferably, the data breakpoints are updated and data reading is performed using an update breakpoint module.

[0044] Compared with the prior art, the present invention has the following beneficial effects:

[0045] 1. Improve query and retrieval efficiency. By using the RoaringBitmap tag inverted index, fast and efficient conditional retrieval can be achieved in massive medical data, which greatly shortens the query time, meets the needs of real-time retrieval of medical data, and can achieve rapid response. At the same time, in a large-scale data environment, it can efficiently support multi-user high-concurrency queries to ensure the stability and reliability of retrieval performance.

[0046] 2. Simplify data management. During the query process, the complex data format conversion process in traditional methods is avoided, and processing is performed directly on the vertical table data, which simplifies the data management and maintenance process. At the same time, through automated label construction and data retrieval, human intervention is reduced, and the difficulty of operation and the probability of error are reduced.

[0047] 3. Enhance system flexibility and be able to adapt to diverse data, that is, it can flexibly adapt to the data structure and type of different hospitals without frequent adjustment of data models, ensuring efficient integration and processing of multi-source data. At the same time, it can be dynamically expanded, that is, it can easily cope with the access of new hospitals and new data types. The system has strong scalability and high adaptability.

[0048] 4. Reduce maintenance costs. Through automated data processing and updating, the human resources required for data maintenance are greatly reduced, reducing manpower investment and operating costs. At the same time, due to the stable system structure and less maintenance workload, the system downtime for maintenance is reduced, thereby improving system availability.

[0049] 5. Improve query accuracy. The precise positioning function based on the label inverted index ensures the accuracy and consistency of data retrieval and improves the reliability of data analysis. At the same time, it can update labels and indexes in real time to ensure the timeliness and accuracy of retrieval results and avoid misjudgment caused by data lag.

[0050] 6. Optimize resource usage. Use an efficient method to dynamically build an inverted index of data labels to optimize the use of computing and storage resources, reduce resource waste, and improve the overall performance of the system. In addition, due to the high efficiency of the construction method, the requirements for hardware resources are low, which reduces hardware investment and maintenance costs.

[0051] 7. Improve user experience. Users do not need to care about the underlying data structure. Complex data retrieval can be achieved through customized configuration information. It is easy to operate and has a good user experience. It provides a friendly management platform and visualization tools to help users query and analyze data more intuitively, thereby improving work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0053] Figure 1 is a structural diagram of a data query device based on a dynamically configured label inverted index provided by an embodiment;

[0054] Figure 2 It is a flowchart of a data query method based on a dynamically configured tag inverted index provided by an embodiment. DETAILED DESCRIPTION

[0055] To make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation methods described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.

[0056] The inventive concept of the present invention is: in most traditional technical solutions, the retrieval of hospital data requires complex data format conversion, which not only consumes a lot of manpower costs, but also increases the difficulty of use and maintenance. In response to these technical problems, the embodiments of the present invention provide a data query method and device based on a dynamically configured label inverted index. The method and device realize medical data management and retrieval in an efficient, flexible and easy-to-maintain manner, significantly improving the processing capability and application effect of large-scale medical data, and providing strong technical support for the efficient use of medical data.

[0057] like Figure 1 As shown, the data query device 10 based on the dynamically configured label inverted index provided in the embodiment includes a configuration module 11, a data processing module 12, a data storage module 13, and an update breakpoint module 14. The data query device 10 is established on the basis of environment construction and data source configuration. When the environment is built, the kafka and PostgreSQL environments are first built, and the pg_roaringbitmap plug-in is installed. When configuring the data source, the source data source and the target data source are specifically configured. The source data source is the medical data that needs to be labeled, and the target data source selects the built PostgreSQL environment.

[0058] In an embodiment, the configuration module 11 provides a visualization interface for visually configuring retrieval query information, that is, visually configuring relevant information of the inverted index task of the data tag, which relevant information includes source database information, incremental data reading method, source data table and tag related information for constructing the inverted index, target database information, and inserted target data table and related field information.

[0059] The configured source database information includes the tables and structures of the source database.

[0060] The configured incremental data reading methods include Kafka synchronization method, primary key incremental method, and time incremental method. When configuring Kafka synchronization method, configure Kafka and message middleware topic, which means using Kafka message middleware topic to read message data. When configuring primary key incremental method, you need to configure the incremental primary key field to be read. When configuring time incremental method, you need to configure the incremental time field to be read.

[0061] The information related to the configured source data table and its tags for building the inverted index includes the source data table, the user primary key (integer type required), the tag that needs to complete the inverted index, the tag data type, and the field key and field value corresponding to the tag. The tag can be a field value in the table or a filter condition for a field value. For example: for the "sex" tag, set the corresponding field key (key) to "man", the corresponding field value (value) to "male" or "1", set the field key to "woman", and the corresponding field value to "female" or "2"; for the "fever (fvr_flg)" tag, set the corresponding field key to "fvr" and the corresponding field value to "1".

[0062] The configured target database information includes the target database table and structure. The configured inserted target data table and its related field information include the table and field where the data tag inverted index data is inserted, the field name of the specified key storage and the value field name of the RoaringBitmap type.

[0063] In the configuration module 11, when the configuration is completed, the configured source data table and its tag-related information for building the inverted index are loaded, and the source data table, user primary key, tag, tag data type, tag specific key and corresponding value that need to implement the inverted index are specifically obtained. These loaded configuration information are used for subsequent data reading and processing.

[0064] In the embodiment, the data processing module 12 is used to read medical data from the source database according to the configured relevant information, and process and assemble the read medical data into a form suitable for the data tag inverted index as the assembly result data.

[0065] Specifically, medical data is read from the source database according to the configured relevant information, including full data reading and incremental data reading.

[0066] For full data reading, a source JDBC connection is generated based on the source database information, and SQL statements are generated based on the source data table and the label-related information for building the inverted index. Medical data is read from the source database connected to the JDBC based on the SQL statements. For example, the constructed SQL statement is "select user ID from table name where sex=1", or "select user ID from table name where sex='male'", and the user primary key, that is, the user ID, is read based on these SQL statements.

[0067] Incremental data reading includes kafka synchronous reading, primary key incremental reading, and time incremental reading. Among them, kafka synchronous reading refers to kafka synchronous reading. According to the configuration information, kafka monitors the topic messages in real time, parses the messages according to the table and label, obtains the table and table name, and searches the table according to the label to determine the field information and its corresponding medical data that need to be inverted indexed, and establishes two layers of key-value pair objects, in which the key in the inner key-value pair is the column field, and the value is the medical data corresponding to the column, and the key in the outer key-value pair is the table name, and the value is the column key-value pair data set corresponding to the table;

[0068] Incremental primary key reading means reading the incremental primary key field and the starting point of the primary key in the temporary table, obtaining the field information that needs to be inverted indexed based on the label in the temporary table and splicing it into the query statement, detecting the newly added data in the source table in real time based on the query statement, and reading the medical data whose primary key is greater than the starting point from the source table;

[0069] Time increment reading refers to reading the table increment time field and start time value in the temporary table, obtaining the field information in the temporary table that needs to implement the inverted index determined by the label and splicing it into the query statement, detecting the data in the source table in real time based on the query statement, and reading the medical data from the starting point corresponding to the start time value.

[0070] Specifically, the read medical data is processed and assembled into a form suitable for data tag inverted index and used as assembly result data, including the processing and assembly of full data and the processing and assembly of incremental data.

[0071] For the processing and assembly of the full data, the source data table information of the full read is obtained, and a set of original key-value pairs consisting of field keys and field values ​​corresponding to the labels are obtained from it. The user primary key set corresponding to each field value is assembled into a new key-value pair with the label as the new key and the user primary key set as the new value. The new key-value pair is stored in the source data table information to form an object with two layers of key-value pairs, namely the original key-value pair and the new key-value pair. The object is in a form suitable for the inverted index of the data label. The medical data read in full are all used as newly added grouped data.

[0072] The processing and assembly of incremental data specifically include data analysis, data inversion, and data integration. Data analysis refers to the content analysis of the analysis results of the kafka synchronous reading step to obtain data flags, where data flags include new flags (I), modification flags (U), and deletion flags (D). The corresponding new data, modified data, and deleted data are determined based on the data flags; all data read based on the primary key increment are considered to be new data; and among the data read based on the time increment, except for the deleted data marked by the deletion flag (IS_DELETE) as 1, the rest of the data are considered to be modified data.

[0073] Data inversion includes: (1) Add operation, that is, grouping the newly added data according to the configured tags according to the field values ​​corresponding to the tags, and dividing them into newly added groups. All newly added data are added to the newly added groups; (2) Modify operation, that is, grouping the modified data according to the configured tags (these fields are generally confirmed by filtering) according to the field values ​​corresponding to the fields, specifically divided into newly added groups corresponding to when there is new data and deleted groups corresponding to when there is deleted data. The data in the newly added groups and deleted groups are marked with the configured tags, and the value is the user primary key corresponding to the field value. For example, the field data corresponding to the tag man is "user ID is 1, gender is male", and the data in the newly added group is "man: 1". The deleted data is grouped according to the configured tags according to the field values ​​corresponding to the tags, and divided into deleted groups. The data in the deleted groups are marked with the configured tags, and the value is the user primary key corresponding to the field value. For example, the data corresponding to the configured tag woman is "user ID is 1, gender is female", and the data in the deleted group is "woman:1".

[0074] Data integration refers to integrating data according to the labels (such as man, woman, etc.) corresponding to the field values ​​in the group and the data grouping to obtain a set of user primary keys as a form suitable for data label inverted index.

[0075] In the embodiment, the data storage module 13 is used to store the assembly result data in the target end data table based on the RoaringBitmap, specifically including reading the configured target end data table and its related field information, and performing the following data operations on the assembly result data according to the data grouping and the key of each field in the grouping:

[0076] Add data in the target data table, and query whether there is corresponding data for the key of each field in the assembly result data according to the relevant field information in the target data table. If there is no corresponding data, add a new data in the target data table. If there is corresponding data, add the user primary key in the group to the original RoaringBitmap data.

[0077] Delete in the target data table, query in the target data table whether there is corresponding data for the key of each field in the assembly result data according to the relevant field information, if there is no corresponding data, do not operate, if there is corresponding data, delete the user primary key in the group on the original RoaringBitmap primary key data.

[0078] In the embodiment, the update breakpoint module 14 is used to update the data breakpoint and read the data, specifically including: after the RoaringBitmap tag inverted index is built in the Kafka synchronization mode, that is, after the data storage is successfully completed, the offset is manually updated to record the consumption progress. If the data construction is interrupted, the data is read from the recorded progress;

[0079] After the primary key incremental data is successfully stored in the database, check whether there is a breakpoint record stored in the temporary table. If not, insert a primary key breakpoint data and save it. If yes, update the user primary key of the data in the breakpoint record. If the data construction is interrupted, re-read the data from the breakpoint record position.

[0080] After the time increment data is successfully stored in the database, the temporary table is queried to see whether there is a breakpoint record stored. If not, a time breakpoint data is inserted. If so, the time value of the data in the breakpoint record is updated. If the data construction is interrupted, the data is read again from the breakpoint record position.

[0081] like Figure 2 As shown, the embodiment also provides a data query method based on a dynamically configured tag inverted index, comprising the following steps:

[0082] The configuration module 11 is used to configure the relevant information of the inverted index construction task of the data label, including configuring three incremental data reading methods: kafka synchronization method, primary key incremental method, and time incremental method;

[0083] After the task configuration is completed, the data processing module 12 is used to read the medical data from the source database according to the configured relevant information, and the read medical data is processed and assembled into a form suitable for label indexing, that is, assembled into a Bitmap format as the assembly result data;

[0084] Using the data storage module 13 to store the assembly result data in the target end data table based on the RoaringBitmap;

[0085] The data breakpoints are updated and data reading is performed using the update breakpoint module 14 .

[0086] The advantages of the above device and method are that there is no need to convert the vertical table data into horizontal table data, thus avoiding the complexity and high cost of data structure conversion. At the same time, it is highly adaptable to changes in vertical table data and types, and does not require frequent adjustment of the data structure, greatly saving the labor cost consumed in the data construction and conversion process.

[0087] In addition, the label inverted index is used to quickly locate personnel information, which improves the speed of data retrieval and analysis, ensuring that the query needs of large-scale medical data can be efficiently responded to. Ultimately, this solution achieves the purpose of simplifying the data processing process, improving retrieval efficiency, reducing maintenance costs, and enhancing system flexibility, providing an efficient, reliable, and easy-to-maintain solution for medical data management.

[0088] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A data query device based on dynamically configured label inverted index, characterized in that: It includes configuration module, data processing module and data storage module; The configuration module is used to visualize the relevant information of the inverted index task of configuring the data tag, including source database information, incremental data reading method, source data table and tag-related information of the inverted index, target database information, and inserted target data table and related field information; The data processing module is used to read medical data from the source database according to the configured relevant information, and process and assemble the read medical data into a form suitable for the data tag inverted index as the assembly result data; The data storage module is used to store the assembly result data in the target end data table based on RoaringBitmap.

2. The data query device based on dynamically configured label inverted index according to claim 1, characterized in that: The incremental data reading method includes Kafka synchronization method, primary key incremental method, and time incremental method; The source data table and the tag-related information for constructing the inverted index, including the source data table, the user primary key, the tag that needs to complete the inverted index, the data type of the tag, and the field key and field value corresponding to the tag; The inserted target data table and its related field information include the table and field where the data tag inverted index data is inserted, the field name of the specified key storage and the value field name of the RoaringBitmap type.

3. The data query device based on dynamically configured label inverted index according to claim 1, characterized in that: The reading of medical data from the source database according to the configured relevant information includes: Full data reading, specifically generating a source JDBC connection based on the source database information, generating SQL statements based on the source data table and its tag-related information for building an inverted index, and reading medical data from the source database connected to the JDBC based on the SQL statements.

4. The data query device based on dynamically configured label inverted index according to claim 1, characterized in that: The reading of medical data from the source database according to the configured relevant information includes: Incremental data reading, including Kafka synchronous reading, primary key incremental reading, and time incremental reading; For Kafka synchronous reading, Kafka monitors topic messages in real time according to the configuration information, and parses the messages according to the table and label, obtains the table and table name, and searches the table to determine the field information and corresponding medical data that need to be inverted indexed according to the label, and establishes two layers of key-value pair objects, where the key in the inner key-value pair is the column field, and the value is the medical data corresponding to the column, and the key in the outer key-value pair is the table name, and the value is the column key-value pair data set corresponding to the table; For incremental reading of primary keys, read the incremental primary key field and the starting point of the primary key in the temporary table, obtain the field information that needs to be inverted indexed based on the label in the temporary table and splice it into the query statement, detect the newly added data in the source table in real time based on the query statement, and read the medical data whose primary key is greater than the starting point from the source table; For time increment reading, read the table increment time field and start time value in the temporary table, obtain the field information in the temporary table that needs to implement the inverted index determined by the label and splice it into the query statement, detect the data in the source table in real time based on the query statement, and read the medical data from the starting point corresponding to the start time value.

5. The data query device based on dynamically configured label inverted index according to claim 3 is characterized in that: The processing and assembling of the read medical data into a form suitable for data tag inverted indexing includes: The processing and assembly of the full data specifically involves obtaining the source data table information of the full read, and obtaining a set of original key-value pairs consisting of field keys and field values ​​corresponding to the labels, assembling the user primary key set corresponding to each field value into a new key-value pair with the label as the new key and the user primary key set as the new value, and storing the new key-value pair in the source data table information to form an object with two layers of key-value pairs, namely the original key-value pair and the new key-value pair. The object is in a form suitable for the inverted index of the data label, and the medical data read in full are all used as newly added grouped data.

6. The data query device based on dynamically configured label inverted index according to claim 4, characterized in that: The processing and assembling of the read medical data into a form suitable for data tag inverted indexing includes: Processing and assembly of incremental data, including data analysis, data inversion, and data integration; For data analysis, the analysis results of the kafka synchronous reading step are further analyzed to obtain data flags, where data flags include new flags, modified flags, and deleted flags. The corresponding new data, modified data, and deleted data are determined based on the data flags; all data read based on the primary key increment are considered new data; among the data read based on the time increment, except for the deleted data marked by the delete flag, the rest of the data are considered modified data; For data inversion, it specifically includes grouping the newly added data according to the configured tags and the corresponding field values ​​of the tags, and dividing them into newly added groups, and adding all the newly added data into the newly added groups; grouping the modified data according to the configured tags and the corresponding field values ​​of the fields, specifically divided into newly added groups corresponding to the presence of newly added data and deleted groups corresponding to the presence of deleted data; grouping the deleted data according to the configured tags and the corresponding field values ​​of the tags, and dividing them into deleted groups; marking the data in all data groups with the key of the configured tag and the value of the user primary key corresponding to the field value; For data integration, data integration is performed specifically according to the labels and data groups corresponding to the field values ​​in the group, and a set of user primary keys is obtained as a form suitable for data label inverted index.

7. The data query device based on dynamically configured label inverted index according to claim 1, characterized in that: The method of storing the assembly result data in the target end data table based on RoaringBitmap includes: Read the configured target data table and its related field information, and perform the following data operations on the assembled result data according to the data grouping and the key of each field in the grouping: Add data in the target data table, and query whether there is corresponding data for the key of each field in the assembly result data according to the relevant field information in the target data table. If there is no corresponding data, add a new data in the target data table. If there is corresponding data, add the user primary key in the group to the original RoaringBitmap data. Delete in the target data table, query in the target data table whether there is corresponding data for the key of each field in the assembly result data according to the relevant field information, if there is no corresponding data, do not operate, if there is corresponding data, delete the user primary key in the group on the original RoaringBitmap primary key data.

8. The data query device based on dynamically configured label inverted index according to claim 1, characterized in that: It also includes an update breakpoint module, which is used to update data breakpoints and read data, specifically including: In the Kafka synchronization mode, the RoaringBitmap tag inverted index is built, that is, after the data is successfully stored in the warehouse, the offset is manually updated to record the consumption progress. If the data construction is interrupted, the data is read from the recorded progress; After the primary key incremental data is successfully stored in the database, check whether there is a breakpoint record stored in the temporary table. If not, insert a primary key breakpoint data and save it. If yes, update the user primary key of the data in the breakpoint record. If the data construction is interrupted, re-read the data from the breakpoint record position. After the time increment data is successfully stored in the database, the temporary table is queried to see whether there is a breakpoint record stored. If not, a time breakpoint data is inserted. If so, the time value of the data in the breakpoint record is updated. If the data construction is interrupted, the data is read again from the breakpoint record position.

9. A data query method based on dynamically configured label inverted index, characterized in that: Using the device according to any one of claims 1 to 8, the method comprises the following steps: Use the configuration module to configure the inverted index of data labels to build the relevant information of the task; Using the data processing module to read medical data from the source database according to the configured relevant information, and processing and assembling the read medical data into a form suitable for label indexing as assembly result data; The data storage module is used to store the assembly result data in the target data table based on RoaringBitmap.

10. The data query method based on dynamically configured label inverted index according to claim 9, characterized in that: The method further includes: using the update breakpoint module to update the data breakpoint and perform data reading.