CN116628027A - Cross-database query method, apparatus, device, medium and computer program product - Google Patents

Cross-database query method, apparatus, device, medium and computer program product Download PDF

Info

Publication number
CN116628027A
CN116628027A CN202310594822.6A CN202310594822A CN116628027A CN 116628027 A CN116628027 A CN 116628027A CN 202310594822 A CN202310594822 A CN 202310594822A CN 116628027 A CN116628027 A CN 116628027A
Authority
CN
China
Prior art keywords
query
database
cross
data
single database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310594822.6A
Other languages
Chinese (zh)
Inventor
黄治军
张同虎
郭晓骞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202310594822.6A priority Critical patent/CN116628027A/en
Publication of CN116628027A publication Critical patent/CN116628027A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to the technical field of big data, in particular to a cross-database query method, which is used for a system comprising a plurality of databases and comprises the following steps: receiving a query request of a user; inquiring a single database; judging whether the subsequent single database inquiry exists, if so, extracting the related data from the single database inquiry results of the steps, and carrying out the subsequent single database inquiry based on the related data, if not, merging all the single databases to determine paging based on the inquiry results, judging whether the next page of data exists, if so, carrying out the single database inquiry of the next page based on the paging, and if not, ending the cross-database inquiry. The application also relates to a cross-database querying apparatus, device, medium and computer program product.

Description

