Data generation methods, information filtering methods, equipment, and media

CN116126918BActive Publication Date: 2026-09-01MASHANG CONSUMER FINANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210775598.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-01
Publication Date
2026-09-01
Estimated Expiration
2042-07-01

AI Technical Summary

Technical Problem

[0003]本申请主要解决的技术问题是提供一种数据生成方法、信息筛选方法、电子设备以及存储介质,以解决需要专门的技术人员来开发编写固定的第一结构化数据的问题

Benefits of technology

[0011]The beneficial effects of this application are as follows: Unlike the prior art, this application adds a definition layer on top of the basic data and below the query language, which can facilitate the combination of the definitions of the basic data as needed to flexibly form the first structured data required by the user. Therefore, it can reduce the threshold for users to locate the target content in the basic data and improve the user's work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116126918B_ABST
    Figure CN116126918B_ABST
Patent Text Reader

Abstract

This application discloses a data generation method, information filtering method, device, and medium. The data generation method includes: receiving an operation instruction to combine definitions of basic data, wherein the definitions include at least one or more combinations of annotations, field names, storage types, table names, field contents, field thresholds, combination relationships, and relationship names of the basic data; responding to the operation instruction, combining at least a portion of the definitions based on structured combination rules and / or conditions to obtain first structured data, wherein the definitions are at least partially derived from an associated data set, and the associated data set defines the association relationship between the basic data and its definitions. This application enables convenient on-demand combination of definitions of basic data to form first structured data, thus lowering the threshold for users to locate target content in basic data and improving user work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer information technology, and in particular to data generation methods, information filtering methods, devices, and media. Background Technology

[0002] Currently, the general approach to retrieving data from a database is to directly obtain it by writing fixed query statements. However, these fixed query statements require specialized technical personnel to develop and write, resulting in a high barrier to entry. Summary of the Invention

[0003] The main technical problem addressed by this application is to provide a data generation method, an information filtering method, an electronic device, and a storage medium to solve the problem of requiring specialized technical personnel to develop and write fixed first structured data.

[0004] To address the aforementioned technical problems, the first aspect of this application provides a data generation method, which includes: receiving an operation instruction to combine definitions of basic data, wherein the definitions include at least one or more combinations of annotations, field names, storage types, table names, field contents, field thresholds, combination relationships, and relationship names of the basic data;

[0005] In response to the operation instruction, at least a portion of the definitions are combined based on rules and / or conditions of structured combination to obtain first structured data, wherein the definitions are at least partially derived from an associated data set, which defines the relationship between the basic data and the definitions.

[0006] To address the aforementioned technical problems, a second aspect of this application provides a method for filtering user information, the method comprising:

[0007] Obtain the second structured data as described in any of the methods above;

[0008] The second structured data is processed to obtain user group information from the underlying data.

[0009] To address the aforementioned technical problems, a third aspect of this application provides an electronic device comprising a memory and a processor, wherein the memory is connected to the processor and is used to store program data, and the processor is used to execute the program data to implement the method described above.

[0010] To address the aforementioned technical problems, a fourth aspect of this application provides a computer-readable storage medium storing program data, which, when executed by a processor, is used to implement the method described above.

[0011] The beneficial effects of this application are as follows: Unlike the prior art, this application adds a definition layer on top of the basic data and below the query language, which can facilitate the combination of the definitions of the basic data as needed to flexibly form the first structured data required by the user. Therefore, it can reduce the threshold for users to locate the target content in the basic data and improve the user's work efficiency.

[0012] Furthermore, this application utilizes the conversion between first and second structured data to solve the problem of convenient querying based on definition combinations. In other words, this application first defines basic data and then flexibly combines these definitions to assemble first structured data. The first structured data is then parsed and converted into executable second structured data. The required basic data is then retrieved through querying the second structured data. This allows users to interact with the defined definitions without needing specialized knowledge, accurately filtering and retrieving the data they need. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:

[0014] Figure 1 This is a flowchart illustrating the first embodiment of the data generation method provided in this application;

[0015] Figure 2 This is a flowchart illustrating the process of combining the definitions of basic data in the data generation method provided in this application;

[0016] Figure 3 This is another flowchart illustrating the combination of basic data definitions in the data generation method provided in this application;

[0017] Figure 4 This is a schematic diagram illustrating the combination of basic data definitions using an interactive interface in the data generation method provided in this application;

[0018] Figure 5 This is a schematic diagram of the process of converting first structured data into second structured data in the data generation method provided in this application;

[0019] Figure 6 This is a schematic diagram of the structure of an embodiment of the electronic device provided in this application;

[0020] Figure 7 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation

[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0022] In the era of big data, databases store massive amounts of data. Retrieving data from these databases that meets specific requirements forms a data class, which can then be used to solve practical problems. Take StarRocks as an example. StarRocks is an open-source, next-generation, high-speed, full-scenario MPP (Massively Parallel Processor) database. It adopts a new generation of elastic MPP architecture, which can efficiently support various data analysis scenarios such as multi-dimensional analysis, real-time analysis, and high-concurrency analysis with large data volumes.

[0023] In one application scenario, the StarRocks database stores massive amounts of user data. When it is necessary to classify user data to form user profiles, it is necessary to query the database to obtain the data. However, for more professional databases such as StarRocks, the query statements have certain inherent formats, which require specialized technical personnel to develop and write, resulting in a high barrier to entry.

[0024] The embodiments of this application are mainly applied to user terminals (such as computers, mobile phones, etc.) so that users can conveniently query the data they need in the StarRocks database on the user terminal to obtain user group information that meets their requirements.

[0025] Please see Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the data generation method provided in this application. The method includes:

[0026] Step 110: Receive an operation instruction to combine the definitions of basic data. The definitions include at least one or more combinations of basic data comments, field names, storage types, table names, field contents, field thresholds, combination relationships, and relationship names.

[0027] This step is an operation performed by the user before obtaining the first structured data. Unlike the traditional method, this application embodiment adds a "definition layer" on top of the basic data. The "definition" for structured combination in this step can come from this "definition layer". When combining the definitions of the basic data, the user performs operation instructions on this "definition layer".

[0028] The basic data refers to the data accessed, such as data on personnel information, card application events, and card activation events. This accessed data will form three tables in the StarRocks database: a personnel information table, a card application event table, and a card activation event table. The personnel information table contains information such as personnel ID, name, age, and gender; the card application event table contains information such as card application time, application location, card type, and applicant ID; and the card activation event table may contain information such as activation time and activator ID. The specific information contained in each table can be determined according to the actual situation, and this application does not impose any restrictions on it.

[0029] In addition, after the system receives data, a data access configuration table can be set up, placing the three tables listed above into one configuration table, as shown in the table below:

[0030] 1 Personnel Information Form data 2 Card application schedule event 3 Activate Card Event Table event

[0031] Optionally, the aforementioned "definition layer" includes a data dictionary used to define the basic data. The definition may include comments on the basic data, field names, storage types, table names, field contents, field thresholds, combination relationships, relationship names, etc.

[0032] For example, the data dictionary can be a table like the one below:

[0033]

[0034]

[0035] The field names can be age, occupation, gender, etc.; the field thresholds can be 20, 30, etc.; the combination relations can be AND and OR; the relation names can be greater than, equal to, less than, etc.; the table names can be registry, activation table, etc.; the field content can be the content corresponding to the field name, for example, if occupation is the field name, then the corresponding field content under that occupation can be doctor, teacher, etc.; the comments are further explanations or supplementary descriptions of a certain basic data, for example, natural language descriptions can be used to annotate a certain basic data to help users identify the meaning of some attributes of the basic data.

[0036] For example, the age in the field name, the 20 in the field threshold, and the greater than in the relation name can be combined to form a statement that the age is greater than 20, thereby enabling an operation instruction to combine at least one or more definitions of the basic data.

[0037] Step 210: In response to the operation instruction, combine at least some of the definitions based on the rules and / or conditions of the structured combination to obtain the first structured data, wherein the definitions are at least partially derived from the associated data set, which limits the basic data and the relationships between its definitions.

[0038] Optionally, the aforementioned "definition layer" includes a data association set, which defines the relationship between the basic data and its definitions. This data association set can also be described as a mapping relationship between the basic data and its definitions, such as the table shown below:

