Data non-inductive query method and device, equipment and storage medium
By encapsulating unified access interfaces for different types of data sources and parsing access requests, determining target data sources and configuring link information, the problem of cumbersome data query in the existing technology is solved, and senseless data query and efficient data access are achieved.
Patent Information
- Application Number
- CN202411478527.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, users need to understand different types of data sources and their interfaces, resulting in a cumbersome data query process.
Through the unified access interface of different types of data sources, receive access requests and analyzes to determine the target data source and configuration link information to realize the sensory data query.
It enables users to query through a unified interface no matter which data source they access, simplifying the data query process and improving the flexibility and efficiency of data access.
Smart Images

Figure CN119357268A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method, device, equipment and storage medium for seamless data query. Background Art
[0002] As the scale of business development of enterprises continues to expand and the Internet becomes more popular in all aspects of life, for example, the services of Yi Telecom Company no longer only include the package handling under the traditional communication business, but also include smart home, home audio and video entertainment, etc. within the scope of business billing, which leads to the diversity of data sources. Usually, different types of data sources have their corresponding interfaces, so when users access data, they need to understand which data source the query data is in and what the corresponding interface of the data source is, and then send a request to query the data, which is very cumbersome. Summary of the invention
[0003] The embodiments of the present application provide a data non-sensing query method, device, equipment and storage medium to solve at least one problem existing in the related art. The technical solution is as follows:
[0004] In a first aspect, an embodiment of the present application provides a method for seamless query of data, including:
[0005] In response to the encapsulation instruction, encapsulate the unified access interface of different types of data sources;
[0006] Receiving an access request based on the unified access interface, parsing the access request, and obtaining a query table name;
[0007] Determine the target data source name according to the query table name and the business data relationship mapping table;
[0008] According to the target data source name, target configuration link information is determined, and data query is performed according to the target configuration link information to obtain query data.
[0009] In one embodiment, in response to the encapsulation instruction, encapsulating the unified access interface of different types of data sources includes:
[0010] In response to the first encapsulation sub-instruction, different types of data sources are determined, the data sources including at least two of MySQL, Oracle, PostgreSQL, CTG-cache, and Redis data sources;
[0011] In response to the second encapsulation sub-instruction, performing customized interface access configuration according to different types of the data sources to determine access configuration information;
[0012] According to the access configuration information, a unified access interface of different types of data sources is encapsulated.
[0013] In one implementation, parsing the access request to obtain the query table name includes:
[0014] Determine the SQL statement of the access request;
[0015] The SQL statement is parsed by a parser to obtain a query table name.
[0016] In one implementation, determining the target data source name according to the query table name and the business data relationship mapping table includes:
[0017] According to the query table name, query the business data relationship mapping table to determine the matching target business table name; the business data relationship mapping table includes data source names of different data sources and the business table name corresponding to each data source name;
[0018] According to the target business table name, the corresponding target data source name is matched.
[0019] In one implementation, determining target configuration link information according to the target data source name includes:
[0020] According to the target data source name, query the actual data source table to determine the matching data source name; the actual data source table includes data source information of different data sources, and the data source information includes the data source name and configuration link information;
[0021] According to the matched data source name, corresponding target configuration link information is determined.
[0022] In one implementation, performing data query according to the target configuration link information to obtain query data includes:
[0023] Connecting to the corresponding target data source through the link address in the target configuration link information;
[0024] Compare the user name and user password in the access request with the user name and user password in the target configuration link information to obtain a comparison result;
[0025] When the comparison results are consistent, the target data source is queried to obtain query data.
[0026] In one embodiment, the method further comprises:
[0027] When the query data exceeds the number of display items of the display page and is less than or equal to a preset number of items, the query data is stored in a cache, and a first display page number is determined according to the number of display items and the query data, and the query data is displayed in pages according to the first display page number;
[0028] When the query data exceeds the number of display items on the display page and is greater than a preset number, determine the first part of the query data within the preset number of items and the second part of the query data outside the preset number of items, store the first part of the data in the cache, and determine the second display page number based on the display number of items and the first part of the data, and display the first part of the data in pages according to the second display page number. When the last page of the second display page number is displayed, when the user switches to the next page, clear the cache and store the second part of the data in the cache, and display the second part of the data in a single page or in pages.
[0029] In a second aspect, an embodiment of the present application provides a data non-sensing query device, including:
[0030] The encapsulation module is used to encapsulate the unified access interface of different types of data sources in response to the encapsulation instruction;
[0031] A parsing module, used for receiving an access request based on the unified access interface, parsing the access request, and obtaining a query table name;
[0032] A determination module, used to determine the target data source name according to the query table name and the business data relationship mapping table;
[0033] The query module is used to determine the target configuration link information according to the target data source name, and perform data query according to the target configuration link information to obtain query data.
[0034] In one embodiment, the query module is further used to:
[0035] When the query data exceeds the number of display items of the display page and is less than or equal to a preset number of items, the query data is stored in a cache, and a first display page number is determined according to the number of display items and the query data, and the query data is displayed in pages according to the first display page number;
[0036] When the query data exceeds the number of display items on the display page and is greater than a preset number, determine the first part of the query data within the preset number of items and the second part of the query data outside the preset number of items, store the first part of the data in the cache, and determine the second display page number based on the display number of items and the first part of the data, and display the first part of the data in pages according to the second display page number. When the last page of the second display page number is displayed, when the user switches to the next page, clear the cache and store the second part of the data in the cache, and display the second part of the data in a single page or in pages.
[0037] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement a method in any one of the above-mentioned embodiments.
[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, the method in any one of the above-mentioned embodiments is implemented.
[0039] The beneficial effects of the above technical solution include at least:
[0040] By responding to the encapsulation instruction, the unified access interface of different types of data sources is encapsulated. No matter which data source the user needs to access, the unified access interface can be accessed, which is very convenient; receiving an access request based on the unified access interface, parsing the access request, obtaining the query table name, determining the target data source name according to the query table name and the business data relationship mapping table, determining the target configuration link information according to the target data source name, and performing data query according to the target configuration link information to obtain the query data, automatically determining the target data source name and the target configuration link information based on the query table name for data query, realizing the seamless switching connection of the data source, and achieving the effect of seamless data query.
[0041] The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present application will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present application and should not be regarded as limiting the scope of the present application.
[0043] Figure 1 This is a schematic diagram of the steps of a method for seamlessly querying data according to an embodiment of the present application;
[0044] Figure 2 This is a structural block diagram of a data non-sensing query device according to an embodiment of the present application;
[0045] Figure 3 This is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0046] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the spirit or scope of the present application. Therefore, the drawings and descriptions are considered to be exemplary and non-restrictive in nature.
[0047] Reference Figure 1 , a flow chart of a method for seamless query of data according to an embodiment of the present application is shown, and the method for seamless query of data may at least include steps S100-S400:
[0048] S100 . In response to a packaging instruction, packaging unified access interfaces of different types of data sources.
[0049] S200: Receive an access request based on a unified access interface, parse the access request, and obtain a query table name.
[0050] S300: Determine the target data source name according to the query table name and the business data relationship mapping table.
[0051] S400: Determine target configuration link information according to the target data source name, and perform data query according to the target configuration link information to obtain query data.
[0052] The technical solution of the embodiment of the present application encapsulates a unified access interface of different types of data sources in response to an encapsulation instruction. No matter which data source the user needs to access, the unified access interface can be accessed, which is very convenient; an access request based on the unified access interface is received, the access request is parsed, and a query table name is obtained, and a target data source name is determined according to the query table name and a business data relationship mapping table, and target configuration link information is determined according to the target data source name, and data query is performed according to the target configuration link information to obtain query data, and the target data source name and target configuration link information are automatically determined based on the query table name for data query, thereby realizing a senseless switching connection of the data source and achieving an effect of senseless data query.
[0053] In one embodiment, step S100 includes steps S110-S130:
[0054] S110 . In response to the first encapsulation sub-instruction, determine different types of data sources, where the data sources include at least two of mysql, Oracle, PostgreSQL, CTG-cache, and redis data sources.
[0055] Optionally, a seamless switching data center is provided in the server, and the seamless switching data center plays the role of configuring the data source, switching the data source, etc., so that large amounts of data from different sources can be centrally stored and maintained, thereby avoiding the management complexity and performance bottlenecks caused by data dispersion. Managers can perform encapsulation operations based on actual needs in the server to generate encapsulation instructions, and the encapsulation instructions include but are not limited to the first encapsulation sub-instruction and the second encapsulation sub-instruction. In an embodiment of the present application, the server responds to the first encapsulation sub-instruction to determine the different types of data sources that currently need to be supported, and the data source includes but is not limited to at least two of mysql, Oracle, PostgreSQL, CTG-cache, and redis data sources.
[0056] S120. In response to the second encapsulation sub-instruction, perform customized interface access configuration according to different types of data sources to determine access configuration information.
[0057] Optionally, the server responds to the second encapsulation sub-instruction to customize the interface access configuration for different types of data sources and determine the access configuration information. For example, it is determined that the relational databases MySQL, Oracle, and PostgreSQL, etc., based on the teledb database as a carrier, encapsulate the access interface and other interface information to form the access configuration information. In some embodiments, management information may also be included, such as data that needs to be persistently stored, using a storage-computing separation database for persistent storage, simplifying the operation process through the phoenix management tool, or using redis and other ctg-cache caching technology to build an encapsulated Cache management tool, shielding the hierarchical concept from the outside, and managing information such as read and write permissions and current limiting, etc., without specific limitation.
[0058] S130. Encapsulate a unified access interface for different types of data sources according to the access configuration information.
[0059] In the embodiment of the present application, a unified access interface for different types of data sources is encapsulated according to the access configuration information, and the user can initiate a request through the unified access interface to achieve general data query, writing, updating, etc. Therefore, no matter which data source the user needs to access, it is only necessary to initiate a request based on the unified access interface, which is very convenient. It should be noted that all the above configurations do not need to involve the client and will not have any impact on the client's application. The client will not feel any service interruption or change in data access. The client can still access the data normally without any additional operations or adjustments.
[0060] It is understandable that if you need to change the data source or add or delete a data source, you can change the content of the business data relationship mapping table and the actual data source table based on the operation, and the seamless data switching center will automatically query data based on the changed table.
[0061] In the embodiment of the present application, the administrator may configure and establish a business data relationship mapping table and an actual data source table in advance on the server side.
[0062] In one implementation, in step S200, a user may initiate a request in his client (terminal) through an access request of a unified access interface, and the server receives the access request based on the unified access interface, and parses the access request to obtain a query table name; wherein step S200 parses the access request to obtain the query table name includes steps S210-S220:
[0063] S210: Determine the SQL statement of the access request.
[0064] S220, parse the SQL statement through a parser to obtain a query table name.
[0065] In the embodiment of the present application, after the server receives an access request based on the unified access interface, the access request includes a SQL statement or the access request itself is a SQL statement, and the server can determine the SQL statement. Then, the server parses the SQL statement through its parser to obtain the query table name.
[0066] In one implementation, step S300 includes steps S310-S320:
[0067] S310: According to the query table name, query the business data relationship mapping table to determine the matching target business table name.
[0068] Optionally, the business data relationship mapping table includes data source names of different data sources, a business table name corresponding to each data source name, creation time and status of each business table name, etc. The business table name is used as the primary key, as shown in Table 1.
[0069] Table 1
[0070]
[0071]
[0072] S320. Match the corresponding target data source name according to the target business table name.
[0073] Optionally, according to the target business table name, a target data source name identical to the target business table name may be found in the business data relationship mapping table, thereby matching the corresponding target data source name.
[0074] In one implementation, step S400 includes steps S410-S420:
[0075] S410: According to the target data source name, query the actual data source table to determine a matching data source name.
[0076] Optionally, the actual data source table includes data source information of different data sources, as shown in Table 2, the data source information includes data source ID, data source name, data source type, and configuration link information, and the configuration link information includes but is not limited to the link address, user name, user password, configuration file configured in the data source, maximum number of connections and status, creator, creation time, and if the data source is modified or updated, the corresponding modifier, modification time, etc. Therefore, based on the target data source name, the actual data source table is queried to determine the data source name that is the same as the target data source name as the matching data source name.
[0077] Table 2
[0078]
[0079]
[0080] S420: Determine corresponding target configuration link information according to the matched data source name.
[0081] Then, based on the matched data source name, the configuration link information corresponding to the matched data source name is queried from the actual data source table as the corresponding target configuration link information.
[0082] In one implementation, performing data query according to the target configuration link information in step S400 to obtain query data includes steps S430-S450:
[0083] S430: Connect to the corresponding target data source through the link address in the target configuration link information.
[0084] Optionally, after determining the target configuration link information, based on the link address in the target configuration link information, the server or client is connected to the corresponding target data source (more specifically, the storage medium of the target data source) to perform data query.
[0085] S440: Compare the user name and user password in the access request with the user name and user password in the target configuration link information to obtain a comparison result.
[0086] S450: When the comparison result indicates consistency, query the target data source to obtain query data.
[0087] Optionally, in order to improve security, the user name and user password in the access request are compared with the user name and user password in the target configuration link information to obtain a comparison result. When the comparison result represents consistency, the target data source is allowed to be queried to obtain the query data; otherwise, access is denied, and the user is prompted that the password is incorrect or the user does not have permission.
[0088] In one implementation, the data non-sensing query method of the embodiment of the present application may further include steps S510-S520:
[0089] S510: When the query data exceeds the number of display items of the display page and is less than or equal to the preset number of items, the query data is stored in the cache, and a first display page number is determined according to the number of display items and the query data, and the query data is displayed in pages according to the first display page number.
[0090] In the embodiment of the present application, exemplarily, the number of displayed items on the display page in the client is 1000, and 1000 items of data can be displayed on each page, and the preset number of items is 10000. Among them, when the query data exceeds the number of displayed items on the display page and is less than or equal to the preset number of items, for example, there are 10000 query data in total, 10000 query data are stored in the cache, and the first display page number is determined according to the display number and the query data: 10000 / 1000=10, that is, the first display page number is 10 pages, and the query data is displayed in pages in 10 pages, and the user can perform page switching operations on the client.
[0091] S520. When the query data exceeds the number of display items on the display page and is greater than a preset number of items, determine the first part of the query data within the preset number of items and the second part of the query data outside the preset number of items, store the first part of the data in the cache, and determine the second display page number based on the display number of items and the first part of the data, and display the first part of the data in pages according to the second display page number. When the last page of the second display page number is displayed, when the user switches to the next page, clear the cache and store the second part of the data in the cache, and display the second part of the data in a single page or in pages.
[0092] In the embodiment of the present application, when the query data exceeds the number of displayed items on the display page and is greater than the preset number, for example, the number of query data is 14,000, the first part of the query data within the preset number is determined: 10,000 data items, and the second part of the query data outside the preset number is determined: 4,000 data items. Then, the first part of the data is stored in the cache, and the second number of display pages is determined based on the number of displayed items and the first part of the data, and the first part of the data is displayed in pages according to the second number of display pages. For example, 10,000 data items are stored in the cache, and the second number of display pages is determined based on the number of displayed items and the first part of the data: 10 pages, and the query data is displayed in pages in 10 pages, and the user can perform page switching operations on the client.
[0093] Furthermore, when the last page of the second display page number is displayed, that is, when the 10th page is displayed, if the user switches to the next page, the current cache is cleared, and the second part of the data is stored in the cache, that is, 4000 data items with sequence numbers of 10000-14000 are stored in the cache, and the second part of the data is displayed in pages, for example, in 4 pages. In some embodiments, if the part exceeding 10000 is less than 1000, the second part of the data is directly displayed in a single page on the display page.
[0094] In the embodiment of the present application, in terms of transactionality, comprehensive transaction management is implemented for the storage media of all data sources involved, especially for the deletion and modification operations of data. Whenever data modification is performed, the seamless switching data center will save the data state changes of all operations belonging to the same transaction in the form of primary keys. Therefore, during the execution of each transaction, not only the data state before the modification is recorded, but also the data state after the modification is recorded. In this way, during the execution of the transaction, the seamless switching data center can track and verify the consistency and integrity of the data.
[0095] In the embodiment of the present application, if any problem or failure occurs during the execution of a transaction, the seamless switching of data centers will automatically trigger a rollback operation. This rollback mechanism ensures the atomicity of the transaction, that is, all operations in the transaction are either all successful or all withdrawn, thereby maintaining the integrity of the data. When rolling back, the seamless switching of data centers will restore all modified data to the state before the transaction started, avoiding data inconsistency problems caused by partial updates. In this way, we can ensure the reliability of data operations and the stability of the system, and effectively reduce data anomalies caused by transaction failures.
[0096] In terms of security, multi-level protection measures such as passwords are adopted to ensure that the client cannot access or expose the link information, effectively enhancing the security and confidentiality of data storage. When performing data operations, the client will not directly access the underlying data source configuration information, thereby reducing potential security risks and preventing data leakage and unauthorized access. All data source links and configuration details are hidden within the system, ensuring that only authorized operations and requests can access and modify the data, thereby protecting the confidentiality and integrity of the data.
[0097] In addition, in terms of atomicity, independent atomic operation capabilities are provided. These operations can be exposed as independent product modules. In data operations, atomicity ensures that each operation is either completely successful or completely failed, thus avoiding the problem of partial update and inconsistency of data. By modularizing atomic operations, we can not only flexibly apply these capabilities in the seamless switching data center, but also configure and manage them separately according to needs. This design allows users to accurately control and apply atomic operation functions according to specific business needs, thereby improving the reliability of the seamless switching data center and the consistency of data operations.
[0098] Through the method of the embodiment of the present application, a unified access interface for fast data reading and writing is provided, allowing seamless switching when reading data, so that users can seamlessly switch data sources when performing data operations without having to worry about the specific implementation details of the underlying data storage, thereby achieving seamless query and greatly improving the flexibility and efficiency of data access; moreover, personnel only need to use the configuration table to perform query operations between different data sources without having to reconfigure or modify the code, thereby simplifying the complexity of data operations; data is decoupled from applications, and data sources are isolated and managed separately, thereby enhancing the control ability of data security, and changes in data will not have a direct impact on the application program, thereby improving the stability of the system and making data security control more accurate and effective.
[0099] Reference Figure 2 , shows a structural block diagram of a data non-sensing query device according to an embodiment of the present application, and the device may include:
[0100] The encapsulation module is used to encapsulate the unified access interface of different types of data sources in response to the encapsulation instruction;
[0101] A parsing module, used for receiving an access request based on a unified access interface, parsing the access request, and obtaining a query table name;
[0102] A determination module is used to determine the target data source name according to the query table name and the business data relationship mapping table;
[0103] The query module is used to determine the target configuration link information according to the target data source name, and perform data query according to the target configuration link information to obtain query data.
[0104] In one embodiment, the query module is further used to:
[0105] When the query data exceeds the number of display items on the display page and is less than or equal to the preset number of items, the query data is stored in the cache, and the first display page number is determined according to the number of display items and the query data, and the query data is displayed in pages according to the first display page number;
[0106] When the query data exceeds the number of display items on the display page and is greater than a preset number, determine the first part of the query data within the preset number of items and the second part of the query data outside the preset number of items, store the first part of the data in the cache, and determine the second display page number based on the display number of items and the first part of the data, and display the first part of the data in pages according to the second display page number. When the last page of the second display page number is displayed, when the user switches to the next page, clear the cache and store the second part of the data in the cache, and display the second part of the data in a single page or in pages.
[0107] The functions of each module in each device in the embodiments of the present application can be found in the corresponding description in the above method, and will not be repeated here.
[0108] Reference Figure 3 , shows a structural block diagram of an electronic device according to an embodiment of the present application, the electronic device includes: a memory 310 and a processor 320, the memory 310 stores instructions that can be run on the processor 320, and the processor 320 loads and executes the instructions to implement the senseless query method of data in the above embodiment. The number of the memory 310 and the processor 320 can be one or more.
[0109] In one embodiment, the electronic device also includes a communication interface 330 for communicating with external devices and performing data exchange transmission. If the memory 310, the processor 320 and the communication interface 330 are implemented independently, the memory 310, the processor 320 and the communication interface 330 can be interconnected through a bus and complete mutual communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0110] Optionally, in a specific implementation, if the memory 310, the processor 320 and the communication interface 330 are integrated on a chip, the memory 310, the processor 320 and the communication interface 330 can communicate with each other through an internal interface.
[0111] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method for seamless query of data provided in the above embodiment.
[0112] An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method provided by the embodiment of the present application.
[0113] An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the application.
[0114] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the advanced RISC machines (ARM) architecture.
[0115] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory, and may also include a non-volatile random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus RAM (DR RAM).
[0116] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
[0117] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the described specific features, structures, materials or characteristics may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0118] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0119] Any process or method description in the flow chart or otherwise described herein can be understood to represent a module, fragment or portion of a code including one or more executable instructions for implementing the steps of a specific logical function or process. And the scope of the preferred embodiment of the present application includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved.
[0120] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.
[0121] It should be understood that the various parts of the present application can be implemented with hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium, and when the program is executed, it includes one of the steps of the method embodiment or a combination thereof.
[0122] In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a disk or an optical disk, etc.
[0123] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for non-sensing query of data, characterized in that: include: In response to the encapsulation instruction, encapsulate the unified access interface of different types of data sources; Receiving an access request based on the unified access interface, parsing the access request, and obtaining a query table name; Determine the target data source name according to the query table name and the business data relationship mapping table; According to the target data source name, target configuration link information is determined, and data query is performed according to the target configuration link information to obtain query data.
2. The method for querying data without any sense according to claim 1, characterized in that: The unified access interface for encapsulating different types of data sources in response to the encapsulation instruction includes: In response to the first encapsulation sub-instruction, different types of data sources are determined, the data sources including at least two of MySQL, Oracle, PostgreSQL, CTG-cache, and Redis data sources; In response to the second encapsulation sub-instruction, performing customized interface access configuration according to different types of the data sources to determine access configuration information; According to the access configuration information, a unified access interface of different types of data sources is encapsulated.
3. The method for querying data without feeling according to claim 1 or 2, characterized in that: The access request is parsed to obtain the query table name including: Determine the SQL statement of the access request; The SQL statement is parsed by a parser to obtain a query table name.
4. The method for querying data without feeling according to claim 3 is characterized by: Determining the target data source name according to the query table name and the business data relationship mapping table includes: According to the query table name, query the business data relationship mapping table to determine the matching target business table name; the business data relationship mapping table includes data source names of different data sources and the business table name corresponding to each data source name; According to the target business table name, the corresponding target data source name is matched.
5. The method for querying data without feeling according to claim 3 is characterized by: Determining target configuration link information according to the target data source name includes: According to the target data source name, query the actual data source table to determine the matching data source name; the actual data source table includes data source information of different data sources, and the data source information includes the data source name and configuration link information; According to the matched data source name, corresponding target configuration link information is determined.
6. The method for querying data without feeling according to claim 5 is characterized by: The querying of data according to the target configuration link information to obtain the query data includes: Connecting to the corresponding target data source through the link address in the target configuration link information; Compare the user name and user password in the access request with the user name and user password in the target configuration link information to obtain a comparison result; When the comparison results are consistent, the target data source is queried to obtain query data.
7. The method for querying data without feeling according to claim 5, characterized in that: The method further comprises: When the query data exceeds the number of display items of the display page and is less than or equal to a preset number of items, the query data is stored in a cache, and a first display page number is determined according to the number of display items and the query data, and the query data is displayed in pages according to the first display page number; When the query data exceeds the number of display items on the display page and is greater than a preset number, determine the first part of the query data within the preset number of items and the second part of the query data outside the preset number of items, store the first part of the data in the cache, and determine the second display page number based on the display number of items and the first part of the data, and display the first part of the data in pages according to the second display page number. When the last page of the second display page number is displayed, when the user switches to the next page, clear the cache and store the second part of the data in the cache, and display the second part of the data in a single page or in pages.
8. A data non-sensing query device, characterized in that: include: The encapsulation module is used to encapsulate the unified access interface of different types of data sources in response to the encapsulation instruction; A parsing module, used for receiving an access request based on the unified access interface, parsing the access request, and obtaining a query table name; A determination module, used to determine the target data source name according to the query table name and the business data relationship mapping table; The query module is used to determine the target configuration link information according to the target data source name, and perform data query according to the target configuration link information to obtain query data.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed, the method according to any one of claims 1 to 7 is implemented.