CN117009392A - Data query method, device, computer equipment and storage medium - Google Patents

Data query method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117009392A
CN117009392A CN202311010861.3A CN202311010861A CN117009392A CN 117009392 A CN117009392 A CN 117009392A CN 202311010861 A CN202311010861 A CN 202311010861A CN 117009392 A CN117009392 A CN 117009392A
Authority
CN
China
Prior art keywords
query
data table
data
delivery plan
parameter
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
CN202311010861.3A
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.)
Beijing Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Youzhuju Network 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 Beijing Youzhuju Network Technology Co Ltd filed Critical Beijing Youzhuju Network Technology Co Ltd
Priority to CN202311010861.3A priority Critical patent/CN117009392A/en
Publication of CN117009392A publication Critical patent/CN117009392A/en
Pending legal-status Critical Current

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/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The present disclosure provides a data query method, apparatus, computer device, and storage medium, including: receiving a query request carrying a user identifier and a query parameter; searching a target delivery plan identification of the media content corresponding to the user identification from a first data table stored in a first database of the query server based on the user identification; based on the target delivery plan identification, connecting at least one second data table corresponding to the query parameters in the first database to generate a temporary data table; the second data table stores parameter values corresponding to the query parameters, wherein the parameter values are interaction data values generated after media content is delivered according to a delivery plan corresponding to the delivery plan identification; and carrying out zero padding processing on the query parameter value corresponding to the target delivery plan identifier with the null corresponding query parameter value in the temporary data table, and returning target query data corresponding to the query request based on the temporary data table subjected to the zero padding processing.

Description