[0039]

[0040] Here, we will explain the rules and / or conditions for structured composition.

[0041] Among them, the conditions can be OR, AND, etc.;

[0042] Rules can be narrowly understood as formats. For example, combining age, 20, and greater than to describe a statement that says age is greater than 20 can be considered a format of natural language.

[0043] The rules for structured composition refer to the language format of the structured statements themselves. For example, structured descriptions are generally in English. Taking JSON as the first example of structured data, some definitions, such as age in the field name, 20 in the field threshold, and greater than in the relation name, are combined into a statement for age greater than 20. Then, according to the agreed JSON format, this is assembled into the corresponding structured statement, which can be:

[0044]

[0045] Additionally, it should be noted that there can be multiple types of rules for structured composition. For example, if the agreed format is JSON, the first structured data will be a JSON string; if it is another agreed format, it will be assembled into other corresponding preset strings. This application does not impose any limitations on this.

[0046] Unlike existing technologies, this embodiment adds a definition layer above the basic data and below the query language, which allows for convenient on-demand combination of the definitions of the basic data. Furthermore, the conversion between the first structured data and the second structured data can be used to solve the problem of simple querying based on definition combinations.

[0047] In other words, this embodiment first defines basic data and then flexibly combines these definitions to assemble first structured data. This facilitates the subsequent parsing and conversion of the first structured data into user-friendly, low-barrier, executable second structured data. By querying the second structured data to obtain the required basic data, users can accurately filter and retrieve the data they need without requiring specialized knowledge, simply by interacting with the defined parameters within the interactive interface.

[0048] In some embodiments, in order to further improve the efficiency, accuracy and effectiveness of obtaining data attribute field information, the definition of basic data (e.g., attribute field information) can be loaded and cached in memory by periodically scanning the unique identifier (which may be a table field) after the basic data is defined and before the interactive operation defined in the interactive interface, so that the front-end page, i.e. the user terminal, can improve the efficiency, accuracy and effectiveness of obtaining data attribute field information.

[0049] For specific instructions on caching, please refer to the following:

[0050] 1) Scan the unique identifiers defined to load the definitions of the underlying data into the cache, which is the process of creating a "definition layer" on top of the underlying data;

[0051] 2) In response to the interactive operation defined in the interactive interface, look up the cache to determine the definitions selected by the interactive operation.

[0052] Here, the unique identifier, representing a unique representation, can be a table field defined in the basic data definition. For example, a serial number can be set in the first column of the field name to represent the field name, such as 1-Name, 2-Gender, 3-Age, etc. For instance, if a user combines the defined age, 20, and greater than in the interactive interface to create a statement that the age is greater than 20, the computer backend will use the unique identifier "3" of the age definition (the unique identifier in this application can also be called an ID) to perform operations such as combination, saving, transmission, and processing, transforming it into the first structured data (taking JSON as an example):

[0053]

[0054] The value "3" corresponding to "field" is a unique identifier that uniquely represents the target field "age" in the target data table. By scanning this unique identifier, the required user information can be found directly. This scanning can be understood as traversing or querying, which is the conventional way of loading data.

[0055] It should be noted that when the data defined in the basic data changes (such as being added, modified, or deleted), the data in the cache will be changed synchronously.

[0056] In other words, this embodiment loads the definition of basic data into the cache first, so that when performing the defined interactive operations in the subsequent interactive interface, the user can directly select the data in the cache for combined operations, thereby improving the efficiency of the user in obtaining data.

[0057] In one embodiment, to facilitate computer processing and reduce processing load, the definitions of the aforementioned basic data can be combined using unique identifiers. For example, step 210, which responds to an operation instruction, combines at least some of the definitions based on structured combination rules and / or conditions to obtain the first structured data, may specifically include the following sub-steps:

[0058] Step 211: In response to the operation instruction, combine several defined unique identifiers based on the rules and / or conditions of structured combination to obtain the first structured data.

[0059] For example, assuming that the unique identifier for age is 5, the unique identifier for contract number is 6, and the unique identifier for gender is 7, this article may also refer to the unique identifier as ONE_ID.

[0060] For example, based on JSON rules, the age in "age greater than 20" can be replaced with the unique identifier 5, the contract number in "contract number equal to 5105" can be replaced with the unique identifier 6, and the gender in "gender equal to female" can be replaced with the unique identifier 7. By combining these unique identifiers, the resulting JSON data can be as follows:

[0061] In some embodiments, to facilitate user editing and lower the barrier to entry for users, an interactive interface can be provided for user operation. For example, step 211, which involves combining several defined unique identifiers based on rules and / or conditions of structured combination to obtain the first structured data, may specifically include:

[0062] Step 212: In response to the defined operation instructions within the interactive interface, determine several definitions selected for the interactive operation;

[0063] Step 213: In response to the operation command for configuring rules and / or conditions within the interactive interface, determine the combination of several definitions according to the rules and / or conditions.

[0064] The interactive interface can be a visual interactive interface or other editing interface. The visual interactive interface can display various definitions, conditions or input boxes. Users can easily select the required definitions or conditions in different areas of the visual interactive interface, and can also directly enter values ​​in the input boxes.

[0065] In one embodiment, the specific process of combining at least some of the rules and / or conditions based on structured composition to obtain the first structured query data can be found in [reference needed]. Figure 2 , Figure 2 This is a flowchart illustrating the process of combining the definitions of basic data, which may specifically include:

[0066] Step 310: In response to the first operation of querying the first-level definition of the basic data, determine the first-level definition as the first target definition from a plurality of candidate first-level definitions.

[0067] For example, a user opens a visual interactive interface for combining the first layer of structured data. This interface has multiple operable fields, and the first-level definition can be any field. For instance, if the left field is selected first, then the right field becomes the second-level definition. Each field has a drop-down list; clicking the drop-down list for the first-level definition will display several candidate first-level definitions for the user's convenience. After the user selects one of the first-level definitions, the computer backend locks the selected first-level definition as the first target definition, thus completing the first operation of selecting the first-level definition of the basic data.

[0068] Step 320: In response to a second operation of selecting or inputting basic data for a second-level definition, receive input or determine a second-level definition as the second target definition from a plurality of candidate second-level definitions.

[0069] For example, the second-level definition is associated with the first-level definition. This means that after a user selects the first-level definition, the candidate options for the second-level definition are determined or narrowed down. The candidate options or narrowed range of the second-level definition change along with the first-level definition. Users can directly input the value 24 into the relevant area of ​​the visual interactive interface, i.e., the input box for the second-level definition, or they can select a pre-set value of 20 by clicking or tapping. Multiple clicks can then be made based on 20 to obtain the desired value. For example, the first click is 20, the second is 22, the third is 24, and so on. After the user selects one of the second-level definitions (e.g., 24), the computer backend locks the selected second-level definition as the second target definition 24, thus completing the second operation of selecting the second-level definition of basic data.

[0070] Step 330: In response to a third operation that queries or inputs a first relation between a first target definition and a second target definition, receive input or determine the target logical operation as the relation from a plurality of candidate logical operations.

[0071] For example, after the computer backend has locked age in the first layer of the visual interactive interface as the first target definition and 24 in the second layer of the definition as the second target definition, the computer backend will automatically select the logical operation (such as greater than, less than, equal to, greater than and / or equal to, less than and / or equal to) in the selection box between the first layer of the definition and the second layer of the definition as the default recommended search option for the user to click and switch. After the user selects one of the logical operations, the computer backend will lock the selected logical operation as the target logical operation of the first relationship between the first target definition and the second target definition, and then complete the third operation of searching or entering the first relationship between the first target definition and the second target definition.

[0072] Step 340: Combine the first target definition, the second target definition, and the first relation into structured first structured data.

[0073] For example, the selected first target definition (age), second target definition (24), and first relation (greater than) are combined to form the first structured data: age greater than 24. If the first structured data is JSON, then the first target definition (age), second target definition (24), and first relation (greater than), i.e., age greater than 24, can also be used as a basic condition in the JSON.