Cross-database query method, apparatus, device, medium and computer program product
Technical Field
The present application relates to the field of big data technology, and in particular, to a method, an apparatus, a device, a medium and a computer program product for cross-database query.
Background
The software tester needs to consume a long time to prepare data before testing, and the business system facing the financial field is often a huge and complex system network, so that the preparation of the test data is a difficult and high-threshold work: the data required for a test case often involves numerous upstream systems, and the links are long, involving numerous components and systems; the data of the test environment has large interference between dirty data and invalid data in different service component libraries, and complete effective data is difficult to obtain; at present, the effective data inquiry of a database is one of important means for preparing test data, but the time consumption is long and the efficiency is low because massive data are required to be traversed to screen out complete and available data.
Disclosure of Invention
The application aims to provide a cross-database query method, a device, equipment, a medium and a computer program product, which solve the technical problems of large cross-database query resource occupation, long time consumption and low efficiency in the prior art.
The first embodiment of the application discloses a cross-database query method, which is used for a system comprising a plurality of databases, and comprises the following steps:
receiving a query request of a user;
inquiring a single database;
judging whether a subsequent single database inquiry exists, if so, extracting associated data from the single database inquiry results of the steps, carrying out the subsequent single database inquiry based on the associated data, if not, merging all single database inquiry results, and returning the merged single database inquiry results to the user;
and determining the paging based on the query result, judging whether the next page of data exists, if so, performing single database query of the next page based on the paging, and if not, ending the cross database query.
Optionally, the determining paging based on the query result further includes:
analyzing structural characteristics of the query result according to the fields and index characteristics of the databases to extract a plurality of characteristic fields;
combining the plurality of feature fields into a data key;
and performing conditional filtering on the plurality of databases based on the data key value.
Optionally, the determining whether there is a subsequent single database query further includes:
judging whether the data is queried, if so, judging whether the subsequent single database is queried, and if not, ending the cross database query.
Optionally, the ending the cross-database query further comprises:
judging whether the preamble single database is queried, if so, returning the preamble single database to query, and if not, ending the cross database query.
Optionally, the determining paging based on the query result, determining whether there is data of a next page includes:
judging whether enough data is queried, if so, ending the cross-database query, if not, determining paging based on the query result, and judging whether the next page of data exists.
Optionally, the method further comprises:
and optimizing the query sequence of the databases based on the query efficiency of each database in the databases.
Optionally, the method further comprises:
the ending cross-database query further comprises: finishing the cross-database query after recording the current query position;
the next time a cross-database query is made, the query is started from the recorded query location.
A second embodiment of the present application discloses a cross-database query apparatus for a system including a plurality of databases, the apparatus comprising:
the receiving module receives a query request of a user;
the query module is used for querying the single database;
the database crossing module is used for judging whether a subsequent single database query exists, if so, extracting associated data from the single database query results of the steps, carrying out the subsequent single database query based on the associated data, and if not, merging all single database query results and returning the merged single database query results to the user;
and the paging module is used for determining paging based on the query result, judging whether next page data exists, if so, carrying out single database query of the next page based on the paging, and if not, ending cross database query.
A third embodiment of the application discloses an electronic device comprising a memory storing computer executable instructions and a processor, which when executed by the processor, cause the electronic device to implement a cross-database query method according to the first embodiment of the application.
A fourth embodiment of the application discloses a computer storage medium having stored thereon instructions which, when run on a computer, cause the computer to perform a cross-database query method according to the first embodiment of the application.
A fifth embodiment of the application discloses a computer program product comprising computer executable instructions that are executed by a processor to implement a cross-database query method according to the first embodiment of the application.
Compared with the prior art, the embodiment of the application has the main differences and effects that:
in the application, batch (paging) inquiry is adopted for cross-library inquiry, the cross-library inquiry is realized by cyclic iteration step-by-step inquiry, and the overtime problem of large inquiry is avoided by a small amount of repeated inquiry. And the single-page query result is output in real time, and the data result is stored in the data set, so that the query progress and result can be known at any time.
In the application, the query sequence of the databases is automatically optimized based on the query efficiency of each database in the databases, so that the query efficiency across the databases is improved.
In the application, the feature fields are dynamically extracted and combined to form the data key value for filtering conditions in the query process, and the paging is converted into conditional filtering to replace the conventional paging, so that the dual filtering of the database and codes is realized, the index is better utilized, the paging performance problem is effectively avoided, and the paging efficiency is improved.
In the application, when the query task is executed again, the query position at the end of the last query task is automatically positioned to continue to query, repeated data query is skipped, and the need of query from the beginning when the query task is executed each time is avoided.
Drawings
FIG. 1 illustrates an exemplary block diagram of a system including multiple databases according to an embodiment of the present application.
FIG. 2 illustrates a flow chart of a cross-database query method according to an embodiment of the application.
FIG. 3 shows a flow chart of a preferred embodiment of a cross-database query method improvement based on the embodiment shown in FIG. 2.
FIG. 4 illustrates a flow chart of a method of implementing a cross-database query by configuring and executing a query task, according to an embodiment of the application.
FIG. 5 shows a schematic diagram of a query template according to an embodiment of the application.
FIG. 6 illustrates a block diagram of a cross-database query apparatus according to an embodiment of the application.
Fig. 7 shows a hardware configuration block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The software development and test stage needs to use a large amount of test data, especially in the financial field, the business system is numerous, the data dependence is very complex, and the acquisition of the test data is often a very challenging task. Querying stock data from existing systems for testing is one of the common means of data preparation, however, test data required for a single test activity is often distributed in numerous service system databases, and cross-database joint query is required to obtain effective test data. In the prior art, each database needs to be manually queried separately, the cross-database association operation is complex, the related data needs to be searched by traversing massive data, the resource occupation is large, the time consumption is long, and the efficiency is low; in the inquiry of large-batch paging data, the inquiry performance of the traditional paging to tail data and large-page data is low; and there is a problem of repeated queries when the query task is performed a plurality of times.
Aiming at the technical problems, the embodiment of the application provides a cross-database query method which is used for a system comprising a plurality of databases, and the acquisition, storage, use, processing and the like of the data in the technical scheme of the application all meet the relevant regulations of national laws and regulations. Fig. 1 shows an exemplary block diagram of a system including a plurality of databases according to an embodiment of the present application, fig. 2 shows a flowchart of a cross-database query method according to an embodiment of the present application, which is described below in connection with fig. 1 and 2.
As shown in fig. 1, system 100 includes database 101, database 102, and database 103. As shown in fig. 2, the cross-database query method includes:
s201, receiving a query request of a user; for example, a software tester in the financial domain sends a data query request to obtain data set A, data set B, and data set C from system 100, where data set A is stored in database 101, data set B is stored in database 102, and data set C is stored in database 103.
S202, inquiring a single database; for example, in response to the received inquiry request described above, the data B1 belonging to the first page of the data set B is first inquired from the database 102.
S203, judging whether a subsequent single database is queried;
s204, if so, extracting associated data from the single database query result in the step, and returning to S202 for subsequent single database query based on the associated data; for example, after the data B1 belonging to the first page of the data set B is queried from the database 102, it is judged that the data belonging to the first page of the data set a and the data set C have not been queried yet, and wherein, according to the configured query order, the database 103 is queried after the database 102 is queried, the database 101 is queried after the database 103 is queried, the associated data is extracted from the data B1, and then the data C1 belonging to the first page of the data set C is queried from the subsequent database 103 based on the associated data.
S205, if not, merging all single database query results, and returning the merged single database query results to the user; for example, after the data b1, the data c1 and the data a1 belonging to the first page of the data set a are queried, the data of the first page is queried, for the data of the first page, no subsequent single database query exists, the queried data b1, the data c1 and the data a1 are filtered and combined into the first page result data set P1, and the first page result data set P1 is returned to the software tester.
S206, determining paging based on the query result, and judging whether the next page of data exists;
s207, if yes, turning to the next page data based on paging, and returning to S202 to perform single database query of the next page; for example, after the data of the first page is queried, i.e. the result data set P1 of the first page is obtained, paging is performed, if it is found that the second page data in the data set a, the data set B and the data set C needs to be queried after paging, the above steps are continuously repeated, and the data B2 of the second page of the data set B, the data C2 of the second page of the data set C, and the data a2 of the second page of the data set a are queried from the database 102, 103, and 101, respectively, in sequence.
If not, the cross database query is ended.
FIG. 3 shows a flow chart of a preferred embodiment of a cross-database query method improvement based on the embodiment shown in FIG. 2, wherein:
s202 specifically comprises: s301, inputting query filtering conditions, and combining SQL sentences according to configuration; s302, executing the SQL; s303, query result processing. S207 specifically includes setting a paging condition to query the next page of data.
S304 is also included between S202 and S203, and whether the data is queried is judged; s305 is included between S205 and S206, and it is determined whether sufficient data is queried; after S206, S306 is further included before the cross-database query is completed, to determine whether there is a preamble database query.
If the judgment result of S304 is yes, go to S203 to judge whether there is a subsequent list database query, if the judgment result of S304 is no, go to S306 to judge whether there is a preceding list database query.
If the judgment result of S305 is yes, the cross-database query is ended, if the judgment result of S305 is no, the process proceeds to S206, the page is determined based on the query result, and whether or not there is next page data is judged.
If the judgment result of S306 is yes, the step goes to S206 after the preamble database query is returned in S307, the paging is determined based on the query result, whether the next page of data exists is judged, if the judgment result of S306 is no, the database cross query is ended.
In the application, batch (paging) inquiry is adopted for cross-library inquiry, the cross-library inquiry is realized by cyclic iteration step-by-step inquiry, and the overtime problem of large inquiry is avoided by a small amount of repeated inquiry. And the single-page query result is output in real time, and the data result is stored in the data set, so that the query progress and result can be known at any time.
According to some embodiments of the application, determining paging based on query results further comprises: analyzing structural characteristics of the query result according to the fields and index characteristics of the databases to extract a plurality of characteristic fields; combining the plurality of feature fields into a data key; conditional filtering is performed on the plurality of databases based on the data key.
In the method, the device and the system, the query performance of the traditional paging to tail data and large page data is low, and in the method, the dynamic extraction characteristic fields are combined to form a data key value for filtering conditions in the query process, and the paging is converted into conditional filtering to replace the conventional paging, so that the dual filtering of a database and codes is realized, the index is better utilized, the paging performance problem is effectively avoided, and the paging efficiency is improved.
According to some embodiments of the application, the method further comprises: the query order for the plurality of databases is optimized based on the query efficiency for each of the plurality of databases. For example, in the first execution of the query according to the steps shown in fig. 2, the associated database information is queried in real time, the resulting data structure characteristics are analyzed according to the field and index characteristics, and a plurality of characteristic field combinations are extracted to form the data key. Then, after the data B1 of the first page of the data set B, the data C1 of the first page of the data set C, and the data a1 of the first page of the data set a are sequentially and respectively queried from the database 102, the database 103, and the database 101, the database 102, and the database 103 are queried in this order when the query efficiency is higher by determining that the query efficiency is sequentially performed in the order of the database 101, the database 102, and the database 103 in combination with the target database query efficiency, the data of the second page is queried.
In the application, the query sequence of the databases is automatically optimized based on the query efficiency of each database in the databases, so that the query efficiency across the databases is improved.
According to some embodiments of the application, the method further comprises: ending the cross-database query further includes: and finishing the cross-database query after recording the current query position.
According to some embodiments of the present application, the method further comprises the following query configuration step before starting to execute the cross-database query:
configuring a query task; acquiring database information; generating an SQL query set based on the received query request; and acquiring the inquiry position of the record at the end of the last cross-database inquiry, and executing the current cross-database inquiry from the inquiry position of the record.
In the application, the problem of repeated data inquiry is solved by a breakpoint continuous inquiry mode, the problem that the inquiry needs to be carried out from beginning every time the inquiry task is executed is avoided, and the inquiry speed of effective data is accelerated. When the query task is executed again, the query position at the end of the last query task is automatically positioned, the last query position is read preferentially, then the data is queried continuously at the last query position, the problem of repeated data query is solved through a breakpoint continuous query mode, the problem that the query needs to be queried from the beginning each time when the query task is executed is avoided, and the query speed of effective data is increased.
The cross-database query method according to the present application may be implemented based on a visual interface, and in particular, in a scenario where a software tester in the financial domain wishes to acquire a data set from the system 100, the software tester in the financial domain may configure a query task at the visual interface of the system 100 or other systems associated with the system 100. FIG. 4 illustrates a flow chart of a method of implementing a cross-database query by configuring and executing a query task, comprising:
s410, configuring a query element; the query element is a component for querying data from a single database, and for each database, the configuration of the query element may include the sub-steps of: s411, configuring a link of a database; s412, importing a database table; s413, selecting a database table; s414, configuring associated fields among database tables; s415, configuring a query field; and S416, configuring an output field; then at S417, a corresponding single database query SQL statement is generated. For example, as shown in FIG. 5, a software tester may wish to obtain from system 100 a data set stored in database 101, a data set stored in database 102, and a data set stored in database 103, and may configure query element 501 for database 101, query element 502 for database 102, and query element 503 for database 103, respectively, based on the data to be queried, at the Web visualization interface of the system.
S420, configuring a query template; the query template is a component for querying data from a plurality of databases, and comprises a plurality of query elements and interrelationships thereof, and the configuration of the query template comprises the following substeps: s421, selecting a query element; s422, configuring the association relation among query elements; s423, configuring a query field; s424, configuring an output field; and S425, configuring an output result data set, wherein the result data set is a component for storing and managing the execution result of the query template. For example, a software tester configures a query template 500 as shown in fig. 5 on a Web visual interface of the system, and as the execution of the query element 503 depends on the execution result of the query element 502, the execution of the query element 502 depends on the execution result of the query element 501, or according to the query task, a connection needs to be established between the databases 101 and 102, 102 and 103 to perform a related query, and then the association relationship between the query element 501 and the query element 502 and between the query element 502 and the query element 503 is configured in the query template 500. And configures a result data set 504 for storing and managing results of execution of the query template 500.
S430, executing the query template. For example, executing the query template 500 according to the flow steps shown in FIG. 2 includes: an instruction is received that the user configuration is complete and requests execution of query template 500. Then according to the configured query template 500, the query element 501 is executed first, i.e. a single database query is performed on the database 101; then, judging that a subsequent query element 502 is also included in the query template 500, extracting associated data from the execution result of the query element 501, and executing the query element 502 based on the associated data; then judging that the subsequent query element 503 is still in the query template 500, extracting associated data from the execution result of the query element 502, and executing the query element 503 based on the associated data; and then judging that no subsequent query element exists in the query template 500, merging the execution results (i.e. queried data) of the query element 501, the query element 502 and the query element 503, storing the merged results into a result data set 504, and returning the result data set to a software tester. And then determining paging based on the query result, judging whether the next page of data exists, if so, repeating the steps to query the next page of data, and if not, ending the query task.
FIG. 6 illustrates a block diagram of a cross-database query apparatus according to an embodiment of the application. The cross-database query apparatus 600 is used in a system including a plurality of databases, and the cross-database query apparatus 600 includes:
a receiving module 601, configured to receive a query request from a user;
the query module 602 performs single database query;
the database crossing module 603 judges whether a subsequent single database query exists, if so, extracts the associated data from the single database query results of the steps, and performs the subsequent single database query based on the associated data, if not, combines all the single database query results, and returns the combined single database query results to the user;
the paging module 604 determines paging based on the query result, determines whether there is next page data, if so, performs a single database query for the next page based on paging, and if not, ends the cross database query.
The method embodiment of the present application corresponds to the present embodiment, which can be implemented in cooperation with the method embodiment of the present application. The related technical details mentioned in the method embodiment of the present application are still valid in this embodiment, and in order to reduce repetition, they are not described here again. Accordingly, the related technical details mentioned in the present embodiment may also be applied in the method embodiment of the present application.
FIG. 7 is a block diagram of the hardware architecture of an electronic device implementing a cross-database query in accordance with an embodiment of the present application.
As shown in fig. 7, an electronic device 700 may include one or more processors 702, a system motherboard 708 coupled to at least one of the processors 702, a system memory 704 coupled to the system motherboard 708, a non-volatile memory (NVM) 706 coupled to the system motherboard 708, and a network interface 710 coupled to the system motherboard 708.
The processor 702 may include one or more single-core or multi-core processors. The processor 702 may include any combination of general-purpose and special-purpose processors (e.g., graphics processor, application processor, baseband processor, etc.). In embodiments of the application, the processor 702 may be configured to perform one or more embodiments in accordance with various embodiments as shown in fig. 1-5.
In some embodiments, system motherboard 708 may include any suitable interface controller to provide any suitable interface to at least one of processors 702 and/or any suitable device or component in communication with system motherboard 708.
In some embodiments, system motherboard 708 may include one or more memory controllers to provide an interface to system memory 704. The system memory 704 may be used for loading and storing data and/or instructions. The system memory 704 of the electronic device 700 may include any suitable volatile memory in some embodiments, such as suitable Dynamic Random Access Memory (DRAM).
NVM 706 may include one or more tangible, non-transitory computer-readable media for storing data and/or instructions. In some embodiments, NVM 706 may include any suitable nonvolatile memory, such as flash memory, and/or any suitable nonvolatile storage device, such as at least one of a HDD (Hard Disk Drive), CD (Compact Disc) Drive, DVD (Digital Versatile Disc ) Drive.
NVM 706 may include a portion of a storage resource installed on an apparatus of electronic device 700, or it may be accessed by, but not necessarily a part of, the device. For example, NVM 706 can be accessed over a network via network interface 710.
In particular, system memory 704 and NVM 706 may each include: a temporary copy and a permanent copy of instruction 720. The instructions 720 may include: instructions that, when executed by at least one of the processors 702, cause the electronic device 700 to implement the methods shown in fig. 1-5. In some embodiments, instructions 720, hardware, firmware, and/or software components thereof may additionally/alternatively be disposed in the system motherboard 708, the network interface 710, and/or the processor 702.
The network interface 710 may include a transceiver to provide a radio interface for the electronic device 700 to communicate with any other suitable device (e.g., front end module, antenna, etc.) over one or more networks. In some embodiments, the network interface 710 may be integrated with other components of the electronic device 700. For example, the network interface 710 may be integrated with at least one of the processor 702, the system memory 704, the NVM 706, and a firmware device (not shown) having instructions that, when executed by at least one of the processor 702, the electronic device 700 implements one or more of the various embodiments shown in fig. 1-5.
The network interface 710 may further include any suitable hardware and/or firmware to provide a multiple-input multiple-output radio interface. For example, network interface 710 may be a network adapter, a wireless network adapter, a telephone modem, and/or a wireless modem.
In one embodiment, at least one of the processors 702 may be packaged together with one or more controllers for the system motherboard 708 to form a system package (SiP). In one embodiment, at least one of the processors 702 may be integrated on the same die as one or more controllers for the system motherboard 708 to form a system on a chip (SoC).
The electronic device 700 may further include: input/output (I/O) devices 712 are connected to system motherboard 708. The I/O device 712 may include a user interface to enable a user to interact with the electronic device 700; the design of the peripheral component interface enables the peripheral component to also interact with the electronic device 700. In some embodiments, the electronic device 700 further comprises a sensor for determining at least one of environmental conditions and location information related to the electronic device 700.
In some embodiments, I/O devices 712 may include, but are not limited to, a display (e.g., a liquid crystal display, a touch screen display, etc.), a speaker, a microphone, one or more cameras (e.g., still image cameras and/or video cameras), a flashlight (e.g., light emitting diode flash), and a keyboard.
In some embodiments, the peripheral component interface may include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.
In some embodiments, the sensors may include, but are not limited to, gyroscopic sensors, accelerometers, proximity sensors, ambient light sensors, and positioning units. The positioning unit may also be part of the network interface 710 or interact with the network interface 710 to communicate with components of a positioning network, such as Global Positioning System (GPS) satellites.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 700. In other embodiments of the application, electronic device 700 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Program code may be applied to input instructions to perform the functions described herein and generate output information. The output information may be applied to one or more output devices in a known manner. For purposes of this disclosure, a system for processing instructions that includes a processor 702 includes any system having a processor such as a Digital Signal Processor (DSP), microcontroller, application Specific Integrated Circuit (ASIC), or microprocessor.
The program code may be implemented in a high level procedural or object oriented programming language to communicate with a processing system. Program code may also be implemented in assembly or machine language, if desired. Indeed, the mechanisms described in the present application are not limited in scope by any particular programming language. In either case, the language may be a compiled or interpreted language.
One or more aspects of at least one embodiment may be implemented by instructions stored on a computer-readable storage medium, which when read and executed by a processor, enable an electronic device to implement the methods of embodiments described in the present application.
According to some embodiments of the present application, a computer storage medium having instructions stored thereon that, when executed on a computer, cause the computer to perform a cross-database query method according to embodiments of the present application is disclosed.
The method embodiment of the present application corresponds to the present embodiment, which can be implemented in cooperation with the method embodiment of the present application. The related technical details mentioned in the method embodiment of the present application are still valid in this embodiment, and in order to reduce repetition, they are not described here again. Accordingly, the related technical details mentioned in the present embodiment may also be applied in the method embodiment of the present application.
According to some embodiments of the present application, a computer program product is disclosed comprising computer executable instructions that are executed by a processor to implement a cross-database query method according to embodiments of the present application.
The method embodiment of the present application corresponds to the present embodiment, which can be implemented in cooperation with the method embodiment of the present application. The related technical details mentioned in the method embodiment of the present application are still valid in this embodiment, and in order to reduce repetition, they are not described here again. Accordingly, the related technical details mentioned in the present embodiment may also be applied in the method embodiment of the present application.
It is to be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application. Furthermore, for convenience of description, only some, but not all, structures or processes related to the present application are shown in the drawings. It should be noted that in the present specification, like reference numerals and letters denote like items throughout the drawings.
It will be understood that, although the terms "first," "second," etc. may be used herein to describe various features, these features should not be limited by these terms. These terms are used merely for distinguishing and are not to be construed as indicating or implying relative importance. For example, a first feature may be referred to as a second feature, and similarly a second feature may be referred to as a first feature, without departing from the scope of the example embodiments.
Illustrative embodiments of the application include, but are not limited to, cross database query methods, apparatus, devices, media, and computer program products.
Various aspects of the illustrative embodiments will be described using terms commonly employed by those skilled in the art to convey the substance of their work to others skilled in the art. However, it will be apparent to those skilled in the art that some alternative embodiments may be practiced using the features described in part. For purposes of explanation, specific numbers and configurations are set forth in order to provide a more thorough understanding of the illustrative embodiments. However, it will be apparent to one skilled in the art that the alternative embodiments may be practiced without the specific details. In some other instances, well-known features are omitted or simplified in order not to obscure the illustrative embodiments of the application.
Furthermore, various operations will be described as multiple discrete operations, in a manner that is most helpful in understanding the illustrative embodiments; however, the order of description should not be construed as to imply that these operations are necessarily order dependent, and that many of the operations be performed in parallel, concurrently or with other operations. Furthermore, the order of the operations may also be rearranged. When the described operations are completed, the process may be terminated, but may also have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, and the like.
References in the specification to "one embodiment," "an illustrative embodiment," etc., indicate that the embodiment described may include a particular feature, structure, or property, but every embodiment may or may not necessarily include the particular feature, structure, or property. Moreover, such phrases are not necessarily referring to the same embodiment. Furthermore, when a particular feature is described in connection with a particular embodiment, it is within the knowledge of one skilled in the art to affect such feature in connection with other embodiments, whether or not such embodiment is explicitly described.
The terms "comprising," "having," and "including" are synonymous, unless the context dictates otherwise. The phrase "a and/or B" means "(a), (B) or (a and B)".
As used herein, the term "module" may refer to, be part of, or include: memory (shared, dedicated, or group) for running one or more software or firmware programs, an Application Specific Integrated Circuit (ASIC), an electronic circuit and/or processor (shared, dedicated, or group), a combinational logic circuit, and/or other suitable components that provide the described functionality.
In the drawings, some structural or methodological features may be shown in a particular arrangement and/or order. However, it should be understood that such a particular arrangement and/or ordering is not required. Rather, in some embodiments, these features may be described in a different manner and/or order than shown in the illustrative figures. Additionally, the inclusion of a structural or methodological feature in a particular drawing does not imply that all embodiments need to include such feature, and in some embodiments may not be included or may be combined with other features.
In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented in the form of instructions or a program loaded onto or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors, etc. When the instructions or programs are executed by a machine, the machine may perform the various methods described above. For example, the instructions may be distributed over a network or other computer readable medium. Thus, a machine-readable medium may include, but is not limited to, any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), such as a floppy disk, an optical disk, a compact disk read-only memory (CD-ROMs), a magneto-optical disk, a read-only memory (ROM), a Random Access Memory (RAM), an erasable programmable read-only memory (EPROM), an electronically erasable programmable read-only memory (EEPROM), a magnetic or optical card, or a flash memory or a tangible machine-readable memory for transmitting network information via electrical, optical, acoustical or other form of signal (e.g., carrier waves, infrared signals, digital signals, etc.). Thus, a machine-readable medium includes any form of machine-readable medium suitable for storing or transmitting electronic instructions or information readable by a machine (e.g., a computer).
The embodiments of the present application have been described in detail above with reference to the accompanying drawings, but the use of the technical solution of the present application is not limited to the applications mentioned in the embodiments of the present application, and various structures and modifications can be easily implemented with reference to the technical solution of the present application to achieve the various advantageous effects mentioned herein. Various changes, which may be made by those skilled in the art without departing from the spirit of the application, are deemed to be within the scope of the application as defined by the appended claims.