Data query method, device, computer equipment and storage medium
Technical Field
The disclosure relates to the technical field of computers, and in particular relates to a data query method, a data query device, computer equipment and a storage medium.
Background
When an advertiser performs advertisement delivery, a delivery plan needs to be made, and then the advertisement delivery is performed according to the delivery plan. After the advertisement is put, the advertiser needs to check the data such as clicking, showing times and the like to adjust the putting plan.
In an application scenario, advertisement data generated after advertisement delivery is stored in a distributed full text search Engine (ES), and when an advertiser performs data query, an advertiser generally sends an advertiser identifier to a background, and the background queries a delivery plan under the advertiser based on the advertiser identifier, and queries advertisement data based on the delivery plan. In the process, the quantity of the advertisement data queried is larger because of the larger quantity of the delivery plans under the advertiser, so that the parameter transmission is more and the query speed is slower in the query process.
Disclosure of Invention
The embodiment of the disclosure at least provides a data query method, a data query device, computer equipment and a storage medium.
In a first aspect, an embodiment of the present disclosure provides a data query method, applied to a query server, including:
receiving a query request carrying a user identifier and a query parameter;
Searching a target delivery plan identification of the media content corresponding to the user identification from a first data table stored in a first database of the query server based on the user identification;
based on the target delivery plan identification, connecting at least one second data table corresponding to the query parameter in the first database, and generating a temporary data table; the second data table stores parameter values corresponding to the query parameters, wherein the parameter values are interaction data values generated after media content is delivered according to a delivery plan corresponding to the delivery plan identifier;
and carrying out zero padding processing on the query parameter value corresponding to the target delivery plan identifier with the null corresponding query parameter value in the temporary data table, and returning target query data corresponding to the query request based on the temporary data table after the zero padding processing.
In a possible implementation manner, the query server further stores a third data table, the third data table stores a first query parameter identifier, and a fourth data table where a parameter value corresponding to the first query parameter is located is stored in the second database.
In a possible implementation manner, the connecting at least one second data table corresponding to the query parameter in the first database based on the target delivery plan identifier includes:
And connecting at least one second data table corresponding to other second query parameters except the first query parameters in the third data table in the first database based on the target delivery plan identification.
In a possible implementation manner, in a case that it is determined, based on the third data table, that the query parameters carried in the query request include at least one first query parameter, the method further includes:
inquiring a fourth data table where a first inquiry parameter carried in the inquiry request is located from the second database, and acquiring first inquiry data corresponding to the target delivery plan identifier;
the first query data is added to the temporary data table.
In a possible implementation manner, the generating a temporary data table based on the target delivery plan identifier and connecting at least one second data table corresponding to the query parameter in the first database includes:
integrating the data corresponding to the target delivery identifier in the second data table according to the target delivery identifier and the query parameter to obtain integrated data;
and adding the integrated data to the temporary data table.
In a possible implementation manner, the query request further carries a first query condition corresponding to the query parameter;
the step of generating a temporary data table by connecting at least one second data table corresponding to the query parameter in the first database based on the target delivery plan identification comprises the following steps:
and connecting at least one second data table corresponding to the query parameter based on the target delivery plan identification, and screening data in the connected at least one second data table based on the first query condition to generate the temporary data table.
In one possible implementation, the query request is a paging query request;
the returning the target query data corresponding to the query request based on the temporary data table after the zero padding processing comprises the following steps:
sorting the temporary data table subjected to zero padding treatment according to the target query parameters;
and determining target query data conforming to the paging query request in the ordered temporary data table, and returning the target query data.
In a second aspect, an embodiment of the present disclosure further provides a data query apparatus, including:
the receiving module is used for receiving a query request carrying a user identifier and a query parameter;
The searching module is used for searching a target delivery plan identifier of the media content corresponding to the user identifier from a first data table stored in a first database of the query server based on the user identifier;
the connection module is used for connecting at least one second data table corresponding to the query parameter in the first database based on the target delivery plan identification to generate a temporary data table; the second data table stores parameter values corresponding to the query parameters, wherein the parameter values are interaction data values generated after media content is delivered according to a delivery plan corresponding to the delivery plan identifier;
and the zero padding module is used for performing zero padding processing on the query parameter value corresponding to the target delivery plan identifier with the null corresponding query parameter value in the temporary data table, and returning target query data corresponding to the query request based on the temporary data table after the zero padding processing.
In a third aspect, embodiments of the present disclosure further provide a computer device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory in communication via the bus when the computer device is running, the machine-readable instructions when executed by the processor performing the steps of the first aspect, or any of the possible implementations of the first aspect.
In a fourth aspect, the presently disclosed embodiments also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the first aspect, or any of the possible implementations of the first aspect.
In the data query method, the data query device, the computer equipment and the storage medium provided by the embodiment of the disclosure, the first data table storing the corresponding relation between the user identifier and the delivery plan identifier and the second data table storing the corresponding relation between the query parameter and the delivery plan identifier are stored in the first database, so that when data query is performed, cross-module parameter transfer is not required, and the performance consumption is lower; in addition, after the target delivery plan identifier corresponding to the user identifier is queried from the first data table, the second data table can be connected to generate a temporary data table based on the target delivery plan identifier, target query data are acquired from the temporary data table for feedback, and compared with table-by-table query, the data are acquired based on the mode of connecting the data tables, so that the data acquisition speed is higher.
The foregoing objects, features and advantages of the disclosure will be more readily apparent from the following detailed description of the preferred embodiments taken in conjunction with the accompanying drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for the embodiments are briefly described below, which are incorporated in and constitute a part of the specification, these drawings showing embodiments consistent with the present disclosure and together with the description serve to illustrate the technical solutions of the present disclosure. It is to be understood that the following drawings illustrate only certain embodiments of the present disclosure and are therefore not to be considered limiting of its scope, for the person of ordinary skill in the art may admit to other equally relevant drawings without inventive effort.
Fig. 1 is a schematic diagram illustrating a data query method in the related art according to an embodiment of the present disclosure;
FIG. 2 illustrates a flow chart of a data query method provided by an embodiment of the present disclosure;
FIG. 3 is an overall schematic diagram of a data query method provided by an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a data query device according to an embodiment of the disclosure;
fig. 5 shows a schematic structural diagram of a computer device according to an embodiment of the disclosure.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are only some embodiments of the present disclosure, but not all embodiments. The components of the embodiments of the present disclosure, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the disclosure, as claimed, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be made by those skilled in the art based on the embodiments of this disclosure without making any inventive effort, are intended to be within the scope of this disclosure.
In one scenario, advertisement data generated after advertisement delivery is stored in a distributed full text search Engine (ES), and when an advertiser performs a data query, the advertiser generally sends an advertiser identification to the background, and the background queries a delivery plan under the advertiser based on the advertiser identification, and queries the advertisement data based on the delivery plan.
Specifically, as shown in fig. 1, the user side may send the user ID (i.e. the advertiser identifier) to the background, and the background may obtain, from the background database, full-volume plan data (herein, a list of delivery plan identifiers formulated by the user) corresponding to the user ID based on the user ID, and then send parameters corresponding to the full-volume plan data to the query platform, and query corresponding user data in the ES through the query platform.
When a plurality of users perform inquiry simultaneously, the data volume of the total planning data transferred from the background to the inquiry platform is larger, and the performance consumption is larger.
In addition, since the ES only has the corresponding advertisement data after the advertisement data is generated according to the advertisement delivery plan, if the advertisement is not generated after the advertisement is delivered according to the advertisement delivery plan, the advertisement data corresponding to the advertisement delivery plan does not exist in the ES, but the user side needs to display all the advertisement delivery plans when inquiring, so that zero padding processing needs to be performed on the advertisement delivery data without the advertisement data.
When zero padding is performed, different advertisement data exist in different data tables, so that the advertisement data need to be compared with the full-scale plan data one by one, an advertisement delivery plan needing zero padding is determined, and the consumed performance of the method is high.
For example, if the advertisement data includes clicking and displaying, clicking the corresponding data table is data table 1, displaying the corresponding data table is data table 2, the storage contents of the data table 1 are shown in the following table 1, and the storage contents of the data table 2 are shown in the following table 2:
TABLE 1
ad_id click
1 1
2 3
3 5
TABLE 2
In the table, ad_id represents a delivery plan representation, click represents clicking, show represents display, and if the full-volume plan data comprises '1, 2, 3 and 4', namely the delivery plan identifications in the full-volume plan data are respectively '1, 2, 3 and 4', the data needing zero padding are 'ad_id, 4, click and 0' through comparison with the data in the table 1; the data to be zero-padded is "ad_id,1, show,0" by comparison with the data in index 2.
Therefore, when the delivery plan identification in the full-volume plan data is more, or when the data volume of the advertisement data is larger, the data is acquired after the zero-filling operation is performed in the mode, and the performance cost is larger.
Based on the above study, the disclosure provides a data query method, a device, a computer device and a storage medium, wherein a first data table storing a corresponding relation between a user identifier and a delivery plan identifier and a second data table storing a corresponding relation between query parameters and a delivery plan identifier are stored in a first database, so that when data query is performed, cross-module parameter transfer is not required, and the performance consumption is lower; in addition, after the target delivery plan identifier corresponding to the user identifier is queried from the first data table, the second data table can be connected to generate a temporary data table based on the target delivery plan identifier, target query data are acquired from the temporary data table for feedback, and compared with table-by-table query, the data are acquired based on the mode of connecting the data tables, so that the data acquisition speed is higher.
In addition, when the zero-filling operation is performed, zero-filling processing can be directly performed on all query parameters of the delivery plan needing the zero-filling operation in the temporary data table, a process of multiple comparison is not needed, and the performance loss is small.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
The term "and/or" is used herein to describe only one relationship, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist together, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
It will be appreciated that prior to using the technical solutions disclosed in the embodiments of the present disclosure, the user should be informed and authorized of the type, usage range, usage scenario, etc. of the personal information related to the present disclosure in an appropriate manner according to the relevant legal regulations.
For example, in response to receiving an active request from a user, a prompt is sent to the user to explicitly prompt the user that the operation it is requesting to perform will require personal information to be obtained and used with the user. Thus, the user can autonomously select whether to provide personal information to software or hardware such as an electronic device, an application program, a server or a storage medium for executing the operation of the technical scheme of the present disclosure according to the prompt information.
As an alternative but non-limiting implementation, in response to receiving an active request from a user, the manner in which the prompt information is sent to the user may be, for example, a popup, in which the prompt information may be presented in a text manner. In addition, a selection control for the user to select to provide personal information to the electronic device in a 'consent' or 'disagreement' manner can be carried in the popup window.
It will be appreciated that the above-described notification and user authorization process is merely illustrative and not limiting of the implementations of the present disclosure, and that other ways of satisfying relevant legal regulations may be applied to the implementations of the present disclosure.
For the sake of understanding the present embodiment, first, a data query method disclosed in the embodiments of the present disclosure is described in detail, and an execution body of the data query method provided in the embodiments of the present disclosure is a query server.
Referring to fig. 2, a flowchart of a data query method according to an embodiment of the present disclosure is shown, where the method includes steps 201 to 204, where:
step 201, a query request carrying a user identifier and a query parameter is received.
Step 202, searching a target delivery plan identification of the media content corresponding to the user identification from a first data table stored in a first database of the query server based on the user identification.
Step 203, based on the target delivery plan identifier, connecting at least one second data table corresponding to the query parameter in the first database, and generating a temporary data table; and the second data table stores parameter values corresponding to the query parameters, wherein the parameter values are interaction data values generated after media content is delivered according to a delivery plan corresponding to the delivery plan identification.
And 204, performing zero padding processing on the query parameter value corresponding to the target delivery plan identifier with the null corresponding query parameter value in the temporary data table, and returning target query data corresponding to the query request based on the temporary data table after the zero padding processing.
The following is a detailed description of the above steps.
For step 201,
Here, the user identification may be an identification of a user who has made a delivery plan for delivering media content, and the delivery plan may include a delivery platform, a delivery time, delivery content, a delivery form, and the like, by way of example. The same user may specify multiple delivery plans.
The query parameter may be a parameter for reflecting a delivery effect of the media content, may be a user interaction parameter, and may include, for example, the number of clicks, the number of plays, the number of collections, the number of shares, and the like of the media content.
In a possible implementation manner, the query request may be sent by a user terminal, and the user may select the query parameter through the user terminal, and send the query request carrying the user identifier and the query parameter through the user terminal.
Aiming at the step 202,
The first data table may be a data table storing a correspondence between user identifiers and delivery plan identifiers, where a plurality of user identifiers may be stored in the first data table, and when the data size of the user identifiers or the delivery plan identifiers is large, the first data table may include a plurality of tables.
The first database may refer to a database supporting join operations (join), and may be, for example, a doris database.
In a possible implementation manner, the query request may further include a second query condition corresponding to the delivery plan, where the second query condition may be a condition for limiting the delivery plan of the query, and may include, for example, a delivery time of the delivery plan, a time of making the delivery plan, and the like.
Correspondingly, the first data table can also store attribute information of each delivery plan, and the attribute information corresponds to the second query condition; and under the condition that the query request carries a second query condition, searching the target delivery plan identifier from the first data table based on the user identifier and the second query condition.
For step 203,
Optionally, the query request may carry a plurality of query parameters, different query parameters may be stored in different second data tables, and the number of second data tables that need to be connected with join may be the same as the number of query parameters.
For example, if the target delivery plan identifier found in the first data table includes "1, 2, 3, and 4", and the second data table is table 1 and table 2, after the second data table is identified based on the target delivery plan identifier join, the temporary data table is generated as shown in table 3 below:
TABLE 3 Table 3
ad_id click Show
1 1
2 3 5
3 5 6
4 7
It can be seen that the temporary data packet includes the target delivery plan identifier of the delivery plan, the query parameters, and the parameter values under each query parameter.
The data table corresponding to the query parameter may be pre-stored in the ES, and then the data table of the query parameter stored in the ES is migrated to the first database, where the first database and the ES are different storage modules.
However, in practical applications, the data table of the query parameters may be used for user query, and other service lines may need to acquire data from the data table, and because the data amount of the data table of the query parameters is large, if all the data tables of the query parameters are migrated to the first database, more performance may be required to be consumed. Therefore, based on this, the data table migrated into the first database may be a data table of the partial query parameters, and the ES also retains the data table of the partial query parameters.
Specifically, the query server further stores a third data table, the third data table may store a first query parameter identifier, a fourth data table where a parameter value corresponding to the first query parameter is located is stored in a second database, and the second database may be the database of the ES.
The data table of the query parameters migrated to the first database may be a data table of the query parameters with higher query frequency, for example, may be the number of pointing strokes, the number of displaying times, and the like. The data table of which query parameter is specifically migrated may be considered to be set, or may determine a query parameter with a query frequency higher than a preset frequency based on the query parameter carried in the historical query request, and migrate the data table of the query parameter with the query frequency higher than the preset frequency to the first database.
Since ES does not support join, when connecting at least one second data table corresponding to the query parameter in the first database based on the target delivery plan identifier, it may mean that at least one second data table corresponding to other second query parameters in the first database except the first query parameter in the third data table is connected based on the target delivery plan identifier.
That is, before executing join, determining a first query parameter belonging to the third data table and a second query parameter except the first query parameter from the query parameters carried by the query request, and then connecting a second data table corresponding to the second query parameter based on the target delivery plan identifier.
And under the condition that the query parameters carried in the query request comprise at least one first query parameter based on the third data table, a fourth data table where the first query parameters carried in the query request are located can be queried from the second database, first query data corresponding to the target delivery plan identification are obtained, and then the first query data are added into the temporary data table.
In practical application, since the data granularity of the fourth data table may be updated, in order to reduce the transmission parameters, the fourth data table may be integrated with the delivery plan identifier as the integration granularity, and then the first query data corresponding to the target delivery plan identifier may be acquired from the integrated fourth data table.
For example, if the minimum data granularity in the fourth data table is "create_id", and the query parameter included in the fourth data table is "click", the data included in the fourth data table may be as shown in the following table 4:
TABLE 4 Table 4
creative_id ad_id click
123 1 6
124 1 7
122 2 8
111 3 9
456 3 10
788 4 11
With the delivery schedule identified as the integration granularity, the data of table 5 below can be obtained after integrating table 4 above:
TABLE 5
When integrating table 4, two pieces of data with the ad_id of 1 are obtained, the first piece of data and the second piece of data are combined, click data 13 corresponding to the ad_id1 can be obtained, similarly, two pieces of data with the ad_id of 13 are also obtained, and the fourth piece of data and the fifth piece of data are combined, so that click data 19 corresponding to the ad_id3 can be obtained.
When the data is acquired from the integrated data table, the data can be acquired from the integrated data table directly according to the target delivery plan identification, and compared with the data acquired from the integrated data table, the data acquisition mode can reduce the acquired data amount and reduce the performance loss.
Similarly, when at least one second data table corresponding to the query parameter in the first database is connected based on the target delivery plan identifier, and a temporary data table is generated, data corresponding to the target delivery identifier in the second data table can be integrated according to the target delivery identifier and the query parameter to obtain integrated data; the integrated data is then added to the temporary data table.
The specific integration method is the same as that of the fourth data table, and will not be described herein.
In a possible implementation manner, the query request may further carry a first query condition, where the first query condition is a parameter for defining the query parameter, for example, may be a condition for defining a generation time of the query parameter; alternatively, the generation source of the query parameter may be defined.
When the query request carries a first query condition, and at least one second data table corresponding to the query parameter in the first database is connected based on the target delivery plan identifier, and a temporary data table is generated, at least one second data table corresponding to the query parameter can be connected based on the target delivery plan identifier, and data in the connected at least one second data table is screened based on the first query condition, so that the temporary data table is generated.
Or when the query request carries a first query condition, and at least one second data table corresponding to the query parameter in the first database is connected based on the target delivery plan identifier, when a temporary data table is generated, at least one second data table corresponding to the query parameter in the first database is connected based on the target delivery plan identifier, and then data in the connected data table is filtered based on the first query condition, so that the temporary data table is generated.
For step 204,
As shown in the above table 3, the parameter values of the query parameters corresponding to the partial target delivery plan identifier in the above table 3 are null, so that zero padding processing needs to be performed on the temporary data table to perfect the temporary data table.
Optionally, the join operation may be left join, that is, the left table is based on the left table, and the left table may be a data table that is searched from the first data table and includes the target delivery plan identifier, so that the temporary data table includes all target delivery plan identifiers corresponding to the user identifier. Correspondingly, the temporary data table may have a situation that the parameter value of the partial query parameter corresponding to the target delivery plan identifier is null, or may have a situation that the parameter value of all the query parameters corresponding to the target delivery plan identifier is null.
The zero-filling processing is performed on the temporary data table, which can be understood as performing zero-filling on all the parameter values with null values corresponding to the target delivery plan identifier in the temporary data table.
In a possible implementation manner, when returning the target query data corresponding to the query request based on the temporary data table after the zero padding processing, the target query data may be ranked according to the target query parameters, and then the target query data is determined based on the ranking result, and the target query data is returned.
Optionally, in the case that the query request is a paging query request, the query request may carry a page number of the requested query data and the data amount contained in each page, after sorting the temporary data table after zero padding processing according to the target query parameter, it may determine target query data conforming to the paging query request in the sorted temporary data table, and return the target query data.
Here, the target query data conforming to the paging query request may refer to the data number pieces of data corresponding to the page number in order.
In the above processing procedure, the process of generating the temporary data table by the join multiple second data tables and the process of data screening (the data screening here may include the data screening based on the first query condition and/or the second query condition) may be executed by multiple machines in parallel, so that the speed of generating the temporary data table is faster; compared with the existing scheme for inquiring es, the scheme has the advantages that the process of comparing is needed to be executed for a plurality of times, and the parameter transmission (referring to the transmission of the full-quantity plan data) is only carried out once, so that the existing executing process can be executed through only one machine, and the efficiency is low.
In the data query method provided by the embodiment of the disclosure, the first data table storing the corresponding relation between the user identifier and the delivery plan identifier and the second data table storing the corresponding relation between the query parameter and the delivery plan identifier are stored in the first database, so that cross-module parameter transfer is not needed when data query is performed, and the performance consumption is lower; in addition, after the target delivery plan identifier corresponding to the user identifier is queried from the first data table, the second data table can be connected to generate a temporary data table based on the target delivery plan identifier, target query data are acquired from the temporary data table for feedback, and compared with table-by-table query, the data are acquired based on the mode of connecting the data tables, so that the data acquisition speed is higher.
The data query method is described in its entirety by combining the whole flow. Taking the put multimedia content as an advertisement and query parameters stored in doris as advertisement base data as an example, referring to fig. 3, an overall flowchart of a data query method provided by an embodiment of the disclosure specifically includes:
a user can initiate doris query to doris (namely a first database) through a query service, the doris mainly comprises three types of query after receiving a query request, one is to query a target delivery plan identifier in the doris, the other is to query an advertisement basic data table in the doris by taking the queried target delivery plan identifier as a left table, the other is to query in doris_on_es (namely a third data table) and query data to ES after query parameters are queried, wherein data transmission in the query process can be carried out through FLINK, zero padding processing is carried out after all data are queried to generate a temporary data table, and data is returned to a user side.
The detailed description of the above steps will not be described in detail with reference to the above embodiments.
After the data storage is performed according to the steps, when new data is generated, the corresponding data can be directly stored according to the data storage mode after the data migration. For example, if the query parameter a is migrated from the second database of ES to the first database of doris, the query parameter a may be directly stored in the first database after the data of the query parameter a is generated.
It will be appreciated by those skilled in the art that in the above-described method of the specific embodiments, the written order of steps is not meant to imply a strict order of execution but rather should be construed according to the function and possibly inherent logic of the steps.
Based on the same inventive concept, the embodiments of the present disclosure further provide a data query device corresponding to the data query method, and since the principle of solving the problem by the device in the embodiments of the present disclosure is similar to that of the data query method in the embodiments of the present disclosure, the implementation of the device may refer to the implementation of the method, and the repetition is omitted.
Referring to fig. 4, an architecture diagram of a data query device according to an embodiment of the disclosure is shown, where the device includes: a receiving module 401, a searching module 402, a connecting module 403 and a zero padding module 404; wherein,
A receiving module 401, configured to receive a query request carrying a user identifier and a query parameter;
a searching module 402, configured to search, based on the user identifier, a first data table stored in a first database of the query server for a target delivery plan identifier of media content corresponding to the user identifier;
a connection module 403, configured to connect at least one second data table corresponding to the query parameter in the first database based on the target delivery plan identifier, and generate a temporary data table; the second data table stores parameter values corresponding to the query parameters, wherein the parameter values are interaction data values generated after media content is delivered according to a delivery plan corresponding to the delivery plan identifier;
and the zero padding module 404 is configured to perform zero padding processing on a query parameter value corresponding to the target delivery plan identifier with a null corresponding query parameter value in the temporary data table, and return target query data corresponding to the query request based on the temporary data table after the zero padding processing.
In a possible implementation manner, the query server further stores a third data table, the third data table stores a first query parameter identifier, and a fourth data table where a parameter value corresponding to the first query parameter is located is stored in the second database.
In a possible implementation manner, the connection module 403 is configured to, when connecting at least one second data table corresponding to the query parameter in the first database based on the target delivery plan identifier:
and connecting at least one second data table corresponding to other second query parameters except the first query parameters in the third data table in the first database based on the target delivery plan identification.
In a possible implementation manner, in a case that it is determined, based on the third data table, that the query parameters carried in the query request include at least one first query parameter, the connection module 403 is further configured to:
inquiring a fourth data table where a first inquiry parameter carried in the inquiry request is located from the second database, and acquiring first inquiry data corresponding to the target delivery plan identifier;
the first query data is added to the temporary data table.
In a possible implementation manner, the connection module 403 is configured to, when connecting at least one second data table corresponding to the query parameter in the first database based on the target delivery plan identifier, generate a temporary data table:
Integrating the data corresponding to the target delivery identifier in the second data table according to the target delivery identifier and the query parameter to obtain integrated data;
and adding the integrated data to the temporary data table.
In a possible implementation manner, the query request further carries a first query condition corresponding to the query parameter;
the connection module 403 is further configured to connect, based on the target delivery plan identifier, at least one second data table corresponding to the query parameter in the first database, and when generating a temporary data table, be configured to:
and connecting at least one second data table corresponding to the query parameter based on the target delivery plan identification, and screening data in the connected at least one second data table based on the first query condition to generate the temporary data table.
In one possible implementation, the query request is a paging query request;
the zero padding module 404 is configured to, when returning the target query data corresponding to the query request based on the temporary data table after the zero padding process:
sorting the temporary data table subjected to zero padding treatment according to the target query parameters;
And determining target query data conforming to the paging query request in the ordered temporary data table, and returning the target query data.
The process flow of each module in the apparatus and the interaction flow between the modules may be described with reference to the related descriptions in the above method embodiments, which are not described in detail herein.
Based on the same technical concept, the embodiment of the disclosure also provides computer equipment. Referring to fig. 5, a schematic structural diagram of a computer device 500 according to an embodiment of the disclosure is shown. The computer devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), car terminals (e.g., car navigation terminals), etc., as well as fixed terminals such as digital TVs, desktop computers, etc., or various forms of servers such as stand-alone servers or server clusters. The computer device illustrated in fig. 5 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 5, the computer apparatus 500 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 501, which may perform various appropriate actions and processes according to a program stored in a read-only memory device (ROM) 502 or a program loaded from a storage device 505 into a random access memory device (RAM) 503. In the RAM 503, various programs and data required for the operation of the computer device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
In general, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 507 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 508 including, for example, magnetic tape, hard disk, etc.; and communication means 509. The communication means 509 may allow the computer device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 shows computer apparatus 500 with various devices, it should be understood that not all illustrated devices are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing a data query method. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or from the storage means 508, or from the ROM 502. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 501.
The disclosed embodiments also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the data query method described in the method embodiments above. Wherein the storage medium may be a volatile or nonvolatile computer readable storage medium.
The embodiments of the present disclosure further provide a computer program product, where the computer program product carries program code, where instructions included in the program code may be used to perform the steps of the data query method described in the foregoing method embodiments, and specifically reference may be made to the foregoing method embodiments, which are not described herein in detail.
Wherein the above-mentioned computer program product may be realized in particular by means of hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied as a computer storage medium, and in another alternative embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), or the like.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system and apparatus may refer to corresponding procedures in the foregoing method embodiments, which are not described herein again. In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present disclosure may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium executable by a processor. Based on such understanding, the technical solution of the present disclosure may be embodied in essence or a part contributing to the prior art or a part of the technical solution, or in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present disclosure. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the foregoing examples are merely specific embodiments of the present disclosure, and are not intended to limit the scope of the disclosure, but the present disclosure is not limited thereto, and those skilled in the art will appreciate that while the foregoing examples are described in detail, it is not limited to the disclosure: any person skilled in the art, within the technical scope of the disclosure of the present disclosure, may modify or easily conceive changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features thereof; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the disclosure, and are intended to be included within the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (10)