[0074] In this embodiment, by setting the definition as a first-level definition and a second-level definition, the various areas of the visual interactive interface appear clear and consistent, which facilitates user operation. Furthermore, when the user selects the first-level definition, the candidate options for the second-level definition can be determined or limited, reducing the chance of the user making the wrong selection.

[0075] After combining the first target definition, the second target definition, and the first relation into one of the basic conditions for the first structured data, further search operations can be performed to determine whether a third-level definition is nested under the first target definition. Please refer to [link / reference] for details. Figure 3 , Figure 3 This is another flowchart illustrating the combination of basic data definitions in the data generation method provided in this application, which may specifically include the following steps:

[0076] Step 410: In response to the fourth operation of selecting the third-level definition, determine the third-level definition as the third target definition from a number of candidate third-level definitions. The third-level definition is nested within the first-level definition.

[0077] For example, users can directly click on the drop-down list of third-level definitions below the first-level definition area in the visual interactive interface to display several candidate third-level definitions for easy selection. After the user selects one of the third-level definitions, the computer backend locks the selected third-level definition as the third target definition, thus completing the fourth operation of selecting the first-level definition of the basic data.

[0078] To make the visual interactive interface look concise and clear, the display box of the third layer definition nested in the first layer definition can also be hidden.

[0079] Step 420: In response to the fifth operation of querying or inputting basic data for the fourth-level definition, receive input or determine the fourth-level definition as the fourth target definition from a number of candidate fourth-level definitions.

[0080] Similarly, users can directly enter the value 5125 in the relevant area of ​​the visual interactive interface, namely the input box of the fourth-level definition, or select the pre-set value 5125 in the input box by clicking or tapping, and then click multiple times on 5125 to obtain the desired value. For example, the first click is 5125, the second click is 5150, the third click is 5175, and so on. After the user selects one of the fourth-level definitions (e.g., 5125), the computer background will lock the selected fourth-level definition as the fourth target definition 5125, thus completing the fifth operation of searching for or entering basic data in the fourth-level definition.

[0081] Step 430: In response to the sixth operation of querying or inputting the second relation between the third target definition and the fourth target definition, receive input or determine the target logical operation as the second relation from a number of candidate logical operations.

[0082] For example, after the computer backend has locked the gender in the third-level definition of the contract number nested in the first-level definition as the third target definition, and locked the male in the fourth-level definition as the fourth target definition, the computer backend will automatically select the logical operation of equal to or not equal to in the selection box between the first-level definition and the second-level definition as the default recommended search option for the user to click and switch. After the user selects one of the logical operations, the computer backend will lock the selected logical operation, namely equal to, as the target logical operation of the second relationship between the third target definition and the fourth target definition, thereby completing the sixth operation of searching or entering the second relationship between the third target definition and the fourth target definition.

[0083] Step 440: Combine the first target definition, the second target definition, the first relation, the third target definition, the fourth target definition, and the second relation into structured first structured data.

[0084] For example, the first target definition is contract number, the second target definition is 5105, and the first relation equals combination is contract number equal to 5105, which is combined with the third target definition is gender, the fourth target definition is male, and the second relation equals combination is gender equal to male, and the result is a structured first structured data.

[0085] In this embodiment, since the parsing of the first structured data is done recursively, that is, starting from nested statements, and the first-level definition may contain nested definitions, it is necessary to continue the search operation from the first-level definition to determine whether there is a third-level definition nested under the first target definition, so as to facilitate subsequent parsing.

[0086] It should be noted that the above embodiment is a process in which the user selects the definition of the required basic data in the visual interactive interface and performs combination operations. However, when the selected target definition (including the first target definition, the second target definition, the third target definition, and the fourth target definition) is converted into the first structured data, it is necessary to first combine it into the basic conditions (including basic conditions and event conditions) of the first structured data before generating the complete first structured data.

[0087] It is important to note that there are several sets of first target definitions, second target definitions, and first relations. Similarly, there can be several sets of third target definitions, fourth target definitions, and second relations. Taking JSON characters as the first structured data as an example, each set of first target definitions, second target definitions, and first relations (e.g., contract number equals 5105) can be used as a basic condition in the JSON, and the third target definitions, fourth target definitions, and second relations (e.g., gender equals male) can be used as another basic condition in the JSON, thus forming structured data with different basic condition layers.

[0088] For example, suppose we select age and contract number from the first target definition, 20 and 5105 from the second target definition, and greater than and equal to from the first relation, forming two sets of first target definitions, second target definitions, and first relations: one set is age greater than 20, and the other set is contract number equal to 5105. Since the third-level definition is nested under the first-level definition, the third target definition is also nested under the first target definition. For example, if the first target definition is contract number, the third target definition could be gender and user mobile phone region, etc. The fourth target definition could correspond to female and Hubei province. The logical operation between the third and fourth target definitions, i.e., the second relation, can be equal to. See the following for details:

[0089] 1. Age over 20;

[0090] 2. Contract number equals 5105;

[0091] (1) Gender is female;

[0092] (2) The user's mobile phone region is equal to Hubei.

[0093] Among them, "age greater than 20" is one set of first target definition, second target definition and first relationship; "contract number equal to 5105" is another set of first target definition, second target definition and first relationship; "gender equal to female" and "user mobile phone region equal to Hubei" are two nested sets of third target definition, fourth target definition and second relationship under the first target definition, second target definition and first relationship of "contract number equal to 5105".

[0094] Furthermore, the two sets of first target definitions, second target definitions, and first relations, combined with the two sets of third target definitions, fourth target definitions, and second relations, are transformed into first structured data (using JSON as an example), as shown below:

[0095]

[0096] Among them, the age ID, contract number ID, gender ID, birthday ID, and user mobile phone region ID are the unique identifiers mentioned above. The specific ID values ​​are not limited here, but they are generally positive integers.

[0097] By combining multiple sets of first target definitions, second target definitions, and first relations with multiple sets of third target definitions, fourth target definitions, and second relations, they are transformed into corresponding first structured data, such as basic conditions and event conditions in the first structured data. In other words, multiple conditions are used to query, thereby finding the data needed by the user more quickly and accurately.

[0098] Additionally, it should be noted that the above examples only illustrate the case where a third-level definition is nested within a first-level definition. However, in practice, since the first structured data is a tree structure, it is necessary to further determine whether there is another layer of definition nested within the third-level definition. For example, the third target definition "gender equals female" may also contain a definition "birthday equals 2010-03-04". See the following for details:

[0099] 1. Age over 20;

[0100] 2. Contract number equals 5105;

[0101] (1) Gender is female;

[0102] (1-1) Birthday equals 2010-03-04;

[0103] (2) The user's mobile phone region is equal to Hubei.

[0104] Similarly, after the user selects the above query statement, the computer backend will further convert these query statements into corresponding first structured data (using JSON as an example), as shown below:

[0105] Furthermore, the first structured data obtained above needs to be parsed and transformed into second structured data. In some embodiments, to avoid some definitions not being parsed, a recursive algorithm is generally used to parse the first structured data. Recursive algorithms can simplify code writing and improve the readability of computer programs. The specific parsing process may include the following steps:

[0106] Step 510: Parse the first structured data and determine whether there is a third-level definition nested within the first-level definition during the parsing process;

[0107] Step 520: If there is a third-level definition nested within the first-level definition, continue to determine if there is another layer of definition nested within the third-level definition, until there is no other layer of definition with a nested relationship, and obtain the basic second-level structured data;

[0108] For example, if there exists another layer of definition nested within the third layer (e.g., the fourth layer), then we continue to check if there is yet another layer nested within the fourth layer (e.g., the fifth layer), and so on, until there are no more nested structures. This recursive branch resolves to its end and does not need to continue. Then, we find all the definitions of the last nested structure and return step by step. For each layer of nested structure returned, we find all the definitions of that layer of nodes.

[0109] Step 530: Combine all the basic second structured data to generate the complete second structured data.

[0110] In steps 510-530, for example, consider the following query statement:

[0111] 1. Age over 20;

[0112] 2. Contract number equals 5105;

[0113] (1) Gender is female;

[0114] (1-1) Birthday equals 2010-03-04;

[0115] (2) The user's mobile phone region is equal to Hubei.

