Data query method, device and equipment based on database bitmap operation and medium

Through the database bitmap operation method, user query conditions are parsed and converted into SQL statements, and the target user data is quickly obtained using bitmap operation functions, solving the problem of inefficient query in the existing technology and reducing system resource usage.

CN120296035APending Publication Date: 2025-07-11HANGZHOU SHUYUN INFORMATION TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510773296.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

When querying multiple user data tables through SQL statements, the prior art occupies database system resources and the query efficiency is inefficient.

Method used

The database bitmap operation method is adopted, and the user query conditions are parsed into data query sub-conditions and logical operators are converted into SQL statements, and the bitmap operation function is used to quickly obtain the target user data.

Benefits of technology

It improves query efficiency, reduces system resource usage, and achieves fast and accurate user data acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120296035A_ABST
    Figure CN120296035A_ABST
Patent Text Reader

Abstract

The invention discloses a data query method and device based on database bitmap operation, equipment and a medium, and the method comprises the steps: obtaining a data query condition, and obtaining a plurality of data query sub-conditions included in the data query condition and logic operators among the data query sub-conditions; converting each data query sub-condition in the plurality of data query sub-conditions and a logic operator between the data query sub-conditions into an SQL statement based on an SQL conversion strategy; obtaining a current bitmap operation function of the SQL statement based on the tag bitmap conversion strategy and obtaining a current bitmap operation value of the SQL statement; and acquiring target user data from the user data table set based on the current bitmap operation value and sending the target user data to the user terminal. According to the embodiment of the invention, the user query condition can be intelligently analyzed into a plurality of data query sub-conditions, then the data query sub-conditions are quickly converted into the SQL statement, the bitmap operation in the SQL statement is executed, the obtained current bitmap operation value can quickly and accurately obtain the target user data from the user data table set, system resources are not occupied, and the query efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data query, and particularly to a data query method, device, equipment and medium based on database bitmap operation. Background Art

[0002] At present, it is a common data storage method to store a large amount of user data through a database. When querying user data in the database, a common method is to write an SQL statement (the full name of SQL is Structured Query Language, which represents a structured query language), and then execute the SQL statement to obtain the corresponding query result. However, if the user database includes multiple user data tables and a large amount of user data, and each user data in each user data table includes multiple data fields (each data field has a corresponding field value), and there are complex association relationships between the user data tables, it is necessary to traverse multiple user data tables to obtain the required target user data through the SQL statement, so as to obtain the corresponding query result. However, the method of querying multiple user data tables by executing an SQL statement not only occupies the system resources of the device where the database is located, but also has low query efficiency. Summary of the Invention

[0003] Embodiments of the present invention provide a data query method, device, equipment and medium based on database bitmap operation, aiming to solve the problems in the prior art that when obtaining multiple user data tables and a large amount of user data through an SQL statement, it not only occupies the system resources of the device where the database is located, but also has low query efficiency.

[0004] In a first aspect, embodiments of the present invention provide a data query method based on database bitmap operation, which includes: In response to a data query instruction sent by a user terminal, obtain a data query condition corresponding to the data query instruction; wherein, the data query condition is text data and can be parsed into a plurality of data query sub-conditions, and the data query sub-condition is a user feature or a user label; Obtain a plurality of data query sub-conditions included in the data query condition, and logical operators between the plurality of data query sub-conditions; Based on a preset SQL conversion strategy, convert each data query sub-condition in the plurality of data query sub-conditions and the logical operators between the plurality of data query sub-conditions into an SQL statement; Based on a preset label bitmap conversion strategy, obtain a current bitmap operation function corresponding to the SQL statement, and obtain a current bitmap operation value of the bitmap operation function; Obtain corresponding target user data from the stored user data dataset based on the current bitmap operation value, and send the target user data to the user terminal.

[0005] In a second aspect, an embodiment of the present invention further provides a data query device based on database bitmap operations, which includes: A data query condition acquisition unit, configured to obtain a data query condition corresponding to the data query instruction in response to the data query instruction sent by the user terminal; wherein, the data query condition is text data and can be parsed into several data query sub-conditions, and the data query sub-condition is a user feature or a user label; A data query condition parsing unit, configured to obtain several data query sub-conditions included in the data query condition, and logical operators between the several data query sub-conditions; An SQL statement conversion unit, configured to convert each data query sub-condition and the logical operators between the several data query sub-conditions into an SQL statement based on a preset SQL conversion strategy; A bitmap operation unit, configured to obtain a current bitmap operation function corresponding to the SQL statement based on a preset label bitmap conversion strategy, and obtain a current bitmap operation value of the bitmap operation function; A target data acquisition unit, configured to obtain corresponding target user data from the stored user data dataset based on the current bitmap operation value, and send the target user data to the user terminal.

[0006] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor. A computer program is stored on the memory, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0007] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium. The computer storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by the processor, the method described in the first aspect can be implemented.

[0008] The embodiments of the present invention provide a data query method, device, equipment and medium based on database bitmap operation. The method includes: in response to a data query instruction sent by a user terminal, obtaining a data query condition corresponding to the data query instruction; wherein the data query condition is text data and can be parsed into a plurality of data query sub-conditions, and the data query sub-conditions are user characteristics or user tags; obtaining the plurality of data query sub-conditions included in the data query condition, and the logical operators between the plurality of data query sub-conditions; based on a preset SQL conversion strategy, converting each data query sub-condition among the plurality of data query sub-conditions and the logical operators between the plurality of data query sub-conditions into an SQL statement; based on a preset tag bitmap conversion strategy, obtaining a current bitmap operation function corresponding to the SQL statement, and obtaining a current bitmap operation value of the bitmap operation function; obtaining corresponding target user data from the stored user data set based on the current bitmap operation value, and sending the target user data to the user terminal. The embodiments of the present invention can intelligently parse user query conditions into a plurality of data query sub-conditions, quickly convert them into SQL statements and execute the bitmap operations therein. The obtained current bitmap operation value can quickly and accurately obtain target user data from the user data set, which not only does not occupy system resources, but also improves the query efficiency. Description of the Drawings

[0009] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0010] Figure 1 It is a schematic diagram of the application scenario of the data query method based on database bitmap operation provided by the embodiments of the present invention; Figure 2 It is a schematic flowchart of the data query method based on database bitmap operation provided by the embodiments of the present invention; Figure 3 It is a schematic sub-flowchart of step S120 in the data query method based on database bitmap operation provided by the embodiments of the present invention; Figure 4 It is a schematic sub-flowchart of step S130 in the data query method based on database bitmap operation provided by the embodiments of the present invention; Figure 5 It is a schematic block diagram of the data query device based on database bitmap operation provided by the embodiments of the present invention; Figure 6 It is a schematic block diagram of the computer equipment provided by the embodiments of the present invention. Detailed Embodiments

