User query method, device, electronic device and computer-readable storage medium

By combining structured query language blocks to generate query statements, the problem of low efficiency of operators in obtaining data reports is solved, and the target user group is quickly queried, and the user query efficiency is improved.

CN113553340BActive Publication Date: 2025-04-11MIGU CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110837111.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-23
Publication Date
2025-04-11
Estimated Expiration
2041-07-23

AI Technical Summary

Technical Problem

In the prior art, operators are less efficient in obtaining data reports, resulting in the inability to query the target user group in time and the user query efficiency is less efficient.

Method used

By obtaining the target business attributes in the user query conditions, multiple target structured query language blocks corresponding to the user query conditions are determined, and these blocks are combined into structured query statements to quickly determine the user query results.

Benefits of technology

It realizes real-time conversion of user query conditions into structured query statements, thereby quickly determining user query results and improving user query efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113553340B_ABST
    Figure CN113553340B_ABST
Patent Text Reader

Abstract

The embodiments of the present invention relate to the field of big data technology, and disclose a user query method, device, electronic device, and computer-readable storage medium. The method includes: obtaining user query conditions, wherein the user query conditions include target business attributes; determining multiple target structured query language blocks corresponding to the user query conditions according to the target business attributes, wherein the target structured query language blocks are structured query language blocks generated by the server according to video playback log data and user activity participation data; combining the multiple target structured query language blocks to generate a structured query statement corresponding to the user query conditions; and determining the user query result according to the structured query statement. In the above manner, the embodiments of the present invention improve the efficiency of user queries.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of big data technology, and specifically to a user query method, device, electronic device and computer-readable storage medium. Background Art

[0002] During the operation of the application, it is necessary to obtain business reports regularly and determine the business participation of the target user group based on the business reports. According to the business participation of the target user group, formulate corresponding operation strategies to enhance user participation.

[0003] In the related art, in order to obtain business reports, the operation personnel need to determine the data requirement type in advance, submit the data requirement type to the data developer, and the data developer formulates the business report and provides the business report to the operation personnel. However, in the process of implementing the embodiment of the present invention, the inventor found that: in the related art, the efficiency of the operation personnel in obtaining data reports is low, resulting in the inability to query the target user group in time, and the user query efficiency is low. Summary of the invention

[0004] In view of the above problems, embodiments of the present invention provide a user query method, device, electronic device and computer-readable storage medium to solve the problem of low user query efficiency in the prior art.

[0005] According to one aspect of an embodiment of the present invention, a user query method is provided, which is applied to a server, and the method includes:

[0006] Acquire user query conditions, where the user query conditions include target business attributes;

[0007] Determining a plurality of target structured query language blocks corresponding to the user query conditions according to the target business attributes, wherein the target structured query language blocks are structured query language blocks generated by the server according to the video playback log data and the user activity participation data;

[0008] Combining the multiple target structured query language blocks to generate a structured query statement corresponding to the user query condition;

[0009] The user query result is determined according to the structured query statement.

[0010] In an optional manner, the method further includes:

[0011] Acquire business data, wherein the business data includes video playback log data and user activity participation data;

[0012] Generate a video playback basic data table according to the playback log data, and generate a user activity participation basic data table according to the user activity participation data;

[0013] Generate a common part structured query language block, a content structured query language block, a primary classification structured query language block, a sports event structured query language block and an integrated structured query language block according to the video playback basic data table;

[0014] A common part structured query language block, an activity participation structured query language block, a prize collection structured query language block and an integrated structured query language block are generated according to the user activity participation basic data table.

[0015] In an optional manner, determining a plurality of target structured query language blocks corresponding to the user query condition according to the target business attribute includes:

[0016] Among the structured query language blocks generated according to the video playback basic data table, determining the structured query language block corresponding to the target business attribute as the first structured query language block;

[0017] In the structured query language block generated according to the user activity participation basic data table, determining the structured query language block corresponding to the target business attribute as a second structured query language block;

[0018] The first structured query language block and the second structured query language block are determined as target structured query language blocks corresponding to the user query condition.

[0019] In an optional manner, the server stores a plurality of preset combined structured query language blocks, and combining the plurality of target structured query language blocks to generate a structured query statement corresponding to the user query condition includes:

[0020] Determining the logical relationship between the plurality of target structured query language blocks according to the user query condition;