[0116] When parsing {"property":{"opr":"gt","field":"ageID","value":"20"}} corresponding to ages greater than 20, it checks whether there is a nested third-level definition for ages greater than 20. Since there is no nested third-level definition for ages greater than 20, it can be directly converted into second-level structured data.

[0117] The code parses the contract number equal to 5105, corresponding to {"property":{"opr":"eq","field":"Contract Number ID","value":"5105"}}. It then checks if there is a nested third-level definition for contract number equal to 5105. If it finds that contract number equal to 5105 has a nested third-level definition for gender equal to female and user mobile phone region equal to Hubei, it continues to check if gender equal to female and user mobile phone region equal to Hubei have another nested definition. For example, gender equal to female might have another nested definition for birthday equal to 2010-03-04, and so on, until birthday equal to 2010-03-04 and user mobile phone region equal to Hubei no longer have any nested definitions. Then, it sequentially parses these into the corresponding basic second-level structured data (taking an SQL query statement as an example). The parsed data is then combined to form the complete SQL query statement.

[0118] In addition, to simplify operations and more quickly locate the data to be queried, you can also set a shortcut for the query statement, which is to further predefine the basic data (abbreviation).

[0119] For specific settings, some embodiments select at least one set of first target definitions, second target definitions, and first relationships as the basic data filtering conditions for a preset dimension.

[0120] For example, please refer to Figure 4 , Figure 4 This is a schematic diagram illustrating the combination of basic data definitions using an interactive interface in the data generation method provided in this application. Users can interact with similar interfaces. Figure 4In the visual interactive interface, under Business Customization - Activity - test, containing, default name 2x, default name 1x, and hqj class - hqj, containing, non-public officials active to silent users, select "non-public officials active to silent users" from the hqj class - hqj containing non-public officials active to silent users group as the basic data filtering condition for the preset dimension. This allows users to skip the subquery steps mentioned above and directly select the set options for querying. For example, if the query statement is contract number, since the range of contract number is relatively large, it needs to be nested, i.e., subqueries, such as continuing to query gender, birthday, or user mobile phone region nested within the contract number. However, with the preset settings, the data to be queried can be directly located.

[0121] Optionally, in other embodiments, the data can be filtered according to the specific values ​​of the data to form specific hierarchical data. For example, filtering can be performed by the user's gender attribute dimension (gender field). Since the gender data only has two enumerated values: male and female, two gender hierarchies will be formed: gender hierarchy male and gender hierarchy female. Another example is that the activity level hierarchy can include: high activity, medium activity and low activity.

[0122] Optionally, to make the JSON structure concise and clear, easy to read, and easier to convert into a second structured statement, in some embodiments, the JSON can be mainly divided into three condition types: basic conditions, event conditions, and relational conditions. Receiving instructions to combine definitions of basic data then includes the following steps:

[0123] Step 610: Receive an operation instruction that combines the definitions of basic data into basic conditions or event conditions, or receive an operation instruction that combines the definitions of basic data into basic conditions, combination relationships, and event conditions. The basic conditions are the results of logical operations between different definitions, the event conditions are the event states corresponding to the definitions, and the combination relationships include the logical operations between the basic conditions and / or the event conditions.

[0124] Here, we will first give a brief introduction to the first structured data of this application. Taking JSON as an example, JSON is mainly divided into three types of conditions: basic conditions, event conditions, and relational conditions. Relational conditions can also be called combination relationships because relational conditions can be directly understood as a combination of basic conditions and event conditions. For the sake of convenience, this application can also refer to basic conditions and event conditions as basic conditions.

[0125] In JSON statements, basic conditions are the results of logical operations between different definitions, or they can be described as judgment conditions for the value of specific data items, including opr, field, value, and source.

[0126] Where A)opr is the comparison operator type, including: equal to (eq-equals), not equal to (neq-notequals), greater than (gt-great than), greater than or equal to (gte-great than and equals), less than (lt-lessthan), less than or equal to (lte-less than and equals), interval (btw-between), contain (in), not contain (nin-not in), null (nvl-null), and not null (nnvl-not null).

[0127] B) field represents the data item participating in the operation, and its corresponding value can be the unique identifier mentioned above.

[0128] C) value: Indicates the conditions that the data item must meet.

[0129] For example, the computer backend receives the basic data defined as age, 20, and greater than. It then performs a greater than logical operation between age and 20, resulting in the following basic conditions:

[0130]

[0131] In this context, "field":"ageID","value":"20" and "opr":"gt" are the first, second, and third key-value pairs of the basic conditions, respectively.

[0132] In order to accurately convert the user's selected query statement into the first structured data, in some embodiments, after determining multiple sets of first target definitions, second target definitions, and first relations, the computer backend will map each key-value pair of the basic conditions to the determined first target definitions, second target definitions, and first relations one-to-one. Specifically, this includes the following steps:

[0133] Step 620: Use the first key-value pair of the basic condition as the first target definition of the first group, use the second key-value pair of the basic condition as the second target definition of the first group, use the third key-value pair of the basic condition as the first relation of the first group, and combine the first key-value pair, the second key-value pair, and the third key-value pair of the basic condition to obtain the basic condition.

[0134] For example, suppose two sets of first target definitions, second target definitions, and first relationships are determined: first set: age greater than 20; second set: contract number equal to 5105.

[0135] Convert "age" to "field":"ageID" to define the first key-value pair of the basic condition as the first target definition of the first group. Convert "20" to "value":"20" to define the second key-value pair of the basic condition as the second target definition of the first group. Convert "greater than" to "opr":"gt" to define the third key-value pair of the basic condition as the first relation of the first group. Combine the first key-value pair "field":"ageID", the second key-value pair "value":"20", and the third key-value pair "opr":"gt" of the basic condition to obtain the basic condition {"property":{"field":"ageID","value":"20","opr":"gt"}}.

[0136] Similarly, defining the contract number as the first target of the second group, defining the contract number as "field":"Contract Number ID", defining the contract number as "value":"5105" as the second target of the second group, defining the contract number as "5105" as "value", and defining the equals sign as "opr":"eq" as the first relation, the basic condition obtained by further combination is {"property":{"field":"Contract Number ID","value":"5105","opr":"eq"}}.

[0137] When there are more than two sets of first target definitions, second target definitions, and first relations, the key-value pairs in the basic conditions are matched one-to-one with the determined first target definitions, second target definitions, and first relations in the same way, and then combined to obtain multiple sets of basic conditions.

[0138] In addition, to reduce the amount of computer processing required, in some embodiments, after the first operation in response to the first-level definition of the underlying data, a unique identifier is set for the first-level definition (e.g., field name), and this unique identifier is used as the value of the first key-value pair. Specifically, this may include the following:

[0139] Step 630: In response to the first operation of selecting field names in the basic data, determine a field name from several candidate field names as the key of the first key-value pair, and use the unique identifier of the determined field name as the value of the first key-value pair. The unique identifier is used to uniquely identify the target data table and target field in the basic data.

[0140] First, let's briefly explain the key-value pairs of the basic conditions. A key-value pair consists of a key and a value. Let's take the previously listed examples, "field":"AgeID","value":"20" and "opr":"gt", as the first, second, and third key-value pairs of the basic conditions, respectively. Here, "field", "value", and "opr" are the keys of the key-value pair, and "AgeID", "20", and "gt" are the values ​​of the key-value pair.

[0141] For example, in a data dictionary, you can set a list of serial numbers in the column before the field name, such as 1-Name, 2-Gender, 3-Age, 4-Contract Number, etc.

[0142] By representing "field":"AgeID" as "field":3" for selection, the field name "age" is used as the key of the first key-value pair, and the unique identifier "3" of age is used as the value of the first key-value pair. By searching the third row, the target field "age" that the user needs can be determined, and the target data table can be a personnel information table.

[0143] After introducing the basic conditions in the first structured data, the event conditions in the following section will be explained. It is important to note that the event conditions in the first structured data differ significantly from the basic conditions. Event conditions define corresponding event states, and user groups matching those event states can be filtered out based on those states.

[0144] Combining at least partially defined rules and / or conditions based on structured composition to obtain first structured data may include the following steps:

[0145] S710: Combine the fourth key-value pair and the fifth key-value pair of the event condition to obtain the event condition;