[0011] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0012] It should be understood that when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0013] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in this specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.

[0014] It should be further understood that the term "and / or" used in this specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the related listed items, and includes these combinations.

[0015] Please refer to Figure 1 and Figure 2 simultaneously, where Figure 1 is a schematic diagram of the scenario of the data query method based on database bitmap operation according to the embodiment of the present invention, Figure 2 and Figure 1 is a schematic flow diagram of the data query method based on database bitmap operation provided by the embodiment of the present invention. As

[0016] shown in Figure 2 , the data query method based on database bitmap operation provided by the embodiment of the present invention is applied to the server 10, and the user terminal 20 is communicatively connected to the server 10.

[0017] S110. In response to a data query instruction sent by the user terminal, obtain a data query condition corresponding to the data query instruction.

[0018] Wherein, the data query condition is text data and can be parsed into a plurality of data query sub-conditions, and the data query sub-conditions are user characteristics or user labels.

[0019] In this embodiment, the technical solution is described with the server as the execution entity. A user data query platform is deployed in the server. After the user logs in to the user data query platform using the user terminal, in the query condition entry area provided by the user data query platform to the user, after inputting data query information through text entry, voice entry, etc., and performing text extraction and semantic analysis on the data query information as data query conditions, several data query sub-conditions included therein can be obtained. Then, after performing corresponding processing on the several data query sub-conditions included in the data query condition in the data query platform, the target user can be queried in the user database corresponding to the user data query platform.

[0020] In one embodiment, as an embodiment of pre-storing a user label table corresponding to a user data table set in the user data query platform, before step S110, it further includes: Obtain an initial user data table set; For each initial user data table in the initial user data table set, perform the operation of assigning a unique digital ID and a unique binary value to each initial user data in the initial user data table to update and obtain a user data table, and form a user data table set; Obtain multiple initial user labels associated with the field names and field values in the user data table. For each initial user label in the multiple initial user labels, perform the operation of obtaining a set of unique digital IDs corresponding to the initial user label in the user data table set, and perform a bitwise OR operation on the unique binary values of each unique data ID in the set of unique digital IDs corresponding to the initial user label to obtain a bitmap representation value corresponding to the initial user label; Form a user label table from each initial user label in the multiple initial user labels and the corresponding bitmap representation value, and store it in a preset storage area locally.

[0021] In this embodiment, a user database is stored in the server. Multiple initial user data tables are stored in the user database. Each initial user data table stores multiple user data. Each piece of user data includes specific field values corresponding to multiple user fields (such as user ID, gender, age, etc.). Table 1 below shows an initial user data table (only part of the user data is shown and not all): Table 1

[0022] In Table 1 above, each piece of user data includes specific field values corresponding to the three fields of user ID, gender, and age, and does not include a unique digital ID and a unique binary value.

[0023] After that, for each initial user data table in the initial user data table set, a unique digital ID and a unique binary value are assigned to each initial user data in the initial user data table (of course, in specific implementation, a unique decimal value corresponding to the unique binary value can also be assigned to each initial user data). The resulting user data table is shown in Table 2 below (only some user data is shown and not all): Table 2

[0024] As shown in Table 2 above, each piece of user data includes the specific field values corresponding to the six fields of user ID, gender, age, unique digital ID, unique binary value, and unique decimal value (obtained by corresponding conversion from the unique binary value).

[0025] Moreover, Table 2 only shows a part of the user data in one user data table of the user data table set. There are also multiple other user data tables stored in the server. The combination of all field names and their corresponding field values in each user data table can form a field name value set (for example, the field names included in Table 2 are user ID, gender, age, unique digital ID, unique binary value, and unique decimal value. Taking the combination of some field names and their corresponding field values as an example, the two field names of gender and age, together with the field values corresponding to the two field names, can combine to form the following field name values: male gender and 10 years old, male gender and 20 years old, female gender and 10 years old, female gender and 20 years old, etc. These can all be used as one field name value in the field name value set). At least one set of Chinese semantic words of field names and their corresponding field values is selected from the field name value set as the initial user label associated with the field names in the user data table. For example, the Chinese semantic word "male gender" combined by the field name gender and the corresponding field value male in Table 2 can be used as an initial user label, and the Chinese semantic word "young man" combined by the field name age and the corresponding field value 20, as well as the field name gender and the corresponding field value male in Table 2 can be used as an initial user label, etc.

[0026] For each initial user tag, a unique digital ID set corresponding to the initial user tag is obtained from the user data dataset. The bitwise OR operation is performed on the unique binary values of each unique data ID in the unique digital ID set corresponding to the initial user tag to obtain a bitmap representation value corresponding to the initial user tag. For example, the unique binary values corresponding to the unique digital ID set obtained for the male gender in the user data dataset include 1 and 10. The bitwise OR operation is performed on the two binary numbers 1 and 10 to obtain a bitmap representation value of 11 corresponding to the initial user tag of male gender. After obtaining the bitmap representation values of other initial user tags with reference to the above process, a user tag table is formed by each initial user tag and its corresponding bitmap representation value among the multiple initial user tags, as shown in Table 3 below: Table 3

[0027] The user tag table as shown in Table 3 above can be stored in a preset local storage area for the server to perform specific user data queries.

[0028] In an embodiment, as an embodiment of pre-storing a user feature table corresponding to a user data dataset in a user data query platform, before step S110, it further includes: Obtain an initial user data dataset; For each initial user data table in the initial user data dataset, perform operations to assign a unique digital ID and a unique binary value to each initial user data in the initial user data table to update and obtain a user data table, and form a user data dataset; Obtain multiple initial user features associated with the field names and field values in the user data table. For each initial user feature among the multiple initial user features, perform operations to obtain a unique digital ID set corresponding to the initial user feature from the user data dataset, and perform a bitwise OR operation on the unique binary values of each unique data ID in the unique digital ID set corresponding to the initial user feature to obtain a bitmap representation value corresponding to the initial user feature; Form a user feature table from each initial user feature and its corresponding bitmap representation value among the multiple initial user features, and store it in a preset local storage area.

[0029] In this embodiment, a user database is stored in the server. Multiple initial user data tables are stored in the user database. Each initial user data table stores multiple pieces of user data. Each piece of user data includes specific field values corresponding to multiple user fields (such as user ID, gender, age, etc.). At this time, one initial user data table shown in Table 1 above can still be referred to (only part of the user data is shown, not all). In Table 1 above, each piece of user data includes specific field values corresponding to the three fields of user ID, gender, and age, and does not include a unique digital ID and a unique binary value.

