CN110413671A - Data query method and device - Google Patents
Data query method and device Download PDFInfo
- Publication number
- CN110413671A CN110413671A CN201910588601.1A CN201910588601A CN110413671A CN 110413671 A CN110413671 A CN 110413671A CN 201910588601 A CN201910588601 A CN 201910588601A CN 110413671 A CN110413671 A CN 110413671A
- Authority
- CN
- China
- Prior art keywords
- employee
- permission levels
- api
- result
- modified
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
Abstract
The invention discloses a kind of data query methods, comprising: obtains structured query language SQL, includes the searching keyword of employee's input in the SQL;The first polling routine is executed according to SQL invocation target API, to obtain query result;When determining query result not is objective result, target API is modified, to obtain modified API, wherein target API and modified API is write based on NG+LUA, and objective result is the result that employee needs;Modified API is called to execute the second polling routine, to obtain objective result.The embodiment of the invention also provides a kind of data query devices.Write api interface by using NG+LUA, just directly tested and issued so that not needing to be compiled after modifying API, reduce debugging process when consumption and manpower, be conducive to improve efficiency data query.
Description
Technical field
The present invention relates to computer field more particularly to a kind of data query method and devices.
Background technique
Application programming interface (application programming interface, API) is two different applications
Interactive interface is realized between program.In order to facilitate user query or tune for database perhaps data service platform
With data, need to be provided out API;And it since data type is various in database or data service platform, needs to mention outward
The API's of confession is large number of, and database or data service platform, which provide most of API to outside, to be write by Java language
, but when the result for the program output that the interface calls is not the result that user needs, need to using written in Java
Interface is modified, is compiled, then issuing again again, this process takes time and effort.
Summary of the invention
The embodiment of the present invention provides a kind of data query method and device, writes api interface by using NG+LUA, so that
Not needing to be compiled after modifying API directly to test and issue, reduce debugging process when consumption and manpower, favorably
In raising efficiency data query.
In a first aspect, the embodiment of the present invention provides a kind of data query method, comprising:
It obtains structured query language (structured query language, SQL), includes that employee inputs in the SQL
Searching keyword;The first polling routine is executed according to SQL invocation target API, to obtain query result;When determining query result
When not being objective result, target API is modified, to obtain modified API, wherein target API and modified API is base
It is write in NG+LUA, which is the result that employee needs;Modified API is called to execute the second inquiry journey
Sequence, to obtain objective result.
In a feasible embodiment, modified API is called to execute the second polling routine, with obtain objective result it
Afterwards, this method further include:
Functional label is added for modified API, which is used to indicate the knot for calling and obtaining after modified API
Fruit is objective result.
In a feasible embodiment, the first polling routine is executed according to SQL invocation target API, to obtain inquiry knot
Before fruit, this method further include:
Obtain the identity information of employee;And the legitimacy of employee is determined according to the identity information of employee.
In a feasible embodiment, modified API is called to execute the second polling routine, to obtain objective result,
Include:
Searching keyword and Database Identification are obtained from modified API;And obtain the Permission Levels of employee;If employee
Permission Levels be higher than the Permission Levels of database indicated by Database Identification, then indicated data of ergodic data library mark
Library obtains multiple queries data relevant to query word from the database;Determine the Permission Levels of multiple queries data;It will be more
Permission Levels are determined as objective result not higher than the data of the Permission Levels of employee in a inquiry data.
In a feasible embodiment, this method further include:
If the Permission Levels of employee are not higher than the Permission Levels of database indicated by Database Identification, to the supervisor of employee
Department's sending permission temporarily modifies request;The permission for receiving authorities' transmission temporarily modifies response, which temporarily modifies
Response carries the modified Permission Levels of employee;If modified Permission Levels are higher than the Permission Levels of database, time
Database indicated by Database Identification is gone through, multiple queries data relevant to query word are obtained from the database;Determination is more
The Permission Levels of a inquiry data;Data by Permission Levels in multiple queries data not higher than the Permission Levels of employee are determined as
Objective result, the Permission Levels of employee are the Permission Levels before modification.
Number in a feasible embodiment, by Permission Levels in multiple queries data not higher than the Permission Levels of employee
After being determined as objective result, this method further include:
The Permission Levels of employee are remodified as the Permission Levels before employee's modification.
Second aspect, the embodiment of the present invention provide a kind of data pipe inquiry unit, comprising:
Acquiring unit includes the searching keyword of employee's input for obtaining structured query language SQL, in the SQL;
Execution unit, for executing the first polling routine according to SQL invocation target API, to obtain query result;
Unit is modified, it is modified to obtain for when determining query result not is objective result, modifying target API
API, wherein target API and modified API is write based on NG+LUA, which is what employee needed
As a result;
Execution unit is also used to that modified API is called to execute the second polling routine, to obtain objective result.
In a feasible embodiment, the data query device further include:
Adding unit, for calling modified API to execute the second polling routine in execution unit, to obtain objective result
Later, functional label is added for modified API, which is used to indicate the result called and obtained after modified API
For objective result.
In a feasible embodiment, which is characterized in that the data query device further include:
Acquiring unit, be also used to according to SQL invocation target API execute the first polling routine, with obtain query result it
Before, obtain the identity information of employee;
Determination unit determines the legitimacy of employee for the identity information according to employee.
In a feasible embodiment, modified API is being called to execute the second polling routine, to obtain objective result
Aspect, execution unit is specifically used for:
Searching keyword and Database Identification are obtained from modified API;And obtain the Permission Levels of employee;
If the Permission Levels of employee are higher than the Permission Levels of database indicated by Database Identification, ergodic data library mark
Know indicated database, multiple queries data relevant to query word are obtained from the database;Determine multiple queries data
Permission Levels;Data by Permission Levels in multiple queries data not higher than the Permission Levels of employee are determined as objective result.
In a feasible embodiment, execution unit also particularly useful for:
If the Permission Levels of employee are not higher than the Permission Levels of database indicated by Database Identification, to the supervisor of employee
Department's sending permission temporarily modifies request;The permission for receiving authorities' transmission temporarily modifies response, which temporarily modifies
Response carries the modified Permission Levels of employee;If modified Permission Levels are higher than the Permission Levels of database, time
Database indicated by Database Identification is gone through, multiple queries data relevant to query word are obtained from the database;Determination is more
The Permission Levels of a inquiry data;Data by Permission Levels in multiple queries data not higher than the Permission Levels of employee are determined as
Objective result, the Permission Levels of the employee are the Permission Levels before modification.
In a feasible embodiment, execution unit also particularly useful for:
By Permission Levels in multiple queries data not higher than employee Permission Levels data be determined as objective result it
Afterwards, the Permission Levels of employee are remodified as the Permission Levels before employee's modification.
The third aspect, a kind of data query device for the offer that the present invention is implemented, comprising:
It is stored with the memory of executable program code;
The processor coupled with memory;
The processor calls the executable program code stored in the memory, executes the whole of first aspect
Or Part Methods.
4th fermentation, the embodiment of the invention provides a kind of computer readable storage medium, the computer storage medium
It is stored with computer program, the computer program includes program instruction, and described program instruction makes institute when being executed by a processor
State all or part of method that processor executes first aspect.
It include employee in the SQL as can be seen that obtaining structured query language SQL in the scheme of the embodiment of the present invention
The searching keyword of input;The first polling routine is executed according to SQL invocation target API, to obtain query result;It is inquired when determining
When not as a result being objective result, target API is modified, to obtain modified API, wherein target API and modified API
It is to be write based on NG+LUA, objective result is the result that employee needs;Modified API is called to execute the second inquiry journey
Sequence, to obtain objective result.Api interface is write by using NG+LUA, so that not needing to be compiled after modifying API just straight
Tap into row test and publication, reduce debugging process when consumption and manpower, be conducive to improve efficiency data query.
The aspects of the invention or other aspects can more straightforwards in the following description.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of data query method provided in an embodiment of the present invention;
Fig. 2 is a kind of structural schematic diagram of data query device provided in an embodiment of the present invention;
Fig. 3 is the structural schematic diagram of another data query device provided in an embodiment of the present invention.
Specific embodiment
It is described in detail separately below.
Description and claims of this specification and term " first ", " second ", " third " and " in the attached drawing
Four " etc. are not use to describe a particular order for distinguishing different objects.In addition, term " includes " and " having " and it
Any deformation, it is intended that cover and non-exclusive include.Such as it contains the process, method of a series of steps or units, be
System, product or equipment are not limited to listed step or unit, but optionally further comprising the step of not listing or list
Member, or optionally further comprising other step or units intrinsic for these process, methods, product or equipment.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments
Containing at least one embodiment of the present invention.Each position in the description occur the phrase might not each mean it is identical
Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and
Implicitly understand, embodiment described herein can be combined with other embodiments.
" multiple " refer to two or more."and/or" describes the incidence relation of affiliated partner, indicates may exist
Three kinds of relationships, for example, A and/or B, can indicate: individualism A exists simultaneously A and B, these three situations of individualism B.Word
Symbol "/" typicallys represent the relationship that forward-backward correlation object is a kind of "or".
Embodiments herein is described with reference to the accompanying drawing.
Referring to Fig. 1, Fig. 1 is a kind of flow diagram of data query method provided in an embodiment of the present invention, including following
Step:
S101, structured query language SQL is obtained, includes the searching keyword of employee's input in the SQL.
It should be noted that employee needs to inquire in the database and the building Shenzhen Wanke Lu Shan due to the demand of business
The relevant information of disk obtains from the background after employee inputs " Shenzhen Wanke Lu Shan " (i.e. searching keyword) on database front-end interface
I.e. " Shenzhen Wanke Lu Shan " searching keyword for taking employee to input generates SQL.
S102, the first polling routine is executed according to SQL invocation target API, to obtain query result.
In a feasible embodiment, the first polling routine is executed according to SQL invocation target API, to obtain inquiry knot
Before fruit, this method further include:
Obtain the identity information of employee;The legitimacy of employee is determined according to the identity information of employee.
It should be noted that needing to maintain secrecy to non-employee for certain sensitive informations, therefore according to SQL tune
The first polling routine is executed with target API and needs to obtain the identity information of employee before obtaining query result, if according to member
The identity information of work determines that the employee is legal, then executes the first polling routine according to SQL invocation target API, to obtain inquiry knot
Fruit;If determining that the employee is illegal according to the identity information of employee, does not execute and looked into according to SQL invocation target API execution first
Program is ask, the step of to obtain query result.
S103, when determining query result not is objective result, modify target API, to obtain modified API.
Wherein, target API and modified API is write based on NG+LUA, and objective result is what employee needed
As a result.
It should be noted that being had characteristics that based on the API that NG+LUA writes
After to API modification, does not need to be compiled, can directly carry out follow-up test and publication.
S104, modified API is called to execute the second polling routine, to obtain objective result.
In a kind of feasible embodiment, modified API is called to execute the second polling routine, to obtain objective result,
Include:
Searching keyword and Database Identification are obtained from modified API;And obtain the Permission Levels of employee;If employee
Permission Levels be higher than the Permission Levels of database indicated by Database Identification, then indicated data of ergodic data library mark
Library obtains multiple queries data relevant to searching keyword from the database;Determine the Permission Levels of multiple queries data;
Data by Permission Levels in multiple queries data not higher than the Permission Levels of the employee are determined as objective result.
Specifically, for certain databases, the lower employee of Permission Levels can not be checked, such as building reserve price
Information, building remaining information, building drawing information etc., therefore when inquiring data, need to judge whether the permission of employee is higher than
The Permission Levels of the database traverse the number if the Permission Levels information of employee is higher than the grade of the database to be inquired
According to library, multiple queries data relevant to searching keyword are obtained;In multiple inquiry data, partial data is can not be to power
Limit what junior employee showed, it is therefore desirable to the permission etc. that Permission Levels are not higher than employee is obtained from multiple queries data
The data of grade, and the data are determined as objective result.
In a feasible embodiment, this method further include:
If the Permission Levels of employee are not higher than the Permission Levels of database indicated by Database Identification, to the supervisor of employee
Department's sending permission temporarily modifies request;It receives the permission that authorities send and temporarily modifies response, which temporarily modifies sound
The modified Permission Levels of employee should be carried;If modified Permission Levels are higher than the Permission Levels of database, traverse
Database indicated by Database Identification obtains multiple queries data relevant to query word from the database;It determines multiple
Inquire the Permission Levels of data;Data by Permission Levels in multiple queries data not higher than the Permission Levels of employee are determined as mesh
Mark is as a result, the Permission Levels of the employee are the Permission Levels before modification.
Specifically, in some cases, power of the Permission Levels of employee not higher than database indicated by Database Identification
Limit grade and the employee have to database indicated by inquiry Database Identification, therefore can temporarily modify the permission etc. of employee
Grade, gives your permission to method Austria, authorities where employee and temporarily modifies request, and the permission for receiving authorities' transmission is faced
Shi Xiugai response, it includes the modified Permission Levels of employee employee which, which temporarily modifies response, if modified Permission Levels
Higher than the Permission Levels of database, then ergodic data library identifies indicated database, acquisition and query word from the database
Relevant multiple queries data;Determine the Permission Levels of multiple queries data;Permission Levels in multiple queries data are not higher than
The data of the Permission Levels of employee are determined as objective result, and the Permission Levels of the employee are the Permission Levels before modification.If employee
Modification before Permission Levels be lower than multiple queries data Permission Levels, then can continue to charge database department send data
Acquisition request, the data acquisition request include the identity information of employee;Charge database department according to the identity information of employee to
The authorities of employee determine whether the employee is legal, however, it is determined that employee is legal, then sends and be used for response data acquisition request, and
It is used to indicate the response message for allowing employee to obtain multiple queries data.After receiving the response message, by multiple queries number
According to being determined as objective result.
Number in a feasible embodiment, by Permission Levels in multiple queries data not higher than the Permission Levels of employee
After being determined as objective result, this method further include:
The Permission Levels of employee are remodified as the Permission Levels before employee's modification.
In a feasible embodiment, modified API is called to execute the second polling routine, with obtain objective result it
Afterwards, this method further include:
Functional label is added for modified API, functional label is used to indicate the result called and obtained after modified API
For objective result.
It should be noted that after adding functional label for API, it, can basis when subsequent employee carries out data query
Its type for needing to inquire data is compared with the functional label of API, determines the API that can satisfy its needs, then basis
SQL calls the API to execute corresponding program, to obtain the data of employee's needs.Employee is conducive to using the method and inquires data
Efficiency, avoid that execute the result that corresponding program obtains be not required for employee by calling API.
It in a feasible embodiment, modifies to target API, after obtaining modified API, before saving modification
API, i.e. target API, it is subsequent can be realized according to the needs of employee modification after between API and target API (i.e. new and old API)
Switching.
It include employee in the SQL as can be seen that obtaining structured query language SQL in the scheme of the embodiment of the present invention
The searching keyword of input;The first polling routine is executed according to SQL invocation target API, to obtain query result;It is inquired when determining
When not as a result being objective result, target API is modified, to obtain modified API, wherein target API and modified API
It is to be write based on NG+LUA, objective result is the result that employee needs;Modified API is called to execute the second inquiry journey
Sequence, to obtain objective result.Api interface is write by using NG+LUA, so that not needing to be compiled after modifying API just straight
Tap into row test and publication, reduce debugging process when consumption and manpower, be conducive to improve efficiency data query.
Referring to fig. 2, Fig. 2 is a kind of structural schematic diagram of data query device provided in an embodiment of the present invention.Such as Fig. 2 institute
Show, which includes:
Acquiring unit 201 includes the inquiry key of employee's input for obtaining structured query language SQL, in the SQL
Word;
Execution unit 202, for executing the first polling routine according to SQL invocation target API, to obtain query result;
Unit 203 is modified, for target API being modified, after obtaining modification when determining query result not is objective result
API, wherein target API and modified API is write based on NG+LUA, the objective result be employee need to obtain
Result;
Execution unit 202 is also used to that modified API is called to execute the second polling routine, to obtain objective result.
In a feasible embodiment, the data query device 200 further include:
Adding unit 204, for calling modified API to execute the second polling routine in execution unit, to obtain target
As a result after, add functional label for modified API, which is used to indicate call modified API after obtain
It as a result is objective result.
In a feasible embodiment, which is characterized in that
Acquiring unit 201 is also used to executing the first polling routine according to SQL invocation target API, to obtain query result
Before, the identity information of employee is obtained;
Determination unit 205 is also used to determine the legitimacy of employee according to the identity information of employee.
In a feasible embodiment, modified API is being called to execute the second polling routine, to obtain objective result
Aspect, execution unit 202 is specifically used for:
Searching keyword and Database Identification are obtained from modified API;And obtain the Permission Levels of employee;
If the Permission Levels of employee are higher than the Permission Levels of database indicated by Database Identification, ergodic data library mark
Know indicated database, multiple queries data relevant to query word are obtained from the database;Determine multiple queries data
Permission Levels;Data by Permission Levels in multiple queries data not higher than the Permission Levels of employee are determined as objective result.
In a feasible embodiment, execution unit 202 also particularly useful for:
If the Permission Levels of employee are not higher than the Permission Levels of database indicated by Database Identification, to the supervisor of employee
Department's sending permission temporarily modifies request;The permission for receiving authorities' transmission temporarily modifies response, which temporarily modifies
Response carries the modified Permission Levels of employee;If modified Permission Levels are higher than the Permission Levels of database, time
Database indicated by Database Identification is gone through, multiple queries data relevant to query word are obtained from the database;Determination is more
The Permission Levels of a inquiry data;Data by Permission Levels in multiple queries data not higher than the Permission Levels of employee are determined as
Objective result, the Permission Levels of the employee are the Permission Levels before modification.
In a feasible embodiment, execution unit 202 also particularly useful for:
By Permission Levels in multiple queries data not higher than employee Permission Levels data be determined as objective result it
Afterwards, the Permission Levels of employee are remodified as the Permission Levels before employee's modification.
It should be noted that above-mentioned each unit (acquiring unit 201, execution unit 202, modification unit 203, adding unit
204 and determination unit 205) for executing the correlation step of the above method.For example, acquiring unit 201 is specifically used for executing step
The related content of S101, execution unit 102, the related content specifically for executing step S102 and S104, modification unit 203 are used
It is specifically used for executing the related content of step S104 in related content, adding unit and the determination unit for executing step S103.
In the present embodiment, data query device 200 is presented in the form of unit.Here " unit " can refer to spy
Determine application integrated circuit (application-specific integrated circuit, ASIC), executes one or more soft
The processor and memory of part or firmware program, integrated logic circuit and/or other device of above-mentioned function can be provided.This
Outside, the above acquiring unit 201, execution unit 202, modification unit 203, adding unit 204 and determination unit 205 can pass through Fig. 3
Shown in the processor 301 of data query device realize.
As shown in Figure 3 data query device 300 can realize that the data query device 300 includes with the structure in Fig. 3
At least one processor 301, at least one processor 302 and at least one communication interface 303.It is the processor 301, described
Memory 302 is connected by the communication bus with the communication interface 303 and completes mutual communication.
Processor 301 can be general central processor (CPU), microprocessor, application-specific integrated circuit
(application-specific integrated circuit, ASIC), or it is one or more for controlling above scheme journey
The integrated circuit that sequence executes.
Communication interface 303 is used for and other equipment or communication, such as Ethernet, wireless access network (RAN), nothing
Line local area network (Wireless Local Area Networks, WLAN) etc..
Memory 302 can be read-only memory (read-only memory, ROM) or can store static information and instruction
Other kinds of static storage device, random access memory (random access memory, RAM) or letter can be stored
The other kinds of dynamic memory of breath and instruction, is also possible to Electrically Erasable Programmable Read-Only Memory (Electrically
Erasable Programmable Read-Only Memory, EEPROM), CD-ROM (Compact Disc Read-
Only Memory, CD-ROM) or other optical disc storages, optical disc storage (including compression optical disc, laser disc, optical disc, digital universal
Optical disc, Blu-ray Disc etc.), magnetic disk storage medium or other magnetic storage apparatus or can be used in carrying or store to have referring to
Enable or data structure form desired program code and can by any other medium of computer access, but not limited to this.
Memory, which can be, to be individually present, and is connected by bus with processor.Memory can also be integrated with processor.
Wherein, the memory 302 be used for store execution above scheme application code, and by processor 501
Control executes.The processor 301 is for executing the application code stored in the memory 302.
The above method of execution provided above can be performed in the code that memory 302 stores, for example obtains structuralized query
It include the searching keyword of employee's input in language SQL, the SQL;The first polling routine is executed according to SQL invocation target API, with
Obtain query result;When determining query result not is objective result, target API is modified, to obtain modified API, wherein
Target API and modified API is write based on NG+LUA, and objective result is the result that employee needs;Calling is repaired
API after changing executes the second polling routine, to obtain objective result.
The embodiment of the present invention also provides a kind of computer storage medium, wherein the computer storage medium can be stored with journey
Sequence, the program include some or all of any data query method recorded in above method embodiment step when executing
Suddenly.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of
Combination of actions, but those skilled in the art should understand that, the present invention is not limited by the sequence of acts described because
According to the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know
It knows, the embodiments described in the specification are all preferred embodiments, and related actions and modules is not necessarily of the invention
It is necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment
Point, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed device, it can be by another way
It realizes.For example, the apparatus embodiments described above are merely exemplary, such as the division of the unit, it is only a kind of
Logical function partition, there may be another division manner in actual implementation, such as multiple units or components can combine or can
To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Coupling, direct-coupling or communication connection can be through some interfaces, the indirect coupling or communication connection of device or unit,
It can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer-readable access to memory.Based on this understanding, technical solution of the present invention substantially or
Person says that all or part of the part that contributes to existing technology or the technical solution can body in the form of software products
Reveal and, which is stored in a memory, including some instructions are used so that a computer equipment
(can be personal computer, server or network equipment etc.) executes all or part of each embodiment the method for the present invention
Step.And memory above-mentioned includes: USB flash disk, read-only memory (ROM, Read-Only Memory), random access memory
The various media that can store program code such as (RAM, Random Access Memory), mobile hard disk, magnetic or disk.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can
It is completed with instructing relevant hardware by program, which can store in a computer-readable memory, memory
May include: flash disk, read-only memory (English: Read-Only Memory, referred to as: ROM), random access device (English:
Random Access Memory, referred to as: RAM), disk or CD etc..
The embodiment of the present invention has been described in detail above, specific case used herein to the principle of the present invention and
Embodiment is expounded, and the above description of the embodiment is only used to help understand the method for the present invention and its core ideas;
At the same time, for those skilled in the art can in specific embodiments and applications according to the thought of the present invention
There is change place, to sum up above-mentioned, the contents of this specification are not to be construed as limiting the invention.
Claims (12)
1. a kind of data query method characterized by comprising
Structured query language SQL is obtained, includes the searching keyword of employee's input in the SQL;
The first polling routine is executed according to the SQL invocation target API, to obtain query result;
When determining the query result not is objective result, the target API is modified, to obtain modified API, wherein
The target API and modified API is write based on NG+LUA, and the objective result is the result that employee needs;
The modified API is called to execute the second polling routine, to obtain the objective result.
2. the method according to claim 1, wherein described call the modified API to execute the second inquiry
Program, after obtaining the objective result, the method also includes:
Functional label is added for the modified API, the functional label obtains after being used to indicate the calling modified API
The result arrived is objective result.
3. according to the method described in claim 2, it is characterized in that, described look into according to SQL invocation target API execution first
Program is ask, before obtaining query result, the method also includes:
Obtain the identity information of the employee;
The legitimacy of employee is determined according to the identity information of the employee.
4. method according to claim 1-3, which is characterized in that described that the modified API is called to execute
Second polling routine, to obtain the objective result, comprising:
Searching keyword and Database Identification are obtained from the modified API;And obtain the Permission Levels of the employee;
If Permission Levels of the Permission Levels of the employee higher than database indicated by the Database Identification, described in traversal
Database indicated by Database Identification obtains multiple queries data relevant to the query word from the database;
Determine the Permission Levels of the multiple inquiry data;
Permission Levels in the multiple inquiry data are determined as the target not higher than the data of the Permission Levels of the employee
As a result.
5. according to the method described in claim 4, it is characterized in that, the method also includes:
If the Permission Levels of the employee are not higher than the Permission Levels of database indicated by the Database Identification, to the member
Authorities' sending permission of work temporarily modifies request;
It receives the permission that the authorities send and temporarily modifies response, the permission temporarily modifies response and carries the member
The modified Permission Levels of work;
If the modified Permission Levels are higher than the Permission Levels of the database, traverse indicated by the Database Identification
Database, relevant to query word multiple queries data are obtained from the database;
Determine the Permission Levels of the multiple inquiry data;
Permission Levels in the multiple inquiry data are determined as the target not higher than the data of the Permission Levels of the employee
As a result, the Permission Levels of the employee are the Permission Levels before modification.
6. according to the method described in claim 5, it is characterized in that, described that Permission Levels in the multiple inquiry data are not high
After the data of the Permission Levels of the employee are determined as the objective result, the method also includes:
The Permission Levels of the employee are remodified as the Permission Levels before employee modification.
7. a kind of data query device characterized by comprising
Acquiring unit includes the searching keyword of employee's input for obtaining structured query language SQL, in the SQL;
Execution unit, for executing the first polling routine according to the SQL invocation target API, to obtain query result;
Unit is modified, for the target API being modified, to be modified when determining the query result not is objective result
API afterwards, wherein the target API and modified API is write based on NG+LUA, and the objective result needs for employee
Obtained result;
The execution unit is also used to that the modified API is called to execute the second polling routine, to obtain the target knot
Fruit.
8. device according to claim 7, which is characterized in that described device further include:
Adding unit, it is described to obtain for calling the modified API to execute the second polling routine in the execution unit
After objective result, functional label is added for the modified API, after the functional label is used to indicate the calling modification
API after obtained result be objective result.
9. device according to claim 8, which is characterized in that described device further include:
The acquiring unit is also used to executing the first polling routine according to the SQL invocation target API, to obtain inquiry knot
Before fruit, the identity information of the employee is obtained;
Determination unit, for determining the legitimacy of employee according to the identity information of the employee.
10. according to the described in any item devices of claim 7-9, which is characterized in that call the modified API to hold described
The second polling routine of row, to obtain the aspect of the objective result, the execution unit is specifically used for:
Searching keyword and Database Identification are obtained from the modified API;And obtain the Permission Levels of the employee;
If Permission Levels of the Permission Levels of the employee higher than database indicated by the Database Identification, described in traversal
Database indicated by Database Identification obtains multiple queries data relevant to the query word from the database;
Determine the Permission Levels of the multiple inquiry data;
Permission Levels in the multiple inquiry data are determined as the target not higher than the data of the Permission Levels of the employee
As a result.
11. device according to claim 10, which is characterized in that the execution unit also particularly useful for:
If the Permission Levels of the employee are not higher than the Permission Levels of database indicated by the Database Identification, to the member
Authorities' sending permission of work temporarily modifies request;
It receives the permission that the authorities send and temporarily modifies response, the permission temporarily modifies response and carries the member
The modified Permission Levels of work;
If the modified Permission Levels are higher than the Permission Levels of the database, traverse indicated by the Database Identification
Database, relevant to query word multiple queries data are obtained from the database;
Determine the Permission Levels of the multiple inquiry data;
Permission Levels in the multiple inquiry data are determined as the target not higher than the data of the Permission Levels of the employee
As a result, the Permission Levels of the employee are the Permission Levels before modification.
12. device according to claim 11, which is characterized in that the execution unit also particularly useful for:
Permission Levels in the multiple inquiry data are being determined as the mesh not higher than the data of the Permission Levels of the employee
After marking result, the Permission Levels of the employee are remodified as the Permission Levels before employee modification.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910588601.1A CN110413671A (en) | 2019-06-28 | 2019-06-28 | Data query method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910588601.1A CN110413671A (en) | 2019-06-28 | 2019-06-28 | Data query method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110413671A true CN110413671A (en) | 2019-11-05 |
Family
ID=68360071
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910588601.1A Pending CN110413671A (en) | 2019-06-28 | 2019-06-28 | Data query method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110413671A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101631116A (en) * | 2009-08-10 | 2010-01-20 | 中国科学院地理科学与资源研究所 | Distributed dual-license and access control method and system |
CN102567517A (en) * | 2011-12-28 | 2012-07-11 | 用友软件股份有限公司 | Device and method for issuing data of database |
CN103312777A (en) * | 2013-05-08 | 2013-09-18 | 天脉聚源(北京)传媒科技有限公司 | Resource searching method and client |
CN107679064A (en) * | 2017-07-31 | 2018-02-09 | 平安科技(深圳)有限公司 | Data query method, apparatus and computer-readable recording medium |
CN108874863A (en) * | 2018-04-19 | 2018-11-23 | 华为技术有限公司 | A kind of control method and database access device of data access |
-
2019
- 2019-06-28 CN CN201910588601.1A patent/CN110413671A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101631116A (en) * | 2009-08-10 | 2010-01-20 | 中国科学院地理科学与资源研究所 | Distributed dual-license and access control method and system |
CN102567517A (en) * | 2011-12-28 | 2012-07-11 | 用友软件股份有限公司 | Device and method for issuing data of database |
CN103312777A (en) * | 2013-05-08 | 2013-09-18 | 天脉聚源(北京)传媒科技有限公司 | Resource searching method and client |
CN107679064A (en) * | 2017-07-31 | 2018-02-09 | 平安科技(深圳)有限公司 | Data query method, apparatus and computer-readable recording medium |
CN108874863A (en) * | 2018-04-19 | 2018-11-23 | 华为技术有限公司 | A kind of control method and database access device of data access |
Non-Patent Citations (1)
Title |
---|
茄子_2008: "《https://www.cnblogs.com/xd502djj/p/6097773.html》", 24 November 2016 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101143222B1 (en) | Adaptive dispatch of received messages to code using inter-positioned message modification | |
CN107113341B (en) | System for high throughput processing of transactions in a distributed relational database management system for data partitioning | |
CN109597853B (en) | Business scene element serial number generation method, device, medium and computer equipment | |
US7313572B2 (en) | Attribute partitioning for user extensibility | |
CN107391632B (en) | Database storage processing method and device, computing equipment and computer storage medium | |
CN103379129A (en) | Data synchronization method, servers and distributed system | |
CN106155775B (en) | Message processing method, device and system | |
WO2019184236A1 (en) | Insurance product calculation model configuration method and apparatus, computer device, and storage medium | |
US20070198697A1 (en) | Method of refactoring methods within an application | |
CN109376173A (en) | A kind of data query method, apparatus, electronic equipment and storage medium | |
US20090138510A1 (en) | Method and apparatus for associating help desk ticket with affected data processing system | |
CN109634983B (en) | Method, apparatus, device and medium for determining recall point of interest information | |
US8533702B2 (en) | Dynamically resolving fix groups for managing multiple releases of multiple products on multiple systems | |
CN112148844A (en) | Information reply method and device for robot | |
CN112068812B (en) | Micro-service generation method and device, computer equipment and storage medium | |
CN111858617A (en) | User searching method and device, computer readable storage medium and electronic equipment | |
CN110413671A (en) | Data query method and device | |
CN110427476A (en) | It is related to the knowledge question associated data processing method and its device of block chain | |
CN106446080A (en) | Data query method, query service device, client device and data system | |
US20070074101A1 (en) | Smart form completion of form values | |
CN114969189A (en) | Method and device for determining connection in database connection pool | |
US7433950B2 (en) | Method and mechanism to multiplex multiple application server requests over a single database connection | |
CN112052330B (en) | Application keyword distribution method and device | |
JP2006073006A (en) | Object categorizing | |
CN113342270A (en) | Volume unloading method and device and electronic equipment |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20191105 |