CN112015787B - Data query method and device - Google Patents

Data query method and device Download PDF

Info

Publication number
CN112015787B
CN112015787B CN202010885548.4A CN202010885548A CN112015787B CN 112015787 B CN112015787 B CN 112015787B CN 202010885548 A CN202010885548 A CN 202010885548A CN 112015787 B CN112015787 B CN 112015787B
Authority
CN
China
Prior art keywords
data
query
data view
view
auxiliary
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010885548.4A
Other languages
Chinese (zh)
Other versions
CN112015787A (en
Inventor
陈辉
李洋涛
马宇申
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information 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 Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202010885548.4A priority Critical patent/CN112015787B/en
Publication of CN112015787A publication Critical patent/CN112015787A/en
Application granted granted Critical
Publication of CN112015787B publication Critical patent/CN112015787B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/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/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the specification provides a data query method and device, wherein the method comprises the following steps: receiving a data query request sent by a user, wherein the data query request is used for requesting to query a first data view in a database; under the condition that the first data view is obtained through inquiry, determining a label corresponding to the first data view, wherein the label is obtained by pre-marking the first data view; performing auxiliary query based on the tag and the first data view to obtain a second data view; and displaying the first data view and the second data view to the user.

Description

Data query method and device
Technical Field
The present document relates to the field of computer technologies, and in particular, to a data query method and apparatus.
Background
Currently, in many application scenarios, data query based on massive data is required. Generally, when a user performs data query, a query keyword can be input, filtering conditions can be configured, and after receiving a query request of the user, the server can perform data query in a database based on the query keyword and the filtering conditions and return a corresponding query result to the user.
However, in practical applications, when a user performs a data query, the user often wants to obtain a query result and obtain other data related to the query result, for example, analysis data of the query result, data that can be queried based on the query result, etc., but an effective method for achieving the above objective is still lacking.
Disclosure of Invention
The embodiment of the specification provides a data query method and device, which are used for solving the problem that other information related to a query result cannot be obtained when data query is performed.
In order to solve the above technical problems, the embodiments of the present specification are implemented as follows:
in a first aspect, a data query method is provided, including:
Receiving a data query request sent by a user, wherein the data query request is used for requesting to query a first data view in a database;
Under the condition that the first data view is obtained through inquiry, determining a label corresponding to the first data view, wherein the label is obtained by pre-marking the first data view;
Performing auxiliary query based on the tag and the first data view to obtain a second data view;
and displaying the first data view and the second data view to the user.
In a second aspect, a data query device is provided, including:
the receiving unit is used for receiving a data query request sent by a user, wherein the data query request is used for requesting to query a first data view in a database;
the determining unit is used for determining a label corresponding to the first data view under the condition that the first data view is obtained through query, wherein the label is obtained by pre-marking the first data view;
the auxiliary query unit is used for carrying out auxiliary query based on the tag and the first data view to obtain a second data view;
and the display unit displays the first data view and the second data view to the user.
In a third aspect, an electronic device is presented, the electronic device comprising:
A processor; and
A memory arranged to store computer executable instructions that, when executed, cause the processor to:
Receiving a data query request sent by a user, wherein the data query request is used for requesting to query a first data view in a database;
Under the condition that the first data view is obtained through inquiry, determining a label corresponding to the first data view, wherein the label is obtained by pre-marking the first data view;
Performing auxiliary query based on the tag and the first data view to obtain a second data view;
and displaying the first data view and the second data view to the user.
In a fourth aspect, a computer-readable storage medium storing one or more programs that, when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform the method of:
Receiving a data query request sent by a user, wherein the data query request is used for requesting to query a first data view in a database;
Under the condition that the first data view is obtained through inquiry, determining a label corresponding to the first data view, wherein the label is obtained by pre-marking the first data view;
Performing auxiliary query based on the tag and the first data view to obtain a second data view;
and displaying the first data view and the second data view to the user.
The above at least one technical solution adopted by one or more embodiments of the present disclosure can achieve the following technical effects: the data view in the database is pre-marked to obtain the label corresponding to the data view, after the data query request of the user is received, under the condition that the first data view is obtained through query, auxiliary query can be performed based on the label corresponding to the first data view and the first data view to obtain the second data view, and the first data view and the second data view are displayed to the user. Therefore, when the user queries the first data view, the auxiliary query can be further performed on the basis of the query of the first data view, and the second data view is obtained, so that the user can obtain the query result and other data related to the query result through one query, the user does not need to perform complex operation, and the data query experience of the user is effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some of the embodiments described in the embodiments of the present description, and that other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a flow diagram of a data query method according to one embodiment of the present disclosure;
FIG. 2 is a flow diagram of a data query method according to one embodiment of the present disclosure;
FIG. 3 is a schematic diagram of configuration items related to an auxiliary query according to one embodiment of the present description;
FIG. 4 is a schematic diagram of a second data view of one embodiment of the present description;
FIG. 5 is a schematic diagram of the structure of an electronic device according to one embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a data query method device according to an embodiment of the present disclosure.
Detailed Description
In order that those skilled in the art will better understand the technical solutions in the embodiments of the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in one or more embodiments of the present specification, and it is apparent that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
In the prior art, a user generates a large amount of data in the process of using the internet, the data are usually stored in a database, and when the user needs to perform data query, the server can perform data query from the database based on a query request sent by the user and return the queried target data to the user. For a relational database, since data stored in the database is structured data, the structured data is usually stored in a data view mode, and therefore, after the server queries from the relational database to obtain target data, the target data can be returned to the user in the form of a data view.
In practical applications, after obtaining a data view, a user typically analyzes the data view to obtain other data related to the data view, for example, after querying a transaction data view of a plurality of users, the user typically analyzes transaction data to determine whether an illegal user exists in the users, or analyze a transaction rule of the users, etc. When a user analyzes the queried data view, the query analysis is usually continuously performed according to the query result and personal experience, however, the whole process takes a lot of time, and the accuracy of the analysis result cannot be ensured.
Based on the above problems, if the user queries the query result and obtains other data related to the query result at the same time when the user queries the data, the user operation can be simplified, the efficiency and accuracy of data query analysis can be improved, and the user experience can be greatly improved.
In order to achieve the above objective, the current query analysis tool provides basic data query capability, and also supports data scrolling and rewinding, however, these capabilities are generally query capability for data in different dimensions, often cannot meet the actual requirements of users, and still requires users to manually perform query analysis, which results in inconvenient operation.
Therefore, an effective scheme for solving the problem that the user cannot obtain other information related to the query result when the user queries the data is still lacking.
In order to effectively solve the above-mentioned technical problems existing at present, the embodiments of the present disclosure provide a data query method and apparatus, where a tag corresponding to a data view is obtained by pre-marking a data view in a database, and after a data query request of a user is received, in the case that a first data view is obtained by query, auxiliary query may be performed based on the tag corresponding to the first data view and the first data view, to obtain a second data view, and the first data view and the second data view are displayed to the user. Therefore, when the user queries the first data view, the auxiliary query can be further performed on the basis of the query of the first data view, and the second data view is obtained, so that the user can obtain the query result and other data related to the query result through one query, the user does not need to perform complex operation, and the data query experience of the user is effectively improved.
The technical scheme provided by the embodiment of the specification provides a set of multi-view multi-type visual auxiliary analysis capability for a user, when the user queries and analyzes a batch of data, the server automatically performs secondary analysis on the query result according to the configured auxiliary analysis tool and is embodied in various presentation forms such as overview, pie charts, bar charts, line charts and the like, so that the user can analyze and decide, the auxiliary analysis function supports dynamic newly-added deletion and online offline, and the method is applicable to offline and real-time various data engines and arbitrary data views, and has extremely strong universality and expandable performance.
The following describes in detail the technical solutions provided by the embodiments of the present specification with reference to the accompanying drawings.
FIG. 1 is a flow chart of a data query method according to one embodiment of the present disclosure. The execution body of the embodiment shown in fig. 1 may be a server (hereinafter referred to as a server) corresponding to a data query platform that provides data query capability, where the data query method includes the following steps.
S102: and receiving a data query request sent by a user, wherein the data query request is used for requesting to query a first data view in a database.
In S102, when the user performs the data query, the user may initiate a data query request in a query interface provided by the data query platform, and at this time, the server may receive the data query request.
In this embodiment, the data query request may include a query keyword and a filtering condition, so that, in order to facilitate a user to initiate the data query request, the data query platform may provide a query interface for the user, where the query interface may include an input box for the query keyword and a candidate box for the filtering condition, so that, when the user initiates the data query request, the user may input the query keyword in the input box, configure the filtering condition at the same time, and initiate the data query request based on the input query keyword and the filtering condition.
The database may be a relational database, where the data stored in the database is structured data, where the structured data is stored in the database in the form of data views, that is, a plurality of data views may be stored in the database, and a data query request initiated by a user may be used to request that one or more data views be queried from the database, where, for convenience of distinction, a first data view may represent a data view that the user wants to query.
After receiving a data query request initiated by a user, the server can query corresponding target data in a database based on query keywords, and after querying the target data, the server can filter the target data based on filtering conditions to obtain a first data view, wherein the first data view can comprise the filtered target data, and the number of the first data view can be one or more. Of course, the server may query the database for the corresponding target data view based on the query keyword, and after querying the target data view, may filter the target data view based on the filtering condition to obtain a filtered target data view, i.e. obtain the first data view.
Alternatively, when the server performs the data query based on the data query request, there may be a case where the first data view is not queried, in which case, it may not be necessary to perform the subsequent steps. The embodiment may be described by taking the case of obtaining the first data view by query as an example.
S104: and under the condition that the first data view is obtained through inquiry, determining a label corresponding to the first data view, wherein the label is obtained by pre-marking the first data view.
In this embodiment, a plurality of data views (including the first data view) are stored in the database, and before receiving a data query request of a user, the plurality of data views may be marked in advance, so as to obtain a label corresponding to each data view.
Alternatively, the data stored in the database may be transaction data, which is stored in the database in the form of a data view, which may be marked in addition to the marking of the data view.
When the transaction data is marked, the transaction data can be marked according to data types, wherein the data types can comprise at least one of seller identification, buyer identification, transaction amount, transaction code and transaction merchant category code mcc, after the transaction data is marked, different data types correspond to different labels, and the labels corresponding to the different data types have global uniqueness.
In this embodiment, for any transaction data, the transaction data generally includes the buyer identifier, the seller identifier, the transaction amount, the transaction code and the transaction mcc, and after any transaction data is marked, a plurality of corresponding tags can be obtained.
Optionally, for multiple data of the same type, a code label may be added after the corresponding label to distinguish different data of the same type, for example, for identifying data of the same type for a buyer, in order to distinguish different buyers, a code label may be added after the label corresponding to the buyer identifier, and different buyers correspond to different codes.
When marking the data view, the label corresponding to the data view may be a label corresponding to the transaction data included in the data view, or may be a label obtained by marking a field included in the data view, which is not specifically limited herein, and the number of labels corresponding to one data view may be one or more, which is not specifically limited herein.
After the data view is marked in advance to obtain the corresponding label, the server can determine the label obtained when the first data view is marked in advance under the condition that the first data view is obtained by inquiry.
S106: and performing auxiliary query based on the tag and the first data view to obtain a second data view.
In this embodiment, the auxiliary query may be understood as a secondary query performed on the basis of a data query based on a data query request, where the data query based on the data query request may be referred to as a primary query.
Optionally, before performing the auxiliary query based on the tag corresponding to the first data view and the first data view, the server may determine whether a preset condition for performing the auxiliary query is satisfied based on the tag and the first data view, if so, may perform the auxiliary query based on the tag corresponding to the first data view and the first data view, and if not, cancel the auxiliary query, that is, do not perform the auxiliary query, where this embodiment is described taking the preset condition for satisfying the auxiliary query as an example.
The preset conditions can be preset by the server, and specifically can include a trigger tag and a trigger threshold. When judging whether the preset condition is met, firstly, the label corresponding to the first data view can be matched with at least one preset trigger label, if the matching fails, the preset condition of the auxiliary query is determined not to be met, if the matching is successful (the matching can be considered to be successful when any one or more trigger labels are matched), whether the data amount of the data included in the first data view is within a preset trigger threshold can be further judged, if the data amount is within the trigger threshold, the preset condition of the auxiliary query is determined to be met, and if the data amount is not within the trigger threshold, the preset condition of the auxiliary query is determined to be not met.
The at least one trigger tag may be one or more tags obtained by marking different types of transaction data as described in S104, so that data in the database may be effectively associated with the auxiliary query. The trigger threshold may be set according to an actual scenario, which is not specifically limited herein, and different scenarios may correspond to different trigger thresholds.
By setting the preset condition of the auxiliary query, the embodiment can avoid nonsensical auxiliary query in the case that the auxiliary query cannot be performed, or avoid the auxiliary query from being performed by the user in the case that the auxiliary query is not desired.
The server performs auxiliary query based on the label corresponding to the first data view and the first data view:
First, it may be determined which tags in the tags corresponding to the first data view are matched with the at least one trigger tag, and the matched tags are used as target tags, where the number of target tags may be one or multiple.
Next, a table name of a data table corresponding to the first data view may be determined. The first data view may be regarded as a data table, when the database stores the first data view, the table name of the first data view will be marked, and after the server queries to obtain the first data view, the server may determine to obtain the table name of the data table corresponding to the first data view.
And obtaining the target script for auxiliary inquiry based on the target label and the table name.
In this embodiment, an original script for performing the auxiliary query may be preset, and a target script may be obtained based on the original script, where the original script may include an original tag, an original view tag, and an original target view tag. It should be noted that the original label, the original view label and the original target view label can be understood as virtual labels, and are not real labels, i.e. the original script, although it can be used for assisting the query, cannot be directly used for assisting the query.
When the target script for auxiliary query is determined, an original script can be obtained, an original label in the original script is replaced by the target label, the original view label is replaced by a table name corresponding to the first data view, and the original target view label is replaced by a query statement corresponding to the data query request, so that the target script is obtained.
Finally, after the target script is obtained, a query request can be initiated based on the target script to perform auxiliary query. In this embodiment, the server may preset a capability type for assisting in query, where the capability type characterizes a query manner used when assisting in query, and may specifically include an SQL type or an atomic type, where the SQL type may be associated with a globally unique tag and a VIEW, the unique tag format may be represented as #marker: code#, the unique VIEW format may be represented as #view: code#, and the corresponding target VIEW is agreed as #view: targetcode #; the atom type one section is a Groovy script, and the inside of the script is a section of user-defined dynamic script.
The SQL type characterization performs data query in a database based on SQL sentences, wherein the database can be the database recorded in S102, and the SQL type-based assisted query characterization performs further query from the database; the atomic type characterization performs data query in other data query platforms, for example, the server is a server corresponding to the transaction platform, and then the other data query platforms can be merchant platforms, the auxiliary query characterization is performed based on the atomic type, merchant information is obtained from the merchant platforms, member information of the user in the merchant is obtained (the information is not stored in the server corresponding to the transaction platform).
Thus, when the auxiliary query is performed based on the target script, the capability type set in advance can be acquired, and the auxiliary query is performed based on the capability type and the target script. The capability type can be determined by a user before initiating the data query, whether to perform auxiliary query based on the SQL type or perform auxiliary query based on the atom type, and of course, the capability type of the auxiliary query can be determined by default SQL type or atom type of the server, or the server can automatically select a proper type from the SQL type and the atom type as the capability type according to the target script.
According to the method and the device, the capability type is set, and the auxiliary query is performed based on the capability type, so that different data can be obtained from different data platforms based on different query modes, and the query requirement of a user on the auxiliary query is met.
Optionally, the server may further preset an auxiliary query field for performing auxiliary query, so that when performing auxiliary query, the server may perform query in combination with the preset auxiliary query field. Specifically, the server may set the auxiliary query field in the above-mentioned target script (or original script), so that when performing the auxiliary query based on the target script, the auxiliary query field may be combined to perform the auxiliary query. Wherein the number of auxiliary query fields may be one or more.
S108: and displaying the first data view and the second data view to the user.
In S108, after performing the auxiliary query based on the tag corresponding to the first data view and the first data view to obtain the second data view, the server may display the first data view and the second data view to the user together.
Therefore, when the user queries the first data view, the auxiliary query can be further performed on the basis of the query of the first data view, and the second data view is obtained, so that the user can obtain the query result and other data related to the query result through one query, the user does not need to perform complex operation, and the data query experience of the user is effectively improved.
Optionally, the server may preset the display modes of the first data view and the second data view, which may be represented by the first display mode and the second display mode, respectively, so that when the first data view and the second data view are displayed, the first data view may be displayed based on the first display mode, and the second data view may be displayed based on the second display mode. The first display mode and the second display mode may be at least one of an overview, a pie chart, a histogram, a bar chart and a line chart, and of course, in other implementation modes, the first display mode and the second display mode may be the same or different, and may be a ranking mode, a duty ratio mode, a table mode or the like.
Optionally, when the auxiliary query is performed, if the auxiliary query field in S106 is combined with the auxiliary query field, the auxiliary query field may be further displayed to the user when the first data view and the second data view are displayed, so that the user knows which field queries the second data view is obtained based on.
Optionally, in S106, if the preset condition for performing the auxiliary query is not satisfied, the auxiliary query may not be performed, and the first data view may be displayed to the user, and when the first data view is displayed, the display may be performed based on the first display manner.
In order to facilitate understanding of the technical solution provided in the present specification, reference may be made to fig. 2, where fig. 2 is a schematic flow chart of a data query method according to an embodiment of the present specification, and an execution body of the embodiment shown in fig. 2 is the same as an execution body of the embodiment shown in fig. 1, and specifically may include the following steps.
S201: the data stored in the database is marked by data type.
Taking transaction data stored in the database as an example, the transaction data can be marked according to at least one data type of seller identification, buyer identification, transaction amount, transaction code and transaction merchant category code mcc, the marked label has global uniqueness, codes can be added after the label, and the code after each label is unique.
S202: configuration items related to the auxiliary query are set.
The configuration items related to the auxiliary query may include at least one trigger tag, trigger threshold, capability type, presentation chart type, auxiliary query field, original script. Wherein, at least one trigger tag and a trigger threshold can be used for judging whether the preset condition of the auxiliary query is satisfied; the capability type characterizes the query mode of the auxiliary query, including SQL type or atomic type; the display chart type is used for determining a display mode of the auxiliary query result; the auxiliary query field is used for carrying out auxiliary query; the original script is used to determine a target script for performing the auxiliary query. For details of these configuration items, reference may be made to the corresponding description in the embodiment shown in fig. 1, and the description is not repeated here.
S203: marking the data view in the database to obtain the label corresponding to the data view.
Marking a data view may be understood as creating an association between the data view and labels, and one data view may correspond to a plurality of labels.
S204: and receiving a data query request sent by a user.
A user may initiate a data query request in a query interface provided by the data query platform, the data query request requesting a query of a first data view in a database.
S205: and inquiring from the database based on the data inquiry request to obtain a corresponding first data view.
S206: and determining the label corresponding to the first data view.
S207: and judging whether preset conditions of auxiliary inquiry are met or not based on the labels corresponding to the first data view and the first data view.
If so, S208 may be performed; if not, S212 may be performed.
S208: and determining a target label matched with at least one preset trigger label in the labels corresponding to the first data view, and determining the table name of the data table corresponding to the first data view.
S209: and replacing and assembling the labels in the preset original script based on the target labels and the table names to obtain the target script.
S210: and carrying out auxiliary query based on the target script and the preset capability type to obtain a second data view.
S211: and displaying the first data view and the second data view based on a preset display chart type.
S212: and displaying the first data view based on a preset display chart type.
The specific implementation of S201 to S212 may refer to the specific implementation of the corresponding steps in the embodiment shown in fig. 1, and the description will not be repeated here.
To facilitate an understanding of the manner in which the configuration items and second data views described above are presented in connection with the auxiliary query, reference may be made to fig. 3 and 4.
The name shown on the left side of fig. 3 can be regarded as the table name of the data view queried after the user initiates the data query request, and the "trigger identifier" is the trigger tag, specifically including two trigger tags of a transaction number and a transaction code; 1000000 input in the "limit trigger number" input frame is the above trigger threshold; the capability type comprises SQL type and service capability, the service capability can be regarded as the atomic type, and the SQL type and the service capability can be selected from one; the processing script is the original script.
The "presentation configuration" shown on the right side of fig. 3 is of the type of presentation chart described above, i.e. the presentation of the second data view, and the presentation configuration in fig. 3 includes five forms of trends, ranks, ratios, tables and overviews, which may be one or more of them, although other presentation forms are possible in other implementations; the field is the auxiliary query field, and is used for auxiliary query.
Based on the multiple configuration items of the auxiliary query shown in fig. 3, after the server queries the first data view, the server can match the two trigger marks, namely the tag corresponding to the first data view, the transaction number and the transaction code, if the two trigger marks are matched successfully, whether the data volume in the first data view is greater than or equal to 1000000 is further judged, and if yes, the auxiliary query can be performed. When the auxiliary query is performed, the auxiliary query can be performed based on the SQL type, the processing script and the field shown in fig. 3, and after the second data view is obtained by the query, the second data view can be displayed based on the display configuration shown in fig. 3, and particularly, refer to fig. 4.
Fig. 4 shows a second data view in a duty cycle manner, where the content shown includes the number of risk merchants, historical shutdown records, merchant investigation records, the number of trepanned merchants, illegal trade in foreign currency risk merchants, the number of clear merchants, and of course, in other implementations, the front N digits of the merchant transaction amount, the transaction code duty cycle, the transaction mcc distribution, etc., and these data may be used for the user to make analysis decisions.
The technical scheme provided by the embodiment of the specification is as follows: the data view in the database is pre-marked to obtain the label corresponding to the data view, after the data query request of the user is received, under the condition that the first data view is obtained through query, auxiliary query can be performed based on the label corresponding to the first data view and the first data view to obtain the second data view, and the first data view and the second data view are displayed to the user. Therefore, when the user queries the first data view, the auxiliary query can be further performed on the basis of the query of the first data view, and the second data view is obtained, so that the user can obtain the query result and other data related to the query result through one query, the user does not need to perform complex operation, and the data query experience of the user is effectively improved.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Fig. 5 is a schematic structural view of an electronic device according to an embodiment of the present specification. Referring to fig. 5, at the hardware level, the electronic device includes a processor, and optionally an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory (non-volatile Memory), such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, network interface, and memory may be interconnected by an internal bus, which may be an ISA (Industry Standard Architecture ) bus, a PCI (PERIPHERAL COMPONENT INTERCONNECT, peripheral component interconnect standard) bus, or EISA (Extended Industry Standard Architecture ) bus, among others. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 5, but not only one bus or type of bus.
And the memory is used for storing programs. In particular, the program may include program code including computer-operating instructions. The memory may include memory and non-volatile storage and provide instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs, and forms a data query device on a logic level. The processor is used for executing the programs stored in the memory and is specifically used for executing the following operations:
Receiving a data query request sent by a user, wherein the data query request is used for requesting to query a first data view in a database;
Under the condition that the first data view is obtained through inquiry, determining a label corresponding to the first data view, wherein the label is obtained by pre-marking the first data view;
Performing auxiliary query based on the tag and the first data view to obtain a second data view;
and displaying the first data view and the second data view to the user.
The method performed by the data query device disclosed in the embodiment shown in fig. 5 of the present specification may be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or by instructions in the form of software. The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but may also be a digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of this specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present specification may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method.
The electronic device may further execute the methods of fig. 1 and fig. 2, and implement the functions of the data query device in the embodiments shown in fig. 1 and fig. 2, which are not described herein again.
Of course, in addition to the software implementation, the electronic device of the embodiments of the present disclosure does not exclude other implementations, such as a logic device or a combination of software and hardware, that is, the execution subject of the following processing flow is not limited to each logic unit, but may also be hardware or a logic device.
The present description also proposes a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, enable the portable electronic device to perform the methods of the embodiments shown in fig. 1 and 2, and in particular to perform the operations of:
Receiving a data query request sent by a user, wherein the data query request is used for requesting to query a first data view in a database;
Under the condition that the first data view is obtained through inquiry, determining a label corresponding to the first data view, wherein the label is obtained by pre-marking the first data view;
Performing auxiliary query based on the tag and the first data view to obtain a second data view;
and displaying the first data view and the second data view to the user.
Fig. 6 is a schematic structural diagram of a data query device 60 according to an embodiment of the present disclosure. Referring to fig. 6, in a software implementation, the data query device 60 may include: a receiving unit 61, a determining unit 62, an auxiliary querying unit 63 and a presenting unit 64, wherein:
a receiving unit 61 for receiving a data query request sent by a user, the data query request being used for requesting to query a database for a first data view;
A determining unit 62, configured to determine, when the first data view is obtained by querying, a label corresponding to the first data view, where the label is obtained by pre-marking the first data view;
an auxiliary query unit 63, configured to perform auxiliary query based on the tag and the first data view, so as to obtain a second data view;
And a display unit 64 for displaying the first data view and the second data view to the user.
Optionally, the data query request comprises query keywords and filtering conditions;
Wherein, the receiving unit 61 queries the database for target data corresponding to the query keyword after receiving the data query request;
And filtering the target data based on the filtering condition to obtain the first data view, wherein the first data view comprises the filtered target data.
Optionally, the data stored in the database is transaction data;
Wherein, the determining unit 62 marks the transaction data according to data types before the receiving unit 61 receives the data query request, and different data types correspond to different tags, and the data types include at least one of seller identification, buyer identification, transaction amount, transaction code and transaction merchant category code mcc.
Optionally, the transaction data is stored in the database in a data view;
The determining unit 62 marks the data view based on the fields included in the data view before the receiving unit 61 receives the data query request, so as to obtain a label corresponding to the data view.
Optionally, the auxiliary query unit 63 performs an auxiliary query based on the tag and the first data view, including:
judging whether preset conditions of auxiliary inquiry are met or not based on the label and the first data view;
and if so, performing auxiliary query based on the label and the first data view.
Optionally, the auxiliary query unit 63 determines, based on the tag and the first data view, whether a preset condition of auxiliary query is satisfied, including:
Matching the label with at least one preset trigger label;
If the matching fails, determining that the preset condition is not met; if the matching is successful, judging whether the data amount of the data in the first data view is within a preset trigger threshold;
if the trigger threshold is within the trigger threshold, determining that the preset condition is met; and if the preset condition is not met, determining that the preset condition is not met.
Optionally, the auxiliary query unit 63 performs an auxiliary query based on the tag and the first data view, including:
determining target tags matched with the at least one trigger tag in the tags;
Determining the table name of a data table corresponding to the first data view;
Obtaining a target script for auxiliary inquiry based on the target label and the table name;
and initiating a query request based on the target script to perform auxiliary query.
Optionally, the auxiliary query unit 63 obtains, based on the target tag and the table name, a target script for performing auxiliary query, including:
Acquiring a preset original script for auxiliary query, wherein the original script comprises an original label, an original view label and an original target view label;
And replacing the original label with the target label, replacing the original view label with the table name, and replacing the original target view label with a query statement corresponding to the data query request to obtain the target script.
Optionally, the auxiliary query unit 63 initiates a query request to perform auxiliary query based on the target script, including:
Acquiring a preset capability type, wherein the capability type represents a query mode used when auxiliary query is performed, the capability type comprises an SQL type or an atomic type, the SQL type represents data query in the database based on SQL sentences, and the atomic type represents data query in other data query platforms;
And initiating a query request to perform auxiliary query based on the capability type and the target script.
Optionally, the target script further includes a preset auxiliary query field, where the auxiliary query field is used for performing auxiliary query;
Wherein, the presenting unit 64 also presents the auxiliary query field to the user when presenting the second data view to the user.
Optionally, the presenting unit 64 presents the first data view and the second data view to the user, including:
acquiring a preset first display mode of the first data view and a preset second display mode of the second data view;
The first data view is presented based on the first presentation and the second data view is presented based on the second presentation.
The data query device 60 provided in the embodiment of the present disclosure may further execute the methods of fig. 1 and fig. 2, and implement the functions of the embodiments of the data query device shown in fig. 1 and fig. 2, which are not described herein again.
In summary, the foregoing description is only a preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of one or more embodiments of the present disclosure should be included in the protection scope of this document.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.

Claims (14)

1. A data query method, comprising:
Receiving a data query request sent by a user, wherein the data query request is used for requesting to query a first data view in a database;
Under the condition that the first data view is obtained through inquiry, determining a label corresponding to the first data view, wherein the label is obtained by pre-marking the first data view; the tag is matched with the data type of the first data view;
Performing auxiliary query based on the tag and the first data view to obtain a second data view;
and displaying the first data view and the second data view to the user.
2. The method of claim 1, wherein the data query request includes query keywords and filtering conditions;
Wherein, after receiving the data query request, the method further comprises:
querying target data corresponding to the query keywords in the database;
And filtering the target data based on the filtering condition to obtain the first data view, wherein the first data view comprises the filtered target data.
3. The method of claim 1, the data stored in the database being transaction data;
wherein, prior to receiving the data query request, the method further comprises:
The transaction data is marked according to data types, different data types correspond to different labels, and the data types comprise at least one of seller identification, buyer identification, transaction amount, transaction code and transaction merchant category code mcc.
4. A method as claimed in claim 3, the transaction data being stored in the database in a data view;
wherein, prior to receiving the data query request, the method further comprises:
And marking the data view based on the fields included in the data view to obtain a label corresponding to the data view.
5. The method of claim 1, performing an auxiliary query based on the tag and the first data view, comprising:
judging whether preset conditions of auxiliary inquiry are met or not based on the label and the first data view;
and if so, performing auxiliary query based on the label and the first data view.
6. The method of claim 5, based on the tag and the first data view, determining whether a preset condition for auxiliary queries is satisfied, comprising:
Matching the label with at least one preset trigger label;
If the matching fails, determining that the preset condition is not met; if the matching is successful, judging whether the data amount of the data in the first data view is within a preset trigger threshold;
if the trigger threshold is within the trigger threshold, determining that the preset condition is met; and if the preset condition is not met, determining that the preset condition is not met.
7. The method of claim 6, performing an auxiliary query based on the tag and the first data view, comprising:
determining target tags matched with the at least one trigger tag in the tags;
Determining the table name of a data table corresponding to the first data view;
Obtaining a target script for auxiliary inquiry based on the target label and the table name;
and initiating a query request based on the target script to perform auxiliary query.
8. The method of claim 7, deriving a target script for conducting an auxiliary query based on the target tag and the table name, comprising:
Acquiring a preset original script for auxiliary query, wherein the original script comprises an original label, an original view label and an original target view label;
And replacing the original label with the target label, replacing the original view label with the table name, and replacing the original target view label with a query statement corresponding to the data query request to obtain the target script.
9. The method of claim 7, initiating a query request based on the target script for an auxiliary query, comprising:
Acquiring a preset capability type, wherein the capability type represents a query mode used when auxiliary query is performed, the capability type comprises an SQL type or an atomic type, the SQL type represents data query in the database based on SQL sentences, and the atomic type represents data query in other data query platforms;
And initiating a query request to perform auxiliary query based on the capability type and the target script.
10. The method of claim 7, wherein the target script further comprises a preset auxiliary query field, and the auxiliary query field is used for performing auxiliary query;
Wherein, upon presenting the second data view to the user, the method further comprises:
And displaying the auxiliary query field to the user.
11. The method of claim 1, presenting the first data view and the second data view to the user, comprising:
acquiring a preset first display mode of the first data view and a preset second display mode of the second data view;
The first data view is presented based on the first presentation and the second data view is presented based on the second presentation.
12. A data query device, comprising:
the receiving unit is used for receiving a data query request sent by a user, wherein the data query request is used for requesting to query a first data view in a database;
the determining unit is used for determining a label corresponding to the first data view under the condition that the first data view is obtained through query, wherein the label is obtained by pre-marking the first data view; the tag is matched with the data type of the first data view;
the auxiliary query unit is used for carrying out auxiliary query based on the tag and the first data view to obtain a second data view;
and the display unit displays the first data view and the second data view to the user.
13. An electronic device, comprising:
A processor; and
A memory arranged to store computer executable instructions that, when executed, cause the processor to:
Receiving a data query request sent by a user, wherein the data query request is used for requesting to query a first data view in a database;
Under the condition that the first data view is obtained through inquiry, determining a label corresponding to the first data view, wherein the label is obtained by pre-marking the first data view; the tag is matched with the data type of the first data view;
Performing auxiliary query based on the tag and the first data view to obtain a second data view;
and displaying the first data view and the second data view to the user.
14. A computer readable storage medium storing one or more programs, which when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform the method of:
Receiving a data query request sent by a user, wherein the data query request is used for requesting to query a first data view in a database;
Under the condition that the first data view is obtained through inquiry, determining a label corresponding to the first data view, wherein the label is obtained by pre-marking the first data view; the tag is matched with the data type of the first data view;
Performing auxiliary query based on the tag and the first data view to obtain a second data view;
and displaying the first data view and the second data view to the user.
CN202010885548.4A 2020-08-28 2020-08-28 Data query method and device Active CN112015787B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010885548.4A CN112015787B (en) 2020-08-28 2020-08-28 Data query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010885548.4A CN112015787B (en) 2020-08-28 2020-08-28 Data query method and device

Publications (2)

Publication Number Publication Date
CN112015787A CN112015787A (en) 2020-12-01
CN112015787B true CN112015787B (en) 2024-06-21

Family

ID=73503788

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010885548.4A Active CN112015787B (en) 2020-08-28 2020-08-28 Data query method and device

Country Status (1)

Country Link
CN (1) CN112015787B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710663A (en) * 2018-12-29 2019-05-03 北京神舟航天软件技术有限公司 A kind of data statistics chart generation method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7644361B2 (en) * 2002-12-23 2010-01-05 Canon Kabushiki Kaisha Method of using recommendations to visually create new views of data across heterogeneous sources
CN101968812A (en) * 2010-10-25 2011-02-09 中国农业大学 Method and device for automatically generating cartogram by calling database data
CN109376171B (en) * 2018-08-15 2020-10-16 广州虎牙信息科技有限公司 Data query method and device, computer storage medium and server
CN110941650A (en) * 2019-11-22 2020-03-31 北京雅丁信息技术有限公司 Medical data statistical query system and method
CN111241123A (en) * 2020-01-07 2020-06-05 深圳市华宇讯科技有限公司 View data query method, device, server and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710663A (en) * 2018-12-29 2019-05-03 北京神舟航天软件技术有限公司 A kind of data statistics chart generation method

Also Published As

Publication number Publication date
CN112015787A (en) 2020-12-01

Similar Documents

Publication Publication Date Title
RU2614933C2 (en) Method and device for information search at e-commercial platform
CN111125376B (en) Knowledge graph generation method and device, data processing equipment and storage medium
CN110599307A (en) Commodity recommendation method and device
CN113535817A (en) Method and device for generating characteristic broad table and training business processing model
CN110362702B (en) Picture management method and equipment
CN110704423B (en) Excitation information acquisition method and device, storage medium and electronic equipment
CN110489032B (en) Dictionary query method for electronic book and electronic equipment
CN115564486A (en) Data pushing method, device, equipment and medium
CN113626558B (en) Intelligent recommendation-based field standardization method and system
EP2850544A1 (en) A user recommendation method and device
CN111131419A (en) Information pushing method and server based on book pages
US20170228398A1 (en) Image metadata enrinchment generator
CN110796178B (en) Decision model training method, sample feature selection method, device and electronic equipment
CN113077321A (en) Article recommendation method and device, electronic equipment and storage medium
CN117421355A (en) Search recall method, device and equipment
CN112015787B (en) Data query method and device
CN109727056B (en) Financial institution recommendation method, device, storage medium and device
CN110336731B (en) User matching method and device in group
CN109598478B (en) Wind measurement result description document generation method and device and electronic equipment
CN111026963A (en) Data query method and device, and configuration information setting method and device
CN111143546A (en) Method and device for obtaining recommendation language and electronic equipment
CN116186286A (en) International logistics information recommendation method, system and medium based on enterprise knowledge graph
CN116644102A (en) Intelligent investment object selection method, system terminal and computer readable storage medium
CN113806526B (en) Feature extraction method, device and storage medium
CN112528096B (en) Enterprise analysis method, storage medium 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
GR01 Patent grant