[0030] After that, for each initial user data table in the set of initial user data tables, a unique digital ID and a unique binary value are assigned to each piece of initial user data in the initial user data table (of course, in actual implementation, a unique decimal value corresponding to its unique binary value can also be assigned to each piece of initial user data). The obtained user data table is as shown in Table 2 above (only part of the user data is shown, not all). In Table 2 above, each piece of user data includes specific field values corresponding to the six fields of user ID, gender, age, unique digital ID, unique binary value, and unique decimal value (converted from the unique binary value).

[0031] Moreover, Table 2 only shows a part of the user data in one of the user data tables in the set of user data tables, and there are still many other field names not fully shown for each piece of user data displayed in Table 2 (such as field names and their corresponding field values including membership joining channels, membership joining dates, membership binding channels, current membership levels, membership residence provinces, membership residence cities, membership genders, membership birthday months, etc.). There are also multiple other user data tables stored in the server. The combination of field names and corresponding field values included in each user data table can form a field name value set. A group of field names and corresponding field values are selected from the field name value set, and the combination of the original name or synonyms of the field name and the field value is used as the initial user feature associated with the field name in the user data table. For example, taking the field name "membership joining channel" not shown in Table 2 and the corresponding field value "joining through offline channels" as an example, "offline channel membership joining" is used as the initial user feature, etc.

[0032] For each initial user feature, a unique digital ID set corresponding to the initial user feature is obtained from the user data set. The bitmap representation value corresponding to the initial user feature is obtained by performing a bitwise OR operation on the unique binary values of each unique data ID in the unique digital ID set corresponding to the initial user feature. For example, the unique binary values corresponding to the unique digital ID set obtained from the user data set for "member enrollment channel" include 1, 10, and 100. Performing a bitwise OR operation on these three binary numbers 1, 10, and 100, the bitmap representation value corresponding to the initial user feature of "member enrollment channel" is 111. After obtaining the bitmap representation values of other initial user features by referring to the above process, a user label table is composed of each initial user feature and the corresponding bitmap representation value in the multiple initial user features, as shown in Table 4 below: Table 4

[0033] The user feature table as shown in Table 4 above can be stored in a preset storage area locally for the server to perform specific user data queries.

[0034] In one embodiment, as the first embodiment of obtaining multiple initial user labels associated with the field names and field values in the user data table, it includes: Obtain a preset initial user label library; For each initial user label in the initial user label library, perform semantic matching between the initial user label and the field names and corresponding field values in the user data table to obtain the matching result of the initial user label; wherein, the matching result is a successful matching result or an unsuccessful matching result; Summarize the initial user labels with successful matching results to form multiple initial user labels associated with the field names and field values in the user data table.

[0035] In this embodiment, in the server, the operation and maintenance personnel can regularly update and preset an initial user tag library including multiple initial user tags. For example, in the preset initial user tag library, there are initial user tags such as male, female, teenager, youth, male teenager, female teenager, male youth, and female youth. Then, taking the judgment process of whether the initial user tag "male" can be one of the multiple initial user tags associated with the field names and field values in the user data table as an example, the semantics corresponding to "male" includes two keywords, namely gender and male. And in the user data table, there is a field name of gender, and there is a field value of male for the field name of gender. The semantic matching processing result of the initial user tag "male" with the field name and the corresponding field value in the user data table corresponds to a successful matching result, and it can be used as one of the multiple initial user tags associated with the field names and field values in the user data table.

[0036] For another example, the semantics corresponding to "male teenager" includes four keywords, namely gender, male, age, and less than 18 years old. And in the user data table, there is a field name of gender, and there is a field value of male for the field name of gender. At the same time, in the user data table, there is a field name of age, and there are several field values less than 18 years old for the field name of age. The semantic matching processing result of the initial user tag "male teenager" with the field name and the corresponding field value in the user data table corresponds to a successful matching result, and it can also be used as one of the multiple initial user tags associated with the field names and field values in the user data table. It can be seen that through the above method, multiple initial user tags associated with the field names and field values in the user data table can be quickly obtained.

[0037] In one embodiment, as the second embodiment of obtaining multiple initial user tags associated with the field names and field values in the user data table, it includes: Obtain the initial user tag library corresponding to the user tag library acquisition request based on the cloud server, or send a tag acquisition prompt word to the locally deployed large language model and obtain the initial user tag library; For each initial user tag in the initial user tag library, perform semantic matching of the initial user tag with the field names and the corresponding field values in the user data table to obtain the matching result of the initial user tag; where the matching result is a successful matching result or an unsuccessful matching result; Summarize the initial user tags with successful matching results to form multiple initial user tags associated with the field names and field values in the user data table.

[0038] In this embodiment, different from the first embodiment of obtaining a plurality of initial user tags associated with the field names and field values in the user data table, the server does not regularly update and preset an initial user tag library including a plurality of initial user tags by operation and maintenance personnel. Instead, the server can currently send a user tag library acquisition request to the cloud service to obtain the latest initial user tag library, or send a tag acquisition prompt word to the large language model deployed locally on the server to obtain the initial user tag library. After that, the process of determining whether each initial user tag in the initial user tag library can be one of the plurality of initial user tags associated with the field names and field values in the user data table in the server still refers to the specific process in the first embodiment of obtaining a plurality of initial user tags associated with the field names and field values in the user data table, which will not be elaborated here. It can be seen that through the above method, a plurality of initial user tags associated with the field names and field values in the user data table can be obtained quickly and intelligently.

[0039] S120. Obtain several data query sub-conditions included in the data query condition, and the logical operators between the several data query sub-conditions.

[0040] In this embodiment, for example, the data query condition entered by the user in the query condition entry area provided by the user data query platform is "query male teenagers". After semantic parsing, it includes two data query sub-conditions: male gender and age less than 18 years old, and the logical operator between the two data query sub-conditions is "AND". Through the parsing of this query condition, the user's query target can be quickly obtained.

[0041] In one embodiment, as Figure 3 shown, step S120 includes: S121. Obtain the user characteristics or user tags corresponding to each data query sub-condition included in the data query condition; S122. Obtain the logical operators between the data query sub-conditions parsed and extracted from the data query condition.

[0042] In this embodiment, still referring to the above example, the data query condition entered by the user in the query condition entry area provided by the user data query platform is "query male teenagers". After semantic parsing, it includes two data query sub-conditions: male gender and age less than 18 years old, and both of these two data query sub-conditions are user tags, and the logical operator between the two user tags is "AND". The logical operator extracted based on the data query condition in the above example is "AND". In actual implementation, other logical operators such as "OR" may also be extracted.