[0021] Among the plurality of preset combined structured query language blocks, determining the combined structured query language block corresponding to the logical relationship as a target combined structured query language block;

[0022] A structured query statement corresponding to the user query condition is generated according to the multiple target structured query language blocks and the target combined structured query language block.

[0023] In an optional manner, determining the user query result according to the structured query statement includes:

[0024] Parsing the structured query statement into a syntax tree using a preset syntax generator tool, and determining an unparsed logical plan according to the syntax tree;

[0025] According to predefined policies and rules, the unparsed logical plan is converted into a parsed logical plan, and an optimized logical plan is generated according to the parsed logical plan;

[0026] converting the optimized logical plan into a physical plan according to a plurality of preset strategies;

[0027] The physical plan is executed by a preset computing engine to determine the user query result.

[0028] In an optional manner, the method further includes:

[0029] The user group corresponding to the user query result is written into a user group table in a data warehouse, wherein the user group table includes a plurality of user group identifiers, and each user group identifier corresponds to a plurality of user identifiers.

[0030] In an optional manner, the method further includes:

[0031] Determine the business indicator parameters of the user group corresponding to the user query result;

[0032] Determining a monitoring indicator for performing service monitoring on the user group according to the service indicator parameter;

[0033] The monitoring indicators are counted according to a preset monitoring period.

[0034] According to another aspect of an embodiment of the present invention, a user query device is provided, which is applied to a server, and the device includes:

[0035] An acquisition module, used to acquire user query conditions, wherein the user query conditions include target business attributes;

[0036] A first determination module, configured to determine a plurality of target structured query language blocks corresponding to the user query condition according to the target business attribute, wherein the target structured query language block is a structured query language block generated by the server according to the video playback log data and the user activity participation data;

[0037] A generating module, used for combining the plurality of target structured query language blocks to generate a structured query statement corresponding to the user query condition;

[0038] The second determining module is used to determine the user query result according to the structured query statement.

[0039] According to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0040] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the operation of the above-mentioned user query method.

[0041] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, wherein at least one executable instruction is stored in the storage medium, and when the executable instruction is executed on an electronic device, the electronic device executes the operation of the above-mentioned user query method.

[0042] In the embodiment of the present invention, according to the user query condition containing the target business attribute, multiple target structured query language blocks corresponding to the user query condition can be determined, and the target structured query language block is a structured query language block generated by the server according to the video playback log data and the user activity participation data; the multiple target structured query language blocks are combined to generate a structured query statement corresponding to the user query condition, and the user query result is determined according to the structured query statement. It can be seen that the embodiment of the present invention can convert the user query condition into a structured query statement in real time by combining multiple target structured query language blocks, so as to determine the user query result relatively quickly according to the structured query statement, and solve the problem of low user query efficiency.

[0043] The above description is only an overview of the technical solution of the embodiment of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:

[0045] Figure 1 A schematic diagram showing a flow chart of a user query method provided by an embodiment of the present invention;

[0046] Figure 2 A schematic diagram showing the structure of a user query device provided by an embodiment of the present invention is shown;

[0047] Figure 3 A schematic structural diagram of an electronic device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0048] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0049] Figure 1 FIG. 1 is a flow chart of a user query method according to an embodiment of the present invention, which can be applied to a server. Figure 1 As shown, the method comprises the following steps:

[0050] Step 110: Obtain user query conditions, where the user query conditions include target business attributes.

[0051] Among them, the user query condition is the condition input by the operator for querying the target user, and the user query condition includes the target business attribute. Furthermore, the operator may be, for example, the operator of a video APP, and the user query condition may be "the mobile phone user group in Sichuan who watched a certain movie or a certain content ID from April 10, 2020 to April 29, 2020", and the target business attribute may include "April 10, 2020 to April 29, 2020", "Movie Name", "Content Id", "Or" and "Sichuan Region". "April 10, 2020 to April 29, 2020" and "Sichuan Region" are public attributes, "Movie Name" and "Content Id" are content attributes, and "Or" is a logical attribute.

[0052] Step 120: Determine a plurality of target structured query language blocks corresponding to the user query conditions according to the target business attributes, wherein the target structured query language blocks are structured query language blocks generated by the server according to the video playback log data and the user activity participation data.

