A method, device, medium and electronic device for constructing a search engine index
By using snapshot recovery and differential data processing technologies during the search engine index construction process, the problem of too long index construction in the existing technology is solved, and the search engine index is quickly constructed and the system performance is improved.
Patent Information
- Application Number
- CN202111665813.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2041-12-31
AI Technical Summary
In the prior art, it takes too long to build search engine indexes, especially when massive medical data is imported, resulting in too long index construction time and affecting online search requests.
By obtaining the medical data of the first and second versions, the search engine index library corresponding to the first version data is restored using snapshots, and the difference data is determined at the same time. Determine whether there is a search engine index corresponding to the user to which the difference data belongs, update if it exists, and generate a new index if it does not exist.
This method can significantly save search engine index construction time, improve build speed, and reduce the impact on online search requests.
Smart Images

Figure CN114496141B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data storage, and in particular to a method, device, medium and electronic device for constructing a search engine index. Background Art
[0002] With the development of electronic information technology, big data has also developed rapidly and is playing an increasingly important role in people's lives. Medical big data is of great significance for precision medicine, disease risk control and early warning. Medical data search can quickly locate patients and medical records, helping doctors and patients quickly obtain the data they need.
[0003] In the prior art, all medical data are exported from the medical database, preprocessed by the search service, and then sent to the search engine using a database building script on the spark platform (a fast search engine designed specifically for big data) to generate a search engine index. Medical data search can be achieved based on the search engine index.
[0004] It takes a very long time to build a search engine index using existing technical solutions, because a patient's visit to a hospital may generate a large amount of medical data (such as a large number of test records, consultation records, medication records, etc.), which shows that the total amount of medical data is very large. Since the search engine itself can only handle a limited number of concurrent database writing tasks, the import of massive amounts of medical data causes the search engine index to take too long to build. In addition, when the search engine index is updated, the update amount is also too large, causing the search engine load to increase, which in turn affects online search requests. Summary of the invention
[0005] The present invention provides a method, device, storage medium and electronic device for constructing a search engine index, so as to at least solve the above technical problems existing in the prior art.
[0006] One aspect of the present invention provides a method for constructing a search engine index, the method comprising:
[0007] Acquire a first version of medical data and a second version of medical data, wherein the recording date of the first version of medical data is earlier than the recording date of the second version of medical data; the first version of medical data includes a plurality of first user data, and the second version of medical data includes a plurality of second user data;
[0008] Restoring the search engine index library corresponding to the first version of the medical data through a snapshot, and determining that the second user data that is different from the first user data is differential data;
[0009] When the total number of differential data is less than a preset threshold, wait until the search engine index library is restored, and determine whether there is a search engine index corresponding to the user to which the differential data belongs in the search engine index library;
[0010] If it exists, deleting the first user data of the user from the search engine index corresponding to the user, and writing the differential data of the user into the search engine index corresponding to the user;
[0011] If it does not exist, a new search engine index is generated, and the differential data of the user is written into the new search engine index.
[0012] In one embodiment, the method further comprises:
[0013] If the total number of the differential data is greater than or equal to a preset threshold, the recovery of the search engine index library is stopped, and a search engine index library corresponding to the second version of the medical data is generated.
[0014] In one possible implementation, the first user data or the second user data includes basic data of the user and at least one medical record data.
[0015] In one possible implementation manner, determining that the second user data that is different from the first user data is differential data includes:
[0016] According to the first version of medical data and the second version of medical data, determining that the second user data of the newly added user in the second version of medical data is differential data;
[0017] According to the first version of medical data and the second version of medical data, second user data of the same user that is different from the first user data is determined to be differential data.
[0018] In one possible implementation manner, determining that second user data of the same user that is different from first user data is differential data includes:
[0019] Aggregating basic data and at least one case data in the first user data of the user to obtain first aggregated data, wherein the first aggregated data includes a plurality of fields;
[0020] Aggregating the basic data and at least one case data in the second user data of the user to obtain second aggregated data, wherein the second aggregated data includes a plurality of fields;
[0021] Sorting the fields in the first aggregated data and the second aggregated data according to a preset order;
[0022] Converting the sorted first aggregated data into first plain text data, and converting the sorted second aggregated data into second plain text data;
[0023] It is determined whether the first user data and the second user data of the user are the same according to the first plain text data and the second plain text data corresponding to the user.
[0024] In one possible implementation manner, determining whether the first user data and the second user data of the user are the same according to the first plain text data and the second plain text data corresponding to the user includes:
[0025] Respectively obtain character strings corresponding to the first plain text data and the second plain text data;
[0026] If the character string of the first plain text data is not equal to the character string of the second plain text data, it is determined that the first user data and the second user data of the user are different, and the second user data of the user is differential data.
[0027] Another aspect of the present invention provides a search engine index construction device, the device comprising:
[0028] An acquisition module, configured to acquire a first version of medical data and a second version of medical data, wherein the recording date of the first version of medical data is earlier than the recording date of the second version of medical data; the first version of medical data includes a plurality of first user data, and the second version of medical data includes a plurality of second user data;
[0029] a determination module, configured to restore the search engine index library corresponding to the first version of the medical data through a snapshot, and determine that the second user data that is different from the first user data is differential data;
[0030] A judgment module, used for, when the total number of differential data is less than a preset threshold, waiting for the search engine index library to be restored, determining whether there is a search engine index corresponding to the user to which the differential data belongs in the search engine index library;
[0031] an updating module, configured to determine if a search engine index corresponding to the user to which the differential data belongs exists in the search engine index library, delete the first user data of the user from the search engine index corresponding to the user, and write the differential data of the user into the search engine index corresponding to the user;
[0032] The first building module is used to determine that if there is no search engine index corresponding to the user to which the differential data belongs in the search engine index library, a new search engine index is generated, and the differential data of the user is written into the new search engine index.
[0033] In one embodiment, the device further comprises:
[0034] The second construction module is used to determine if the total number of differential data is greater than or equal to a preset threshold, then stop restoring the search engine index library and generate a search engine index library corresponding to the second version of the medical data.
[0035] In one possible implementation, the first user data or the second user data includes basic data of the user and at least one medical record data.
[0036] In one possible implementation, the determining module includes:
[0037] A first determining unit, configured to determine, based on the first version of medical data and the second version of medical data, that second user data of a newly added user in the second version of medical data is differential data;
[0038] The second determining unit is used to determine, based on the first version of the medical data and the second version of the medical data, that second user data of the same user that is different from the first user data is differential data.
[0039] In one possible implementation manner, the second determining unit is specifically configured to:
[0040] Aggregating basic data and at least one case data in the first user data of the user to obtain first aggregated data, wherein the first aggregated data includes a plurality of fields;
[0041] Aggregating the basic data and at least one case data in the second user data of the user to obtain second aggregated data, wherein the second aggregated data includes a plurality of fields;
[0042] Sorting the fields in the first aggregated data and the second aggregated data according to a preset order;
[0043] Converting the sorted first aggregated data into first plain text data, and converting the sorted second aggregated data into second plain text data;
[0044] It is determined whether the first user data and the second user data of the user are the same according to the first plain text data and the second plain text data corresponding to the user.
[0045] In one possible implementation manner, determining whether the first user data and the second user data of the user are the same according to the first plain text data and the second plain text data corresponding to the user includes:
[0046] Respectively obtain character strings corresponding to the first plain text data and the second plain text data;
[0047] If the character string of the first plain text data is not equal to the character string of the second plain text data, it is determined that the first user data and the second user data of the user are different, and the second user data of the user is differential data.
[0048] Another aspect of the present invention provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the method for constructing a search engine index described in the present invention.
[0049] Another aspect of the present invention provides an electronic device, comprising:
[0050] processor;
[0051] a memory for storing instructions executable by the processor;
[0052] The processor is used to read the executable instructions from the memory and execute the instructions to implement the search engine index construction method described in the present invention.
[0053] In the above scheme of the present invention, by obtaining the first version of medical data and the second version of medical data, when restoring the search engine index library corresponding to the first version of medical data, the differential data between the first version of medical data and the second version of medical data is determined at the same time. The restoration of the search engine index library and the determination of the differential data are carried out simultaneously, which can save the time of search engine index construction; in addition, different search engine index construction methods are determined according to the data volume of the differential data. If the total number of differential data is less than the preset threshold, after the search engine index library is restored, it is determined whether there is a search engine index corresponding to the user to which the differential data belongs in the search engine index library. If so, the first user data of the user is deleted from the search engine index corresponding to the user, and the differential data of the user is written into the search engine index corresponding to the user; if not, a new search engine index is generated, and the differential data of the user is written into the new search engine index. The search engine index construction method of the present invention has the effect of fast construction speed and short construction time. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A schematic diagram showing a flow chart of a method for constructing a search engine index provided by an embodiment of the present invention;
[0055] Figure 2 A schematic diagram showing a flow chart of a method for constructing a search engine index provided by another embodiment of the present invention;
[0056] Figure 3 A schematic diagram showing the structure of a search engine index construction device provided by an embodiment of the present invention;
[0057] Figure 4 A schematic structural diagram of a search engine index construction device provided by another embodiment of the present invention is shown;. DETAILED DESCRIPTION
[0058] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0059] like Figure 1 A schematic diagram of a process for constructing a search engine index provided by the present invention is shown, and the construction method includes:
[0060] Step S101, obtaining a first version of medical data and a second version of medical data, wherein the recording date of the first version of medical data is earlier than the recording date of the second version of medical data; the first version of medical data includes multiple first user data, and the second version of medical data includes multiple second user data.
[0061] For example, the first version of medical data is the data of December 1, 2021, that is, it records the medical data of all patients in a hospital as of December 1, 2021; the second version of medical data is the data of December 5, 2021, that is, it records the medical data of all patients in a hospital as of December 5, 2021. The first version of medical data and the second version of medical data are both stored in a medical database or backed up in a distributed file system (HDFS). The method for obtaining the first version of medical data and the second version of medical data in this embodiment can be obtained from the medical database, or the backed up first version of medical data and second version of medical data can be restored through snapshots. The present invention does not limit the specific method for obtaining the first version of medical data and the second version of medical data.
[0062] The first version of medical data includes multiple first user data, and the second version of medical data includes multiple second user data. All data generated by the user during a hospital visit is user data, and the total number of second user data is not less than the total number of first user data.
[0063] Step S102: restore the search engine index library corresponding to the first version of the medical data through a snapshot, and at the same time determine that the second user data that is different from the first user data is differential data.
[0064] In order to avoid building a search engine index based on the full amount of second user data in the second version of the medical data, which would result in a long search engine index building time, the search engine index library corresponding to the first version of the medical data is first restored through a snapshot. Since the restoration of the search engine index library takes time, the restoration of the search engine index library and the determination of the differential data are performed simultaneously, thereby saving the time for search engine index construction.
[0065] The second user data that is different from the first user data is determined to be differential data. For example, if the second version of the medical data on December 5, 2021 is compared with the first version of the medical data on December 1, 2021, there is a difference between the second user data and the first user data. In this case, the second user data is differential data. The differential data includes data generated by new users from December 1, 2021 to December 5, 2021 and data generated by the same user visiting the hospital twice or more times.
[0066] Step S103: when the total number of differential data is less than a preset threshold, wait until the search engine index library is restored, and determine whether there is a search engine index corresponding to the user to which the differential data belongs in the search engine index library.
[0067] If a second user data is different from the first user data, then the second user data is a differential data. Assuming the preset threshold is 2000, if there are 1500 second user data that are different from the first user data, then there are 1500 differential data. Since the total number of differential data is less than the preset threshold, wait for the search engine index library to be restored. The search engine index library includes multiple search engine indexes. A search engine index includes multiple data of multiple users. After the search engine index library is restored, determine whether there is a search engine index corresponding to the user to which the differential data belongs in the search engine index library. Assuming that the user to which one of the differential data belongs is user A, determine whether there is a search engine index corresponding to user A in the search engine index library.
[0068] Step S104: If it exists, then delete the first user data of the user from the search engine index corresponding to the user, and write the differential data of the user into the search engine index corresponding to the user.
[0069] If there is a search engine index corresponding to user A in the search engine index library, since the second user data of user A is different from the first user data, the first user data of user A is deleted from the search engine index corresponding to user A, and the differential data of user A, i.e., the second user data of user A, is written into the search engine index corresponding to user A.
[0070] Step S105: If it does not exist, generate a new search engine index and write the user's differential data into the new search engine index.
[0071] If the search engine index corresponding to user A does not exist in the search engine index library, a new search engine index is generated, and the differential data of user A, that is, the second user data of user A, is written into the new search engine index.
[0072] In this embodiment, the search engine may be ES (Elastic Search is a search server based on Lucene), and the search engine index is an ES index.
[0073] In the above scheme of the present invention, by obtaining the first version of medical data and the second version of medical data, when restoring the search engine index library corresponding to the first version of medical data, the differential data between the first version of medical data and the second version of medical data is determined at the same time. The restoration of the search engine index library and the determination of the differential data are carried out simultaneously, which can save the time of search engine index construction; in addition, different search engine index construction methods are determined according to the data volume of the differential data. If the total number of differential data is less than the preset threshold, after the search engine index library is restored, it is determined whether there is a search engine index corresponding to the user to which the differential data belongs in the search engine index library. If so, the first user data of the user is deleted from the search engine index corresponding to the user, and the differential data of the user is written into the search engine index corresponding to the user; if not, a new search engine index is generated, and the differential data of the user is written into the new search engine index. Compared with the prior art of constructing a search engine index using full medical data (all medical data of all patients in a hospital), the search engine index construction method of the present invention has the effect of fast construction speed and short construction time.
[0074] In one example, in step S101, the first user data or the second user data includes basic data of the user and at least one medical record data.
[0075] Among them, user data is data representing user personal information, such as user name, age, gender, height, weight, ID number, medical card number, etc.; the first user data or the second user data includes at least one medical record data, for example, if a user visits a hospital once, one medical record data is generated, and if the user visits the hospital multiple times, multiple medical record data are generated accordingly. Each medical record data includes medical data related to the user, such as medical diagnosis, test results, examination results, medication records, etc. generated when the user visits the hospital.
[0076] The first user data or the second user data also includes information such as version records (data_version). For example, the version record of user A’s first user data on December 1, 2021 is 20211201, and the version record of user A’s second user data on December 5, 2021 is 20211205.
[0077] In one example, in step S102, determining that the second user data that is different from the first user data is differential data includes:
[0078] According to the first version of medical data and the second version of medical data, determining that the second user data of the newly added user in the second version of medical data is differential data;
[0079] According to the first version of medical data and the second version of medical data, second user data of the same user that is different from the first user data is determined to be differential data.
[0080] In one example, the second user data of the newly added user in the second version of the medical data is differential data, including:
[0081] Comparing the first version of medical data with the second version of medical data to determine a newly added user;
[0082] It is determined that the second user data of the newly added user is differential data.
[0083] For example, by comparing the ID card number or medical card number of the user in the first version of medical data with the second version of medical data, it is determined which users in the second version of medical data are new users. New users are users that do not exist in the first version of medical data. The user is the first user to visit the hospital between the recording time of the first version of medical data and the recording time of the second version of medical data. The second user data of the user is differential data. For example, a user visited the hospital for the first time between December 1, 2021 and December 5, 2021, and the second user data generated by the user is differential data.
[0084] For example, during the time period between the second version of medical data and the first version of medical data, the first user data and second user data corresponding to some users have not changed. For example, a user did not visit the hospital between December 1, 2021 and December 5, 2021, and the basic data and medical record data generated in the hospital have not changed. In this case, the first user data of the user is the same as the second user data. Some users have visited the hospital once or more between December 1, 2021 and December 5, 2021. Each visit of the user will generate corresponding second user data. The data content in the basic data and medical record data in the second user data is added or changed compared with the basic data and medical record data in the first user data of the user. Assuming that the user has added test indicators and generated new test results, or the data of a certain indicator in the test results has changed, the second user data of the user will be different from the first user data. Therefore, the second user data of the user is determined to be differential data.
[0085] For example, the first user data corresponding to user A in the first version of medical data is: weight is 65kg, and the test results are high blood sugar and high blood lipids. The second user data corresponding to user A in the second version of medical data is: weight is 63kg, and the test results are normal blood sugar and normal blood lipids. Then the second user data of user A is differential data. For example, the first user data corresponding to user B in the first version of medical data does not include blood pressure test results. The second user data corresponding to user B in the second version of medical data adds blood pressure test results, resulting in differences between the second user data of user B and the first user data. Therefore, the second user data of user B is differential data. For example, user C is a newly added user in the second version of medical data, and the second user data generated by user C is differential data, where the newly added user C can visit the hospital once or multiple times.
[0086] In one example, determining that second user data of the same user that is different from first user data is differential data includes:
[0087] Aggregating basic data and at least one case data in the first user data of the user to obtain first aggregated data, wherein the first aggregated data includes a plurality of fields;
[0088] Aggregating the basic data and at least one case data in the second user data of the user to obtain second aggregated data, wherein the second aggregated data includes a plurality of fields;
[0089] Sorting the fields in the first aggregated data and the second aggregated data according to a preset order;
[0090] Converting the sorted first aggregated data into first plain text data, and converting the sorted second aggregated data into second plain text data;
[0091] It is determined whether the first user data and the second user data of the user are the same according to the first plain text data and the second plain text data corresponding to the user.
[0092] For example, the same user in the first version of medical data and the second version of medical data is determined based on an account that uniquely identifies the user, such as using the user's ID number or the medical card number when visiting the doctor to identify the same user, and the present invention does not limit this. Taking user A as an example, the basic data and at least one case data in the first user data of user A in the first version of medical data are aggregated to obtain the first aggregated data. Since the first user data of user A includes basic data and medical record data, the first aggregated data includes multiple fields. The basic data and at least one case data in the second user data of user A in the second version of medical data are aggregated to obtain the second aggregated data, and the second aggregated data also includes multiple fields. The first aggregated data and the second aggregated data are sorted in a preset order, for example, the preset order is name, age, gender, medical diagnosis, test results, examination results, and medication information. The first aggregated data and the second aggregated data are arranged in the above preset order to obtain the sorted first aggregated data and the sorted second aggregated data. It should be noted that the fields included in the preset order are all fields (i.e., all fields involved in the user data), while the fields in the first aggregated data or the second aggregated data of a certain user may be all fields or only some fields (for example, if the user has not undergone surgery, then the values of the surgery-related fields in the first aggregated data or the second aggregated data are empty, or do not include these fields). The present invention sorts the fields of the first aggregated data and the second aggregated data in order to improve the accuracy of the comparison between the first aggregated data and the second aggregated data of the same user, thereby accurately determining whether the first user data and the second user data of the same user are the same.
[0093] The sorted first aggregated data is converted into first plain text data, and the sorted second aggregated data is converted into second plain text data. Since the comparison between plain text data is more convenient, converting the sorted aggregated data into plain text data is conducive to improving the accuracy and efficiency of comparison. Then, according to the first plain text data and the second plain text data corresponding to the same user, it is determined whether the first user data and the second user data of the same user are the same.
[0094] In one example, determining whether the first user data and the second user data of the user are the same according to the first plain text data and the second plain text data corresponding to the user includes:
[0095] Respectively obtain character strings corresponding to the first plain text data and the second plain text data;
[0096] If the character string of the first plain text data is not equal to the character string of the second plain text data, it is determined that the first user data and the second user data of the user are different, and the second user data of the user is differential data.
[0097] For example, the first plain text data and the second plain text data are shortened and simplified into a string by a hash algorithm, and the first plain text data and the second plain text data are used as inputs of the hash algorithm. After calculation by the hash algorithm, a hash value corresponding to the first plain text data and a hash value corresponding to the second plain text data are output, wherein the hash value is a string. If the hash value corresponding to the first plain text data is the same as the hash value corresponding to the second plain text data, it means that the contents of the first plain text data and the second plain text data are consistent, that is, the first user data and the second user data of the same user in the second version of the medical data and the first version of the medical data are the same; if the hash value corresponding to the first plain text data is different from the hash value corresponding to the second plain text data, it means that the contents of the first plain text data and the second plain text data are different, that is, the first user data and the second user data of the same user in the second version of the medical data and the first version of the medical data are different, and the difference includes the addition or change of the second user data of the user, such as the addition of a test indicator, the change of the diagnosis result, etc., so it is determined that the second user data of the user is differential data. In addition to the hash algorithm, the present invention can also use the MD5 algorithm, etc., and the present invention does not limit this.
[0098] In one example, before sorting the fields in the first aggregated data and the second aggregated data according to a preset order, the method further includes:
[0099] The interference fields in the first aggregated data and the second aggregated data are deleted.
[0100] The data content in the user data that is irrelevant to the construction of the search engine index is an interference field and needs to be deleted, such as the version record (data_version) included in the first user data or the second user data. Before sorting the fields in the first aggregated data and the second aggregated data, delete such interference fields. Because the version record of the first user data is inconsistent with the version record of the second user data, the existence of such interference fields will, on the one hand, prolong the time for comparing the first aggregated data with the second aggregated data; on the other hand, due to the different data in the version records, even if the basic data and medical record data of some users have not changed, the first aggregated data and the second aggregated data will be different after comparison, reducing the accuracy of the comparison results. Therefore, deleting the interference fields is conducive to improving the accuracy and speed of comparing the first aggregated data with the second aggregated data.
[0101] After all the differential data in the second version of the medical data are determined by the above method, when the total number of differential data is less than the preset threshold, wait until the search engine index library is restored, and determine whether there is a search engine index corresponding to the user to which the differential data belongs in the search engine index library. If there is, delete the first user data of the user from the search engine index corresponding to the user, and write the differential data of the user into the search engine index corresponding to the user; if there is not, generate a new search engine index, and write the differential data of the user into the new search engine index.
[0102] like Figure 2 A method for constructing a search engine index provided by another embodiment of the present invention is shown, and the method further includes:
[0103] Step S106: If the total number of the differential data is greater than or equal to a preset threshold, the recovery of the search engine index library is stopped, and a search engine index library corresponding to the second version of the medical data is generated.
[0104] Assuming the preset threshold is 2000, if the total number of differential data exceeds 2000, the search engine index library recovery will be stopped, because the amount of differential data is large, and continuing to recover the search engine index library will reduce the efficiency of search engine index construction. Therefore, the search engine index is built with the full amount of second-version medical data, all second-version medical data is imported into the search engine search server, and the search engine index corresponding to the second-version medical data is generated by submitting spark tasks.
[0105] like Figure 3 The present invention shows a search engine index construction device, which includes:
[0106] An acquisition module 201 is used to acquire a first version of medical data and a second version of medical data, wherein the recording date of the first version of medical data is earlier than the recording date of the second version of medical data; the first version of medical data includes a plurality of first user data, and the second version of medical data includes a plurality of second user data;
[0107] A determination module 202 is used to restore the search engine index library corresponding to the first version of the medical data through a snapshot, and determine that the second user data that is different from the first user data is differential data;
[0108] The judgment module 203 is used to determine whether there is a search engine index corresponding to the user to which the differential data belongs in the search engine index library when the total number of differential data is less than a preset threshold value, after the search engine index library is restored;
[0109] An updating module 204 is configured to determine if a search engine index corresponding to the user to which the differential data belongs exists in the search engine index library, delete the first user data of the user from the search engine index corresponding to the user, and write the differential data of the user into the search engine index corresponding to the user;
[0110] The first construction module 205 is used to determine if there is no search engine index corresponding to the user to which the differential data belongs in the search engine index library, then generate a new search engine index and write the differential data of the user into the new search engine index.
[0111] like Figure 4 As shown, another embodiment of the present invention provides a device for constructing a search engine index, the device also includes:
[0112] The second construction module 206 is used to determine if the total number of the differential data is greater than or equal to a preset threshold, then stop restoring the search engine index library, and generate a search engine index library corresponding to the second version of the medical data.
[0113] In one example, the first user data or the second user data includes basic data of the user and at least one medical record data.
[0114] In one example, the determining module 202 includes:
[0115] A first determining unit, configured to determine, based on the first version of medical data and the second version of medical data, that second user data of a newly added user in the second version of medical data is differential data;
[0116] The second determining unit is used to determine, based on the first version of the medical data and the second version of the medical data, that second user data of the same user that is different from the first user data is differential data.
[0117] In an example, the second determining unit is specifically configured to:
[0118] Aggregating basic data and at least one case data in the first user data of the user to obtain first aggregated data, wherein the first aggregated data includes a plurality of fields;
[0119] Aggregating the basic data and at least one case data in the second user data of the user to obtain second aggregated data, wherein the second aggregated data includes a plurality of fields;
[0120] Sorting the fields in the first aggregated data and the second aggregated data according to a preset order;
[0121] Converting the sorted first aggregated data into first plain text data, and converting the sorted second aggregated data into second plain text data;
[0122] It is determined whether the first user data and the second user data of the user are the same according to the first plain text data and the second plain text data corresponding to the user.
[0123] In one example, determining whether the first user data and the second user data of the user are the same according to the first plain text data and the second plain text data corresponding to the user includes:
[0124] Respectively obtain character strings corresponding to the first plain text data and the second plain text data;
[0125] If the character string of the first plain text data is not equal to the character string of the second plain text data, it is determined that the first user data and the second user data of the user are different, and the second user data of the user is differential data.
[0126] Another aspect of the present invention provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the method for constructing a search engine index described in the present invention.
[0127] Another aspect of the present invention provides an electronic device, comprising:
[0128] processor;
[0129] a memory for storing instructions executable by the processor;
[0130] The processor is used to read the executable instructions from the memory and execute the instructions to implement the search engine index construction method described in the present invention.
[0131] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method according to various embodiments of the present application described in the above-mentioned "Exemplary Method" section of this specification.
[0132] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0133] In addition, an embodiment of the present application may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the method according to various embodiments of the present application described in the above "Exemplary Method" section of this specification.
[0134] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0135] The basic principles of the present application are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present application are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present application. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, not for limitation, and the above details do not limit the present application to being implemented by adopting the above specific details.
[0136] The block diagrams of the devices, apparatuses, equipment, and systems involved in this application are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The words "such as" used here refer to the phrase "such as but not limited to", and can be used interchangeably with them.
[0137] It should also be noted that in the apparatus, device and method of the present application, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present application.
[0138] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present application. Therefore, the present application is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0139] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present application to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A method for constructing a search engine index, characterized in that: The method comprises: Acquire a first version of medical data and a second version of medical data, wherein the recording date of the first version of medical data is earlier than the recording date of the second version of medical data; the first version of medical data includes a plurality of first user data, and the second version of medical data includes a plurality of second user data; Restoring the search engine index library corresponding to the first version of the medical data through a snapshot, and determining that the second user data that is different from the first user data is differential data; When the total number of the differential data is less than a preset threshold, wait until the search engine index library is restored, and determine whether there is a search engine index corresponding to the user to which the differential data belongs in the search engine index library; If it exists, deleting the first user data of the user from the search engine index corresponding to the user, and writing the differential data of the user into the search engine index corresponding to the user; If it does not exist, a new search engine index is generated, and the differential data of the user is written into the new search engine index; The method further comprises: If the total number of the differential data is greater than or equal to a preset threshold, the recovery of the search engine index library is stopped, and a search engine index library corresponding to the second version of the medical data is generated.
2. The method according to claim 1, characterized in that The first user data or the second user data includes basic data of the user and at least one medical record data.
3. The method according to claim 2, characterized in that Determining that second user data that is different from the first user data is differential data includes: According to the first version of medical data and the second version of medical data, determining that the second user data of the newly added user in the second version of medical data is differential data; According to the first version of medical data and the second version of medical data, second user data of the same user that is different from the first user data is determined to be differential data.
4. The method according to claim 3, characterized in that The step of determining that second user data of the same user that is different from the first user data is differential data includes: Aggregating basic data and at least one case data in the first user data of the user to obtain first aggregated data, wherein the first aggregated data includes a plurality of fields; Aggregating the basic data and at least one case data in the second user data of the user to obtain second aggregated data, wherein the second aggregated data includes a plurality of fields; Sorting the fields in the first aggregated data and the second aggregated data according to a preset order; Converting the sorted first aggregated data into first plain text data, and converting the sorted second aggregated data into second plain text data; It is determined whether the first user data and the second user data of the user are the same according to the first plain text data and the second plain text data corresponding to the user.
5. The method according to claim 4, characterized in that The determining, according to the first plain text data and the second plain text data corresponding to the user, whether the first user data and the second user data of the user are the same includes: Respectively obtain character strings corresponding to the first plain text data and the second plain text data; If the character string of the first plain text data is not equal to the character string of the second plain text data, it is determined that the first user data and the second user data of the user are different, and the second user data of the user is differential data.
6. A device for constructing a search engine index, characterized in that: The device includes: An acquisition module, configured to acquire a first version of medical data and a second version of medical data, wherein the recording date of the first version of medical data is earlier than the recording date of the second version of medical data; the first version of medical data includes a plurality of first user data, and the second version of medical data includes a plurality of second user data; a determination module, configured to restore the search engine index library corresponding to the first version of the medical data through a snapshot, and determine that the second user data that is different from the first user data is differential data; A judgment module, used for, when the total number of differential data is less than a preset threshold, waiting for the search engine index library to be restored, determining whether there is a search engine index corresponding to the user to which the differential data belongs in the search engine index library; an updating module, configured to determine if a search engine index corresponding to the user to which the differential data belongs exists in the search engine index library, delete the first user data of the user from the search engine index corresponding to the user, and write the differential data of the user into the search engine index corresponding to the user; A first construction module is used to determine that if there is no search engine index corresponding to the user to which the differential data belongs in the search engine index library, a new search engine index is generated, and the differential data of the user is written into the new search engine index; The device also includes: The second construction module is used to determine if the total number of differential data is greater than or equal to a preset threshold, then stop restoring the search engine index library and generate a search engine index library corresponding to the second version of the medical data.
7. A computer-readable storage medium storing a computer program, wherein the computer program is used to execute the search engine index construction method according to any one of claims 1 to 5.
8. An electronic device comprising: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the search engine index construction method described in any one of claims 1 to 5.
Citation Information
Patent Citations
Method, equipment and system for storing and acquiring medical information
CN101840412A
Quality control method and device for electronic medical record, electronic equipment and storage medium
CN113297853A