[0043] Given a number of data query sub - conditions included in the data query condition, and the logical operators between the several data query sub - conditions. Still referring to the above example, if the data query condition is "query male teenagers", it includes two data query sub - conditions, namely "gender is male" and "age less than 18 years old", and the logical operator between the two data query sub - conditions is "AND". At this time, the first data query sub - condition "gender is male" can be converted into the following first SQL statement: SELECT 1, rb_union_agg(rb_build(ARRAY[user_id])) AS rb FROM user_profile WHERE gender = ‘M’; And the second data query sub - condition "age less than 18 years old" is converted into the following second SQL statement: SELECT 2, rb_union_agg(rb_build(ARRAY[user_id])) AS rb FROM user_profile WHERE age<18; Among them, the rb_build() operation is used to convert a given integer array into a bitmap format for subsequent bitmap value calculations; ARRAY[user_id] represents the integer array expression corresponding to the unique digital ID in the user data table; the rb_union_agg() operation is used to perform a union operation on the given bitmap values and return the union calculation result; user_profile represents the user data table.

[0044] The user characteristics or user labels corresponding to the first data query sub - condition are obtained through the first SQL statement, and the user characteristics or user labels corresponding to the second data query sub - condition are obtained through the second SQL statement.

[0045] S130. Based on a preset SQL conversion strategy, convert each data query sub - condition in the several data query sub - conditions and the logical operators between the several data query sub - conditions into SQL statements.

[0046] In one embodiment, as Figure 4 shown, step S130 includes: S131. For each data query sub - condition in the several data query sub - conditions, match the corresponding feature ID or label ID in the corresponding user feature table or user label table according to the user characteristics or user labels of the data query sub - condition; S132. Fill the data query sub - conditions into a preset first query statement template according to the corresponding feature ID or tag ID to obtain a sub - SQL statement corresponding to the data query sub - conditions; S133. Connect the sub - SQL statements corresponding to each data query sub - condition among the several data query sub - conditions through the logical operators between the several data query sub - conditions and fill them into a preset second query statement template to obtain the SQL statement.

[0047] In this embodiment, given several data query sub - conditions included in the data query condition and the logical operators between the several data query sub - conditions. Still referring to the above example, the data query condition is "query male teenagers", which includes two data query sub - conditions: "gender is male" and "age is less than 18 years", and the logical operator between the two data query sub - conditions is "AND". After querying, the tag ID corresponding to the first data query sub - condition "gender is male" is 1, and the tag ID corresponding to the second data query sub - condition "age is less than 18 years" is 2. At this time, combined with the first preset query statement template, we can get: SELECT userbits FROM t_user_tags WHERE tag_id =1; SELECT userbits FROM t_user_tags WHERE tag_id =2; In the above two sub - SQL statements, tag_id =1 corresponds to the tag ID of "gender is male", and tag_id =2 corresponds to the tag ID of "age is less than 18 years"; t_user_tags represents the user tag table; userbits represents the bitmap representation value corresponding to the corresponding tag ID.

[0048] Then fill the above two sub - SQL statements into the second preset query statement template to obtain the following SQL statement: SELECT unnest(rb_to_array( rb_and( (SELECT userbits FROM t_user_tags WHERE tag_id =1), (SELECT userbits FROM t_user_tags WHERE tag_id =2) ) )) as user_id; Among them, the rb_and() operation is an intersection operation for calculating the bitmap values that satisfy multiple condition bits simultaneously; The rb_to_array() operation is used to convert the bitmap operation value after intersection into an array, i.e., the user_id array; The unest() operation is used to expand the array into individual user_ids, with each user_id on a separate line; The resulting SQL statement can then be automatically executed to obtain the corresponding execution result.

[0049] S140. Obtain the current bitmap operation function corresponding to the SQL statement based on a preset tag bitmap conversion strategy, and obtain the current bitmap operation value of the bitmap operation function.

[0050] In this embodiment, after obtaining the SQL statement as described in the above embodiment, the corresponding current bitmap operation functions can be obtained based on the tag bitmap conversion strategy, such as the rb_and() operation function and the rb_to_array() operation function. After these functions are sequentially executed with specific input parameters, the current bitmap operation value can be obtained. For example, the current bitmap value corresponding to tag_id = 1 is 11, and the current bitmap value corresponding to tag_id = 2 is 101. By performing a bitwise AND operation on the two current bitmap values in combination with the logical operator "AND" between several data query sub-conditions, the current bitmap operation value is obtained as 1.

[0051] S150. Obtain the corresponding target user data from the stored user data dataset based on the current bitmap operation value, and send the target user data to the user terminal.

[0052] In this embodiment, since the stored user data dataset includes multiple user data tables, and each user data in each user data table is assigned a unique digital ID and a unique binary value. When determining the user data corresponding to the unique binary value with the current bitmap operation value, this user data can be used as the target user data, and the query and acquisition operation of the target user data can be completed. At this time, the server can send the target user data to the user terminal for data display on the user interaction interface corresponding to the user data query platform logged in on the user terminal.

[0053] It can be seen that the embodiment implementing this method can intelligently parse the user query conditions into several data query sub-conditions, quickly convert them into an SQL statement and execute the bitmap operation therein. The obtained current bitmap operation value can quickly and accurately obtain the target user data from the user data dataset, which not only does not occupy system resources but also improves the query efficiency.

[0054] Figure 5 This is a schematic block diagram of a data query device based on database bitmap operations provided by an embodiment of the present invention. As Figure 5As shown, corresponding to the above data query method based on database bitmap operations, the present invention also provides a data query device 100 based on database bitmap operations. The data query device 100 based on database bitmap operations includes units for executing the above data query method based on database bitmap operations. Please refer to Figure 5 The data query device 100 based on database bitmap operations includes: a data query condition acquisition unit 110, a data query condition parsing unit 120, an SQL statement conversion unit 130, a bitmap operation unit 140, and a target data acquisition unit 150.

[0055] The data query condition acquisition unit 110 is configured to acquire a data query condition corresponding to the data query instruction in response to the data query instruction sent by the user terminal.

[0056] Wherein, the data query condition is text data and can be parsed into a plurality of data query sub-conditions, and the data query sub-conditions are user characteristics or user tags.