[0053] There are generally multiple target business attributes, and the structured query language block is a SQL (Structured Query Language) block. Each target business attribute corresponds to a target structured query language block, and multiple target structured query language blocks corresponding to the user query conditions can be determined according to the target business attributes. Furthermore, different structured query language blocks can be generated according to different business attributes, and the target structured query language block is a structured query language block generated according to the target business attribute.

[0054] Among them, business data can be acquired in advance, and the business data includes video playback log data and user activity participation data; a video playback basic data table is generated according to the playback log data, and a user activity participation basic data table is generated according to the user activity participation data; a common part structured query language block, a content structured query language block, a first-level classification structured query language block, a sports event structured query language block and an integrated structured query language block are generated according to the video playback basic data table; a common part structured query language block, an activity participation structured query language block, a prize collection structured query language block and an integrated structured query language block are generated according to the user activity participation basic data table.

[0055] Furthermore, when generating a basic data table based on business data, the business data can be classified so that each type of business data corresponds to a different business type, and each type of business data can be cleaned separately, and the basic data table corresponding to each type of business data can be generated separately based on each type of business data after data cleaning. For example, for a video APP, the business data generated by the video APP every day can be obtained, and the business data includes the video playback log data and user activity participation data generated by the video APP every day; after obtaining the business data, the business data is divided into two categories: video playback log data and user activity participation data. The video playback log data can be further classified according to content ID, content type, and sports event type, and the user activity participation data can be further classified according to activity type and prize collection. The video playback log data and user activity participation data are cleaned separately, and a video playback basic data table is generated based on the video playback log data after data cleaning, and a user activity participation basic data table is generated based on the user activity participation data after data cleaning.

[0056] Further, according to the video playback basic data table, multiple structured query language blocks related to playback can be generated, and according to the user activity participation basic data table, multiple structured query language blocks related to activities can be generated. For example, the structured query language blocks related to playback can include a common part structured query language block, a content structured query language block, a first-level classification structured query language block, a sports event structured query language block, and an integrated structured query language block. The common part structured query language block can be further classified according to regional attributes and time attributes, and the regional attributes include provincial classification attributes, and the provincial classification attributes also include municipal classification attributes. The content structured query language block can be further classified according to user type and video type, for example, according to "mobile phone users, video feature films", "mobile phone users and tourist users, video feature films", "mobile phone users, non-video feature films" and "mobile phone users and tourist users, non-video feature films". The sub-attributes of the first-level classification structured query language block can include, for example, TV series, movies, variety shows, etc. The first-level classification structured query language block can be further classified according to user type, video type and first-level classification attributes, for example, according to "mobile phone users, video features, all first-level classification attributes", "mobile phone users and tourist users, video features, all first-level classifications", "mobile phone users, non-video features, all first-level classification attributes", "mobile phone users and tourist users, non-video features, all first-level classification attributes", "mobile phone users, video features, first-level classification sub-attributes", "mobile phone users and tourist users, video features, first-level classification sub-attributes", "mobile phone users, non-video features, first-level classification sub-attributes" and "mobile phone users and tourist users, non-video features, first-level classification sub-attributes". The sports event structured query language block can be further classified according to user type and video type, for example, according to "mobile phone users, video features", "mobile phone users and tourist users, video features", "mobile phone users, non-video features", "mobile phone users and tourist users, non-video features". The integrated structured query language block can be further classified according to logical types, for example, according to "intersection", "union" and "single result".

[0057] Among them, the structured query language block related to the activity can include a common part structured query language block, a participation activity structured query language block, a prize collection structured query language block and an integrated structured query language block. The common part structured query language block can be further classified according to the regional attribute and the time attribute, and the regional attribute includes the provincial classification attribute, and the provincial classification attribute also includes the municipal classification attribute. The participation activity structured query language block can be further classified according to the participation details attribute, and the participation details attribute can include, for example, "watching a movie", "sharing", "checking in", "H5" and "sharing and checking in". The prize collection structured query language block can be further classified according to the collection details attribute, and the collection details attribute can include, for example, "watching a movie", "sharing", "checking in", "H5" and "sharing and checking in". The integrated structured query language block can be further classified according to the logical type, for example, according to "participation and receiving a prize", "participation or receiving a prize", "only participation" and "only receiving a prize".