1. A data query method, applied to a query server, comprising:
receiving a query request carrying a user identifier and a query parameter;
searching a target delivery plan identification of the media content corresponding to the user identification from a first data table stored in a first database of the query server based on the user identification;
Based on the target delivery plan identification, connecting at least one second data table corresponding to the query parameter in the first database, and generating a temporary data table; the second data table stores parameter values corresponding to the query parameters, wherein the parameter values are interaction data values generated after media content is delivered according to a delivery plan corresponding to the delivery plan identifier;
and carrying out zero padding processing on the query parameter value corresponding to the target delivery plan identifier with the null corresponding query parameter value in the temporary data table, and returning target query data corresponding to the query request based on the temporary data table after the zero padding processing.
2. The method of claim 1, wherein the query server further stores a third data table, the third data table stores a first query parameter identifier, and a fourth data table in which a parameter value corresponding to the first query parameter is stored in the second database.
3. The method of claim 2, wherein the concatenating at least one second data table in the first database corresponding to the query parameter based on the target delivery plan identification comprises:
And connecting at least one second data table corresponding to other second query parameters except the first query parameters in the third data table in the first database based on the target delivery plan identification.
4. A method according to claim 2 or 3, characterized in that in case it is determined, based on the third data table, that the query parameters carried in the query request comprise at least one first query parameter, the method further comprises:
inquiring a fourth data table where a first inquiry parameter carried in the inquiry request is located from the second database, and acquiring first inquiry data corresponding to the target delivery plan identifier;
the first query data is added to the temporary data table.
5. The method of claim 1, wherein the concatenating at least one second data table in the first database corresponding to the query parameter based on the target delivery plan identification, generating a temporary data table, comprises:
integrating the data corresponding to the target delivery identifier in the second data table according to the target delivery identifier and the query parameter to obtain integrated data;
And adding the integrated data to the temporary data table.
6. The method of claim 1, wherein the query request further carries a first query condition corresponding to the query parameter;
the step of generating a temporary data table by connecting at least one second data table corresponding to the query parameter in the first database based on the target delivery plan identification comprises the following steps:
and connecting at least one second data table corresponding to the query parameter based on the target delivery plan identification, and screening data in the connected at least one second data table based on the first query condition to generate the temporary data table.
7. The method of claim 1, wherein the query request is a paging query request;
the returning the target query data corresponding to the query request based on the temporary data table after the zero padding processing comprises the following steps:
sorting the temporary data table subjected to zero padding treatment according to the target query parameters;
and determining target query data conforming to the paging query request in the ordered temporary data table, and returning the target query data.
8. A data query device, for use in a query server, comprising:
the receiving module is used for receiving a query request carrying a user identifier and a query parameter;
the searching module is used for searching a target delivery plan identifier of the media content corresponding to the user identifier from a first data table stored in a first database of the query server based on the user identifier;
the connection module is used for connecting at least one second data table corresponding to the query parameter in the first database based on the target delivery plan identification to generate a temporary data table; the second data table stores parameter values corresponding to the query parameters, wherein the parameter values are interaction data values generated after media content is delivered according to a delivery plan corresponding to the delivery plan identifier;
and the zero padding module is used for performing zero padding processing on the query parameter value corresponding to the target delivery plan identifier with the null corresponding query parameter value in the temporary data table, and returning target query data corresponding to the query request based on the temporary data table after the zero padding processing.
9. A computer device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory in communication via the bus when the computer device is running, the machine-readable instructions when executed by the processor performing the steps of the data querying method according to any of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps of the data query method of any of claims 1 to 7.
CN202311010861.3A 2023-08-10 2023-08-10 Data query method, device, computer equipment and storage medium Pending CN117009392A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311010861.3A CN117009392A (en) 2023-08-10 2023-08-10 Data query method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311010861.3A CN117009392A (en) 2023-08-10 2023-08-10 Data query method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117009392A true CN117009392A (en) 2023-11-07