[0057] In this embodiment, the technical solution is described with the server as the execution subject. A user data query platform is deployed in the server. When the user logs in to the user data query platform using the user terminal, after inputting data query information in the query condition entry area provided to the user by the user data query platform through text input, voice input, etc., and performing text extraction and semantic parsing on the data query information as the data query condition, a plurality of data query sub-conditions included therein can be obtained. Then, after performing corresponding processing on the plurality of data query sub-conditions included in the data query condition in the data query platform, the target user can be queried in the user database corresponding to the user data query platform.

[0058] In one embodiment, as an embodiment of pre-storing a user tag table corresponding to a user data table set in the user data query platform, the data query device 100 based on database bitmap operations further includes: A first data table set acquisition unit, configured to acquire an initial user data table set; A first data table set update unit, configured to, for each initial user data table in the initial user data table set, execute numbering each initial user data in the initial user data table with a unique digital ID and a unique binary value to update to obtain a user data table, and form a user data table set; The first bitmap representation unit is used to obtain a plurality of initial user tags associated with the field names and field values in the user data table. For each initial user tag among the plurality of initial user tags, a unique digital ID set corresponding to the initial user tag is obtained from the user data table set, and a bitwise OR operation is performed on the unique binary values of each unique data ID in the unique digital ID set corresponding to the initial user tag to obtain a bitmap representation value corresponding to the initial user tag. The user tag table construction unit is used to form a user tag table from each initial user tag among the plurality of initial user tags and the corresponding bitmap representation value, and store it in a preset storage area locally.

[0059] In this embodiment, a user database is stored in the server. A plurality of initial user data tables are stored in the user database. Each initial user data table stores multiple user data. Each piece of user data includes specific field values corresponding to multiple user fields (such as user ID, gender, age, etc.). As shown in Table 1 above, an initial user data table is shown (only part of the user data is shown and not all are presented). In Table 1 above, each piece of user data includes specific field values corresponding to the three fields of user ID, gender, and age, and does not include a unique digital ID and a unique binary value.

[0060] After that, for each initial user data table in the initial user data table set, a unique digital ID and a unique binary value are assigned to each initial user data in the initial user data table (of course, in actual implementation, a unique decimal value corresponding to the unique binary value can also be assigned to each initial user data). The obtained user data table is as shown in Table 2 above (only part of the user data is shown and not all are presented). In Table 2 above, each piece of user data includes specific field values corresponding to the six fields of user ID, gender, age, unique digital ID, unique binary value, and unique decimal value (converted from the unique binary value).

[0061] Moreover, Table 2 only shows a part of the user data in one of the user data tables in the user data table set. There are also multiple other user data tables stored in the server. The combination of the field names and the corresponding field values included in each user data table can form a field name value set (for example, the field names included in Table 2 are user ID, gender, age, unique digital ID, unique binary value, and unique decimal value. Taking the combination of some field names and the corresponding field values as an example, the two field names of gender and age, combined with the field values corresponding to the two field names respectively, can combine the following field name values: male gender and 10 years old, male gender and 20 years old, female gender and 10 years old, female gender and 20 years old, etc. These can all be used as one of the field name values in the field name value set). At least one set of Chinese semantic words of field names and the corresponding field values is selected from the field name value set as the initial user tags associated with the field names in the user data table. For example, the Chinese semantic word "male gender" combined by the field name gender and the corresponding field value male in Table 2 can be used as an initial user tag, and the Chinese semantic word "young man" combined by the field name age and the corresponding field value 20, and the field name gender and the corresponding field value male in Table 2 can be used as an initial user tag, etc.

[0062] For each initial user tag, a set of unique digital ID corresponding to the initial user tag is obtained from the user data table set. The bitwise OR operation is performed on the unique binary values of each unique data ID in the set of unique digital ID corresponding to the initial user tag to obtain a bitmap representation value corresponding to the initial user tag. For example, the unique binary values corresponding to the set of unique digital ID obtained for male gender in the user data table set include 1 and 10. The bitwise OR operation is performed on the two binary numbers 1 and 10 to obtain a bitmap representation value of 11 corresponding to the initial user tag of male gender. After obtaining the bitmap representation values of other initial user tags by referring to the above process, a user tag table is formed by each initial user tag and the corresponding bitmap representation value among the multiple initial user tags, as specifically shown in Table 3 above. The user tag table in Table 3 above can be stored in a preset storage area locally for the server to perform specific user data queries.

[0063] In one embodiment, as an embodiment of pre-storing a user feature table corresponding to the user data table set in the user data query platform, the data query device 100 based on database bitmap operation further includes: A second data table set obtaining unit, configured to obtain an initial user data table set; A second data table set update unit, configured to, for each initial user data table in the initial user data table set, perform operations of assigning a unique digital ID and a unique binary value to each initial user data in the initial user data table, so as to update and obtain a user data table, and form a user data table set; A second bitmap representation value acquisition unit, configured to acquire a plurality of initial user features associated with field names and field values in the user data table, and for each initial user feature among the plurality of initial user features, perform operations of obtaining a set of unique digital IDs corresponding to the initial user feature in the user data table set, and performing a bitwise OR operation on the unique binary values of each unique data ID in the set of unique digital IDs corresponding to the initial user feature, so as to obtain a bitmap representation value corresponding to the initial user feature; A user feature table construction unit, configured to form a user feature table from each initial user feature among the plurality of initial user features and the corresponding bitmap representation value, and store the user feature table in a preset storage area in the local device.

[0064] In this embodiment, a user database is stored in the server. Multiple initial user data tables are stored in the user database. Each initial user data table stores multiple user data. Each piece of user data includes specific field values corresponding to multiple user fields (such as user ID, gender, age, etc.). At this time, reference can still be made to an initial user data table shown in Table 1 above (only part of the user data is shown, and not all are presented). In Table 1 above, each piece of user data includes specific field values corresponding to the three fields of user ID, gender, and age, and does not include a unique digital ID and a unique binary value.

[0065] After that, for each initial user data table in the initial user data table set, a unique digital ID and a unique binary value are assigned to each initial user data in the initial user data table (certainly, in actual implementation, a unique decimal value corresponding to the unique binary value can also be assigned to each initial user data). The obtained user data table is shown in Table 2 above (only part of the user data is shown, and not all are presented). In Table 2 above, each piece of user data includes specific field values corresponding to the six fields of user ID, gender, age, unique digital ID, unique binary value, and unique decimal value (converted from the unique binary value).

