A relational database access method and platform
By querying the latest timestamp in the medical institution's information system and selecting the data source based on the comparison results, the performance problem caused by frequent access to relational databases was solved, resulting in improved system speed and efficiency.
Patent Information
- Application Number
- CN202410886583.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-07-03
AI Technical Summary
The information systems of medical institutions suffer from performance degradation and downtime due to frequent access to relational databases, and the existing unified API interface method has failed to effectively solve the problem of database access frequency.
Data requests are obtained through the interface, the latest timestamp is queried and compared with the timestamp in the document object repository, and the data is retrieved from the document object storage database or relational database based on the comparison result, reducing the frequency of access to the relational database.
Without increasing hardware, improve the operating speed of the information system, reduce the pressure on the database, and improve the system's operating efficiency and the work efficiency of medical staff.
Smart Images

Figure CN118820372B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of database access technology, and in particular to a relational database access method and platform. Background Technology
[0002] Medical institutions have a variety of information systems, and the data of these systems is scattered and stored in numerous relational databases. Data exchange is required between these systems. For example, if a doctor issues a CT scan order in the HIS system, the financial system, PACS system, CDR system, electronic medical record system, etc., all need to obtain the information of that CT scan order from the HIS system.
[0003] Currently, data integration mainly relies on one-to-one negotiation of interface solutions between various IT vendors, primarily through Web Services, HL7, and database views. As medical institutions develop their businesses, the number of such integration interfaces is increasing, leading to frequent access to the relational databases of various IT systems. Because relational databases contain a large number of table relationships, frequent access can cause database performance to degrade, slow down the operation of IT systems, or even cause them to crash.
[0004] Some medical institutions have established their own data integration platforms, providing a unified API interface. While this approach can unify the interface calling methods of various IT vendors, it does not solve the problem of the access frequency of relational databases. The IT system still suffers from performance issues caused by the frequent access to relational databases. Summary of the Invention
[0005] This application provides a relational database access method and platform to solve the problems existing in related technologies.
[0006] In a first aspect, the present invention provides a relational database access method, comprising: obtaining data requests from different caller business systems through an interface; querying the latest timestamp of the latest data from the relational database of the callee based on the request parameters in the data request; comparing the latest timestamp with existing timestamps in the document object repository to determine whether there is a timestamp in the document object repository that matches the latest timestamp; and obtaining access data from the document object storage database or the relational database of the callee based on the difference in the determination result.
[0007] Optionally, depending on the judgment result, retrieving access data from the document object storage database or the callee's relational database includes: if a timestamp consistent with the latest timestamp exists, retrieving access data from the document object storage database; if no timestamp consistent with the latest timestamp exists, retrieving access data from the callee's relational database.
[0008] Optionally, after retrieving access data from the document object storage database, the retrieved access data is formatted in a format consistent with the data in the relational database.
[0009] Optionally, the relational database stores the query records for the request in the form of documents in a document object repository. The query records include the request parameters, query results, and the latest timestamp corresponding to the query results. The query records are then compiled and stored in the document object repository. The compiled query records include the name of the relational database of the callee corresponding to the request, the interface name, and the request parameters as keys; the latest timestamp corresponding to the request parameters as a timestamp; and the query result data of the relational database of the callee as a value.
[0010] Optionally, after retrieving the access data from the callee's relational database, the query record is compiled and stored in the document object repository.
[0011] Secondly, the present invention provides a relational database access platform, including an API interface unit configured to obtain data requests from different caller business systems; a validator configured to query the latest timestamp of the latest data from the relational database of the callee based on the request parameters in the data request, and compare the latest timestamp with existing timestamps in the document object repository to determine whether there is a timestamp in the document object repository that matches the latest timestamp; and a traffic splitter configured to obtain access data from the document object storage database or the relational database of the callee based on the different judgment results.
[0012] Optionally, the splitter is configured to: if a timestamp consistent with the latest timestamp exists, retrieve access data from the document object storage database; if no timestamp consistent with the latest timestamp exists, retrieve access data from the callee's relational database.
[0013] Optionally, after retrieving access data from the document object storage database, the retrieved access data is formatted in a format consistent with the data in the relational database.
[0014] Thirdly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any of the first aspects above.
[0015] Fourthly, the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method provided in the first aspect.
[0016] This invention discloses a relational database access method and platform. The method includes obtaining data requests from different calling party business systems through an interface; querying the latest timestamp of the corresponding latest data from the relational database of the called party based on the request parameters in the data request; comparing the latest timestamp with existing timestamps in the document object repository to determine whether there is a timestamp in the document object repository that matches the latest timestamp; and obtaining access data from the document object storage database or the relational database of the called party based on the difference in the determination result. Without upgrading hardware, while meeting the requirements of data real-time performance and accuracy, this method significantly reduces the access frequency of the relational database, lowers the operating pressure on the relational database, and ultimately improves the operating speed of the medical information system. Attached Figure Description
[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0018] Figure 1 This application provides a relational database access method;
[0019] Figure 2 This is a logical diagram illustrating a relational database access method according to this application;
[0020] Figure 3 A corresponding to the present application Figure 1 A schematic diagram of an electronic device. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] The following is in conjunction with the appendix Figure 1 An exemplary method for accessing relational databases is provided. The method includes the following steps:
[0023] Step 101: Obtain data requests from different caller business systems through the interface.
[0024] In this embodiment, reference Figure 2 An API interface that is open to callers, through which data requests are obtained.
[0025] Step 102: Based on the request parameters in the data request, query the latest timestamp of the latest data from the relational data of the callee.
[0026] In this embodiment, based on the request parameters passed in by the API, only the timestamp of the latest data corresponding to the request is queried from the relational database of the called party.
[0027] Step 103: Compare the latest timestamp with existing timestamps in the document object repository to determine whether there is a timestamp in the document object repository that matches the latest timestamp.
[0028] In this embodiment, the timestamp obtained from the validator is compared with the timestamp in the document object repository.
[0029] Step 104: Based on the different judgment results, retrieve the access data from the document object storage database or the relational database of the callee.
[0030] As an optional implementation of this embodiment, depending on the judgment result, obtaining access data from the document object storage database or the relational database of the callee includes: if a timestamp consistent with the latest timestamp exists, then obtaining access data from the document object storage database; if no timestamp consistent with the latest timestamp exists, then obtaining access data from the relational database of the callee.
[0031] In this embodiment, if the timestamps match, it is considered an object hit, and the data is retrieved directly from the document object repository. If there is no hit, the complete data is queried from the relational database of the called party.
[0032] As an optional implementation in this embodiment, the relational database stores the query records for the request in the form of documents in a document object repository. The query record includes the request parameters, the query results, and the latest timestamp corresponding to the query results. The query record is then compiled and stored in the document object repository. The compiled query record includes the name of the relational database of the callee corresponding to the request, the interface name, and the request parameters as keys; the latest timestamp corresponding to the request parameters as a timestamp; and the query result data of the relational database of the callee as a value.
[0033] In this optional implementation, API request parameters, API query results, and the latest timestamp of the API query results are compiled into a key-timestamp-value format and stored in the Document Object Repository. Due to the large amount of business data, the following method is used to store the data in the Document Object Repository.
[0034] In the Document Object Repository, query records from relational databases are stored as documents in key-timestamp-value format.
[0035] key: Name of the called relational database # API name # API request parameters, such as: DB_1 # API_QueryPatientInfo # PID = 123456;
[0036] timestamp: The latest timestamp related to the API request parameters in the callee's relational database, such as 1714492800, which is the Unix timestamp of 2024-05-01 00:00:00;
[0037] value: The serialized query result from the callee's relational database.
[0038] like: [
[0040] {
[0041] "patient_id":"123456",
[0042] "patient_name":"Zhang San",
[0043] "patient_dob":"1996-05-03",
[0044] "patient_gender":"male",
[0045] "patient_contact":"13666666666"
[0046] },
[0047] {
[0048] "patient_id":"123457",
[0049] "patient_name":"Li Si",
[0050] "patient_dob":"1975-11-15",
[0051] "patient_gender":"male",
[0052] "patient_contact":"13777777777"
[0053] } ]
[0055] In this embodiment, after obtaining access data from the relational database of the callee, the query record is compiled and stored in the document object repository.
[0056] In this optional implementation, the document object is compiled using the aforementioned compilation method and then stored in the document object repository.
[0057] As an optional implementation of this embodiment, after obtaining access data from the document object storage database, the obtained access data is formatted in a format consistent with the data in the relational database.
[0058] In this optional implementation, the key-timestamp-value formatted document data in the document object repository is formatted into a row-list grid structure consistent with the results of relational database queries:
[0059] patient_id patient_name patient_dob patient_gender patient_contact 123456 Zhang San 1996-05-03 male 13666666666 123457 Li Si 1975-11-15 male 13777777777
[0060] This embodiment can significantly increase data connectivity between various information systems in medical institutions without requiring any additional hardware configuration, thereby improving the operational efficiency of information systems, increasing the work efficiency of medical staff, and reducing patients' waiting time.
[0061] The above describes the methods provided by one or more embodiments of this application. Based on the same idea, this application also provides a corresponding relational database access platform, including an API interface unit configured to obtain data requests from different caller business systems; a validator configured to query the latest timestamp of the latest data from the relational database of the callee based on the request parameters in the data request, and compare the latest timestamp with existing timestamps in the document object repository to determine whether there is a timestamp in the document object repository that matches the latest timestamp; and a traffic splitter configured to obtain access data from the document object storage database or the relational database of the callee based on the different judgment results.
[0062] As an optional implementation of this embodiment, the traffic splitter is configured to: if a timestamp consistent with the latest timestamp exists, retrieve access data from the document object storage database; if no timestamp consistent with the latest timestamp exists, retrieve access data from the relational database of the callee.
[0063] As an optional implementation of this embodiment, after obtaining access data from the document object storage database, the obtained access data is formatted in a format consistent with the data in the relational database.
[0064] As an optional implementation in this embodiment, the relational database stores the query records for the request in the form of documents in a document object repository. The query record includes the request parameters, the query results, and the latest timestamp corresponding to the query results. The query record is then compiled and stored in the document object repository. The compiled query record includes the name of the relational database of the callee corresponding to the request, the interface name, and the request parameters as keys; the latest timestamp corresponding to the request parameters as a timestamp; and the query result data of the relational database of the callee as a value.
[0065] As an optional implementation in this embodiment, after obtaining the access data from the relational database of the callee, the query record is compiled and stored in the document object repository.
[0066] Figure 3 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as... Figure 3 As shown, the electronic device 50 includes a processor 501, a memory 502, and a bus 503; wherein the processor 501 and the memory 502 communicate with each other through the bus 503; the processor 501 is used to call program instructions in the memory 502 to execute the methods provided in the above-described method embodiments.
[0067] This embodiment provides a non-transitory computer-readable storage medium that stores computer instructions, which cause the computer to execute the methods provided in the above-described method embodiments.
[0068] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various storage media capable of storing program code, such as ROM, RAM, magnetic disk, or optical disk.
[0069] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0070] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of each embodiment or some parts of the embodiments.
[0071] Although the present invention has been described in detail above with general descriptions and specific embodiments, modifications or improvements can be made to it, which will be obvious to those skilled in the art. Therefore, all such modifications or improvements made without departing from the spirit of the present invention fall within the scope of protection claimed by the present invention.
Claims
1. A relational database access method, characterized in that, include: Data requests are obtained from different caller business systems via interfaces; Based on the request parameters in the data request, retrieve the latest timestamp of the latest data from the relational data of the callee; The latest timestamp is compared with existing timestamps in the document object repository to determine whether there is a timestamp in the document object repository that matches the latest timestamp. Based on the different judgment results, access data is obtained from the document object storage database or the relational database of the callee, including: if there is a timestamp that matches the latest timestamp, then access data is obtained from the document object storage database; If no timestamp matching the latest timestamp exists, the access data is retrieved from the relational database of the called party.
2. The relational database access method according to claim 1, characterized in that, After retrieving access data from the Document Object Storage database, the retrieved access data is formatted in a format consistent with the data in the relational database.
3. The relational database access method according to claim 1, characterized in that, Relational databases store query records for a request in the form of documents in a document object repository. The query records include the request parameters, the query results, and the latest timestamp corresponding to the query results. After the query records are compiled, they are stored in the document object repository. The compiled query records include the name of the relational database of the callee corresponding to the request, the interface name, and the request parameters as keys; the latest timestamp corresponding to the request parameters as timestamps; and the query result data of the relational database of the callee as values.
4. The relational database access method according to claim 3, characterized in that, After retrieving the access data from the relational database of the callee, the query record is compiled and stored in the document object repository.
5. A relational database access platform, characterized in that, include: API interface units are configured to retrieve data requests from different caller business systems; The validator is configured to query the latest timestamp of the latest data from the relational data of the callee based on the request parameters in the data request, and compare the latest timestamp with the existing timestamps in the document object repository to determine whether there is a timestamp in the document object repository that matches the latest timestamp. The splitter is configured to retrieve access data from the document object storage database or the relational database of the callee based on the different judgment results. The splitter is configured to: if a timestamp matching the latest timestamp exists, retrieve access data from the document object storage database; if no timestamp matching the latest timestamp exists, retrieve access data from the relational database of the callee.
6. The relational database access platform according to claim 5, characterized in that, After retrieving access data from the Document Object Storage database, the retrieved access data is formatted in a format consistent with the data in the relational database.
7. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 4.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method described in any one of claims 1 to 4.
Citation Information
Patent Citations
A meteorological data management method
CN109241161A
Data processing method and device
CN112181921A