Family

ID=88568901

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311010861.3A Pending CN117009392A (en) 2023-08-10 2023-08-10 Data query method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117009392A (en)

Similar Documents

Publication Publication Date Title
CN102402605B (en) Mixed distribution model for search engine indexing
CN110168529B (en) Data storage method, device and storage medium
CN110019540B (en) Implementation method, display method, device and equipment of enterprise atlas
WO2019024496A1 (en) Enterprise recommendation method and application server
CN103620601A (en) Joining tables in a mapreduce procedure
US20140143094A1 (en) Processing of categorized product information
CN109614402B (en) Multidimensional data query method and device
CN103748579A (en) Processing data in a mapreduce framework
CN103597474A (en) Efficient indexing and searching of access control listed documents
CN108388604A (en) User right data administrator, method and computer readable storage medium
CN101689201A (en) Federated search
CN112269789A (en) Method and device for storing data and method and device for reading data
CN104834660A (en) Interval based fuzzy database search
CN104050292A (en) Traffic-saving mode search service method, server, client and system
CN109753504A (en) Data query method and device
CN111553749A (en) Activity push strategy configuration method and device
CN104021192A (en) Database renewing method and device
CN104123307A (en) Data loading method and system
CN117009392A (en) Data query method, device, computer equipment and storage medium
CN115481026A (en) Test case generation method and device, computer equipment and storage medium
CN111897894A (en) POI retrieval heat determining method, device, equipment and storage medium
CN105721527A (en) Data processing method and server
CN104536992A (en) Method and device for expanding keywords
CN110874370B (en) Data query method and device, computer equipment and readable storage medium
CN111309932A (en) Comment data query method, device, 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