[0066] Moreover, Table 2 only shows a part of the user data in one of the user data tables in the user data set, and there are many other field names not fully shown for each piece of user data displayed in Table 2 (such as including field names like membership joining channel, membership joining date, membership binding channel, current membership level, membership residence province, membership residence city, membership gender, membership birthday month, etc. and their corresponding field values). There are also multiple other user data tables stored in the server. The combination of the field names and the corresponding field values included in each user data table can form a field name value set. Select a group of field names and their corresponding field values from the field name value set, and use the combination of the original name or synonyms of the field names and the field values as the initial user characteristics associated with the field names in the user data table. For example, taking the field name "membership joining channel" not shown in Table 2 and its corresponding field value "joining through offline channel" as an example, use "membership joining through offline channel" as the initial user characteristic, etc.

[0067] For each initial user characteristic, obtain the corresponding unique digital ID set in the user data set. By performing a bitwise OR operation on the unique binary values of each unique data ID in the unique digital ID set corresponding to the initial user characteristic, obtain the bitmap representation value corresponding to the initial user characteristic. For example, the unique binary values corresponding to the unique digital ID set obtained for "membership joining channel" in the user data set include 1, 10, and 100. Perform a bitwise OR operation on these three binary numbers 1, 10, and 100 to obtain the bitmap representation value corresponding to the initial user characteristic "membership joining channel" as 111. After obtaining the bitmap representation values of other initial user characteristics by referring to the above process, form a user label table from each initial user characteristic and its corresponding bitmap representation value among the multiple initial user characteristics, as specifically shown in Table 4 above. The user characteristic table as shown in Table 4 above can be stored in a preset storage area locally for the server to perform specific user data queries.

[0068] In one embodiment, as the first embodiment of obtaining multiple initial user labels associated with the field names and field values in the user data table, it includes: Obtain a preset initial user label library; For each initial user label in the initial user label library, perform semantic matching between the initial user label and the field names and corresponding field values in the user data table to obtain the matching result of the initial user label; wherein, the matching result is a successful matching result or an unsuccessful matching result; Summarize the initial user labels with successful matching results to form multiple initial user labels associated with the field names and field values in the user data table.

[0069] In this embodiment, in the server, the operation and maintenance personnel can regularly update and preset an initial user tag library including a plurality of initial user tags. For example, in the preset initial user tag library, there are initial user tags such as male, female, juvenile, young, male juvenile, female juvenile, male young, and female young. Then, taking the judgment process of whether the initial user tag "male" can be one of the multiple initial user tags associated with the field names and field values in the user data table as an example, the semantics corresponding to "male" includes two keywords, namely gender and male. And in the user data table, there is a field name of gender, and the field value of male specifically exists for the field name of gender. The semantic matching processing result of the initial user tag "male" with the field name and the corresponding field value in the user data table corresponds to a successful matching result, and it can be used as one of the multiple initial user tags associated with the field names and field values in the user data table.

[0070] For another example, the semantics corresponding to "male juvenile" includes four keywords, namely gender, male, age, and less than 18 years old. And in the user data table, there is a field name of gender, and the field value of male specifically exists for the field name of gender. At the same time, in the user data table, there is a field name of age, and there are several field values less than 18 years old specifically for the field name of age. The semantic matching processing result of the initial user tag "male juvenile" with the field name and the corresponding field value in the user data table corresponds to a successful matching result, and it can also be used as one of the multiple initial user tags associated with the field names and field values in the user data table. It can be seen that through the above method, multiple initial user tags associated with the field names and field values in the user data table can be quickly obtained.

[0071] In one embodiment, as the second embodiment of obtaining multiple initial user tags associated with the field names and field values in the user data table, it includes: Obtain the initial user tag library corresponding to the user tag library acquisition request based on the cloud server, or send a tag acquisition prompt word to the locally deployed large language model and obtain the initial user tag library; For each initial user tag in the initial user tag library, perform semantic matching of the initial user tag with the field names and the corresponding field values in the user data table to obtain the matching result of the initial user tag; where the matching result is a successful matching result or an unsuccessful matching result; Summarize the initial user tags with successful matching results to form multiple initial user tags associated with the field names and field values in the user data table.

[0072] In this embodiment, different from the first embodiment of obtaining a plurality of initial user tags associated with the field names and field values in the user data table, the server does not periodically update and preset an initial user tag library including a plurality of initial user tags by operation and maintenance personnel. Instead, the server can currently send a user tag library acquisition request to the cloud service to obtain the latest initial user tag library, or send a tag acquisition prompt word to the large language model deployed locally on the server to obtain the initial user tag library. After that, the process of determining whether each initial user tag in the obtained initial user tag library in the server can be one of the plurality of initial user tags associated with the field names and field values in the user data table still refers to the specific process in the first embodiment of obtaining a plurality of initial user tags associated with the field names and field values in the user data table, which will not be elaborated here. It can be seen that through the above method, a plurality of initial user tags associated with the field names and field values in the user data table can be obtained quickly and intelligently.

[0073] The data query condition parsing unit 120 is configured to obtain a plurality of data query sub-conditions included in the data query condition, and logical operators between the plurality of data query sub-conditions.

[0074] In this embodiment, for example, the data query condition input by the user in the query condition input area provided by the user data query platform is "query male teenagers", which after semantic parsing includes two data query sub-conditions: male gender and age less than 18 years old, and the logical operator between the two data query sub-conditions is "and". Through the parsing of this query condition, the user's query target can be quickly obtained.

[0075] In one embodiment, the data query condition parsing unit 120 is specifically configured to: Obtain user features or user tags corresponding to each data query sub-condition included in the data query condition; Obtain logical operators between the data query sub-conditions parsed and extracted from the data query condition.

[0076] In this embodiment, still referring to the above example, the data query condition input by the user in the query condition input area provided by the user data query platform is "query male teenagers", which after semantic parsing includes two data query sub-conditions: male gender and age less than 18 years old, and both of these two data query sub-conditions are user tags, and the logical operator between the two user tags is "and". The logical operator extracted based on the data query condition in the above example is "and", and in specific implementation, other logical operators such as "or" may also be extracted.

[0077] Given several data query sub - conditions included in the said data query condition, and the logical operators between several data query sub - conditions. Still referring to the above example, the data query condition is "query male teenagers", which includes two data query sub - conditions, namely "gender is male" and "age less than 18 years old", and the logical operator between the two data query sub - conditions is "AND". At this time, the first data query sub - condition "gender is male" can be converted into the following first SQL statement: SELECT 1, rb_union_agg(rb_build(ARRAY[user_id])) AS rb FROM user_profile WHERE gender =‘M’; And convert the second data query sub - condition "age less than 18 years old" into the following second SQL statement: SELECT 2, rb_union_agg(rb_build(ARRAY[user_id])) AS rb FROM user_profile WHERE age<18; Among them, the rb_build() operation is used to convert a given integer array into a bitmap format for subsequent bitmap value calculations; ARRAY[user_id] represents the integer array expression corresponding to the unique digital ID in the user data table; the rb_union_agg() operation is used to perform a union operation on the given bitmap values and return the union calculation result; user_profile represents the user data table.

