[go: nahoru, domu]

CN113704307A - Data query method, device, server and computer readable storage medium - Google Patents

Data query method, device, server and computer readable storage medium Download PDF

Info

Publication number
CN113704307A
CN113704307A CN202111015394.4A CN202111015394A CN113704307A CN 113704307 A CN113704307 A CN 113704307A CN 202111015394 A CN202111015394 A CN 202111015394A CN 113704307 A CN113704307 A CN 113704307A
Authority
CN
China
Prior art keywords
query
data
data query
condition
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111015394.4A
Other languages
Chinese (zh)
Inventor
马林银
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Zhaolong Technology Co ltd
Original Assignee
Shenzhen Zhaolong Technology 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 Shenzhen Zhaolong Technology Co ltd filed Critical Shenzhen Zhaolong Technology Co ltd
Priority to CN202111015394.4A priority Critical patent/CN113704307A/en
Publication of CN113704307A publication Critical patent/CN113704307A/en
Priority to PCT/CN2022/104789 priority patent/WO2023029752A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24564Applying rules; Deductive queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2468Fuzzy queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Fuzzy Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Automation & Control Theory (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application is applicable to the technical field of data query, and provides a data query method, a data query device, a server and a computer readable storage medium, wherein the method comprises the following steps: the client encapsulates a preset API (application program interface), sends a query request and user information to the server and receives a corresponding query result; the server side determines an authority control query condition based on a query request and user information, a target reflection mechanism is called to determine the query condition and a query function based on the query request, a query statement is determined based on the authority control query condition, the query condition and the query function, data query is carried out based on the query statement to obtain a data query result, serialization processing is carried out, and the data query result is sent to the client side.

Description

Data query method, device, server and computer readable storage medium
Technical Field
The present application belongs to the field of data query technologies, and in particular, to a data query method, apparatus, server, and computer-readable storage medium.
Background
In Object-oriented programming language based programming, it is commonly applied to an Object Relational Mapping (ORM) technique. When the front-end and back-end development services are performed based on the above technology, the client usually has a variety of different data query requirements, and sets complex and variable query conditions correspondingly.
The existing data query method generally selects a plurality of APIs to perform data query according to complex and changeable query conditions to obtain data query results. The method has the advantages of complex operation, large workload, inflexible operation and low data query efficiency.
Disclosure of Invention
The embodiment of the application provides a data query method, a data query device, a server and a readable storage medium, and can solve the problems of complex operation, large workload, inflexibility and low data query efficiency of a related data method.
In a first aspect, an embodiment of the present application provides a data query method, which is applied to a client, and includes:
acquiring a query request and user information;
packaging a preset API interface so as to send the query request and the user information to a server side through the preset API interface;
and when receiving a query result corresponding to the query request returned by the server, displaying the query result.
In a second aspect, an embodiment of the present application provides a data query method, which is applied to a server side, and includes:
calling a preset API (application programming interface) to acquire a query request and user information sent by a client;
determining an authority control query condition corresponding to the query request according to the user information;
determining a query condition and a data query function based on the query request;
determining a query statement based on the authority control query condition, the query condition and the data query function;
performing data query based on the query statement to obtain a data query result;
and serializing the data query result to obtain a serialized result, and sending the serialized result to a client.
In one embodiment, the user information includes a user ID;
the determining the authority control query condition corresponding to the query request according to the user information comprises the following steps:
determining the user type according to the user ID;
and determining an authority control query condition corresponding to the query request according to the user type.
In one embodiment, the query request carries a query request parameter;
the determining of the query condition and the data query function based on the query request comprises the following steps:
converting the query request parameters carried by the query request into an object through an object reflection mechanism;
and analyzing the attribute value of the object to obtain a corresponding query condition and a data query function.
In one embodiment, the determining a query statement based on the permission control query condition, the query condition, and the data query function includes:
and combining the authority control query condition, the query condition and the data query function based on a preset combination rule to obtain a query statement.
In one embodiment, the performing data query based on the query statement to obtain a data query result includes:
performing data query based on the query statement to obtain a corresponding field;
and carrying out object relation mapping on the fields by an object relation mapping technology to obtain corresponding objects as data query results.
In a third aspect, an embodiment of the present application provides a data query device, which is applied to a client, and includes:
the first acquisition module is used for acquiring the query request and the user information;
the packaging module is used for packaging a preset API (application programming interface) so as to send the query request and the user information to a server side through the preset API;
and the display module is used for displaying the query result when receiving the query result corresponding to the query request returned by the server.
In a fourth aspect, an embodiment of the present application provides a data query apparatus, which is applied to a server side, and includes:
the second acquisition module is used for calling a preset API (application program interface) to acquire the query request and the user information sent by the client;
the first calling module is used for determining an authority control query condition corresponding to the query request according to the user information;
the second calling module is used for determining a query condition and a data query function based on the query request;
a determining module, configured to determine a query statement based on the permission control query condition, the query condition, and the data query function;
the query module is used for carrying out data query based on the query statement to obtain a data query result;
and the serialization processing module is used for serializing the data query result to obtain a serialization result and sending the serialization result to the client.
In one embodiment, the user information includes a user ID;
the first calling module comprises:
the first analysis unit is used for determining the user type according to the user ID;
and the determining unit is used for determining the authority control query condition corresponding to the query request according to the user type.
In one embodiment, the query request carries a query request parameter;
the second calling module comprises:
the conversion unit is used for converting the query request parameters carried by the query request into an object through an object reflection mechanism;
and the second analysis unit is used for analyzing the attribute value of the object to obtain a corresponding query condition and a data query function.
In an embodiment, the determining module is specifically configured to combine the authority control query condition, the query condition, and the data query function based on a preset combination rule to obtain a query statement.
In one embodiment, the query module includes:
the query unit is used for carrying out data query based on the query statement to obtain a corresponding field;
and the third analysis unit is used for carrying out object relation mapping on the fields by an object relation mapping technology to obtain corresponding objects as data query results.
In a fifth aspect, an embodiment of the present application provides a server, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor, when executing the computer program, implements the data query method according to any one of the first and second aspects.
In a sixth aspect, the present application provides a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the data query method according to any one of the first and second aspects.
In a seventh aspect, an embodiment of the present application provides a computer program product, which, when running on a server, causes the server to execute the data query method according to any one of the first and second aspects.
Compared with the prior art, the embodiment of the application has the advantages that: the client encapsulates the preset API interface, sends a query request and user information to the server and receives a corresponding query result, the server determines an authority control query condition based on the query request and the user information, calls an object reflection mechanism to determine the query condition and a query function based on the query request, determines a query statement based on the authority control query condition, the query condition and the query function, performs data query based on the query statement to obtain a data query result, performs serialization processing and sends the data query result to the client.
It is to be understood that, the beneficial effects of the second to seventh aspects may be referred to the relevant description of the first aspect, and are not repeated herein.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flowchart of a data query method according to an embodiment of the present application;
fig. 2 is another schematic flow chart of a data query method according to the second embodiment of the present application;
FIG. 3 is a flowchart illustrating a data query method step 202 according to a third embodiment of the present application;
FIG. 4 is a flowchart illustrating step 203 of a data query method provided in the third embodiment of the present application;
fig. 5 is a schematic structural diagram of a data query apparatus according to a fourth embodiment of the present application;
fig. 6 is another schematic structural diagram of a data query apparatus according to a fifth embodiment of the present application;
fig. 7 is a schematic structural diagram of a server according to a sixth embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The data query method provided by the embodiment of the application can be applied to terminal devices such as a mobile phone, a tablet computer, a vehicle-mounted device, a notebook computer, an ultra-mobile personal computer (UMPC), a Personal Digital Assistant (PDA), and the like, and the specific type of the terminal device is not limited in any way in the embodiment of the application.
Example one
Fig. 1 shows a schematic flow chart of a data query method provided by the present application, which can be applied to a client of a notebook computer by way of example and not limitation.
S101, acquiring a query request and user information.
Specifically, a plurality of plug-ins at the client respectively obtain query request parameters corresponding to a plurality of different service requirements input by a user, obtain a query request, and simultaneously obtain user information of the user.
The types of the query request parameters include, but are not limited to, public parameters and private parameters. The public parameters are general type parameters, and the private parameters are compound type parameters.
Table 1 look up a schematic table of request parameters.
Figure BDA0003239823940000071
As can be seen from table 1, the query request parameters available for the preset API interface generally include, but are not limited to, the current page number pageNumber, the number of pieces pageSize per page, whether the total number of pieces needTotalNumbers is needed, the filter condition parameter filterConds, the search condition parameter searchConds, and the sorting order by.
Specifically, the preset client includes a search box plug-in and a filter box plug-in, where the search box plug-in is an input box and can simultaneously obtain query request parameters of multiple service requirements.
For example, the search box plug-in calls the API method searchAssem (used to obtain the query request parameters to determine the search/filter criteria seracchContons: i.e., to obtain the user-entered params, command cmd, domain listing args …); for example, if the parameter of the function instruction input by the user is "%", if the domain list is custamname, the user inputs the para sheet, and if the domain list is contectname, the user inputs the para sheet, the corresponding screening conditions are as follows: and determining that the user name contains the data of 'sheets' or the client contact contains the data of 'sheets' through a full fuzzy matching query. For example, the user inputs the function instruction parameter "%", and the user inputs the paras123 when the domain list is account _ id; the corresponding search condition is data for which the user ID is determined to be 123 by a full-fuzzy matching query.
The filter box plug-in is a multi-field input box or a selection box and is used for determining operation options according to different service requirements, acquiring parameters input by a user and determining a corresponding searching/screening condition/data query function. For example, the service requirement is data in the query interval, the corresponding operation option is < >, and the obtained parameters input by the user are 100 and 200. Data with a corresponding required search interval within <100, 200 >.
S102, packaging a preset API interface, and sending the query request and the user information to a server side through the preset API interface.
Specifically, the preset API interface is packaged through the plurality of plug-ins based on the query request, so that the packaged preset API interface can realize data query operation corresponding to various service requirements, and the query request is sent to the server side based on the preset API interface. The preset API interface is a preset general API interface formed by assembling a plurality of plug-ins.
S103, when receiving a query result corresponding to the query request returned by the server, displaying the query result.
Specifically, when receiving a query result corresponding to the query request returned by the server, displaying the query result through a display interface.
In the embodiment, the client side obtains the query requests corresponding to various different service requirements, and the preset API is packaged to send the query requests and the user information to the server side and receive the corresponding query results, so that various query services are sent to the server side to be processed based on the universal preset API, the data query operation process is simplified, and the data query efficiency is improved.
Example two
Fig. 2 shows a schematic flow chart of a data query method provided by the present application, which can be applied to a server side of a notebook computer by way of example and not limitation.
S201, calling a preset API (application programming interface) to acquire a query request and user information sent by a client;
s202, determining an authority control query condition corresponding to the query request according to the user information.
Specifically, the packaged preset API interface is called to obtain a query request sent by the client based on the preset API interface and user information of a user corresponding to the query request (i.e., the query request is input at the client), and the data query permission of the user is determined according to the user information and serves as a permission control query condition corresponding to the query request.
S203, determining query conditions and a data query function based on the query request.
Specifically, as can be seen from the detailed description of the embodiment, the query request includes query request parameters, the query request parameters include, but are not limited to, search criteria parameters and filtering criteria parameters, and the corresponding query criteria include search criteria and filtering criteria.
Specifically, the query request parameter further includes a function instruction parameter for determining a data query function operation. The data query function includes, but is not limited to, one or more of fuzzy query, aggregate query, matching query, interval query, and comparison query.
Specifically, an object reflection mechanism is called to analyze the query request, determine that the query request carries a functional instruction parameter, a screening condition parameter and a search condition parameter, and determine a data query function, a search condition and a screening condition corresponding to the functional instruction parameter.
Table 2 schematic table of functional instruction parameters.
Figure BDA0003239823940000091
Figure BDA0003239823940000101
In an embodiment, the query request can be further analyzed by calling an object reflection mechanism, so as to obtain the current page number pageNumber, the number of pieces pageSize per page, whether the total number of pieces need to be acquired, the ordering mode orderBy and the like corresponding to the query request parameter carried in the query request.
S204, determining a query statement based on the authority control query condition, the query condition and the data query function.
Specifically, the query statement is obtained by combining the authority control query condition, the query condition and the data query function.
In one embodiment, the determining a query statement based on the permission control query condition, the query condition, and the data query function includes:
and combining the authority control query condition, the query condition and the data query function based on a preset combination rule to obtain a query statement.
Specifically, preset combination rules of the query statement are preset, and the authority control query condition, the search condition, the screening condition, the data query function and the sorting mode orderBy are combined based on the preset combination rules to obtain the query statement.
For example, the preset combination rule is to combine the query conditions, the search conditions, the screening conditions, the data query functions and the sequencing order according to the authority control to obtain query statements; then, when the authority control query condition is data with a queriable page number of page 1, each page is 20, the total number of pieces needs to be displayed, the search condition is an account with an ID ranging from 81231 to 82451, the data query function is a full fuzzy matching query, the screening condition is that the user name is "sheet" or the client contact is "sheet", and the sorting mode is updateTime desc, and sorting is performed according to the updating time sequence:
{
“pageNumber”:1,
“pageSize”:20,
“needTotalNumbers”:true,
“filterConds”:{
“account”:”()81231,82451”
},
“searchConds”:{
"custom name"% tonicity ",
"ContactName"% "of"
}
}
The corresponding query statement is:
select from t _ b _ custom where account id in (81231, 82451) and (custom _ name like '% or contact _ name like'% or) order by update _ time desc limit 0, 20.
S205, carrying out data query based on the query statement to obtain a data query result.
Specifically, data query is performed through the ORM based on the query statement, and a data query result is obtained.
In one embodiment, the performing data query based on the query statement to obtain a data query result includes:
performing data query based on the query statement to obtain a corresponding field;
and carrying out object relation mapping on the fields by an object relation mapping technology to obtain corresponding objects as data query results.
Specifically, Object Relational Mapping (ORM, or O/RM, or O/R Mapping) is a programming technique for implementing conversion between data of different types of systems in an Object-oriented programming language.
Specifically, data query operation is performed based on the query statement determined by combination to obtain a corresponding field, and object relation mapping is performed on the field through an Object Relation Mapping (ORM) technology to obtain a corresponding object as a data query result.
It can be understood that, since the API interface can perform data query operation based on a plurality of different business requirements in general, a plurality of objects are correspondingly obtained, that is, the data query result is a query result set including an object list.
S206, serializing the data query result to obtain a serialized result, and sending the serialized result to a client.
Specifically, the objects (including a plurality of objects, specifically stored in an object list form) included in the data query result are serialized to obtain a serialization result, and the serialization result is sent to the client.
In the embodiment, the preset API interface is called to obtain the query request and the user information sent by the client, the authority control query condition is determined, the object reflection mechanism is called to determine the query condition and the query function based on the query request, the query statement is determined based on the authority control query condition, the query condition and the query function, and the data query is performed based on the query statement to obtain the data query result, i.e., the query function with different service requirements is realized through the universal preset API interface.
EXAMPLE III
The present embodiment is further described in the second embodiment, and reference may be made to the related description of the second embodiment for details of the same or similar parts as those of the second embodiment, which are not repeated herein. As shown in fig. 3, the determining, according to the user information, an authority control query condition corresponding to the query request in this embodiment includes:
s2021, determining the user type according to the user ID.
In particular, the user information includes, but is not limited to, a user ID from which the user type of the user can be determined. The user type includes, but is not limited to, a general account user, a premium account user, or an administrative user. Different user types have different data query permissions.
S2022, determining an authority control query condition corresponding to the query request according to the user type.
Specifically, the data query authority of the user is determined according to the user type, and is used as an authority control query condition corresponding to a query request input by the user.
For example, the query request includes the query request parameters "account": 81231, 82451 ", the user information is the user ID: 123, determining that the user type of the user ID123 is a normal account user, and the data query permission of the normal account user does not include related data of a high-level account user with an ID 81432, and correspondingly setting a permission control query condition corresponding to the query request as new daoeentity [ ] { new daoeentity ("user _ ID", "123") } or new daoeentity [ ] { new daoeentity ("account _ ID", daosqwherseymbol. When data query is carried out, related data of users with the ID of 81432 cannot be queried, and only related data of users with the IDs from 81231 to 81431 and the IDs from 81433 to 82451 can be queried.
As shown in fig. 4, in an embodiment, the query request carries a query request parameter;
the determining of the query condition and the data query function based on the query request comprises the following steps:
s2031, converting the query request parameters carried by the query request into objects through an object reflection mechanism;
s2032, analyzing the attribute value of the object to obtain the corresponding query condition and the data query function.
Specifically, query request parameters carried by a query request are converted into objects through an object reflection mechanism, and an attribute value of each object is determined to obtain a corresponding query condition and a data query function.
For example, the screening condition parameters in the query request parameters are converted into objects, the attribute values of the objects are "customName: sheet" and "containname: sheet", the function instruction parameters in the query request parameters are converted into objects, the attribute values of the objects are "%", the data query function is correspondingly determined to be fuzzy query LIKE, and the query conditions are data with the screening user name of "sheet" or the client contact of "sheet".
In the embodiment, a universal preset API interface is called to determine a plurality of different query service requirement parameters carried in a user query request, so as to obtain a plurality of query conditions, and a corresponding query statement is assembled to obtain a query result, thereby simplifying the operation flow and workload of data query, and having high flexibility.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Example four
Fig. 5 shows a block diagram of a data query apparatus 100 according to an embodiment of the present application, which corresponds to the data query method described in the first embodiment above, and only shows portions related to the embodiment of the present application for convenience of description.
Referring to fig. 5, the data query apparatus 100 includes:
a first obtaining module 101, configured to obtain a query request and user information;
the encapsulation module 102 is configured to encapsulate a preset API interface, so as to send the query request and the user information to a server through the preset API interface;
and the display module 103 is configured to display the query result when receiving a query result corresponding to the query request returned by the server.
In the embodiment, the client side acquires the query requests corresponding to various different service requirements, and the preset API interface is packaged to send the query requests and the user information to the server side and receive the corresponding query results, so that various query services are sent to the server side to be processed based on the universal preset API interface, the data query operation process is simplified, and the data query efficiency is improved.
EXAMPLE five
Fig. 6 shows a block diagram of a data query apparatus provided in the embodiment of the present application, which corresponds to the data query method described in the second embodiment above, and only shows the relevant parts in the embodiment of the present application for convenience of description.
Referring to fig. 6, the data query apparatus 200 includes:
a second obtaining module 201, configured to call a preset API interface to obtain a query request and user information sent by a client;
a first calling module 202, configured to determine, according to the user information, an authority control query condition corresponding to the query request;
a second calling module 203, configured to determine a query condition and a data query function based on the query request;
a determining module 204, configured to determine a query statement based on the permission control query condition, the query condition, and the data query function;
the query module 205 is configured to perform data query based on the query statement to obtain a data query result;
and the serialization processing module 206 is configured to serialize the data query result to obtain a serialization result, and send the serialization result to the client.
In one embodiment, the user information includes a user ID;
the first calling module comprises:
the first analysis unit is used for determining the user type according to the user ID;
and the determining unit is used for determining the authority control query condition corresponding to the query request according to the user type.
In one embodiment, the query request carries a query request parameter;
the second calling module comprises:
the conversion unit is used for converting the query request parameters carried by the query request into an object through an object reflection mechanism;
and the second analysis unit is used for analyzing the attribute value of the object to obtain a corresponding query condition and a data query function.
In an embodiment, the determining module is specifically configured to combine the authority control query condition, the query condition, and the data query function based on a preset combination rule to obtain a query statement.
In one embodiment, the query module includes:
the query unit is used for carrying out data query based on the query statement to obtain a corresponding field;
and the third analysis unit is used for carrying out object relation mapping on the fields by an object relation mapping technology to obtain corresponding objects as data query results.
The method comprises the steps of calling a preset API to obtain a query request and user information sent by a client side, further determining an authority control query condition, calling an object reflection mechanism to determine the query condition and a query function based on the query request, determining a query statement based on the authority control query condition, the query condition and the query function, and performing data query based on the query statement to obtain a data query result, namely, the query function with different service requirements is realized through a universal preset API.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
EXAMPLE six
Fig. 7 is a schematic structural diagram of the server provided in this embodiment. As shown in fig. 7, the server 7 of this embodiment includes: at least one processor 70 (only one shown in fig. 7), a memory 71, and a computer program 72 stored in the memory 71 and executable on the at least one processor 70, wherein the processor 70 implements the steps of any of the various data query method embodiments described above when executing the computer program 72.
The server 7 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The server may include, but is not limited to, a processor 70, a memory 71. Those skilled in the art will appreciate that fig. 7 is merely an example of the server 7, and does not constitute a limitation of the server 7, and may include more or less components than those shown, or combine certain components, or different components, such as input output devices, network access devices, etc.
The Processor 70 may be a Central Processing Unit (CPU), and the Processor 70 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 71 may in some embodiments be an internal storage unit of the server 7, such as a hard disk or a memory of the server 7. The memory 71 may also be an external storage device of the server 7 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital Card (SD), a Flash memory Card (Flash Card), and the like, which are provided on the server 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the server 7. The memory 71 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 71 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/server, a recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), an electrical carrier wave signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A data query method is applied to a client and comprises the following steps:
acquiring a query request and user information;
packaging a preset API interface so as to send the query request and the user information to a server side through the preset API interface;
and when receiving a query result corresponding to the query request returned by the server, displaying the query result.
2. A data query method is applied to a server side and comprises the following steps:
calling a preset API (application programming interface) to acquire a query request and user information sent by a client;
determining an authority control query condition corresponding to the query request according to the user information;
determining a query condition and a data query function based on the query request;
determining a query statement based on the authority control query condition, the query condition and the data query function;
performing data query based on the query statement to obtain a data query result;
and serializing the data query result to obtain a serialized result, and sending the serialized result to a client.
3. The data query method of claim 2, wherein the user information includes a user ID;
the determining the authority control query condition corresponding to the query request according to the user information comprises the following steps:
determining the user type according to the user ID;
and determining an authority control query condition corresponding to the query request according to the user type.
4. The data query method of claim 2, wherein the query request carries a query request parameter;
the determining of the query condition and the data query function based on the query request comprises the following steps:
converting the query request parameters carried by the query request into an object through an object reflection mechanism;
and analyzing the attribute value of the object to obtain a corresponding query condition and a data query function.
5. The data query method of claim 2, wherein the determining a query statement based on the permission control query condition, the query condition, and the data query function comprises:
and combining the authority control query condition, the query condition and the data query function based on a preset combination rule to obtain a query statement.
6. The data query method of any one of claims 2 to 5, wherein the performing data query based on the query statement to obtain a data query result comprises:
performing data query based on the query statement to obtain a corresponding field;
and carrying out object relation mapping on the fields by an object relation mapping technology to obtain corresponding objects as data query results.
7. A data query device, applied to a client, includes:
the first acquisition module is used for acquiring the query request and the user information;
the packaging module is used for packaging a preset API (application programming interface) so as to send the query request and the user information to a server side through the preset API;
and the display module is used for displaying the query result when receiving the query result corresponding to the query request returned by the server.
8. A data query device, applied to a server side, comprises:
the second acquisition module is used for calling a preset API (application program interface) to acquire the query request and the user information sent by the client;
the first calling module is used for determining an authority control query condition corresponding to the query request according to the user information;
the second calling module is used for determining a query condition and a data query function based on the query request;
a determining module, configured to determine a query statement based on the permission control query condition, the query condition, and the data query function;
the query module is used for carrying out data query based on the query statement to obtain a data query result;
and the serialization processing module is used for serializing the data query result to obtain a serialization result and sending the serialization result to the client.
9. A server comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any of claims 1 or 2 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 or 2 to 6.
CN202111015394.4A 2021-08-31 2021-08-31 Data query method, device, server and computer readable storage medium Pending CN113704307A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111015394.4A CN113704307A (en) 2021-08-31 2021-08-31 Data query method, device, server and computer readable storage medium
PCT/CN2022/104789 WO2023029752A1 (en) 2021-08-31 2022-07-11 Data query method and apparatus, server, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111015394.4A CN113704307A (en) 2021-08-31 2021-08-31 Data query method, device, server and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN113704307A true CN113704307A (en) 2021-11-26