[0058] In an optional manner, when determining multiple target structured query language blocks corresponding to user query conditions based on target business attributes, the structured query language block corresponding to the target business attribute can be determined as the first structured query language block in the structured query language block generated based on the video playback basic data table; the structured query language block corresponding to the target business attribute can be determined as the second structured query language block in the structured query language block generated based on the user activity participation basic data table; and the first structured query language block and the second structured query language block can be determined as the target structured query language blocks corresponding to the user query conditions.

[0059] Step 130: Combine the multiple target structured query language blocks to generate a structured query statement corresponding to the user query condition.

[0060] Among them, the attributes such as time period, classified playback records, and participation in activities in the user's query conditions can be determined, and then the structured query language blocks are assembled. Different structured query language blocks are assembled according to the user's query conditions and the logical relationship between the query conditions to form a combined structured query language block, and the combined structured query language block is identified and stored. Furthermore, multiple target structured query language blocks can be combined according to the type of the target structured query language to generate a combined structured query language block. For example, if the user's query condition is "a mobile phone user group in Sichuan who has watched a certain movie or a certain content ID from April 10, 2020 to April 29, 2020 (the content does not include highlights)", first select the public part structured query language block, and then select the query condition structured query language block and the merged structured query language block. The common part structured query language block can, for example, select the provincial classification attribute in the regional attribute, the query condition structured query language block can, for example, select "mobile phone users, video features, first-level classification subcategories (movies)" and "mobile phone users, video features, first-level classification subcategories (content ID)", and the merged structured query language block can, for example, select the structured query language block corresponding to the "union" attribute.

[0061] Among them, the combined structured query language can be converted into an executable SPARK structured query language statement through the SPARK computing engine, and the executable SPARK structured query language statement is determined as the structured query statement corresponding to the user query condition. Further, a plurality of preset combined structured query language blocks are stored in the server. When a plurality of target structured query language blocks are combined to generate a structured query statement corresponding to the user query condition, the logical relationship between the plurality of target structured query language blocks can be determined according to the user query condition, and among the plurality of preset combined structured query language blocks, the combined structured query language block corresponding to the logical relationship is determined as the target combined structured query language block, and the structured query statement corresponding to the user query condition is generated according to the plurality of target structured query language blocks and the target combined structured query language block.

[0062] Step 140: Determine the user query result according to the structured query statement.

[0063] The generated structured query statement can be stored in the Mysql table selected by the user, and then the user query result corresponding to the structured query statement can be obtained through the SPARK computing engine, and the user query result can be marked with the same identifier as the combined structured query language block. When the user query result corresponding to the structured query statement is obtained through the SPARK computing engine, the scheduling task provided by the big data platform analysis cloud can be used to scan the structured query statement that needs to be executed in the Mysql table selected by the user at a preset time interval. After the executable structured query statement is read, the structured query statement is executed through the SPARK computing engine provided by the big data platform to determine the query result of the corresponding structured query statement.

[0064] Among them, when determining the user query result based on the structured query statement, a preset syntax generator tool can be used to parse the structured query statement into a syntax tree, and an unparsed logical plan can be determined based on the syntax tree; according to predefined strategies and rules, the unparsed logical plan can be converted into a parsed logical plan, and an optimized logical plan can be generated based on the parsed logical plan; according to multiple preset strategies, the optimized logical plan can be converted into a physical plan; and the physical plan can be executed by a preset computing engine to determine the user query result.

[0065] Furthermore, the structured query statement is converted into an unresolved logical plan (unresolved logical plan), i.e., the parser operation. When converting the structured query statement into an unresolved logical plan, Antlr4 can be used to parse the structured query statement into a syntax tree, convert the syntax tree into a Catalysts expression, and determine the Catalysts expression as the unresolved logical plan. Antlr4 is an open source syntax analyzer generation tool, which can use Antlr4's lexical parser and syntax parser to parse the structured query language statement, and parse the structured query language statement into Antlr4's syntax tree structure ParseTree; then in the parsePlan method, AstBuilder is used to convert the Antlr4 syntax tree structure into a Catalysts expression, and the Catalysts expression is determined as the unresolved logical plan. The Analyzer operation is to generate a parsed logical plan based on the unparsed logical plan. When executing the Analyzer operation, multiple Fix points (strategies) and rules (rules) can be pre-defined. Each node in the unparsed logical execution plan will call the HashMap in the catalog object to find the corresponding basic data structures such as the basic play table and the basic activity table, so as to parse the fields involved in the table (including the duration of the play, the restricted time interval, and the activity type, etc., which are the filtering conditions initially entered by the user) to obtain the parsed logical plan. When generating an optimized logical plan based on the parsed logical plan, the parsed logical plan can be adjusted in execution order, subquery optimized, and multi-join operation reordered to generate an optimized logical plan. When generating a physical plan based on the optimized logical plan, the SparkPlan module can be used to convert the optimized logical plan into a recognizable physical plan through preset strategies, which may include DataSourceV2Strategy, FileSourceStrategy, DataSourceStrategy, SpecialLimits, Aggregation, JoinSelection, InMemoryScans, BasicOperators) physical plan, etc. For example, convert join into BroadcastHashJoinExec, ShuffledHashJoinExec or SortMergeJoinExec through JoinSelection.