[0078] The user characteristics or user labels corresponding to the first data query sub - condition are obtained through the first SQL statement, and the user characteristics or user labels corresponding to the second data query sub - condition are obtained through the second SQL statement.

[0079] The SQL statement conversion unit 130 is used to convert each data query sub - condition in the said several data query sub - conditions and the logical operators between several data query sub - conditions into SQL statements based on a preset SQL conversion strategy.

[0080] In an embodiment, the SQL statement conversion unit 130 is specifically used for: For each data query sub - condition in the said several data query sub - conditions, according to the user characteristics or user labels of the data query sub - condition, match the corresponding feature ID or label ID in the corresponding user feature table or user label table; Fill the data query sub - conditions into a preset first query statement template according to the corresponding feature ID or tag ID to obtain a sub - SQL statement corresponding to the data query sub - conditions; Connect the sub - SQL statements corresponding to each data query sub - condition in the several data query sub - conditions through the logical operators between the several data query sub - conditions and fill them into a preset second query statement template to obtain the SQL statement.

[0081] In this embodiment, given several data query sub - conditions included in the data query condition and the logical operators between the several data query sub - conditions. Still referring to the above example, the data query condition is "query male teenagers", which includes two data query sub - conditions: "gender is male" and "age is less than 18 years old", and the logical operator between the two data query sub - conditions is "and". After querying, the tag ID corresponding to the first data query sub - condition "gender is male" is 1, and the tag ID corresponding to the second data query sub - condition "age is less than 18 years old" is 2. At this time, combining with the first preset query statement template, we can get: SELECT userbits FROM t_user_tags WHERE tag_id =1; SELECT userbits FROM t_user_tags WHERE tag_id =2; In the above two sub - SQL statements, tag_id =1 corresponds to the tag ID of "gender is male", and tag_id =2 corresponds to the tag ID of "age is less than 18 years old"; t_user_tags represents the user tag table; userbits represents the bitmap representation value corresponding to the corresponding tag ID.

[0082] Then fill the above two sub - SQL statements into the second preset query statement template to obtain the following SQL statement: SELECT unnest(rb_to_array( rb_and( (SELECT userbits FROM t_user_tags WHERE tag_id =1), rb_to_array() operation is used to convert the bitmap operation value after intersection into an array, that is, the user_id array (SELECT userbits FROM t_user_tags WHERE tag_id =2) ) )) as user_id; Among them, the rb_and() operation is an intersection operation for calculating the marked values of multiple conditional bits simultaneously; The rb_to_array() operation is used to convert the bitmap operation value after the intersection into an array, that is, the user_id array; The unest() operation is used to expand the array into individual user_ids, and each user_id occupies one line; The obtained SQL statement can be used to be automatically executed, so as to obtain the corresponding execution result.

[0083] The bitmap operation unit 140 is used to obtain the current bitmap operation function corresponding to the SQL statement based on a preset label bitmap conversion strategy, and obtain the current bitmap operation value of the bitmap operation function.

[0084] In this embodiment, after obtaining the SQL statement as described in the above embodiment, the current bitmap operation function corresponding thereto can be obtained based on the label bitmap conversion strategy, such as the rb_and() operation function and the rb_to_array() operation function. After these functions are sequentially executed in combination with specific input parameters, the current bitmap operation value can be obtained. For example, the current bitmap value corresponding to tag_id = 1 is 11, and the current bitmap value corresponding to tag_id = 2 is 101. By combining the two current bitmap values with the bitwise AND operation corresponding to the logical operator "AND" between several data query sub-conditions, the current bitmap operation value is obtained as 1.

[0085] The target data acquisition unit 150 is used to acquire corresponding target user data from the stored user data dataset based on the current bitmap operation value, and send the target user data to the user terminal.

[0086] In this embodiment, since the stored user data dataset includes multiple user data tables, and each user data of each user data table is assigned a unique digital ID and a unique binary value, when determining the user data corresponding to the unique binary value having the current bitmap operation value, this user data can be used as the target user data, and the query acquisition operation of the target user data can be completed. At this time, the server can send the target user data to the user terminal for data display on the user interaction interface corresponding to the user data query platform logged in by the user terminal.

[0087] It can be seen that implementing the embodiment of this device can intelligently parse the user query conditions into several data query sub-conditions, quickly convert them into SQL statements and execute the bitmap operations therein. The obtained current bitmap operation value can quickly and accurately acquire target user data from the user data dataset, which not only does not occupy system resources, but also improves the query efficiency.

[0088] The above data query device based on database bitmap operations can be implemented in the form of a computer program, which can run on a computer device such as Figure 6 as shown.

[0089] Please refer to Figure 6 , Figure 6 which is a schematic block diagram of a computer device provided by an embodiment of the present invention. This computer device integrates any data query device based on database bitmap operations provided by the embodiments of the present invention.

[0090] Referring to Figure 6 , the computer device 400 includes a processor 402, a memory, and a network interface 405 connected through a system bus 401. Among them, the memory may include a storage medium 403 and an internal memory 404.

[0091] The storage medium 403 can store an operating system 4031 and a computer program 4032. The computer program 4032 includes program instructions, which when executed, can cause the processor 402 to execute a data query method based on database bitmap operations.

[0092] The processor 402 is used to provide computing and control capabilities to support the operation of the entire computer device.

[0093] The internal memory 404 provides an environment for the operation of the computer program 4032 in the storage medium 403. When the computer program 4032 is executed by the processor 402, the processor 402 can be caused to execute the above data query method based on database bitmap operations.

[0094] The network interface 405 is used for network communication with other devices. Those skilled in the art can understand that Figure 6 the structure shown in

[0095] is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.

[0096] It should be understood that in the embodiments of the present invention, the processor 402 may be a central processing unit (CPU), and the processor 402 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0097] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, and the storage medium is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the above method embodiments.

[0098] Therefore, the present invention also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, where the computer program includes program instructions. When the program instructions are executed by a processor, the processor is caused to execute the data query method based on database bitmap operations as described above.

[0099] The storage medium may be various computer-readable storage media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disc that can store program codes.

[0100] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the present invention.

[0101] In several embodiments provided by the present invention, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0102] The steps in the method embodiments of the present invention can be adjusted, combined, and deleted according to actual needs. The units in the device embodiments of the present invention can be combined, divided, and deleted according to actual needs. In addition, the functional units in each embodiment of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.