Family

ID=78658235

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111015394.4A Pending CN113704307A (en) 2021-08-31 2021-08-31 Data query method, device, server and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN113704307A (en)
WO (1) WO2023029752A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023029752A1 (en) * 2021-08-31 2023-03-09 深圳市兆珑科技有限公司 Data query method and apparatus, server, and computer-readable storage medium

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116204136B (en) * 2023-05-04 2023-08-15 山东浪潮科学研究院有限公司 Data storage and query method, device, equipment and storage medium
CN116483483B (en) * 2023-06-21 2023-09-19 中科方德软件有限公司 Data query method and device and electronic equipment
CN116662376B (en) * 2023-08-01 2024-02-13 腾讯科技(深圳)有限公司 Data query method, device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815284A (en) * 2019-01-04 2019-05-28 平安科技(深圳)有限公司 A kind of method and apparatus of data processing
CN111611276A (en) * 2020-06-05 2020-09-01 腾讯科技(深圳)有限公司 Data query method, device and storage medium
CN112861182A (en) * 2021-03-29 2021-05-28 中信银行股份有限公司 Database query method and system, computer equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8601016B2 (en) * 2011-08-30 2013-12-03 International Business Machines Corporation Pre-generation of structured query language (SQL) from application programming interface (API) defined query systems
CN109739873A (en) * 2018-12-27 2019-05-10 广州市玄武无线科技股份有限公司 A kind of business datum querying method, device, equipment and readable storage medium storing program for executing
CN111639078A (en) * 2020-05-25 2020-09-08 北京百度网讯科技有限公司 Data query method and device, electronic equipment and readable storage medium
CN112463836A (en) * 2020-12-15 2021-03-09 广州品唯软件有限公司 Data query method and device based on Django framework, computer equipment and medium
CN112835930A (en) * 2021-03-03 2021-05-25 上海渠杰信息科技有限公司 Database query method and device
CN113704307A (en) * 2021-08-31 2021-11-26 深圳市兆珑科技有限公司 Data query method, device, server and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815284A (en) * 2019-01-04 2019-05-28 平安科技(深圳)有限公司 A kind of method and apparatus of data processing
CN111611276A (en) * 2020-06-05 2020-09-01 腾讯科技(深圳)有限公司 Data query method, device and storage medium
CN112861182A (en) * 2021-03-29 2021-05-28 中信银行股份有限公司 Database query method and system, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023029752A1 (en) * 2021-08-31 2023-03-09 深圳市兆珑科技有限公司 Data query method and apparatus, server, and computer-readable storage medium