[0066] It should be noted that after the physical plan is generated according to the optimized logical plan, the conversion of the specific operation logic from the structured query statement to the Spark internal RDD (Resiliennt Distributed Datasets) is completed. Further, the Spark engine can execute the combined structured query language block according to the physical execution plan RDD to obtain the user query result, and write the user group corresponding to the user query result into the user group table in the data warehouse. The user group table includes multiple user group identifiers, and each user group identifier corresponds to multiple user identifiers. For example, the user query result can be written to the user group table corresponding to the Hive data warehouse. Further, multiple user query results can be saved in the user group table. In order to distinguish different user query results, fields can be set for the user query results to distinguish them. The fields of the user query results can include user group ID, user group type and user identifier, and each user identifier can correspond to multiple user group IDs.

[0067] In an optional manner, the user group corresponding to the user query result may be determined, the business indicator parameters of the user group corresponding to the user query result may be further determined, the monitoring indicators for business monitoring of the user group may be determined according to the business indicator parameters, and the monitoring indicators may be counted according to a preset monitoring period. For example, the business indicator parameters of the user group may be determined by the SPARK engine, and the business indicator parameters may include, for example, the total number of playbacks, the total number of playback users, the daily playback trend within a preset time, and the daily usage time trend, for viewing by the operator.

[0068] Among them, the analysis cloud scheduling platform of the big data platform can also be used to start a scheduled task to calculate the monitoring indicators of the user group. The target business indicators may include, for example, retention rate, daily top list of content viewed, and member conversion. Furthermore, the daily login usage can be associated and counted based on the user group, video playback basic data table, and user activity participation basic data table to calculate the retention rate of the user group; the user group and the video playback basic data table can be associated and counted, and the daily top list of content viewed can be determined by sorting according to the playback volume; the user group and the App subscription member data table can be associated to count the member conversion of the user group to members. Based on the monitoring indicators calculated above, the operator can send SMS and Push notifications to subsequent content operations, event operations, special operations, etc. to increase user activity.

[0069] In the embodiment of the present invention, according to the user query condition containing the target business attribute, multiple target structured query language blocks corresponding to the user query condition can be determined, and the target structured query language block is a structured query language block generated by the server according to the video playback log data and the user activity participation data; the multiple target structured query language blocks are combined to generate a structured query statement corresponding to the user query condition, and the user query result is determined according to the structured query statement. It can be seen that the embodiment of the present invention can convert the user query condition into a structured query statement in real time by combining multiple target structured query language blocks, so as to determine the user query result relatively quickly according to the structured query statement, and solve the problem of low user query efficiency.

[0070] Figure 2 FIG. 1 is a schematic diagram showing the structure of a user query device according to an embodiment of the present invention, and the user query device is applied to a server. Figure 2 As shown, the device 300 includes: an acquisition module 310 , a first determination module 320 , a generation module 330 and a second determination module 340 .

[0071] Among them, the acquisition module 310 is used to obtain user query conditions, and the user query conditions include target business attributes; the first determination module 320 is used to determine multiple target structured query language blocks corresponding to the user query conditions according to the target business attributes, and the target structured query language blocks are structured query language blocks generated by the server according to video playback log data and user activity participation data; the generation module 330 is used to combine the multiple target structured query language blocks to generate a structured query statement corresponding to the user query conditions; the second determination module 340 is used to determine the user query results according to the structured query statement.

[0072] In an optional manner, the generating module 330 is further configured to:

[0073] Acquire business data, wherein the business data includes video playback log data and user activity participation data;