[0103] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on such an understanding, the technical solution of the present invention, 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. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0104] As described above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A data query method based on database bitmap operation, characterized in that, Including: In response to a data query instruction sent by a user terminal, obtaining a data query condition corresponding to the data query instruction; wherein, the data query condition is text data and can be parsed into a plurality of data query sub-conditions, and the data query sub-conditions are user characteristics or user tags; Obtaining a plurality of data query sub-conditions included in the data query condition, and logical operators between the plurality of data query sub-conditions; Based on a preset SQL conversion strategy, converting each data query sub-condition among the plurality of data query sub-conditions and the logical operators between the plurality of data query sub-conditions into an SQL statement; Based on a preset tag bitmap conversion strategy, obtaining a current bitmap operation function corresponding to the SQL statement, and obtaining a current bitmap operation value of the bitmap operation function; Based on the current bitmap operation value, obtaining corresponding target user data from a stored user data dataset, and sending the target user data to the user terminal.

2. The method according to claim 1, characterized in that, Before the step of, in response to a data query instruction sent by a user terminal, obtaining a data query condition corresponding to the data query instruction, the method further includes: Obtaining an initial user data dataset; For each initial user data table in the initial user data dataset, performing an operation of assigning a unique digital ID and a unique binary value to each initial user data in the initial user data table to update and obtain a user data table, and forming a user data dataset; Obtaining a plurality of initial user tags associated with field names and field values in the user data table, and for each initial user tag among the plurality of initial user tags, performing an operation of obtaining a set of unique digital IDs corresponding to the initial user tag in the user data dataset, and performing a bitwise OR operation on the unique binary values of each unique data ID in the set of unique digital IDs corresponding to the initial user tag to obtain a bitmap representation value corresponding to the initial user tag; Forming a user tag table from each initial user tag among the plurality of initial user tags and the corresponding bitmap representation value, and storing it in a preset storage area locally.

3. The method according to claim 1, wherein Before the step of, in response to a data query instruction sent by a user terminal, obtaining a data query condition corresponding to the data query instruction, the method further includes: Obtaining an initial user data dataset; For each initial user data table in the initial user data dataset, performing an operation of assigning a unique digital ID and a unique binary value to each initial user data in the initial user data table to update and obtain a user data table, and forming a user data dataset; Obtaining a plurality of initial user characteristics associated with field names and field values in the user data table, and for each initial user characteristic among the plurality of initial user characteristics, performing an operation of obtaining a set of unique digital IDs corresponding to the initial user characteristic in the user data dataset, and performing a bitwise OR operation on the unique binary values of each unique data ID in the set of unique digital IDs corresponding to the initial user characteristic to obtain a bitmap representation value corresponding to the initial user characteristic; A user feature table is formed by each initial user feature among the multiple initial user features and the corresponding bitmap representation value, and is stored in a preset storage area locally.

4. The method according to claim 2, wherein The obtaining of multiple initial user labels associated with the field names and field values in the user data table includes: Obtaining a preset initial user label library; For each initial user label in the initial user label library, perform semantic matching of the initial user label with the field names and corresponding field values in the user data table to obtain a matching result of the initial user label; wherein, the matching result is a successful matching result or an unsuccessful matching result; Summarize the initial user labels with successful matching results to form multiple initial user labels associated with the field names and field values in the user data table.

5. The method according to claim 2, wherein The obtaining of multiple initial user labels associated with the field names and field values in the user data table includes: Obtain the initial user label library corresponding to the user label library acquisition request from the cloud server, or send a label acquisition prompt word to the locally deployed large language model and obtain the initial user label library; For each initial user label in the initial user label library, perform semantic matching of the initial user label with the field names and corresponding field values in the user data table to obtain a matching result of the initial user label; wherein, the matching result is a successful matching result or an unsuccessful matching result; Summarize the initial user labels with successful matching results to form multiple initial user labels associated with the field names and field values in the user data table.

6. The method according to claim 1, characterized in that, The obtaining of several data query sub-conditions included in the data query condition, and the logical operators between the several data query sub-conditions includes: Obtain the user features or user labels corresponding to the respective data query sub-conditions included in the data query condition; Obtain the logical operators between the respective data query sub-conditions parsed and extracted from the data query condition.

7. The method according to claim 1, wherein The conversion of each data query sub-condition among the several data query sub-conditions and the logical operators between the several data query sub-conditions into an SQL statement based on a preset SQL conversion strategy includes: For each data query sub-condition among the several data query sub-conditions, match the corresponding feature ID or label ID in the corresponding user feature table or user label table according to the user feature or user label of the data query sub-condition; Fill the data query sub-condition into a preset first query statement template according to the corresponding feature ID or label ID to obtain a sub-SQL statement corresponding to the data query sub-condition; Connect the sub-SQL statements corresponding to each data query sub-condition among the several data query sub-conditions through the logical operators between the several data query sub-conditions and fill them into a preset second query statement template to obtain the SQL statement.

8. A data query device based on database bitmap operation, characterized in that Includes: A data query condition acquisition unit, configured to acquire a data query condition corresponding to the data query instruction in response to the data query instruction sent by the user terminal; wherein, the data query condition is text data and can be parsed into a plurality of data query sub-conditions, and the data query sub-conditions are user characteristics or user tags; A data query condition parsing unit, configured to acquire a plurality of data query sub-conditions included in the data query condition, and logical operators between the plurality of data query sub-conditions; An SQL statement conversion unit, configured to convert each data query sub-condition among the plurality of data query sub-conditions and the logical operators between the plurality of data query sub-conditions into an SQL statement based on a preset SQL conversion strategy; A bitmap operation unit, configured to acquire a current bitmap operation function corresponding to the SQL statement based on a preset label bitmap conversion strategy, and acquire a current bitmap operation value of the bitmap operation function; A target data acquisition unit, configured to acquire corresponding target user data from the stored user data dataset based on the current bitmap operation value, and send the target user data to the user terminal.

9. A computer device, characterized in that, The computer device includes a memory and a processor, and a computer program is stored on the memory. When the processor executes the computer program, the data query method based on database bitmap operation according to any one of claims 1-7 is implemented.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by the processor, the data query method based on database bitmap operation according to any one of claims 1-7 can be implemented.

Citation Information

Patent Citations

  • Data query method and device

    CN113360499A

  • Bitmap-based user data analysis method and device and computer equipment

    CN114328632A

  • Data query method and device, equipment and storage medium

    CN114490656A

  • Data query method and device, equipment, storage medium and program product

    CN118916361A

  • Data type conversion method and device, equipment and medium

    CN119357264A