Also Published As

Publication number Publication date
WO2023029752A1 (en) 2023-03-09

Similar Documents

Publication Publication Date Title
CN113704307A (en) Data query method, device, server and computer readable storage medium
CN107798038B (en) Data response method and data response equipment
CN111352902A (en) Log processing method and device, terminal equipment and storage medium
CN111049878A (en) Method, device, electronic device and storage medium for visualizing micro-service call chain
CN111104426B (en) Data query method and system
CN113704243A (en) Data analysis method, data analysis device, computer device, and storage medium
CN111367870A (en) Method, device and system for sharing picture book
CN111435376A (en) Information processing method and system, computer system, and computer-readable storage medium
CN107590248B (en) Search method, search device, search terminal and computer-readable storage medium
CN112905600A (en) Data query method and device, storage medium and electronic equipment
CN116244387A (en) Entity relationship construction method, device, electronic equipment and storage medium
CN117195185A (en) User authority management method for graph database, electronic equipment and medium
CN113609128B (en) Method, device, terminal equipment and storage medium for generating database entity class
CN109933595B (en) Internet of things equipment information sharing system and device and terminal equipment
CN111241137A (en) Data processing method and device, electronic equipment and storage medium
Bobkov et al. Maximal existence domains of positive solutions for two-parametric systems of elliptic equations
CN112799763A (en) Function management method, management device, terminal equipment and readable storage medium
CN112733510A (en) Financial certificate generation method, device, equipment and computer readable storage medium
CN109697234B (en) Multi-attribute information query method, device, server and medium for entity
CN111310076A (en) Geographic position query method, device, medium and electronic equipment
CN113312410B (en) Data map construction method, data query method and terminal equipment
US9460139B2 (en) Distributed storage system with pluggable query processing
CN114661762A (en) Query method and device for embedded database, storage medium and equipment
CN110471708B (en) Method and device for acquiring configuration items based on reusable components
CN111611056A (en) Data processing method and device, computer equipment and 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