[0074] Generate a video playback basic data table according to the playback log data, and generate a user activity participation basic data table according to the user activity participation data;

[0075] Generate a common part structured query language block, a content structured query language block, a primary classification structured query language block, a sports event structured query language block and an integrated structured query language block according to the video playback basic data table;

[0076] A common part structured query language block, an activity participation structured query language block, a prize collection structured query language block and an integrated structured query language block are generated according to the user activity participation basic data table.

[0077] In an optional manner, the first determining module 320 is used to:

[0078] Among the structured query language blocks generated according to the video playback basic data table, determining the structured query language block corresponding to the target business attribute as the first structured query language block;

[0079] In the structured query language block generated according to the user activity participation basic data table, determining the structured query language block corresponding to the target business attribute as a second structured query language block;

[0080] The first structured query language block and the second structured query language block are determined as target structured query language blocks corresponding to the user query condition.

[0081] In an optional manner, a plurality of preset combined structured query language blocks are stored in the server, and the generating module 330 is further used to:

[0082] Determining the logical relationship between the plurality of target structured query language blocks according to the user query condition;

[0083] Among the plurality of preset combined structured query language blocks, determining the combined structured query language block corresponding to the logical relationship as a target combined structured query language block;

[0084] A structured query statement corresponding to the user query condition is generated according to the multiple target structured query language blocks and the target combined structured query language block.

[0085] In an optional manner, the second determining module 340 is used to:

[0086] Parsing the structured query statement into a syntax tree using a preset syntax generator tool, and determining an unparsed logical plan according to the syntax tree;

[0087] According to predefined policies and rules, the unparsed logical plan is converted into a parsed logical plan, and an optimized logical plan is generated according to the parsed logical plan;

[0088] converting the optimized logical plan into a physical plan according to a plurality of preset strategies;

[0089] The physical plan is executed by a preset computing engine to determine the user query result.

[0090] In an optional manner, the apparatus 300 further includes a writing module, which is used to:

[0091] The user group corresponding to the user query result is written into a user group table in a data warehouse, wherein the user group table includes a plurality of user group identifiers, and each user group identifier corresponds to a plurality of user identifiers.

[0092] In an optional manner, the apparatus 300 further includes a statistical module, which is used to:

[0093] Determine the business indicator parameters of the user group corresponding to the user query result;

[0094] Determining a monitoring indicator for performing service monitoring on the user group according to the service indicator parameter;

[0095] The monitoring indicators are counted according to a preset monitoring period.

[0096] In the embodiment of the present invention, according to the user query condition containing the target business attribute, multiple target structured query language blocks corresponding to the user query condition can be determined, and the target structured query language block is a structured query language block generated by the server according to the video playback log data and the user activity participation data; the multiple target structured query language blocks are combined to generate a structured query statement corresponding to the user query condition, and the user query result is determined according to the structured query statement. It can be seen that the embodiment of the present invention can convert the user query condition into a structured query statement in real time by combining multiple target structured query language blocks, so as to determine the user query result relatively quickly according to the structured query statement, and solve the problem of low user query efficiency.

[0097] Figure 3 A schematic diagram of the structure of an electronic device according to an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.

[0098] like Figure 3 As shown, the electronic device may include: a processor (processor) 402 , a communication interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .

[0099] The processor 402, the communication interface 404, and the memory 406 communicate with each other via the communication bus 408. The communication interface 404 is used to communicate with other devices such as a client or other server network elements. The processor 402 is used to execute the program 410, which can specifically execute the relevant steps in the above-mentioned embodiment of the user query method.

[0100] Specifically, the program 410 may include program code including computer executable instructions.

[0101] The processor 402 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0102] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0103] Program 410 can be specifically called by processor 402 to enable the electronic device to perform the following operations:

[0104] Acquire user query conditions, where the user query conditions include target business attributes;

[0105] Determining a plurality of target structured query language blocks corresponding to the user query conditions according to the target business attributes, wherein the target structured query language blocks are structured query language blocks generated by the server according to the video playback log data and the user activity participation data;

[0106] Combining the multiple target structured query language blocks to generate a structured query statement corresponding to the user query condition;

[0107] The user query result is determined according to the structured query statement.

[0108] In an optional manner, the program 410 may be specifically called by the processor 402 to enable the electronic device to perform the following operations:

[0109] Before obtaining the user query condition, obtaining business data, the business data including video playback log data and user activity participation data;

[0110] Generate a video playback basic data table according to the playback log data, and generate a user activity participation basic data table according to the user activity participation data;

[0111] Generate a common part structured query language block, a content structured query language block, a primary classification structured query language block, a sports event structured query language block and an integrated structured query language block according to the video playback basic data table;

[0112] A common part structured query language block, an activity participation structured query language block, a prize collection structured query language block and an integrated structured query language block are generated according to the user activity participation basic data table.

[0113] In an optional manner, the program 410 may be specifically called by the processor 402 to enable the electronic device to perform the following operations:

[0114] Among the structured query language blocks generated according to the video playback basic data table, determining the structured query language block corresponding to the target business attribute as the first structured query language block;

[0115] In the structured query language block generated according to the user activity participation basic data table, determining the structured query language block corresponding to the target business attribute as a second structured query language block;

[0116] The first structured query language block and the second structured query language block are determined as target structured query language blocks corresponding to the user query condition.

[0117] In an optional manner, the program 410 may be specifically called by the processor 402 to enable the electronic device to perform the following operations:

[0118] Determine the target basic data table and attribute identifier corresponding to the target business attribute;

[0119] In the structured query language block corresponding to the target basic data table, the structured query language block corresponding to the attribute identifier is determined as the target structured query language block.

[0120] In an optional manner, the server stores a plurality of preset combined structured query language blocks, and the program 410 can be specifically called by the processor 402 to enable the electronic device to perform the following operations:

[0121] Determining the logical relationship between the plurality of target structured query language blocks according to the user query condition;

[0122] Among the plurality of preset combined structured query language blocks, determining the combined structured query language block corresponding to the logical relationship as a target combined structured query language block;

[0123] A structured query statement corresponding to the user query condition is generated according to the multiple target structured query language blocks and the target combined structured query language block.

[0124] In an optional manner, the program 410 may be specifically called by the processor 402 to enable the electronic device to perform the following operations:

[0125] Parsing the structured query statement into a syntax tree using a preset syntax generator tool, and determining an unparsed logical plan according to the syntax tree;

[0126] According to predefined policies and rules, the unparsed logical plan is converted into a parsed logical plan, and an optimized logical plan is generated according to the parsed logical plan;

[0127] converting the optimized logical plan into a physical plan according to a plurality of preset strategies;

[0128] The physical plan is executed by a preset computing engine to determine the user query result.

[0129] In an optional manner, the program 410 may be specifically called by the processor 402 to enable the electronic device to perform the following operations:

[0130] Determine the business indicator parameters of the user group corresponding to the user query result;

[0131] Determining a monitoring indicator for performing service monitoring on the user group according to the service indicator parameter;

[0132] The monitoring indicators are counted according to a preset monitoring period.

[0133] In the embodiment of the present invention, according to the user query condition containing the target business attribute, multiple target structured query language blocks corresponding to the user query condition can be determined, and the target structured query language block is a structured query language block generated by the server according to the video playback log data and the user activity participation data; the multiple target structured query language blocks are combined to generate a structured query statement corresponding to the user query condition, and the user query result is determined according to the structured query statement. It can be seen that the embodiment of the present invention can convert the user query condition into a structured query statement in real time by combining multiple target structured query language blocks, so as to determine the user query result relatively quickly according to the structured query statement, and solve the problem of low user query efficiency.

[0134] An embodiment of the present invention provides a computer-readable storage medium, wherein the storage medium stores at least one executable instruction. When the executable instruction is executed on an electronic device, the electronic device executes the user query method in any of the above method embodiments.

[0135] An embodiment of the present invention provides a user query device, which is used to execute the above user query method.

[0136] An embodiment of the present invention provides a computer program, which can be called by a processor to enable an electronic device to execute the user query method in any of the above method embodiments.

[0137] An embodiment of the present invention provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed on a computer, the computer executes the user query method in any of the above method embodiments.

[0138] The algorithm or display provided herein is not inherently related to any particular computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the embodiment of the present invention is not directed to any specific programming language yet. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description made to specific languages ​​above is for disclosing the best mode of the present invention.

[0139] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0140] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed invention requires more features than those expressly recited in each claim.

[0141] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0142] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.

Claims