Claims (11)

1. A method of cross-database querying for a system comprising a plurality of databases, the method comprising: receiving a query request of a user;
inquiring a single database;
judging whether a subsequent single database inquiry exists, if so, extracting associated data from the single database inquiry results of the steps, carrying out the subsequent single database inquiry based on the associated data, if not, merging all single database inquiry results, and returning the merged single database inquiry results to the user;
and determining the paging based on the query result, judging whether the next page of data exists, if so, performing single database query of the next page based on the paging, and if not, ending the cross database query.
2. The method of claim 1, wherein the determining the page based on the query result further comprises:
analyzing structural characteristics of the query result according to the fields and index characteristics of the databases to extract a plurality of characteristic fields;
combining the plurality of feature fields into a data key;
and performing conditional filtering on the plurality of databases based on the data key value.
3. The method of claim 1, wherein said determining whether there is a subsequent single database query further comprises:
judging whether the data is queried, if so, judging whether the subsequent single database is queried, and if not, ending the cross database query.
4. The method of claim 3, wherein the ending the cross-database query further comprises:
judging whether the preamble single database is queried, if so, returning the preamble single database to query, and if not, ending the cross database query.
5. The method of claim 1, wherein determining paging based on the query result, determining whether there is a next page of data, comprises:
judging whether enough data is queried, if so, ending the cross-database query, if not, determining paging based on the query result, and judging whether the next page of data exists.
6. The method as recited in claim 1, further comprising:
and optimizing the query sequence of the databases based on the query efficiency of each database in the databases.
7. The method as recited in claim 1, further comprising:
the ending cross-database query further comprises: finishing the cross-database query after recording the current query position;
the next time a cross-database query is made, the query is started from the recorded query location.
8. A cross-database query apparatus for use in a system comprising a plurality of databases, the apparatus comprising: the receiving module receives a query request of a user;
the query module is used for querying the single database;
the database crossing module is used for judging whether a subsequent single database query exists, if so, extracting associated data from the single database query results of the steps, carrying out the subsequent single database query based on the associated data, and if not, merging all single database query results and returning the merged single database query results to the user;
and the paging module is used for determining paging based on the query result, judging whether next page data exists, if so, carrying out single database query of the next page based on the paging, and if not, ending cross database query.
9. An electronic device comprising a memory storing computer-executable instructions and a processor that, when executed by the processor, cause the electronic device to implement the cross-database query method of any of claims 1-7.
10. A computer storage medium having instructions stored thereon that when executed on a computer cause the computer to perform the cross-database query method of any of claims 1-7.
11. A computer program product comprising computer executable instructions that are executed by a processor to implement the cross-database query method of any of claims 1-7.
CN202310594822.6A 2023-05-24 2023-05-24 Cross-database query method, apparatus, device, medium and computer program product Pending CN116628027A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310594822.6A CN116628027A (en) 2023-05-24 2023-05-24 Cross-database query method, apparatus, device, medium and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310594822.6A CN116628027A (en) 2023-05-24 2023-05-24 Cross-database query method, apparatus, device, medium and computer program product