[0146] In this context, the key of the fourth key-value pair is the event name or code, and the value of the fourth key-value pair is the code value that uniquely identifies the event name or code. The key of the fifth key-value pair is the relationship type, and the value of the fifth key-value pair is the state of the event: whether it has occurred, has not occurred, or has occurred sequentially.

[0147] Specifically, the event conditions include a fourth key-value pair and a fifth key-value pair to represent the event status basis for filtering user groups. The fourth key-value pair indicates which event is used for filtering, which can be represented by the specific name of the event (either the full name or abbreviation) or its code. Therefore, the key of the fourth key-value pair can be the event name or code, and the value can be a unique identifier for the event name or code. The fifth key-value pair represents the behavioral state of the event used as the filtering basis. The behavioral state can be occurred, not occurred, or occurred sequentially. Therefore, the key of the fifth key-value pair is the relation type, and the value of the fifth key-value pair is the state of the event: occurred, not occurred, or occurred sequentially. For example, if the value of the fifth key-value pair is "event occurred," it means filtering user groups who have executed the event corresponding to the value of the fourth key-value pair; if the value of the fifth key-value pair is "event not occurred," it means filtering user groups who have not executed the event corresponding to the value of the fourth key-value pair; if the value of the fifth key-value pair is "event occurred sequentially," it means filtering user groups who have sequentially executed the events corresponding to the values ​​of the fourth key-value pairs in the event conditions. Optionally, the value of the fifth key-value pair can represent the behavioral state of the event using the name (which can be the full name or abbreviation) corresponding to whether the event occurred, did not occur, or occurred sequentially, or the corresponding behavioral state number. The behavioral state number uniquely identifies the behavioral state of the event. For example, the value of the fifth key-value pair can use the abbreviation "hap" to represent that the event occurred, "unhap" to represent that the event did not occur, and "hit" to represent that the event occurred sequentially. Alternatively, the value of the fifth key-value pair can use the behavioral state number "e1" to represent that the event occurred, "e2" to represent that the event did not occur, and "e3" to represent that the event occurred sequentially.

[0148] For example, the first type of structured data is a JSON statement:

[0149] {"opr":"hap","events":[{"eventcode":"2"}]}, the event with event code 2 represents the card opening event. The user group filtered by the event conditions represented by this JSON statement is the user group that has executed the card opening event.

[0150] Using the events and their corresponding states in the event conditions as the basis for filtering user groups can, to some extent, predetermine the scope of the user group and improve the efficiency of filtering user groups.

[0151] Optionally, in addition to the fourth and fifth key-value pairs, the event conditions may include more key-value pairs, such as the sixth key-value pair, the seventh key-value pair, etc. This application does not limit the number of key-value pairs included in the event conditions.

[0152] When the event condition also includes a sixth key-value pair, it can be combined using the following steps, which may include:

[0153] S720: Combine the fourth key-value pair, the fifth key-value pair, and the sixth key-value pair of the event condition to obtain the event condition;

[0154] The sixth key-value pair of the event conditions includes at least one of the aggregate main condition, aggregate sub-condition, event start time, and event end time.

[0155] Furthermore, event conditions can also include aggregate main conditions, aggregate sub-conditions, event start time, and event end time to further filter the user groups corresponding to those who have performed specific behavioral events. Therefore, event conditions also include a sixth key-value pair, which represents the filtering of user groups based on the aggregate main conditions, aggregate sub-conditions, event start time, and event end time for the events corresponding to the values ​​of the fourth key-value pair.

[0156] The start and end times of an event can include both the original time value and the time interval unit. The original time value is a numerical value related to time, while the time interval unit is a unit of time measurement, such as second, minute, hour, day, or fixed. If the original time value is a complete time, including year, month, day, hour, minute, and second, such as 2022-01-31 13:56:00, then the corresponding time interval unit is fixed. If the original time value is just a single numerical value, such as 5, then the time measurement unit can be one of second, minute, hour, or day.

[0157] If the sixth key-value pair represents the event start time used to filter user groups, then the key of the sixth key-value pair can be the name of the original time value of the event start time (e.g., beginTime, bTime) and the time interval unit (beginInterval) corresponding to the original time value of the event start time. The value of the sixth key-value pair is the set original time value of the event start time and the time interval unit. The set original time value of the event start time can be a dynamic time or an absolute time. The dynamic time can be a numerical value. For example, if it represents the event start time five days away from the event end time, and the event end time is 2022-01-31 13:56:00, then the value of the sixth key-value pair corresponding to the original time value of the event start time is 5, and the value of the sixth key-value pair corresponding to the time interval unit of the event start time is day. Absolute time refers to the specific time of year, month, and day, or the specific time of year, month, day, hour, minute, and second. For example, the value of the sixth key-value pair corresponding to the original value of the time representing the start time of an event is 2022-01-31 13:56:00, and the value of the sixth key-value pair corresponding to the time interval unit representing the end time of an event is fixed.

[0158] If the sixth key-value pair represents the event end time used to filter user groups, then the key of the sixth key-value pair can be the name of the original time value of the event end time (e.g., beginTime, bTime) and the corresponding time interval unit (beginInterval). The value of the sixth key-value pair is the set original time value of the event end time and the time interval unit. The set original time value of the event end time can be a dynamic time or an absolute time. The dynamic time can be a numerical value. For example, if it represents the time 5 minutes away from the event start time, and the event start time is 2022-01-31 13:56:00, then the value of the sixth key-value pair corresponding to the original time value of the event end time is 5, and the value of the sixth key-value pair corresponding to the time interval unit of the event end time is minute. Absolute time refers to the specific time of year, month, and day, or the specific time of year, month, day, hour, minute, and second. For example, if the event end time is 2022-01-31 13:56:00, then the value of the sixth key-value pair corresponding to the original value of the event end time is 2022-01-31 13:56:00, and the value of the sixth key-value pair corresponding to the time interval unit of the event end time is fixed.

[0159] For example, the first structured data is a JSON statement: {"opr":"hap","beginInterval":"day","beginTime":"5","endInterval":"fixed","endTime":"2022-01-31 13:56:00","events":[{"eventcode":"2"}]}. The event code 2 represents the card opening event. The user group filtered by the event conditions represented by this JSON statement is the user group that performed the card opening event between 13:56:00 on 2022-01-26 and 13:56:00 on 2022-01-31.

[0160] Since event filtering is generally time-limited, and some data in the database changes dynamically over time, in order to make full use of various data and improve query accuracy, in some embodiments, event sequences are formed by combining event conditions and basic conditions or multiple event conditions, and then user groups are further filtered by event sequences or combinations of event sequences.

[0161] It is important to note here that when event conditions and basic conditions, or multiple event conditions, are combined to form an event sequence, after the user selects the required basic data definitions in the visual interactive interface for combination, the computer backend receives the user's selected basic data definitions and performs further combination operations, which may include the following steps:

[0162] S730: Receives operation instructions for combining basic conditions, combination relations, event conditions, and event sequences of the definition of basic data. The basic conditions are the results of logical operations between different definitions, the event conditions are the event states corresponding to the definition, the event sequences are the sequences formed between multiple events corresponding to the definition, and the combination relations are the operators used for logical operations between basic conditions, event conditions, and event sequences.

[0163] S740: In response to an operation command, it combines basic conditions, event conditions, and event sequences based on combination relationships to obtain the first structured data.

[0164] After obtaining the first structured data, it needs to be converted into the second structured data. Please refer to [link / reference needed] for details. Figure 5 , Figure 5 This is a flowchart illustrating the process of converting first-structured data into second-structured data, which may include the following steps:

[0165] S810: Parse the first structured data and determine whether there is a combination relationship between the first structured data;