1. A user query method, applied to a server, characterized in that: The method comprises: Acquire user query conditions, wherein the user query conditions include target business attributes; Determine multiple target structured query language blocks corresponding to the user query conditions according to the target business attributes, wherein the target structured query language block is a structured query language block generated by the server according to the video playback log data and the user activity participation data, each target business attribute corresponds to a target structured query language block, and different structured query language blocks are generated according to different business attributes; wherein, obtain business data, the business data includes video playback log data and user activity participation data; generate a video playback basic data table according to the playback log data, and generate a user activity participation basic data table according to the user activity participation data; generate a common part structured query language block, a content structured query language block, a primary classification structured query language block, a sports event structured query language block and an integrated structured query language block according to the video playback basic data table; generate a common part structured query language block, an activity participation structured query language block, a prize collection structured query language block and an integrated structured query language block according to the user activity participation basic data table; Combining the multiple target structured query language blocks to generate a structured query statement corresponding to the user query condition; The user query result is determined according to the structured query statement.

2. The method according to claim 1, characterized in that The step of determining a plurality of target structured query language blocks corresponding to the user query condition according to the target business attribute comprises: Among the structured query language blocks generated according to the video playback basic data table, determining the structured query language block corresponding to the target business attribute as the first structured query language block; In the structured query language block generated according to the user activity participation basic data table, determining the structured query language block corresponding to the target business attribute as a second structured query language block; The first structured query language block and the second structured query language block are determined as target structured query language blocks corresponding to the user query condition.

3. The method according to claim 1, characterized in that The server stores a plurality of preset combined structured query language blocks, and the step of combining the plurality of target structured query language blocks to generate a structured query statement corresponding to the user query condition includes: Determining the logical relationship between the plurality of target structured query language blocks according to the user query condition; Among the plurality of preset combined structured query language blocks, determining the combined structured query language block corresponding to the logical relationship as a target combined structured query language block; A structured query statement corresponding to the user query condition is generated according to the multiple target structured query language blocks and the target combined structured query language block.

4. The method according to claim 1, characterized in that: Determining the user query result according to the structured query statement includes: Parsing the structured query statement into a syntax tree using a preset syntax generator tool, and determining an unparsed logical plan according to the syntax tree; According to predefined policies and rules, the unparsed logical plan is converted into a parsed logical plan, and an optimized logical plan is generated according to the parsed logical plan; converting the optimized logical plan into a physical plan according to a plurality of preset strategies; The physical plan is executed by a preset computing engine to determine the user query result.

5. The method according to claim 4, characterized in that The method further comprises: The user group corresponding to the user query result is written into a user group table in a data warehouse, wherein the user group table includes a plurality of user group identifiers, and each user group identifier corresponds to a plurality of user identifiers.

6. The method according to claim 5, characterized in that The method further comprises: Determine the business indicator parameters of the user group corresponding to the user query result; Determining a monitoring indicator for performing service monitoring on the user group according to the service indicator parameter; The monitoring indicators are counted according to a preset monitoring period.

7. A user query device, applied to a server, characterized in that: The device comprises: An acquisition module, used to acquire user query conditions, wherein the user query conditions include target business attributes; A first determination module is used to determine a plurality of target structured query language blocks corresponding to the user query condition according to the target business attribute, wherein the target structured query language block is a structured query language block generated by the server according to the video playback log data and the user activity participation data, each target business attribute corresponds to a target structured query language block, and different structured query language blocks are generated according to different business attributes; wherein business data is obtained, the business data includes video playback log data and user activity participation data; a video playback basic data table is generated according to the playback log data, and a user activity participation basic data table is generated according to the user activity participation data; a common part structured query language block, a content structured query language block, a primary classification structured query language block, a sports event structured query language block and an integrated structured query language block are generated according to the video playback basic data table; a common part structured query language block, an activity participation structured query language block, a prize collection structured query language block and an integrated structured query language block are generated according to the user activity participation basic data table; A generating module, used for combining the plurality of target structured query language blocks to generate a structured query statement corresponding to the user query condition; The second determining module is used to determine the user query result according to the structured query statement.

8. An electronic device, characterized in that: include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of the user query method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that: The storage medium stores at least one executable instruction. When the executable instruction is executed on the electronic device, the electronic device executes the operation of the user query method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Calculation index query method and device

    CN110019385A

  • Data query method and device, electronic equipment and readable storage medium

    CN111639078A

  • Data query method and device and computer readable storage medium

    CN112905595A