Publications (1)

Publication Number Publication Date
CN116628027A true CN116628027A (en) 2023-08-22

Family

ID=87602117

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310594822.6A Pending CN116628027A (en) 2023-05-24 2023-05-24 Cross-database query method, apparatus, device, medium and computer program product

Country Status (1)

Country Link
CN (1) CN116628027A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117453774A (en) * 2023-12-22 2024-01-26 北京汇通天下物联科技有限公司 Cross-platform information joint query method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117453774A (en) * 2023-12-22 2024-01-26 北京汇通天下物联科技有限公司 Cross-platform information joint query method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107247808B (en) Distributed NewSQL database system and picture data query method
US8078628B2 (en) Streaming faceted search
CN105589881B (en) Data processing method and device
CN109408507B (en) Multi-attribute data processing method, device, equipment and readable storage medium
CN116628027A (en) Cross-database query method, apparatus, device, medium and computer program product
CN111737564A (en) Information query method, device, equipment and medium
CN107341106B (en) Application compatibility detection method, development terminal and storage medium
CN109299101A (en) Data retrieval method, device, server and storage medium
CN112905441A (en) Test case generation method, test method, device and equipment
CN111427784B (en) Data acquisition method, device, equipment and storage medium
CN113760242A (en) Data processing method, device, server and medium
CN112199272A (en) Intelligent terminal testing method and device, terminal equipment and medium
CN109726213B (en) Program code conversion method, device, medium and computing equipment
CN110515979A (en) Data query method, apparatus, equipment and storage medium
CN111124545A (en) Application program starting method and device, electronic equipment and storage medium
CN116305118A (en) Method, device, electronic equipment and medium for static detection of increment codes
CN114064601B (en) Storage process conversion method, device, equipment and storage medium
CN111443920B (en) Frame migration method and device
CN103853791A (en) Implementation method and device for quick file retrieving
CN110333883B (en) Method and device for updating persistent data
CN107656868B (en) Debugging method and system for acquiring thread name by using thread private data
CN105528226A (en) Method and apparatus for starting intelligent terminal
CN112559920B (en) Hook method, device and equipment based on jump instruction and storage medium
CN113704320B (en) Data processing method, device, electronic equipment and storage medium
CN107729013B (en) Method for managing operation buttons on web page and computer-readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination