CN109739874B - Method, apparatus, computer device and storage medium for providing data content - Google Patents

Method, apparatus, computer device and storage medium for providing data content Download PDF

Info

Publication number
CN109739874B
CN109739874B CN201811412873.8A CN201811412873A CN109739874B CN 109739874 B CN109739874 B CN 109739874B CN 201811412873 A CN201811412873 A CN 201811412873A CN 109739874 B CN109739874 B CN 109739874B
Authority
CN
China
Prior art keywords
data content
data
query statement
content query
statement
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.)
Active
Application number
CN201811412873.8A
Other languages
Chinese (zh)
Other versions
CN109739874A (en
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811412873.8A priority Critical patent/CN109739874B/en
Publication of CN109739874A publication Critical patent/CN109739874A/en
Application granted granted Critical
Publication of CN109739874B publication Critical patent/CN109739874B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application belongs to the technical field of big data, and relates to a method, a device, computer equipment and a storage medium for providing data content. The method for providing data content includes: when a Code for requesting data content is received by a data calling party, searching in a local data dictionary by applying the Code; when the same Code exists in the data dictionary, the Code is applied to search a data content query statement; when a corresponding data content query statement is found, the data content query statement is applied to extract data content; and returning the extracted data content to the data calling party. The method for providing the data content can keep the same data content consistent in different functions, is beneficial to the management of the data content, and provides the data content quickly. In addition, the method for providing the data content can reduce the time for carrying out the inspection processing, and is beneficial to subsequent maintenance personnel to maintain the system.

Description

Method, apparatus, computer device and storage medium for providing data content
Technical Field
The application belongs to the technical field of big data, and relates to a method, a device, computer equipment and a storage medium for providing data content.
Background
A data dictionary is a collection of information about data, i.e., a collection of definitions for all elements contained in a dataflow graph. The data dictionary is an important part of the database and is mainly used for storing relevant information used by the database. The data dictionary is a set of read-only tables for the user, and typically the contents of the data dictionary include: information of all mode objects in the database, such as tables, views, clusters, indexes and the like; allocated space, such as how much space is currently used, etc.; default values for columns, constraint information integrity; a name of the user; rights granted to the user and the role; audit information accessed or used by a user; and other generated database information. A typical representation of a data dictionary is a set of tables and view structures, stored in the system's table space.
In the prior art, the description of the same data content employed in different functions is different. The use of different descriptions for the same data content is prone to ambiguity, which is detrimental to the management of the data content, in particular to the quick provision of the data content. In general, it takes a lot of time to perform the inspection process in order to keep the same data content consistent among different functions, thus being disadvantageous for subsequent maintenance personnel to maintain the system.
Disclosure of Invention
The embodiment of the application discloses a method, a device, equipment and a storage medium for providing data content, which aim to rapidly provide the data content for a data calling party.
Some embodiments of the application disclose a method of providing data content. The method for providing data content comprises the following steps: when a Code for requesting data content is received by a data calling party, searching in a local data dictionary by applying the Code; when the same Code exists in the data dictionary, the Code is applied to search a data content query statement; when a corresponding data content query statement is found, the data content query statement is applied to extract data content; and returning the extracted data content to the data calling party.
In some embodiments of the present application, the step of extracting the data content using the data content query term includes: querying a local cache using the data content query statement; when an execution plan of the data content query statement exists in a local cache, the data content query statement is applied to extract data content; when the execution plan of the data content query statement does not exist in the local cache, grammar checking is carried out on the data content query statement; when the data content query statement passes the grammar check, carrying out semantic check on the data content query statement; locking the data content to be queried when the data content query statement passes the semantic check; checking the data calling authority of the data calling party; and when the data calling party has the data calling right, extracting the data content from the locked data content to be queried by applying the data content query statement.
In some embodiments of the present application, the step of extracting the data content using the data content query term further comprises: and when the data calling party has the data calling right, generating an optimal execution plan of the data content query statement.
In some embodiments of the present application, the step of generating an optimal execution plan for the data content query statement includes: mapping the data content query statement with the data dictionary; and combining corresponding statistical data and a storage outline of the data content queried by the data content query statement in the data dictionary to generate an optimal execution plan of the data content query statement.
In some embodiments of the present application, the step of locking the data content to be queried includes: the block of the data content corresponding to the data content query statement is locked by the latch, preventing the block of the data content corresponding to the data content query statement from being occupied.
In some embodiments of the application, the step of checking the data call authority of the data caller includes: checking whether the data calling party is contained in a data calling authority list; when the data calling party is contained in the data calling authority list, the data calling party has data calling authority.
In some embodiments of the present application, the step of extracting the data content using the data content query term further comprises: searching corresponding data content in a data cache area based on fields and tables in the data content query statement; when the corresponding data content exists in the data cache region, extracting the corresponding data content in the cache region; no corresponding data content exists in the data cache region, and the corresponding data content is searched in a database based on the fields and the tables in the data content query statement; and when the corresponding data content exists in the database, extracting the corresponding data content in the database.
An embodiment of the present application discloses an apparatus for providing data content. The apparatus for providing data content includes: the Code retrieval module is used for retrieving the Code in the local data dictionary by applying the Code when the Code for requesting the data content is received by the data calling party; the sentence searching module is used for searching the data content query sentence by using the Code when the same Code exists in the data dictionary; the data content extraction module is used for extracting data content by applying the data content query statement when the corresponding data content query statement is found; and the data content sending module is used for returning the extracted data content to the data calling party.
In some embodiments of the application, the data content extraction module comprises: a cache query unit for querying a local cache using the data content query statement; an extracting unit, configured to extract data content by applying the data content query statement when there is an execution plan of the data content query statement in a local cache; a grammar checking unit for performing grammar checking on the data content query statement when the execution plan of the data content query statement does not exist in the local cache; the semantic checking unit is used for carrying out semantic checking on the data content query statement when the data content query statement passes the grammar checking; the data content locking unit is used for locking the data content to be queried when the data content query statement passes the semantic check; the data calling authority checking unit is used for checking the data calling authority of the data calling party; and when the data calling party has the data calling right, the extracting unit applies the data content query statement to extract the data content from the locked data content to be queried.
In some embodiments of the present application, the apparatus for providing data content further includes an optimal execution plan generating module, where the optimal execution plan generating module is configured to generate an optimal execution plan for the data content query statement when the data caller has a data call right.
In some embodiments of the present application, the optimal execution plan generation module includes: the mapping unit is used for mapping the data content query statement with the data dictionary; and the generation unit is used for combining the corresponding statistical data and the storage outline of the data content queried by the data content query statement in the data dictionary to generate an optimal execution plan of the data content query statement.
In some embodiments of the present application, the data content locking unit locks the block of the data content corresponding to the data content query statement through a latch, preventing the block of the data content corresponding to the data content query statement from being occupied.
In some embodiments of the present application, the data call authority checking unit checks whether the data caller is included in a data call authority list; when the data calling party is contained in the data calling authority list, the data calling party has data calling authority.
In some embodiments of the present application, the data content extraction module searches the data cache for corresponding data content based on the fields and tables in the data content query statement; the data content extraction module extracts corresponding data content in the cache region when the corresponding data content exists in the data cache region; the data content extraction module does not have corresponding data content in the data cache region, and searches corresponding data content in a database based on fields and tables in the data content query statement; and the data content extraction module extracts the corresponding data content in the database when the corresponding data content exists in the database.
Some embodiments of the application disclose a computer device comprising a memory having a computer program stored therein and a processor implementing steps of any of the methods of providing data content described above when the computer program is executed.
Some embodiments of the application disclose a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of any of the methods of providing data content described above.
Compared with the prior art, the technical scheme disclosed by the application has the following main beneficial effects:
In an embodiment of the present application, the method for providing data content includes: when a Code for requesting data content is received by a data calling party, searching in a local data dictionary by applying the Code; when the same Code exists in the data dictionary, the Code is applied to search a data content query statement; when a corresponding data content query statement is found, the data content query statement is applied to extract data content; and returning the extracted data content to the data calling party. In the embodiment of the application, the Code for requesting the data content is used for searching in the local data dictionary, when the same Code exists in the data dictionary, the Code is used for searching the data content query statement, and when the corresponding data content query statement is searched, the data content query statement is used for extracting the data content, so that the consistency of the description of the data calling party and the data service party for the same data content (namely, the consistency of the codes) is only required to be maintained, the same data content can be kept consistent in different functions, the management of the data content is facilitated, and the data content is provided quickly. In addition, in the embodiment of the application, the method for providing the data content can reduce the time for carrying out the inspection processing, and is beneficial to subsequent maintenance personnel to maintain the system.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a diagram illustrating a data service providing data content to a data caller according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a method for providing data content according to an embodiment of the application;
FIG. 3 is a diagram illustrating steps for extracting data content using the data content query term according to an embodiment of the present application;
FIG. 4 is a diagram illustrating steps for generating an optimal execution plan for the data content query term according to an embodiment of the present application;
FIG. 5 is a diagram illustrating steps for extracting data content using the data content query term according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an apparatus for providing data content according to an embodiment of the present application;
FIG. 7 is a schematic diagram of the data content extraction module 30 according to an embodiment of the application;
FIG. 8 is a schematic diagram of an apparatus for providing data content according to another embodiment of the present application;
FIG. 9 is a schematic diagram of an optimal execution plan generation module 50 according to another embodiment of the present application;
fig. 10 is a basic block diagram of a computer device 100 according to an embodiment of the present application.
Reference numerals illustrate:
Detailed Description
In order that the application may be readily understood, a more complete description of the application will be rendered by reference to the appended drawings. Preferred embodiments of the present application are shown in the drawings. This application may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
An embodiment of the present application discloses a method of providing data content.
Referring to fig. 1 and 2, fig. 1 is a schematic diagram of providing data content to a data caller by a data service according to an embodiment of the present application, and fig. 2 is a schematic diagram of a method for providing data content according to an embodiment of the present application.
As illustrated in fig. 1, in an embodiment of the present application, data content is requested by a data call to a data server. Specifically, the data caller sends a data service request to the data service party through an interface url, wherein the data service request contains a Code for requesting data content. The data calling party and the data service party agree to adopt the same Code, name and the like for the same data content. The data service side provides the data content to the data calling side by adopting the following method for providing the data content.
As illustrated in fig. 2, the method of providing data content includes:
s1: when a Code for requesting data content is received by a data caller, the Code is applied to search in a local data dictionary.
In an embodiment of the present application, the Code is composed of a number, letter, or other character.
S2: and when the same Code exists in the data dictionary, the Code is applied to search the data content query statement.
S3: and when the corresponding data content query statement is found, the data content query statement is applied to extract the data content.
In an embodiment of the present application, the data content query statement is an SQL (Structured Query Language, structured query language, used to access data and query, update, and manage relational database systems) query statement.
S4: and returning the extracted data content to the data calling party.
Specifically, the data service side returns the extracted data content to the data calling side through an interface url.
In an embodiment of the present application, the method for providing data content includes: when a Code for requesting data content is received by a data calling party, searching in a local data dictionary by applying the Code; when the same Code exists in the data dictionary, the Code is applied to search a data content query statement; when a corresponding data content query statement is found, the data content query statement is applied to extract data content; and returning the extracted data content to the data calling party. In the embodiment of the application, the Code for requesting the data content is used for searching in the local data dictionary, when the same Code exists in the data dictionary, the Code is used for searching the data content query statement, and when the corresponding data content query statement is searched, the data content query statement is used for extracting the data content, so that the consistency of the description of the data calling party and the data service party for the same data content (namely, the consistency of the codes) is only required to be maintained, the same data content can be kept consistent in different functions, the management of the data content is facilitated, and the data content is provided quickly. In addition, in the embodiment of the application, the method for providing the data content can reduce the time for carrying out the inspection processing, and is beneficial to subsequent maintenance personnel to maintain the system.
Referring to fig. 3, a schematic diagram of steps for extracting data content using the data content query term according to an embodiment of the present application is shown.
As illustrated in fig. 3, in some embodiments of the application, the step of extracting the data content using the data content query statement includes:
s31: the local cache is queried using the data content query statement.
In an embodiment of the present application, the data content query statement is an SQL statement. The application finds the SQL statement to query the local cache. The local cache stores the hash value of the executed SQL statement. The server process converts the searched SQL sentence into ASII codes, and then transmits ASII codes obtained by conversion to the HASH function. The HASH function returns a HASH value to the server process. The server process looks up whether the same hash value exists in the local cache.
S32: when an execution plan of the data content query statement exists in the local cache, the data content query statement is applied to extract the data content.
In an embodiment of the application, the execution plan is typically generated for a database from the data content query statement. The execution plan includes:
The main body of the execution plan is a reentrant read-only data structure, called a query plan, which can be used by any number of users. No user context is stored in the query plan. The copies of the query plan in the local cache never exceed two. Where one copy of the query plan is for all serial execution and another copy of the query plan is for all parallel execution. The copy of the query plan for parallel execution covers all parallel execution, but is independent of the parallelism of the parallel execution.
In the execution context, each user that is executing a query has a data structure that contains its execution-specific data (e.g., parameter values). This data structure is referred to as an execution context. The data structure of the execution context may be reused. If a user performs a query with one of the data structures unused, the data structure will be reinitialized with the context of the new user.
In an embodiment of the present application, the data content query statement is an SQL statement. When the same hash value as the searched SQL statement exists in the local cache, the SQL statement is applied to extract the data content.
S33: when the execution plan of the data content query statement does not exist in the local cache, grammar checking is performed on the data content query statement.
In an embodiment of the present application, the data content query statement is an SQL statement. When the hash value same as the searched SQL statement does not exist in the local cache, the SQL statement is subjected to grammar checking. The grammar checking of the SQL statement is mainly to check whether the SQL statement accords with the grammar rule of the structured query language.
In the embodiment of the application, when the data content query statement does not pass the grammar check, the prompt information of grammar errors of the data content query statement is returned to the data calling party through an interface url.
S34: and when the data content query statement passes the grammar check, carrying out semantic check on the data content query statement.
In an embodiment of the present application, the step of performing semantic checking on the data content query statement includes: after the grammar check is carried out on the data content query statement by the server process, analyzing the table, the field, the index, the view and the like in the data content query statement, and judging whether the table, the field, the index, the view and the like of the data content query statement are contained in the database or not according to the table, the field, the index, the view and the like in the data dictionary. When a table, field, index, view, etc. of the data content query statement is contained in the database, the data content query statement passes the semantic check.
For example, the data content query statement is an SQL statement. After the grammar checking is performed on the SQL statement by the server process, analyzing tables, fields, indexes, views and the like in the SQL statement, and judging whether the tables, fields, indexes, views and the like of the data content query statement are contained in a database or not according to the tables, fields, indexes, views and the like in the data dictionary. When a table, field, index, view, etc. of the SQL statement is contained in the database, the data content query statement passes the semantic check.
S35: and locking the data content to be queried when the data content query statement passes the semantic check. The locking of the data content to be queried can prevent the structure of the data content from being changed in the query process.
In an embodiment of the present application, the step of locking the data content to be queried includes: the block of data content corresponding to the data content query statement is locked by a latch (shared pool latch) to prevent the block of data content corresponding to the data content query statement from being occupied.
In the embodiment of the application, when the data content query statement does not pass the semantic check, the prompt information of the semantic error of the data content query statement is returned to the data calling party through an interface url.
S36: and checking the data calling authority of the data calling party.
In an embodiment of the present application, the step of checking the data call authority of the data caller includes: checking whether the data calling party is contained in a data calling authority list; when the data calling party is contained in the data calling authority list, the data calling party has data calling authority.
S37: and when the data calling party has the data calling right, extracting the data content from the locked data content to be queried by applying the data content query statement.
In the embodiment of the application, when the data calling party does not have the data calling right, the prompt information that the data calling party does not have the data calling right is returned to the data calling party through an interface url.
In some embodiments of the present application, the step of extracting the data content using the data content query term further comprises:
S38: and when the data calling party has the data calling right, generating an optimal execution plan of the data content query statement.
Referring to fig. 4, a schematic diagram of steps for generating an optimal execution plan of the data content query term according to an embodiment of the present application is shown.
As illustrated in fig. 4, the step of generating an optimal execution plan for the data content query statement includes:
S381: the data content query statement is mapped with the data dictionary.
S382: and combining corresponding statistical data and a storage outline of the data content queried by the data content query statement in the data dictionary to generate an optimal execution plan of the data content query statement.
In an embodiment of the present application, the optimal execution plan may be generated by an optimization model preset at the data service side.
By generating the optimal execution plan of the data content query statement, the execution efficiency of the data content query statement is improved.
Referring to fig. 5, a schematic diagram of steps for extracting data content using the data content query term according to an embodiment of the present application is shown.
As illustrated in fig. 5, the step of extracting the data content using the data content query statement further includes:
s391: searching corresponding data content in a data cache area based on fields and tables in the data content query statement;
S392: when the corresponding data content exists in the data cache region, extracting the corresponding data content in the cache region;
S393: no corresponding data content exists in the data cache region, and the corresponding data content is searched in a database based on the fields and the tables in the data content query statement;
s394: and when the corresponding data content exists in the database, extracting the corresponding data content in the database.
In an embodiment of the present application, the data content query statement is an SQL statement. And the server process searches corresponding data content in the data cache region based on fields, tables and the like in the SQL sentence, and if the corresponding data content exists in the data cache region. And when the corresponding data content exists in the data cache region, running a data content extraction code to extract the data content in the data cache region, and increasing the access times of the corresponding data content in the data cache region by a server process according to an LRU algorithm (a page replacement algorithm for memory management).
And when the corresponding data content does not exist in the data cache region, the server process searches the corresponding data content in the database based on the fields, the tables and the like in the SQL statement. And when the corresponding data content exists in the database, running a data content extraction code to extract the data content in the database.
An embodiment of the present application discloses an apparatus for providing data content.
Referring to fig. 6, a schematic diagram of an apparatus for providing data content according to an embodiment of the present application is shown.
As illustrated in fig. 6, the apparatus for providing data content includes:
The Code retrieval module 10 is configured to, when receiving a Code for requesting data content from a data caller, apply the Code to retrieve from a local data dictionary.
The sentence searching module 20 is configured to, when the same Code exists in the data dictionary, apply the Code to search for the data content query sentence.
The data content extraction module 30 is configured to extract data content by applying the data content query statement when the corresponding data content query statement is found.
And the data content sending module 40 is used for returning the extracted data content to the data calling party.
In the embodiment of the application, when the device for providing the data content receives the Code for requesting the data content by the data calling party through the Code retrieval module 10, the device applies the Code to retrieve in a local data dictionary; when the same Code exists in the data dictionary, the Code is applied to search a data content query sentence through the sentence searching module 20; when a corresponding data content query statement is found, the data content extraction module 30 applies the data content query statement to extract data content; the extracted data content is returned to the data caller through the data content transmission module 40. In the embodiment of the application, the device for providing the data content can keep the consistency of the description of the data calling party and the data service party for the same data content, can keep the same data content consistent in different functions, is beneficial to the management of the data content, and can provide the data content quickly. In addition, in the embodiment of the application, the device for providing the data content can reduce the time for carrying out the inspection processing, and is beneficial to subsequent maintenance personnel to maintain the system.
Referring to fig. 7, a schematic diagram of the data content extraction module 30 according to an embodiment of the application is shown.
As illustrated in fig. 7, in some embodiments of the application, the data content extraction module 30 includes:
A cache query unit 31 for querying the local cache using the data content query statement.
The extracting unit 32 is configured to apply the data content query term to extract the data content when there is an execution plan of the data content query term in the local cache.
And a grammar checking unit 33 for performing grammar checking on the data content query sentence when the execution plan of the data content query sentence does not exist in the local cache.
The semantic checking unit 34 is configured to perform semantic checking on the data content query statement when the data content query statement passes the grammar checking.
And the data content locking unit 35 is configured to lock the data content to be queried when the data content query statement passes the semantic check.
In some embodiments of the present application, the data content locking unit 35 locks the block of the data content corresponding to the data content query statement through a latch, preventing the block of the data content corresponding to the data content query statement from being occupied.
A data call authority checking unit 36 for checking the data call authority of the data caller. In some embodiments of the present application, the data call authority checking unit 36 checks whether the data caller is included in a data call authority list; when the data calling party is contained in the data calling authority list, the data calling party has data calling authority.
Further, the extracting unit 32 applies the data content query statement to extract the data content when the data caller has the data call right.
Referring to fig. 8, a schematic diagram of an apparatus for providing data content according to another embodiment of the present application is shown.
As illustrated in fig. 8, in some embodiments of the present application, the apparatus for providing data content further includes an optimal execution plan generation module 50. The optimal execution plan generating module 50 is configured to generate an optimal execution plan of the data content query statement when the data caller has a data call right.
Referring to FIG. 9, a schematic diagram of the optimal execution plan generation module 50 according to another embodiment of the present application is shown.
As illustrated in fig. 9, in some embodiments of the application, the optimal execution plan generation module 50 includes:
a mapping unit 51, configured to map the data content query statement with the data dictionary.
And the generating unit 52 is configured to combine the corresponding statistical data and the storage outline of the data content queried by the data content query statement in the data dictionary to generate an optimal execution plan of the data content query statement.
In some embodiments of the present application, the data content extraction module 30 searches the data cache for the corresponding data content based on the fields and tables in the data content query statement.
The data content extraction module 30 extracts the corresponding data content in the buffer when the corresponding data content exists in the data buffer.
The data content extraction module 30 does not have corresponding data content in the data cache region, and searches the database for the corresponding data content based on the fields and tables in the data content query statement.
The data content extraction module 30 extracts the corresponding data content in the database when the corresponding data content exists in the database.
An embodiment of the application discloses a data interaction system.
The data interaction system comprises a data calling party and a data service party. The data caller and the data server are respectively configured with at least one server and at least one database. The data calling party and the data service party agree to adopt the same Code, name and the like for the same data content. When the data calling party needs to call the data content of the data service party, the data calling party sends a data service request to the data service party through an interface url, wherein the data service request comprises a Code for requesting the data content. The data service side executes the method for providing the data content so as to provide the corresponding data content for the data calling side.
An embodiment of the application discloses a computer device. Referring specifically to fig. 10, a basic structural block diagram of a computer device 100 according to an embodiment of the present application is shown.
As illustrated in fig. 10, the computer device 100 includes a memory 101, a processor 102, and a network interface 103 communicatively coupled to each other via a system bus. It should be noted that only computer device 100 having components 101-103 is shown in FIG. 10, but it should be understood that not all of the illustrated components need be implemented, and that more or fewer components may alternatively be implemented. It will be appreciated by those skilled in the art that the computer device herein is a device capable of automatically performing numerical calculations and/or information processing in accordance with predetermined or stored instructions, the hardware of which includes, but is not limited to, microprocessors, application SPECIFIC INTEGRATED Circuits (ASICs), programmable gate arrays (Field-Programmable GATE ARRAY, FPGA), digital processors (DIGITAL SIGNAL processors, DSPs), embedded devices, and the like.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
The memory 101 includes at least one type of readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 101 may be an internal storage unit of the computer device 100, such as a hard disk or a memory of the computer device 100. In other embodiments, the memory 101 may also be an external storage device of the computer device 100, such as a plug-in hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like, which are provided on the computer device 100. Of course, the memory 101 may also include both internal storage units of the computer device 100 and external storage devices. In this embodiment, the memory 101 is typically used to store an operating system and various application software installed on the computer device 100, such as the program code of the method for providing data content described above. Further, the memory 101 may be used to temporarily store various types of data that have been output or are to be output.
The processor 102 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 102 is generally used to control the overall operation of the computer device 100. In this embodiment, the processor 102 is configured to execute the program code stored in the memory 101 or process data, for example, execute the program code of the method for providing data content.
The network interface 103 may comprise a wireless network interface or a wired network interface, which network interface 103 is typically used to establish communication connections between the computer device 100 and other electronic devices.
The present application also provides another embodiment, namely, a computer-readable storage medium storing a document information entry program executable by at least one processor to cause the at least one processor to perform any one of the steps of the method for providing data content.
Finally, it should be noted that the above-mentioned embodiments illustrate rather than limit the application to the particular embodiments disclosed, and that these embodiments are merely exemplary of the application and are intended to be limiting. This application may be embodied in many different forms, but rather, embodiments are provided in order to provide a thorough and complete understanding of the present disclosure. Although the application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing description, or equivalents may be substituted for elements thereof. All equivalent structures made by the content of the specification and the drawings of the application are directly or indirectly applied to other related technical fields, and are also within the scope of the application.

Claims (9)

1. A method of providing data content, comprising:
When a Code for requesting data content is received by a data calling party, the Code is applied to search in a local data dictionary, wherein the data calling party and a data receiving party adopt the same Code for the same data content so as to ensure that the same data content is kept consistent in different functions;
when the same Code exists in the data dictionary, the Code is applied to search a data content query statement;
when a corresponding data content query statement is found, the data content query statement is applied to extract data content;
the extracted data content is returned to the data calling party;
the step of extracting the data content by using the data content query statement comprises the following steps:
Querying a local cache using the data content query statement;
When an execution plan of the data content query statement exists in a local cache, the data content query statement is applied to extract data content;
when the execution plan of the data content query statement does not exist in the local cache, grammar checking is carried out on the data content query statement;
When the data content query statement passes the grammar check, carrying out semantic check on the data content query statement;
locking the data content to be queried when the data content query statement passes the semantic check;
checking the data calling authority of the data calling party;
When the data calling party has the data calling right, the data content query statement is applied to extract the data content from the locked data content to be queried;
The data content query statement is an SQL statement, the local cache stores a hash value of the executed SQL statement, and the step of applying the data content query statement to query the local cache comprises the following steps:
converting the SQL statement corresponding to the data content query statement into ASII codes;
transmitting the ASII codes to a HASH function, and acquiring a HASH value returned by the HASH function;
Querying whether the same hash value exists in the local cache.
2. The method of providing data content according to claim 1, wherein the step of extracting data content using the data content query term further comprises: and when the data calling party has the data calling right, generating an optimal execution plan of the data content query statement.
3. The method of providing data content according to claim 2, wherein the step of generating an optimal execution plan for the data content query term comprises:
mapping the data content query statement with the data dictionary;
And combining corresponding statistical data and a storage outline of the data content queried by the data content query statement in the data dictionary to generate an optimal execution plan of the data content query statement.
4. The method of providing data content according to claim 1, wherein the step of locking the data content to be queried comprises: the block of the data content corresponding to the data content query statement is locked by the latch, preventing the block of the data content corresponding to the data content query statement from being occupied.
5. The method of providing data content according to claim 1, wherein the step of checking the data call authority of the data caller comprises: checking whether the data calling party is contained in a data calling authority list; when the data calling party is contained in the data calling authority list, the data calling party has data calling authority.
6. The method of providing data contents according to any one of claims 1 to 5, wherein the step of extracting the data contents using the data contents query term further comprises:
searching corresponding data content in a data cache area based on fields and tables in the data content query statement;
when the corresponding data content exists in the data cache region, extracting the corresponding data content in the cache region;
no corresponding data content exists in the data cache region, and the corresponding data content is searched in a database based on the fields and the tables in the data content query statement;
and when the corresponding data content exists in the database, extracting the corresponding data content in the database.
7. An apparatus for providing data content, comprising:
The Code retrieval module is used for retrieving the Code in the local data dictionary by applying the Code when receiving the Code for requesting the data content by the data calling party, wherein the data calling party and the data receiving party adopt the same Code for the same data content so as to ensure that the same data content is consistent in different functions;
The sentence searching module is used for searching the data content query sentence by using the Code when the same Code exists in the data dictionary;
The data content extraction module is used for extracting data content by applying the data content query statement when the corresponding data content query statement is found;
the data content sending module is used for returning the extracted data content to the data calling party;
The data content extraction module is also used for inquiring a local cache by applying the data content inquiry statement; when an execution plan of the data content query statement exists in a local cache, the data content query statement is applied to extract data content; when the execution plan of the data content query statement does not exist in the local cache, grammar checking is carried out on the data content query statement; when the data content query statement passes the grammar check, carrying out semantic check on the data content query statement; locking the data content to be queried when the data content query statement passes the semantic check; checking the data calling authority of the data calling party; when the data calling party has the data calling right, the data content query statement is applied to extract the data content from the locked data content to be queried;
The data content query statement is an SQL statement, the local cache stores a hash value of the executed SQL statement, and the applying the data content query statement to query the local cache comprises: converting the SQL statement corresponding to the data content query statement into ASII codes; transmitting the ASII codes to a HASH function, and acquiring a HASH value returned by the HASH function; querying whether the same hash value exists in the local cache.
8. A computer device comprising a memory and a processor, wherein the memory has stored therein a computer program, which when executed by the processor performs the steps of the method of providing data content according to any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of providing data content according to any one of claims 1 to 6.
CN201811412873.8A 2018-11-23 2018-11-23 Method, apparatus, computer device and storage medium for providing data content Active CN109739874B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811412873.8A CN109739874B (en) 2018-11-23 2018-11-23 Method, apparatus, computer device and storage medium for providing data content

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811412873.8A CN109739874B (en) 2018-11-23 2018-11-23 Method, apparatus, computer device and storage medium for providing data content

Publications (2)

Publication Number Publication Date
CN109739874A CN109739874A (en) 2019-05-10
CN109739874B true CN109739874B (en) 2024-05-31

Family

ID=66358717

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811412873.8A Active CN109739874B (en) 2018-11-23 2018-11-23 Method, apparatus, computer device and storage medium for providing data content

Country Status (1)

Country Link
CN (1) CN109739874B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111611241A (en) * 2020-04-29 2020-09-01 平安科技(深圳)有限公司 Dictionary data operation method and device, readable storage medium and terminal equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1321859A1 (en) * 2001-12-18 2003-06-25 Cognos Incorporated System and method for retrieving data from a database system
US6678674B1 (en) * 1998-07-09 2004-01-13 Informex, Inc. Data retrieving method and apparatus data retrieving system and storage medium
CN105589936A (en) * 2015-12-11 2016-05-18 航天恒星科技有限公司 Data query method and system
CN108334622A (en) * 2018-02-08 2018-07-27 竞技世界(北京)网络技术有限公司 A method of it obtains and formats complex data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080214154A1 (en) * 2005-11-01 2008-09-04 Jorey Ramer Associating mobile and non mobile web content

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6678674B1 (en) * 1998-07-09 2004-01-13 Informex, Inc. Data retrieving method and apparatus data retrieving system and storage medium
EP1321859A1 (en) * 2001-12-18 2003-06-25 Cognos Incorporated System and method for retrieving data from a database system
CN105589936A (en) * 2015-12-11 2016-05-18 航天恒星科技有限公司 Data query method and system
CN108334622A (en) * 2018-02-08 2018-07-27 竞技世界(北京)网络技术有限公司 A method of it obtains and formats complex data

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
关系型数据库系统查询优化分析;孙萧寒 等;甘肃科技;20050330;第21卷(第03期);全文 *

Also Published As

Publication number Publication date
CN109739874A (en) 2019-05-10

Similar Documents

Publication Publication Date Title
CN107463635B (en) Method for inquiring picture data and distributed NewSQL database system
CN110795455B (en) Dependency analysis method, electronic device, computer apparatus, and readable storage medium
US8032544B2 (en) Methods and apparatus for generating dynamic program files based on input queries that facilitate use of persistent query services
US9600513B2 (en) Database table comparison
CN107038222B (en) Database cache implementation method and system
US9298775B2 (en) Changing the compression level of query plans
CN112434059B (en) Data processing method, data processing device, computer equipment and storage medium
WO2021179722A1 (en) Sql statement parsing method and system, and computer device and storage medium
US20130232143A1 (en) Efficient knowledge base system
CN113051268A (en) Data query method, data query device, electronic equipment and storage medium
CN105550206B (en) The edition control method and device of structured query sentence
CN116383238B (en) Data virtualization system, method, device, equipment and medium based on graph structure
CN110597844A (en) Heterogeneous database data unified access method and related equipment
US8875222B1 (en) Efficient XACML access control processing
CN103198361A (en) Extensible access control markup language (XACML) strategy assessment engine system based on various optimization mechanisms
CN111414378B (en) Class metadata framework based on GraphQL
CN115269631A (en) Data query method, data query system, device and storage medium
CN109739874B (en) Method, apparatus, computer device and storage medium for providing data content
US20110302220A1 (en) Sql processing for data conversion
CN113377876A (en) Domino platform-based data sub-database processing method, device and platform
CN117076491A (en) Data processing method, storage medium and equipment
US9342581B2 (en) System to disclose the internal structure of persistent database objects
US11966401B2 (en) Query tree labeling and processing
CN111831659B (en) Index checking method and device and computing equipment
CN116204546A (en) SQL precompilation method, SQL precompilation device, SQL precompilation server and SQL precompilation 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
GR01 Patent grant
GR01 Patent grant