[0166] The first structured data is a data structure composed of basic conditions, combination relationships, event conditions, and event sequences included in the operation instructions received by the server. Combination relationships are operators used for logical operations between basic conditions, event conditions, and event sequences. The conditions for filtering user groups can be combinations of basic conditions and event conditions. There can be one or more conditions for filtering user groups. If there are multiple conditions (basic conditions and / or event conditions), the relationship between the multiple conditions can be an AND relationship or an OR relationship. Multiple AND and OR relationships can exist in the first structured data. If it is an AND relationship, the statement {"relation":"and"} in the combination relationship of the first structured data represents the user group filtered by the basic conditions and / or event conditions associated with this AND relationship, which is the intersection of the user groups filtered by the associated basic conditions and / or event conditions. If it is an OR relationship, the statement {"relation":"or"} in the combination relationship of the first structured data represents the user group filtered by the basic conditions and / or event conditions associated with this OR relationship, which is the union of the user groups filtered by the associated basic conditions and / or event conditions.

[0167] After receiving the operation instruction, the server responds by obtaining the first structured data. To retrieve the user groups filtered based on the basic conditions, event conditions, and event sequences included in the first structured data, the server transforms the first structured data into second structured data. This allows the server to query the database for user groups that meet the various conditions included in the first structured data. To obtain the second structured data, the server parses the first structured data, converting the various conditions included in the first structured data into portions of the second structured data. To obtain the conditional relationships between the various conditions in the first structured data, the first step in parsing the first structured data is to determine whether there is a combination relationship in the first structured data. That is, to determine whether the value of the "relation" attribute representing the combination relationship in the first structured data is empty, i.e., {"relation":""}. If the server parses the first structured data and finds that the value of the "relation" attribute is empty, then the first structured data includes a single basic condition or a single event condition. If the server parses the first structured data and finds that the value of the "relation" attribute is not empty, then the first structured data includes multiple conditions (basic conditions and / or event conditions), and the value of the "relation" attribute corresponds to the combination relationship between the multiple conditions (basic conditions and / or event conditions).

[0168] S820: In response to the existence of a composition relationship, obtain the basic conditions and event conditions associated with the composition relationship;

[0169] When the server parses the first structured data, it will determine whether there is a combination relationship in the first structured data. If the server finds a combination relationship in the first structured data, the server will obtain the basic conditions and / or event conditions associated with the combination relationship.

[0170] Combination relationships include simple combination relationships and complex combination relationships. A simple combination relationship refers to a relationship in which the basic conditions and / or event conditions associated with the combination relationship do not include other combination relationships.

[0171] For example, the first type of structured data is a JSON statement:

[0172]

[0173] The basic and event conditions in this JSON statement do not contain any other relation attributes. Therefore, the relationship between the basic and event conditions is a simple combination relationship (AND). When the server parses the combination relationship relation attribute as "and", it continues to parse the first structured data to obtain the event and basic conditions associated with this combination relationship "and".

[0174] Complex composition relationships refer to conditions that contain other composition relationships. Complex composition relationships include nested composition relationships, where conditions contain other basic conditions and / or event conditions. For example, the first structured data is a JSON statement:

[0175] {"relation":"and",

[0176] "conditions":[{"opr":"hap",

[0177] "beginInterval":"day",

[0178] "beginTime":"5",

[0179] "endInterval":"fixed",

[0180] "endTime":"2022-01-31 13:56:00",

[0181] "events":[{"eventcode":"2"}]},

[0182] {"relation":"or",

[0183] "conditions":

[0184] [{"property":["field":1,"value":30,"opt":"lt"]},

[0185] The JSON statement `{"property":["field":2,"value":1,"opt":"eq"]}]}]}` contains other `relation` attributes within its basic and event conditions. Therefore, the relationship between these basic and event conditions is a complex combination relationship (an `AND` relationship containing a nested `OR` relationship). When the server parses the `relation` attribute "and", it retrieves the associated event conditions and nested conditions. It then continues parsing the nested conditions within the first structured data, retrieving the `relation` attribute "or". At this point, the basic conditions within the nested conditions are simple combinations. The server retrieves the two basic conditions associated with the `or` relationship, thus obtaining all the combination relationships, basic conditions, and event conditions in the first structured data.

[0186] S830: Parse the basic conditions and event conditions, and use the combination of the first key-value pair, the second key-value pair, the third key-value pair of the basic conditions, and the key-value pair of the event conditions as the query conditions for the second structured data. The data table containing the field name corresponding to the value of the first key-value pair is used as the query source for the second structured data.

[0187] The server parses the first structured data, and after obtaining the basic conditions and event conditions from the first structured data, it continues to parse the obtained basic conditions and event conditions. The basic conditions include a first key-value pair, a second key-value pair, and a third key-value pair. The first key-value pair is the first target definition of the first group, the second key-value pair is the second target definition of the first group, and the third key-value pair is the first relation of the first group.

[0188] The second structured data includes query conditions and query sources. The basic conditions and event conditions of the first structured data correspond to the query conditions of the second structured data.

[0189] For basic conditions, since the value of the first key-value pair of the basic condition is a unique identifier, this unique identifier can determine the filtering criteria corresponding to the basic condition, that is, it can uniquely determine the target data table and target field in the basic data. When converting the first structured data into the second structured data, the target data table containing the target field corresponding to the value of the first key-value pair is used as the query source of the second structured data.

[0190] For example, the first structured data can be a JSON statement. The basic condition in the JSON statement is "property":["field":1,"value":30,"opt":"lt"], where the value "1" of the "field" attribute represents the field field "field_1" in table_1, which represents the age field in the user table. The "value" attribute corresponds to the second key-value pair, the "opt" attribute corresponds to the third key-value pair, and the value "lt" of the "opt" attribute means less than. Therefore, the purpose of the basic condition of this JSON statement is to filter out users whose age is less than 30. This basic condition is then converted into part of the second structured data: "from table_1where field_1<30".

[0191] For event conditions, since there are event codes in the event conditions, and the events represented by the event codes have corresponding event tables, when converting the first structured data into the second structured data, the event table corresponding to the event represented by the event codes in the key-value pair combination of the event conditions is used as the query source for the second structured data.

[0192] For example, the first structured data could be a JSON statement, where the event conditions are {"opr":"hap",

[0193] "beginInterval":"day",

[0194] "beginTime":"5",

[0195] "endInterval":"fixed",

[0196] "endTime":"2022-01-31 13:56:00",

[0197] The JSON statement `"events":[{"eventcode":"2"}]}` defines an event condition where the value "2" of the "eventcode" attribute indicates a card activation event. The purpose of this event condition is to filter out users who experienced card activation events between 13:56:00 on January 26, 2022 and 13:56:00 on January 31, 2022. The corresponding query condition for the second structured data is that card activation events occurred between 13:56:00 on January 26, 2022 and 13:56:00 on January 31, 2022, and the query source is the card activation event table corresponding to the card activation events.

[0198] S840: Convert the first structured data into a second structured data containing bitmap functions. The second structured data includes query conditions and query source. The bitmap function is used to perform a query in the query source based on the query conditions to obtain the query target. The query target is output in the form of an array. Different elements of the array come from the values ​​of the same field in the data table in the query source. Several data tables have the same field, and the value of the same field is a unique identifier.

[0199] The purpose of transforming the first structured data into the second structured data is to filter out user groups that meet the basic and event conditions included in the first structured data. To facilitate the acquisition of user groups, the data tables storing user group-related information all contain the same field, and the value of the same field is a unique identifier (e.g., user id) to uniquely identify users. Since the data tables in the query source contain the same field, the second structured data can use this same field as the query target, and the query results can be output as an array using bitmap functions.

[0200] By organizing different elements with the same field into an array in an ordered manner, various operations can be performed directly on the array, and the query target can be output in the form of an array. This simplifies the complex calculations and makes the program structure simpler.

[0201] Generally, converting the first structured data into the second structured data involves converting the key-value pairs contained in the first structured data into the corresponding bitmap functions of the second structured data. The specific conversion process can be as follows:

[0202] The bitmap functions include a first bitmap function, a second bitmap function, and a third bitmap function.

[0203] S910: Convert the first key-value pair, the second key-value pair, and the third key-value pair of the basic conditions into the first condition of the first part of the second structured data. The first part includes the first graph function, which is used to output the first query target based on the first condition.

[0204] To facilitate the retrieval of user groups that meet various basic and event conditions in the first structured data, we can first query out the user groups that meet each condition (basic condition, event condition) separately, and then obtain the user groups that meet various basic and event conditions in the first structured data based on the combination relationship associated with each condition (basic condition, event condition).

[0205] For the basic conditions, the second structured data corresponding to the basic conditions is obtained based on the first key-value pair, the second key-value pair, and the third key-value pair. The query target is output in the form of an array using a bitmap function.

[0206] For example, the first structured data can be a JSON statement. The basic condition in the JSON statement is "property":["field":1,"value":30,"opt":"lt"], where the value "1" of the "field" attribute in the first key-value pair represents the field field "field_1" in table_1, which represents the age field in the user table. The "value" attribute corresponds to the second key-value pair, and the "opt" attribute corresponds to the third key-value pair. The value "lt" of the "opt" attribute indicates less than. Therefore, the purpose of the basic condition of this JSON statement is to filter out users whose age is less than 30. This basic condition is then transformed into the second structured data: "t1 as(select to_bitmap(id)ids from table_1where field_1<30),t2 as(select bitmap_union(t1.ids)ids from t1)". Here, the first bitmap function to_bitmap and bitmap_union functions convert the same field (i.e., id) corresponding to the query target into an array for output. Thus, based on this second structured data, an array of identical fields (e.g., an array containing user IDs) can be obtained, which corresponds to a group of users under the age of 30.

[0207] S920: The second condition is converted into the second part of the second structured data, which includes a second bitmap function. The second bitmap function is used to output the second query target based on the second condition.

[0208] For event conditions, the second structured data corresponding to the event conditions is obtained based on the key-value pairs of the event conditions, and the query target is output in the form of an array using bitmap functions.

[0209] For example, the first structured data could be a JSON statement, where the basic conditions are {"opr":"hap",

[0210] "beginInterval":"day",

[0211] "beginTime":"5",

[0212] "endInterval":"fixed",

[0213] "endTime":"2022-01-31 13:56:00",

[0214] The JSON statement `"events":[{"eventcode":"2"}]}` defines an event condition where the value "2" of the "eventcode" attribute indicates a card opening event. The purpose of this JSON condition is to filter users who experienced card opening events between 13:56:00 on January 26, 2022 and 13:56:00 on January 31, 2022. The corresponding query condition in the second structured data is for a card opening event `event_1` that occurred between 13:56:00 on January 26, 2022 and 13:56:00 on January 31, 2022. The query source is the card opening event table `table_2`. This event condition is then converted into the second structured data: `t3 as(select to_bitmap(id)ids from table_2where event_1between'2022-01-26`. The query `t4 as(select bitmap_union(t1.ids)ids from t3)` uses the second bitmap function `to_bitmap` and the function `bitmap_union` corresponding to the event conditions to convert the same field (i.e., `id`) corresponding to the query target into an array. Based on this second structured data, an array of the same fields (e.g., an array containing user IDs) can be obtained. This array corresponds to a group of users who had an account opening event between 13:56:00 on January 26, 2022 and 13:56:00 on January 31, 2022.

[0215] In steps S910 and S920, by converting the key-value pairs in the basic conditions and event conditions into the corresponding parts of the bitmap function in the second structured data, database professionals can easily modify the second structured data at any time when the basic conditions and event conditions in the first structured data change slightly, without affecting the application source code, thereby improving the portability of the program.

[0216] S930: The first query target and the second query target are converted into a third part of the second structured data. The third part includes a third bitmap function, which is used to operate on the first query target and the second query target to obtain the query target.

[0217] Since the criteria for filtering user groups include not only single basic conditions or single event conditions, but also combinations of conditions, such as combinations of basic conditions and event conditions, we can first filter out user groups that meet the basic condition and user groups that meet the event condition separately, and then perform set operations on the user groups corresponding to the basic condition and the user groups corresponding to the event condition based on the combination relationship. For example, if the combination relationship is "AND", then we can find the intersection of the user groups corresponding to the basic condition and the user groups corresponding to the event condition; if the combination relationship is "OR", then we can find the union of the user groups corresponding to the basic condition and the user groups corresponding to the event condition.

[0218] For example, to obtain user groups who had card activation events and were under 30 years old between 13:56:00 on January 26, 2022 and 13:56:00 on January 31, 2022, the corresponding first structured data could be: {"relation":"and",

[0219] "conditions":[{"opr":"hap",

[0220] "beginInterval":"day",

[0221] "beginTime":"5",

[0222] "endInterval":"fixed",

[0223] "endTime":"2022-01-31 13:56:00",

[0224] "events":[{"eventcode":"2"}]},

[0225] {"property":["field":1,"value":30,"opt":"lt"]}]}, the corresponding second structured data is "with

[0226] t1 as(select to_bitmap(id)ids from user where age<30),

[0227] t2 as(select bitmap_union(t1.ids)ids from t1),t3 as(select to_bitmap(id)ids from table_2where event_1between'2022-01-26 13:56:00'and'2022-01-3113:56:00'),t4 as(select bitmap_union(t1.ids)ids from t3),

[0228] The query `t5 as(select bitmap_and(t2.ids, t4.ids)from t2, t4)select t5.ids from t5` retrieves user groups filtered by basic conditions (t1 and t2), user groups filtered by event conditions (t3 and t4), and user group t5. The `relation` attribute in the JSON statement is "and". Therefore, the third bitmap function `bitmap_and` finds the intersection of the user groups filtered by basic and event conditions. `t5` corresponds to information about a group of users under 30 years old who participated in a card opening event between 13:56:00 on January 26, 2022 and 13:56:00 on January 31, 2022.

[0229] Optionally, the third bitmap function can also be used to find the union of user groups filtered by basic conditions and user groups filtered by event conditions. The specific function implemented by the third bitmap function is based on the "relation" attribute in the first structured data.

[0230] Optionally, the function names of the first bitmap function, the second bitmap function, and the third bitmap function can be set by the user.

[0231] Optionally, the use of bitmap functions depends on all access tables having the same field. If some access tables do not have the same field, bitmap functions may not be used.

[0232] To summarize, this application uses two methods for querying statements (taking JSON to SQL conversion as an example):

[0233] The first method involves using a visual interactive interface to query and combine related data sets (which may also be referred to as relational tables in this application) to obtain a JSON string, which is then converted into an SQL statement. The SQL statement is then used to query the relational table to obtain the fields. The above-listed examples are based on this method.

[0234] The second method involves preparing all the relational tables, JSON strings, and SQL statements in advance, and then directly calling the SQL statement to query the relational tables when needed.

[0235] In addition, by expanding the key or value in JSON, more usage scenarios can be supported, such as supporting relative time conditions and event sequences.

[0236] Optionally, the first structured data can be an SQL statement, and the second structured data can be a JSON string. Optionally, the first and second structured data can be other structured data besides SQL statements and JSON strings.

[0237] The user information filtering method provided in this application includes the following steps:

[0238] Obtain the second structured data as described in any of the methods above;

[0239] Execute the second structured data to obtain user group information from the base data.

[0240] Specifically, users can select any of the multiple second-structured data sets to query, thereby obtaining user group information from the basic data.

[0241] See Figure 6 , Figure 6 This is a schematic diagram of an embodiment of the electronic device provided in this application. The electronic device 60 includes a memory 61 and a processor 62. The memory 61 is used to store program data, and the processor 62 is used to execute the program data to implement the following method:

[0242] In response to an operation command, at least some definitions are combined based on rules and / or conditions of structured combination to obtain first structured data, wherein at least some of the definitions are derived from an associated data set, which defines the basic data and the associated relationships between its definitions; the first structured data is converted into second structured data, which is used to query the basic data through the converted rules and / or conditions.

[0243] See Figure 7 , Figure 7This is a schematic diagram of an embodiment of a computer-readable storage medium provided in this application. The computer-readable storage medium 70 stores program data 71, which, when executed by a processor, is used to implement the following method:

[0244] In response to an operation command, at least some definitions are combined based on rules and / or conditions of structured combination to obtain first structured data, wherein at least some of the definitions are derived from an associated data set, which defines the basic data and the associated relationships between its definitions; the first structured data is converted into second structured data, which is used to query the basic data through the converted rules and / or conditions.

[0245] When the embodiments of this application are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0246] The above are merely embodiments of this application and do not limit the scope of this patent application. Any equivalent structural or procedural changes made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of this application.

Claims

1. A data generating method characterized by comprising: The method includes: Receive an operation instruction to combine definitions of basic data, wherein the definitions include at least one or more combinations of the basic data's annotations, field names, storage types, table names, field contents, field thresholds, combination relationships, and relationship names; In response to the operation instruction, at least a portion of the definitions are combined based on the rules and / or conditions of structured combination to obtain first structured data, wherein the definitions are at least partially derived from an associated data set, and the associated data set defines the relationship between the basic data and the definitions. The first structured data includes basic conditions and event conditions, and is used to convert it into second structured data containing bitmap functions based on the association relationships defined in the associated data set. The basic conditions are the results of logical operations between different definitions, and the event conditions are the event states corresponding to the definitions. The second structured data includes query conditions and query sources. The query conditions include the basic conditions and the event conditions. The key-value pairs in the basic conditions and the event conditions are converted into the parts corresponding to the bitmap functions. The bitmap functions are used to query the query sources according to the query conditions to obtain query targets output in array form. The different elements of the array come from the values ​​of the same field in several data tables, and the values ​​of the same field are unique identifiers.

2. The method according to claim 1, characterized in that, In response to the operation instruction, at least a portion of the definitions are combined based on rules and / or conditions of structured combination to obtain first structured data, including: In response to the operation instruction, several defined unique identifiers are combined based on the rules and / or conditions of structured combination to obtain the first structured data.

3. The method according to claim 2, characterized in that, The rules and / or conditions based on structured combination combine several defined unique identifiers to obtain the first structured data, including: In response to an operation command on the definition within the interactive interface, determine a plurality of the selected definitions; In response to an operation instruction to configure rules and / or conditions within the interactive interface, determine the combination of the several definitions according to the rules and / or conditions.

4. The method according to claim 1, characterized in that, In response to the operation instruction, combining at least a portion of the definitions based on rules and / or conditions of structured composition to obtain first structured data includes: In response to a first operation of querying the first layer definition of the basic data, the first layer definition as the first target definition is determined from a plurality of candidate first layer definitions; In response to a second operation of querying or inputting the second-level definition of the basic data, the input is received or the second-level definition as the second target definition is determined from a plurality of candidate second-level definitions; In response to a third operation that queries or inputs a first relationship between the first target definition and the second target definition, the system receives input or determines the target logical operation as the first relationship from a plurality of candidate logical operations. The first target definition, the second target definition, and the first relationship are combined into the first structured data.

5. The method according to claim 4, characterized in that, After the step of receiving input or determining the target logical operation as the first relation from a plurality of candidate logical operations, the method further includes: In response to a fourth operation of selecting a third-level definition, a third-level definition is determined from a plurality of candidate third-level definitions as a third target definition, the third-level definition being nested within the first-level definition; In response to a fifth operation of querying or inputting the fourth-level definition of the basic data, the input is received or the fourth-level definition is determined from a plurality of candidate fourth-level definitions as the fourth target definition; In response to a sixth operation that queries or inputs a second relationship between the third target definition and the fourth target definition, input is received or a target logical operation is determined from a plurality of candidate logical operations as the second relationship; The first structured data, which combines the first target definition, the second target definition, and the first relationship into structured data, includes: The first target definition, the second target definition, the first relationship, the third target definition, the fourth target definition, and the second relationship are combined into the structured first structured data.

6. The method according to claim 5, characterized in that, After the step of combining at least part of the definitions using rules and / or conditions based on structured composition, the method further includes: The first structured data is parsed, and during the parsing process, it is determined whether there is a third-level definition nested within the first-level definition; If a third-level definition nested within the first-level definition exists, then it continues to determine whether another layer definition nested within the third-level definition exists, until no other layer definition with a nesting relationship exists, thus obtaining the basic second structured data; Combine all the basic second structured data to generate the complete second structured data.

7. The method according to claim 4, characterized in that, There are several first target definitions, second target definitions, and first relations, to form several groups of first target definitions, second target definitions, and first relations; The first structured data, which combines the first target definition, the second target definition, and the first relationship into structured data, includes: The plurality of sets of the first target definition, the second target definition, and the first relationship are combined into the structured first structured data.

8. The method according to claim 4, characterized in that, The operation instruction for receiving the combination of definitions of basic data includes: The system can receive operation instructions that combine the definitions of the basic data into basic conditions or event conditions, or receive operation instructions that combine the definitions of the basic data into basic conditions, combination relationships, and event conditions, wherein the combination relationship includes the logical operation relationship between the basic conditions and / or the event conditions. In response to the operation instruction, combining at least a portion of the definitions based on rules and / or conditions of structured composition to obtain first structured data includes: In response to the operation instruction, the basic conditions and event conditions are combined based on the combination relationship to obtain the first structured data.

9. The method according to claim 8, characterized in that, The step of combining the plurality of groups of the first target definition, the second target definition, and the first relationship into structured first structured data includes: The first key-value pair of the basic condition is used as the first target definition of the first group, the second key-value pair of the basic condition is used as the second target definition of the first group, the third key-value pair of the basic condition is used as the first relation of the first group, and the first key-value pair, the second key-value pair, and the third key-value pair of the basic condition are combined to obtain the basic condition.

10. The method according to claim 8, characterized in that, The rules and / or conditions based on structured combination combine at least some of the definitions to obtain the first structured data, including: The fourth key-value pair and the fifth key-value pair of the event condition are combined to obtain the event condition; In this context, the key of the fourth key-value pair is the event name or code, and the value of the fourth key-value pair is the code value that uniquely identifies the event name or code. The key of the fifth key-value pair is the relationship type, and the value of the fifth key-value pair is the state of the event: occurred, did not occur, or occurred sequentially.

11. The method according to claim 4, characterized in that, The operation instruction for receiving the combination of definitions of basic data includes: The system receives operation instructions that combine basic conditions, combination relationships, event conditions, and event sequences into the definition of the basic data. The event sequence is a sequence formed between multiple events corresponding to the definition, and the combination relationship is an operator used to perform logical operations between the basic conditions, the event conditions, and the event sequence. In response to the operation instruction, combining at least a portion of the definitions based on rules and / or conditions of structured composition to obtain first structured data includes: In response to the operation instruction, the basic conditions, the event conditions, and the event sequence are combined based on the combination relationship to obtain the first structured data.

12. The method according to claim 1, characterized in that, The steps for converting the first structured data into the second structured data include: Parse the first structured data and determine whether the first structured data has the stated combination relationship; In response to the existence of the said combination relationship, obtain the basic condition and the event condition associated with the said combination relationship; The basic conditions and the event conditions are parsed, and the combination of the first key-value pair, the second key-value pair, the third key-value pair of the basic conditions, and the key-value pair of the event conditions is used as the query conditions for the second structured data. The data table containing the field name corresponding to the value of the first key-value pair is used as the query source for the second structured data.

13. The method of claim 12, wherein, The bitmap functions include a first bitmap function, a second bitmap function, and a third bitmap function. The step of using the combination of the first key-value pairs, the second key-value pairs, the third key-value pairs, and the key-value pairs of the event conditions as query conditions for the second structured data includes: The first key-value pair, the second key-value pair, and the third key-value pair of the basic conditions are converted into the first condition of the first part of the second structured data. The first part includes the first bitmap function, which is used to output the first query target according to the first condition. The key-value pairs of the event conditions are converted into a second condition of a second part of the second structured data, the second part including a second bitmap function, the second bitmap function being used to output a second query target based on the second condition; The first query target and the second query target are converted into a third part of the second structured data. The third part includes the third bitmap function, which is used to operate on the first query target and the second query target to obtain the query target.

14. A method for filtering user information, characterized in that, The method includes: Obtain the second structured data obtained by any one of claims 1 to 13; The second structured data is processed to obtain user group information from the underlying data.

15. An electronic device, characterized in that, include: Memory and processor The memory is connected to the processor and is used to store program data. The processor is used to execute the program data to implement the method as described in any one of claims 1-13.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program data, which, when executed by a processor, is used to implement the method as described in any one of claims 1-13.

Citation Information

Patent Citations

  • Data query method and device, equipment and storage medium

    CN113420044A

  • Data query method and device, equipment and computer storage medium

    CN113918605A