WO2022262663A1 - 数据处理方法、装置及电子设备 - Google Patents

数据处理方法、装置及电子设备 Download PDF

Info

Publication number
WO2022262663A1
WO2022262663A1 PCT/CN2022/098297 CN2022098297W WO2022262663A1 WO 2022262663 A1 WO2022262663 A1 WO 2022262663A1 CN 2022098297 W CN2022098297 W CN 2022098297W WO 2022262663 A1 WO2022262663 A1 WO 2022262663A1
Authority
WO
WIPO (PCT)
Prior art keywords
bsi
bit
condition
target
attribute value
Prior art date
Application number
PCT/CN2022/098297
Other languages
English (en)
French (fr)
Inventor
徐勋
Original Assignee
维沃移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 维沃移动通信有限公司 filed Critical 维沃移动通信有限公司
Publication of WO2022262663A1 publication Critical patent/WO2022262663A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2237Vectors, bitmaps or matrices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results

Definitions

  • the present application belongs to the technical field of data processing, and in particular relates to a data processing method, device and electronic equipment.
  • bitmap (Bitmap) storage such as compressed bitmap (Roaring Bitmap) storage
  • Roaring Bitmap Roaring Bitmap
  • the purpose of the embodiments of the present application is to provide a data processing method, device and electronic equipment, which can solve the problem that the existing technology cannot adapt to the scene of conditional filtering based on more attribute information of storage objects.
  • the embodiment of the present application provides a data processing method, the method comprising:
  • an embodiment of the present application provides a data processing device, the device comprising:
  • a conditional acquisition module used to acquire data filtering conditions
  • a BSI object acquisition module configured to acquire at least two bit slice index BSI objects associated with the filter condition
  • An operation module configured to perform an arithmetic operation on the attribute values of the at least two bit slice index BSI objects according to the filter conditions, to obtain an operation result that meets the filter conditions;
  • the result display module is used to display the operation result.
  • an embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, and a program or instruction stored in the memory and operable on the processor, and the program or instruction is The processor implements the steps of the method described in the first aspect when executed.
  • an embodiment of the present application provides a readable storage medium, on which a program or an instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented .
  • the embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions, so as to implement the first aspect the method described.
  • an embodiment of the present application provides a computer program product, the program product is stored in a non-volatile storage medium, and the program product is executed by at least one processor to implement the method described in the first aspect A step of.
  • an embodiment of the present application provides a data processing device, including that the device is configured to execute the method as described in the first aspect.
  • the embodiment of the present application it is possible to acquire data filtering conditions, and acquire at least two bit slice index BSI objects associated with the filtering conditions, so that the at least two bit slice index BSI objects are obtained according to the filtering conditions Perform arithmetic operations on the attribute values to obtain the operation results that meet the filter conditions, so as to display the operation results.
  • BSI objects are used to store data, and according to the filter conditions, arithmetic operations can be performed on the attribute values of at least two bit slice index BSI objects associated with the filter conditions, so as to obtain The result of the operation.
  • the embodiments of the present application can perform more types of calculations on the attribute values of the BSI object, thereby adapting to more types of screening. Therefore, the embodiments of the present application can be adapted to perform operations based on more attribute information of the storage object. Scenarios for conditional filtering.
  • FIG. 1 is a flow chart of a data processing method provided in an embodiment of the present application
  • Fig. 2 is the schematic diagram of the process that the preference score of stock is converted into BSI object in the embodiment of the present application;
  • Fig. 3 is a schematic diagram of the process of converting the fund preference score into a BSI object in the embodiment of the application;
  • Fig. 4 is the schematic diagram of calculating bsi1.B1 ⁇ bsi2.B1 in the embodiment of the present application;
  • Fig. 5 is the comparison schematic diagram of bsi1.Bi, bsi2.Bi, Xi, X'i in the embodiment of the present application;
  • Fig. 6 is a structural block diagram of a data processing device provided by an embodiment of the present application.
  • FIG. 7 is a structural block diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 8 is a structural block diagram of another electronic device provided by an embodiment of the present application.
  • bit-sliced indexes (BSI) as follows.
  • BSI bit-slice
  • the id column of the T table is referred to as the user id.
  • B1 indicates whether the id exists in the Not-Null Bitmap, which is 1 if it exists, and 0 if it does not exist;
  • B2 indicates whether the attribute value is a negative sign bitmap, and the positive number is 0, and the negative number is 1;
  • the binary range encoding Bitmap is used to represent the column value.
  • the column value is mapped and converted into the value V of the xth bit of binary, which corresponds to the corresponding id in the Bitmap of B(x+2) in the BSI comparison value.
  • BSI bit length also known as BSI bit depth, represents the number of BSI object Bitmaps, and the bit length in Table 1 is n.
  • the bit length of the BSI attribute value range is the number of Bitmaps used to store attribute values in the BSI Bitmap collection object, excluding the sign bit.
  • the bit length of the BSI attribute value range is: n-2.
  • the BSI attribute value is the value of the G column.
  • BSI base value It is a benchmark value used for numerical mapping in the range coding technology.
  • the original attribute value is mapped into a mapped value through the base value to achieve the effect of compressed storage.
  • the bit length of the attribute value range of BSI is equal to the number of digits of the binary number converted from the decimal result obtained by subtracting the base value from the maximum attribute value of BSI, and the number of digits converted into a binary number from the decimal result obtained by subtracting the base value from the minimum attribute value. The largest number of digits of the two.
  • the values represented by B3-Bn and the sign bit represented by B2 based on the binary range coding can be restored to decimal values, and the BSI attribute value can be obtained by adding the base value.
  • the base value of a BSI object may be half of the sum of the maximum attribute value and the minimum attribute value. It can be understood that the manner of determining the base value is not limited to this.
  • the binary-based range-encoded bit-slice index technology (Base-2 Range-Encoded Bit-Slice Indexes), based on the Bitmap function, can additionally store the attribute value of the object.
  • the BSI storage algorithm is a calculation and storage algorithm that uses multiple sets of Bitmaps to solve massive object data with attribute values. It can realize the range query function of the column attribute value of the object.
  • the embodiment of the present application provides a data processing method, as shown in Figure 1, the method may include the following steps 101 to 104:
  • Step 101 Acquire data filtering conditions.
  • the filtering conditions for obtaining data include:
  • filter conditions of data are obtained.
  • the user can directly enter the filter conditions of the data. For example, if an input box is displayed in the data query interface, the user can input filter conditions in the input box.
  • Step 102 Obtain at least two bit slice index BSI objects associated with the filter condition.
  • the filter condition indicates the BSI object where the data to be acquired resides, that is, the BSI object associated with the filter condition.
  • Step 103 at least two bit slice index BSI objects perform an arithmetic operation on attribute values of the at least two bit slice index BSI objects according to the filter condition, and obtain an operation result that meets the filter condition.
  • the filter condition can be used to indicate that for at least two attribute values of bit slice index BSI objects, judgments are made for greater than, greater than or equal to, less than, less than or equal to, equal to, and not equal to, so as to filter qualified data, or to The attribute values of at least two bit slice index BSI objects are added and subtracted to obtain new attribute values.
  • the attribute values of two BSI objects can be judged and filtered as greater than, greater than or equal to, less than, less than or equal to, equal to, or not equal to, and the attribute values of the two can also be added or subtracted.
  • the new attribute value is calculated to meet the needs of extended filtering and calculation derived from BSI in scenarios such as portrait tags.
  • Step 104 Display the operation result.
  • the filter condition of the data can be obtained, and at least two bit slice index BSI objects associated with the filter condition can be obtained, so that according to the filter condition, the An arithmetic operation is performed on the attribute values of at least two bit slice index BSI objects to obtain an operation result that meets the filter condition, so as to display the operation result.
  • BSI objects are used to store data, and according to the filter conditions, arithmetic operations can be performed on the attribute values of at least two bit slice index BSI objects associated with the filter conditions, so as to obtain The result of the operation.
  • the embodiments of the present application can perform more types of calculations on the attribute values of the BSI object, thereby adapting to more types of screening. Therefore, the embodiments of the present application can be adapted to perform operations based on more attribute information of the storage object. Scenarios for conditional filtering.
  • the at least two bit slice index BSI objects include a first BSI object and a second BSI object, and attribute values of the first BSI object and the second BSI object represent different field values of different target objects ;
  • the screening conditions include at least one of the following conditions:
  • a first condition where the first condition is used to indicate to filter target objects whose attribute values are the same in the first BSI object and the second BSI object;
  • a second condition where the second condition is used to indicate to filter target objects whose attribute values are different in the first BSI object and the second BSI object;
  • a third condition where the third condition is used to indicate to filter target objects whose attribute values in the first BSI object are greater than the attribute values in the second BSI object;
  • a fourth condition where the fourth condition is used to indicate to filter target objects whose attribute values in the first BSI object are greater than or equal to the attribute values in the second BSI object;
  • a fifth condition where the fifth condition is used to indicate to add the attribute values belonging to the same target object in the first BSI object and the second BSI object;
  • the sixth condition is used to indicate to subtract the attribute values belonging to the same target object in the first BSI object and the second BSI object.
  • the first BSI object bsi1 can be used to represent the BSI object of users whose investment and wealth management preferences are stocks
  • the second BSI object bsi2 can be used to represent the BSI objects of users whose investment and wealth management preferences are funds, wherein the preference score is obtained in advance through a preference model score, ranging from 0 to 100.
  • the BSI base value needs to be calculated before converting the preference scores of users 1 to 8 for stocks into bsi1 and the preference scores of users 1 to 8 for funds into bsi2.
  • the base value of bsi1 can be calculated and recorded as base1, and the stock preference scores of users 1 to 8 can be converted to bsi1 according to the base1; the base value of bsi2 can be calculated and recorded as base2, and the stock preference scores of users 1 to 8 can be converted into bsi1; Preference score, converted to bsi2 according to the base2.
  • the bit lengths of bsi1 and bsi2 converted in this way may be different.
  • bit length of the BSI object needs to be the same, then after converting bsi1 and bsi2 according to the above method, it is necessary to compare the bit length of bsi1 and bsi2 with another bit length. Great alignment. Assuming that the bit length of bsi1 is small, recreate a BSI object, convert each Bitmap in bsi1 according to the new base value and bit length, and reassign bsi1 to it. In this way, bsi1 and bsi2 have the same base value and bit length.
  • bsi1 and bsi2 can be converted according to the flow charts in Figure 2 and Figure 3 . That is, each score is subtracted from the base value (ie 41), and then the obtained difference is converted into a binary number, so that the obtained binary number is mapped to B3 to B8 bits of the BSI object. Among them, B3 is the low bit, and B8 is the high bit.
  • arithmetic operations can be performed on the attribute values in bsi1 and bsi2 according to the filter conditions, so as to obtain results that meet the filter conditions. For example, users with the same preference scores for stocks and funds in bsi1 and bsi2 can be screened out; or, users with different preference scores for stocks and funds in bsi1 and bsi2 can be screened out; or, users with different preference scores for stocks and funds can be screened out; In bsi1 and bsi2, the users whose stock preference score is greater than the fund preference score; or, filter out the users whose stock preference score is greater than or equal to the fund preference score in bsi1 and bsi2, or, the same user can calculate The sum or difference of the stock preference score and the fund preference score.
  • the attribute values of the first BSI object and the second BSI object have the same bit length
  • performing an arithmetic operation on the attribute values of the at least two bit slice index BSI objects to obtain an operation result that meets the filter condition includes:
  • n represents the bit length of the first BSI object.
  • the acquisition of target objects whose attribute values are not zero in the first BSI object and the second BSI object, to obtain a first target set includes:
  • the acquisition of the target object with the same i-th binary value in the first BSI object and the second BSI object to obtain the i-th second target set includes:
  • the process of obtaining the intersection of the first target set and the 2nd to nth second target sets includes:
  • the target object corresponding to the position whose value is 1 in the third parameter is determined as the intersection of the first target set and the 2nd to nth second target sets.
  • the calculation formula for filtering target objects with the same attribute value in the first BSI object and the second BSI object is: bsi1.B1 ⁇ bsi2.B1 ⁇ (bsi1.B2 ⁇ bsi2.B2) ⁇ (bsi1.B3 ⁇ bsi2.B3) ⁇ ... ⁇ (bsi1.Bn ⁇ bsi2.Bn), ⁇ means exclusive OR operation.
  • the attribute values of the first BSI object and the second BSI object have the same bit length
  • performing an arithmetic operation on the attribute values of the at least two bit slice index BSI objects to obtain an operation result that meets the filter condition includes:
  • n represents the bit length of the first BSI object.
  • the acquisition of target objects whose attribute values are not zero in the first BSI object and the second BSI object, to obtain a first target set includes:
  • the process of obtaining the union of the 2nd to nth third target sets includes:
  • the target object corresponding to the position where the value of the fifth parameter is 1 is determined as a union set of the second to nth third target sets.
  • the process of obtaining the intersection of the union of the 2nd to nth third target sets and the first target set includes:
  • the target object corresponding to the position where the value of the sixth parameter is 1 is determined as the intersection of the union of the second to nth third target sets and the first target set.
  • the calculation formula for filtering target objects with different attribute values in the first BSI object and the second BSI object is: (bsi1.B1 ⁇ bsi2.B1) ⁇ ((bsi1.B2 xor bsi2.B2) ⁇ (bsi1.B3 xor bsi2 .B3) ⁇ ... ⁇ (bsi1.Bn xor bsi2.Bn)), xor means XOR operation.
  • the intersection of bsi1.B1 ⁇ bsi2.B1 can be calculated first as shown in Figure 4 to obtain the preference for stocks
  • the user with the score and the preference score for the fund (that is, the user whose preference score for the stock and the preference score for the fund is not 0) is recorded as the first user; then, calculate ((bsi1.B2 xor bsi2.B2) ⁇ (bsi1.B3 xor bsi2.B3) ⁇ ... ⁇ (bsi1.B8 xor bsi2.B8)), the users whose preference scores for stocks and funds are different are recorded as the third users.
  • the third users include users who only have preference scores for stocks and users who only have preference scores for funds, it is also necessary to calculate the intersection of the first user and the third user.
  • the attribute values of the first BSI object and the second BSI object have the same bit length
  • performing an arithmetic operation on the attribute values of the at least two bit slice index BSI objects to obtain an operation result that meets the filter condition includes:
  • Bi represents the A set of target objects corresponding to a position with a value of 1 in the i-th bit of a BSI object
  • Ci represents a set of target objects corresponding to a position with a value of 1 in the i-th bit of the second BSI object
  • the second fifth set D2 is calculated, and the second fifth set is converted into a binary representation to obtain two seventh parameters X'2, where B2 represents all The set B2 composed of target objects corresponding to the positions with a value of 1 in the second bit of the first BSI object, C2 represents the set B2 composed of target objects corresponding to the positions with a value of 1 in the second bit of the second BSI object gather;
  • n represents the bit length of the first BSI object.
  • R 1 (bsi1.B1 ⁇ bsi2.B1) ⁇ (P 1 ⁇ (Rlt 1 3 ⁇ bsi1.B2 ⁇ bsi2.B2) ⁇ X'2);
  • Xi is the converted binary number of the set represented by bsi1.Bi minus the difference of the set represented by bsi2.Bi
  • X'i is the converted binary number of the set represented by bsi2.Bi minus the difference of the set represented by bsi1.Bi
  • P 1 is the converted binary number of the set represented by Rgt 1 3 minus the difference set represented by bsi1.B2
  • X'2 is the difference between the set represented by bsi2.B2 minus the set represented by bsi1.B1
  • Set converted binary numbers, i is an integer from 3 to n.
  • the i-th binary value of bsi1.Bi is greater than the i-th binary value of bsi2.Bi
  • the target object of is: the converted binary number obtained by subtracting the set represented by bsi1.Bi from the set represented by bsi2.Bi, denoted as Xi.
  • the result of the target object whose attribute value in bsi1 is greater than the attribute value in bsi2 includes two parts: the result of the high-order attribute meeting the condition, and the part with the same high-order attribute value but the attribute value of this row meets the greater than, the intersection of the two parts is Cut off eligible results from traversing up to this row.
  • the qualified result for the i-th position is: Xi ⁇ Y(i+1), that is, Xi ⁇ Y(i+1) means that the n to i+1 positions are the same, and the bsi1 on the i-th position is greater than bsi2 object.
  • P 1 in Table 2 indicates that bsi1 is a positive number and the attribute value of bsi1 is greater than that of bsi2.
  • R 1 (bsi1.B1 ⁇ bsi2.B1) ⁇ (P 1 ⁇ (Rlt 1 3 ⁇ bsi1.B2 ⁇ bsi2.B2) ⁇ X2)
  • user 4 and user 6 are users who have both stock and fund tags and whose stock preference score is greater than the fund preference score.
  • the attribute values of the first BSI object and the second BSI object have the same bit length
  • the filter condition includes the fourth condition
  • performing an arithmetic operation on the attribute values of the at least two bit slice index BSI objects to obtain an operation result that meets the filter condition includes:
  • Bi represents the A set of target objects corresponding to a position with a value of 1 in the i-th bit of a BSI object
  • Ci represents a set of target objects corresponding to a position with a value of 1 in the i-th bit of the second BSI object
  • the i-th fourteenth parameter Wi is obtained, wherein bsi1.Bi represents the i-th bit of the first BSI object, bsi2. Bi represents the i-th bit of the second BSI object;
  • the second fifth set D2 is calculated, and the second fifth set is converted into a binary representation to obtain two seventh parameters X'2, where B2 represents all The set B2 composed of target objects corresponding to the positions with a value of 1 in the second bit of the first BSI object, C2 represents the set B2 composed of target objects corresponding to the positions with a value of 1 in the second bit of the second BSI object gather;
  • n represents the bit length of the first BSI object.
  • R 2 (bsi1.B1 ⁇ bsi2.B1) ⁇ (P 2 ⁇ (Rlt 2 3 ⁇ bsi1.B2 ⁇ bsi2.B2) ⁇ X'2);
  • Xi is the converted binary number of the set represented by bsi1.Bi minus the difference of the set represented by bsi2.Bi
  • X'i is the converted binary number of the set represented by bsi2.Bi minus the difference of the set represented by bsi1.Bi
  • P 2 is the converted binary number of the set represented by Rgt 2 3 minus the difference set represented by bsi1.B2
  • X'2 is the difference between the set represented by bsi1.B2 minus the set represented by bsi2.B2
  • Set converted binary numbers, i is an integer from 3 to n.
  • the calculation formula for determining the target object whose attribute value in the first BSI object is smaller than the attribute value in the second BSI object is as follows:
  • R 3 (bsi1.B1 ⁇ bsi2.B1) ⁇ (P 3 ⁇ (Rlt 3 3 ⁇ bsi1.B2 ⁇ bsi2.B2));
  • Xi is the converted binary number of the set represented by bsi1.Bi minus the difference of the set represented by bsi2.Bi
  • X'i is the converted binary number of the set represented by bsi2.Bi minus the difference of the set represented by bsi1.
  • Bi P 1 is the binary number converted from the difference of the set represented by Rgt 1 3 minus the set represented by bsi1.B2, and i is an integer from 3 to n.
  • the calculation formula for determining the target object whose attribute value in the first BSI object is less than or equal to the attribute value in the second BSI object is as follows:
  • R 4 (bsi1.B1 ⁇ bsi2.B1) ⁇ (P 4 ⁇ (Rlt 2 3 ⁇ bsi1.B2 ⁇ bsi2.B2));
  • Xi is the converted binary number of the set represented by bsi1.Bi minus the difference of the set represented by bsi2.Bi
  • X'i is the converted binary number of the set represented by bsi2.Bi minus the difference of the set represented by bsi1.
  • Bi P 4 is the binary number converted from the difference set of the set represented by Rgt 4 3 minus the set represented by bsi1.B2, and i is an integer from 3 to n.
  • the logical operation of binary numbers can be used to realize the attribute values of the same target object in different BSI objects The comparison of each binary bit. In this way, operations can be performed directly based on the binary form of the attribute value of the BSI object, and the operation result that meets the filtering conditions can be obtained, and the operation process is simpler.
  • the attribute values of the first BSI object and the second BSI object have the same bit length
  • performing an arithmetic operation on the attribute values of the at least two bit slice index BSI objects to obtain an operation result that meets the filter condition includes:
  • a sum of the first attribute value and the second attribute value is determined according to the first symbol and the third bitmap.
  • the first attribute value of the kth target object in the first BSI object needs to be compared with the kth target object
  • the positive and negative conditions of the second attribute value of the object in the second BSI object are processed separately, which can be specifically described in the following situations 1 to 3.
  • the process of adding the attribute values belonging to the kth target object in the first BSI object and the second BSI object is specific Can be as follows:
  • the eighteenth preset formula and the nineteenth preset formula calculate bsi3.k.B2 to bsi3.k.B(n+1), and combine bsi3.k.B2 and bsi3.k.B(n+1) to bsi3. k.
  • the binary number composed of B3 is determined as the sum of the first attribute value and the second attribute value;
  • the first attribute value is an attribute value belonging to the k-th target object in the first BSI object
  • the second attribute value is an attribute value belonging to the k-th target object in the second BSI object attribute value
  • the eighteenth preset formula is:
  • the nineteenth preset formula is:
  • bsi1.k.Bi represents the i-th bit of the first attribute value
  • bsi2.k.Bi represents the i-th bit of the second attribute value
  • Q 1 3 ⁇ Q 1 n represent the above-mentioned first bitmap
  • the result of bsi1.k.Bi xor bsi2.k.Bi represents the second bitmap
  • bsi3.k. B3 to bsi3.kB(n+1) represent the above-mentioned third bitmap
  • bsi3.k.B2 represents the first sign of the sum of the first attribute value and the second attribute value.
  • Table 8 The process of calculating the sum of user 6's preference score for stocks and preference scores for funds
  • the process of adding the attribute values belonging to the kth target object in the first BSI object and the second BSI object can specifically be Can be described as follows:
  • Q 2 i N 1 i ⁇ (bsi1.k.Bi ⁇ bsi2.k.Bi ⁇ Q 2 (i-1)), calculate Q 2 4 to Q 2 n, wherein, i ⁇ [4,n] and is an integer, N 1 i is the converted binary number of the difference between the set represented by bsi2.k.Bi and the set represented by bsi1.k.Bi, Q 2 3 is represented by bsi2.k.B3 The converted binary number of the difference between the set represented by bsi1.k.B3 and the set represented by bsi1.k.B3;
  • the twenty-first preset formula is:
  • the twenty-third preset formula is:
  • the first attribute value is an attribute value of the k-th target object in the first BSI object
  • the second attribute value is an attribute of the k-th target object in the second BSI object value
  • bsi1.k.Bi represents the i-th bit of the first attribute value
  • bsi2.k.Bi represents the i-th bit of the second attribute value
  • Q 2 3 ⁇ Q 2 n represent the above-mentioned first bitmap, when i takes every integer from 3 to n, the result of bsi1.k.Bi xor bsi2.k.Bi represents the second bitmap, bsi3.k. B3 to bsi3.k.Bn represent the third bitmap above, and bsi3.k.B2 represents the first sign of the sum of the first attribute value and the second attribute value.
  • the process of adding the attribute values belonging to the kth target object in the first BSI object and the second BSI object can specifically be Can be described as follows:
  • the twenty-fifth preset formula is:
  • the first attribute value is an attribute value of the k-th target object in the first BSI object
  • the second attribute value is an attribute of the k-th target object in the second BSI object value
  • bsi1.k.Bi represents the i-th bit of the first attribute value
  • bsi2.k.Bi represents the i-th bit of the second attribute value
  • Q 3 3 ⁇ Q 3 n represent the above-mentioned first bitmap, when i takes every integer from 3 to n, the result of bsi1.k.Bi xor bsi2.k.Bi represents the second bitmap, bsi3.k. B3 to bsi3.k.Bn represent the third bitmap above, and bsi3.k.B2 represents the first sign of the sum of the first attribute value and the second attribute value.
  • Table 10 The process of calculating the sum of user 2's preference score for stocks and preference score for funds
  • the attribute values of the first BSI object and the second BSI object have the same bit length
  • performing an arithmetic operation on the attribute values of the at least two bit slice index BSI objects to obtain an operation result that meets the filter condition includes:
  • a difference between the first attribute value and the second attribute value is determined based on the second symbol and the fifth bitmap.
  • the first attribute value of the kth target object in the first BSI object is also required, and the kth
  • the positive and negative conditions of the second attribute value of the target object in the second BSI object are processed separately, which can be specifically described in the following situations 4 to 6.
  • the process of subtracting the attribute value belonging to the kth target object in the first BSI object and the second BSI object can be specifically as follows Said:
  • Q 2 i N 1 i ⁇ (bsi1.k.Bi ⁇ bsi2.k.Bi ⁇ Q 2 (i-1)), calculate Q 2 4 to Q 2 n, wherein, i ⁇ [4,n] and is an integer, N 1 i is the converted binary number of the difference between the set represented by bsi2.k.Bi and the set represented by bsi1.k.Bi, Q 2 3 is represented by bsi2.k.B3 The converted binary number of the difference between the set represented by bsi1.k.B3 and the set represented by bsi1.k.B3;
  • the twenty-first preset formula is:
  • the twenty-third preset formula is:
  • the first attribute value is an attribute value of the k-th target object in the first BSI object
  • the second attribute value is an attribute of the k-th target object in the second BSI object value
  • bsi1.k.Bi represents the i-th bit of the first attribute value
  • bsi2.k.Bi represents the i-th bit of the second attribute value
  • Q 2 3 ⁇ Q 2 n represent the above-mentioned fourth bitmap, when i takes every integer from 3 to n, the result of bsi1.k.Bi xor bsi2.k.Bi represents the second bitmap, bsi3.k. B3 to bsi3.k.Bn represent the above-mentioned fifth bitmap, and bsi3.k.B2 represents the second sign of the subtraction of the first attribute value and the second attribute value.
  • the subtraction is first considered when the attribute value of bsi1 is greater than the attribute value of bsi2.
  • bsi3 the result of the subtraction of Bi of bsi1 and bsi2, two Bitmaps will be generated.
  • Q 2 i the result of the Bitmap representing the need to borrow one row i+1
  • bsi3.kB(i+1) the result of the Bitmap representing the need to borrow one row i+1.
  • N 1 i is the set represented by bsi2.k.Bi and the set represented by bsi1.k.Bi
  • the converted binary number of the difference between the sets represented by Q 2 3 is the converted binary number of the difference between the set represented by bsi2.k.B3 and the set represented by bsi1.k.B3;
  • N 1 i means bsi2.k.Bi attribute value is greater than bsi1.k.Bi, bsi1.k.Bi ⁇ bsi2.k.Bi ⁇ Q 2 (i-1) represents bsi1.k.Bi and bsi2.k.
  • bsi3.k.Bi represents the value left in the bit after the binary value is subtracted. It consists of several situations: 0-0-0 is 0; 1-0-0 is 1; 0-1-1 is (- 1,0), this row only keeps the result of the row 0; 0-1-0 gets (-1,1); 1-1-0 gets 0; 1-1-1 gets (-1,1).
  • the subtraction of two positive numbers is equivalent to the addition of a positive number and a negative number. Therefore, the first attribute value and the second attribute value are both positive numbers, and the formula for subtracting them is, The formula for adding the first attribute value to a positive number and the second attribute value to a negative number and adding them is the same.
  • the specific calculation process please refer to the above-mentioned case two.
  • the process of subtracting the attribute value belonging to the kth target object in the first BSI object and the second BSI object can be specifically as follows Said:
  • the twenty-fifth preset formula is:
  • the first attribute value is an attribute value of the k-th target object in the first BSI object
  • the second attribute value is an attribute of the k-th target object in the second BSI object value
  • bsi1.k.Bi represents the i-th bit of the first attribute value
  • bsi2.k.Bi represents the i-th bit of the second attribute value
  • Q 3 3 ⁇ Q 3 n represent the fourth bitmap mentioned above, when i takes every integer from 3 to n, the result of bsi1.k.Bi xor bsi2.k.Bi represents the second bitmap, bsi3.k. B3 to bsi3.k.Bn represent the above-mentioned fifth bitmap, and bsi3.k.B2 represents the second sign of the subtraction of the first attribute value and the second attribute value.
  • the subtraction of two negative numbers is equivalent to the addition of a negative number and a positive number. Therefore, the first attribute value and the second attribute value are both negative numbers, and the formula for subtracting them is the same as the aforementioned
  • the first attribute value is a negative number
  • the second attribute value is a positive number
  • the calculation formula for adding them is the same.
  • the specific calculation process please refer to the above-mentioned case three.
  • the first BSI object and the process of subtracting the attribute values belonging to the kth target object in the second BSI object can be specifically described as follows:
  • the eighteenth preset formula and the twenty-sixth preset formula calculate bsi3.k.B2 to bsi3.k.B(n+1), and combine bsi3.k.B2 and bsi3.k.B(n+1) to bsi3 .k.
  • the binary number composed of B3 is determined as the sum of the first attribute value and the second attribute value;
  • the first attribute value is an attribute value belonging to the k-th target object in the first BSI object
  • the second attribute value is an attribute value belonging to the k-th target object in the second BSI object attribute value
  • the eighteenth preset formula is:
  • the twenty-sixth preset formula is:
  • bsi1.k.Bi represents the i-th bit of the first attribute value
  • bsi2.k.Bi represents the i-th bit of the second attribute value
  • Q 1 3 ⁇ Q 1 n represent the above-mentioned fourth bitmap
  • bsi1.k.Bi xor bsi2.k.Bi represents the second bitmap
  • bsi3.k. B3 to bsi3.kB(n+1) represent the above-mentioned fifth bitmap
  • bsi3.k.B2 represents the second sign of the subtraction of the first attribute value and the second attribute value.
  • first attribute value and second attribute value include the 2nd to n bits, wherein, the 2nd bit belongs to the sign bit, the 3rd to n bits represent the absolute value, and the 3rd bit belongs to the low bit, and the 3rd bit belongs to the low bit, and the The n bit belongs to the high bit, that is, the 2nd bit and the nth to 3rd bits form a complete binary number.
  • the logical operation of binary numbers is used to realize the attribute values of the same target object in different BSI objects addition or subtraction of .
  • operations can be performed directly based on the binary form of the attribute value of the BSI object, and the operation result that meets the filtering conditions can be obtained, and the operation process is simpler.
  • an arithmetic operation is performed on the attribute values of the at least two bit slice index BSI objects, and after an operation result meeting the filter condition is obtained, a new BSI object may also be created for the operation result.
  • the BSI object participating in the operation can also be converted according to the bit length of the BSI object of the operation result.
  • the embodiment of the present application can realize the comparison of attribute values of BSI objects, for example, support greater than, greater than or equal to, less than, less than or equal to, equal to, not equal to judgment filtering of two BSI object attribute values; and, It can realize the addition and subtraction of the attribute value of the BSI object to obtain a new attribute value. Therefore, the embodiment of the present application can be applied to the demand scenario where BSI object storage and attribute value comparison calculation are performed simultaneously.
  • the target circle selection results can be obtained by comparing and filtering the attribute values of the two tags during the selection process.
  • the attribute is a value expressed in long type, which can be a certain fixed attribute, or some behavior statistics, XOR algorithm model scoring, etc. According to the meanings represented by different labels and attribute values, there will be many uses Scenes.
  • the attribute value comparison calculation method of the BSI object can also play a certain role.
  • location-based services Location Based Services, LBS
  • LBS Location Based Services
  • the complex event processing (CEP) capability using real-time stream computing such as the complex event processing structured query language (cep sql) using the source stream processing framework (flink).
  • CEP complex event processing
  • the disadvantages of this method are: since the real-time stream computing CEP scheme is based on the time window for statistics, when the time span between target events is large, it will greatly affect performance and increase resource utilization; and, because real-time computing needs to be arranged in advance tasks, so it cannot well meet the flexible and changeable analysis requirements. For example, if the above-mentioned points of a, b, c, and d change, the existing layout tasks cannot be well satisfied.
  • Steps H1 to H are as follows:
  • Step H1 Use LBS to query the deduplication records of vehicles passing through areas a, b, c, and d in the time period from T1 to T2, and use BSI to construct the deduplication target id results of each point.
  • the attribute value of BSI is the value of the passing point Time information, time information is assumed to be represented by Long type data in ddhhmm (day hour minute) format, accurate to minute granularity, and bsi1, bsi2, bsi3, bsi4 are obtained respectively, and they have the same bit length time attribute.
  • Step H2 Carry out sequential intersection of the first row of Bitmaps of BSI objects at each point, that is, (bsi1.B1 ⁇ bsi2.B1 ⁇ bsi3.B1 ⁇ bsi3.B1), and name the intersected Bitmap B1.
  • Step H3 Apply the "method of screening attribute values greater than" to points b, c, and d, respectively calculate the result Rb of the attribute value of bsi2 greater than bsi1, obtain the result Rc of the attribute value of bsi3 greater than bsi2, and obtain the result Rc of the attribute value of bsi4 greater than The result of bsi3 Rd.
  • the calculation process of this scheme avoids the traversal of line-by-line passing records, but is transformed into the union calculation of several sets of overall RoaringBitmaps, especially the comparison and filtering of passing time is also converted into several sets by comparing BSI attribute values
  • the intersection and complement operation of RoaringBitmap can greatly improve the calculation performance.
  • the BSI object attribute value comparison calculation can also be applied to some systems with similar indexing and calculation scenarios based on this feature, and used as specific data storage and indexing.
  • the execution subject may be a data processing device, or a control module in the data processing device for executing the data processing method.
  • the data processing device provided in the embodiment of the present application is described by taking the execution of the data processing method by the data processing device as an example.
  • the embodiment of the present application also provides a data processing device, which includes:
  • BSI object acquisition module 602 configured to acquire at least two bit slice index BSI objects associated with the filter condition
  • An operation module 603 configured to perform arithmetic operations on the attribute values of the at least two bit slice index BSI objects according to the filtering conditions, and obtain an operation result that meets the filtering conditions;
  • the result display module 604 is configured to display the operation result.
  • the at least two bit slice index BSI objects include a first BSI object and a second BSI object, and attribute values of the first BSI object and the second BSI object represent different field values of different target objects ;
  • the screening conditions include at least one of the following conditions:
  • a first condition where the first condition is used to indicate to filter target objects whose attribute values are the same in the first BSI object and the second BSI object;
  • a second condition where the second condition is used to indicate to filter target objects whose attribute values are different in the first BSI object and the second BSI object;
  • a third condition where the third condition is used to indicate to filter target objects whose attribute values in the first BSI object are greater than the attribute values in the second BSI object;
  • a fourth condition where the fourth condition is used to indicate to filter target objects whose attribute values in the first BSI object are greater than or equal to the attribute values in the second BSI object;
  • a fifth condition where the fifth condition is used to indicate to add the attribute values belonging to the same target object in the first BSI object and the second BSI object;
  • the sixth condition is used to indicate to subtract the attribute values belonging to the same target object in the first BSI object and the second BSI object.
  • the attribute values of the first BSI object and the second BSI object have the same bit length
  • the operation module 603 is specifically configured to:
  • n represents the bit length of the first BSI object.
  • the attribute values of the first BSI object and the second BSI object have the same bit length
  • the operation module 603 is specifically used for:
  • n represents the bit length of the first BSI object.
  • the attribute values of the first BSI object and the second BSI object have the same bit length
  • the operation module 603 is specifically configured to:
  • a sum of the first attribute value and the second attribute value is determined according to the first symbol and the third bitmap.
  • the attribute values of the first BSI object and the second BSI object have the same bit length
  • the operation module 603 is specifically configured to:
  • the i-th bit of the second bit map is XORed with the i-1 bit of the fourth bit map to obtain the i-th bit of the fifth bit map;
  • a difference between the first attribute value and the second attribute value is determined based on the second symbol and the fifth bitmap.
  • the data processing device in the embodiment of the present application can obtain the filter condition of data, and obtain at least two bit slice index BSI objects associated with the filter condition, so that according to the filter condition, the at least An arithmetic operation is performed on the attribute values of two bit slice index BSI objects to obtain an operation result that meets the filter condition, so as to display the operation result.
  • the data processing device in the embodiment of the present application uses BSI objects to store data, and can perform arithmetic operations on the attribute values of at least two bit slice index BSI objects associated with the filter conditions according to the filter conditions, so that Obtain the operation results that meet the filter conditions.
  • the data processing device in the embodiment of the present application can perform more types of operations on the attribute values of the BSI object, thereby adapting to more types of screening. Therefore, the data processing device in the embodiment of the present application can adapt to storage-based More attribute information of the object to do conditional filtering scenarios.
  • the data processing device in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal.
  • the device may be a mobile electronic device or a non-mobile electronic device.
  • the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-
  • Non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), TV TV (television, TV), teller machine or self-service machine, etc., which are not specifically limited in this embodiment of the present application.
  • the data processing device in the embodiment of the present application may be a device with an operating system.
  • the operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.
  • the data processing device provided in the embodiment of the present application can implement various processes implemented in the method embodiment in FIG. 1 , and details are not repeated here to avoid repetition.
  • the embodiment of the present application further provides an electronic device 700, including a processor 701, a memory 702, and programs or instructions stored in the memory 702 and operable on the processor 701,
  • an electronic device 700 including a processor 701, a memory 702, and programs or instructions stored in the memory 702 and operable on the processor 701,
  • the program or instruction is executed by the processor 701
  • each process of the above-mentioned data processing method embodiment can be achieved, and the same technical effect can be achieved. To avoid repetition, details are not repeated here.
  • the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
  • FIG. 8 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
  • the electronic device 800 includes, but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, and a processor 810, etc. part.
  • the electronic device 800 can also include a power supply (such as a battery) for supplying power to various components, and the power supply can be logically connected to the processor 810 through the power management system, so that the management of charging, discharging, and function can be realized through the power management system. Consumption management and other functions.
  • a power supply such as a battery
  • the structure of the electronic device shown in FIG. 8 does not constitute a limitation to the electronic device.
  • the electronic device may include more or fewer components than shown in the figure, or combine some components, or arrange different components, and details will not be repeated here. .
  • the processor 810 is used to acquire data filtering conditions; acquire at least two bit slice index BSI objects associated with the filtering conditions; according to the filtering conditions, attribute the at least two bit slice index BSI objects Perform arithmetic operations on the values to obtain the operation results that meet the filter conditions;
  • the display unit 806 is configured to display the operation result.
  • the electronic device in the embodiment of the present application can obtain the filter condition of data, and obtain at least two bit slice index BSI objects associated with the filter condition, so that according to the filter condition, the at least two Arithmetic operations are performed on the attribute values of the ones slice index BSI object to obtain the operation results that meet the filter conditions, so as to display the operation results.
  • the electronic device in the embodiment of the present application uses BSI objects to store data, and can perform arithmetic operations on the attribute values of at least two bit slice index BSI objects associated with the filter conditions according to the filter conditions, so as to obtain Operation results that match the filter criteria.
  • the electronic device in the embodiment of the present application can perform more types of operations on the attribute values of the BSI object, thereby adapting to more types of screening. Therefore, the data processing device in the embodiment of the present application can adapt to More attribute information for conditional filtering scenarios.
  • the input unit 804 may include a graphics processor (Graphics Processing Unit, GPU) 8041 and a microphone 8042, and the graphics processor 8041 is used for the image capture device (such as the image data of the still picture or video obtained by the camera) for processing.
  • the display unit 806 may include a display panel 8061, and the display panel 8061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the user input unit 807 includes a touch panel 8071 and other input devices 8072 .
  • the touch panel 8071 is also called a touch screen.
  • the touch panel 8071 may include two parts, a touch detection device and a touch controller.
  • Other input devices 8072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, and joysticks, which will not be repeated here.
  • Memory 809 may be used to store software programs as well as various data, including but not limited to application programs and operating systems.
  • the processor 810 may integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems, user interfaces, and application programs, and the modem processor mainly processes wireless communications. It can be understood that the foregoing modem processor may not be integrated into the processor 810 .
  • the embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, each process of the above-mentioned data processing method embodiment is realized, and the same To avoid repetition, the technical effects will not be repeated here.
  • the processor is the processor in the electronic device described in the above embodiments.
  • the readable storage medium includes computer readable storage medium, such as computer read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
  • the embodiment of the present application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the above data processing method embodiment Each process can achieve the same technical effect, so in order to avoid repetition, it will not be repeated here.
  • chips mentioned in the embodiments of the present application may also be called system-on-chip, system-on-chip, system-on-a-chip, or system-on-a-chip.
  • the term “comprising”, “comprising” or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase “comprising a " does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element.
  • the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions are performed, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

Abstract

本申请公开了一种数据处理方法、装置及电子设备,属于计算机技术领域。该方法包括:获取数据的筛选条件;获取与所述筛选条件相关联的至少两个位切片索引BSI对象;根据所述筛选条件,对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果;显示所述运算结果。

Description

数据处理方法、装置及电子设备
相关申请的交叉引用
本申请要求在2021年06月15日提交中国专利局、申请号为202110661779.1、名称为“数据处理方法、装置及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于数据处理技术领域,具体涉及一种数据处理方法、装置及电子设备。
背景技术
目前,对海量数据(亿级以上)的查找、去重,交差并补、异或计算有很多的应用场景。例如用户画像标签系统,需要存储标签的人群,以及标签之间的交差并补,以进行人群圈选;或者,一些大数据存储引擎,也需要考虑这方面的索引技术来对海量数据做查找去重。
其中,这些场景往往具有数据量大、对计算性能要求高的特点。但是,这些场景通常要求不能占用太大的存储空间。
而目前可以采用位图(Bitmap)存储,例如压缩位图(Roaring Bitmap)存储来解决上述场景的问题。即上述用户画像系统可以采用RoaringBitmap存储人群的画像标签,并做人群圈选;某些开源的大数据存储引擎的底层索引也采用RoaringBitmap存储技术。
但是,由于RoaringBitmap的存储特性,其只能表达简单的对象存在性信息,无法适应基于存储对象的更多属性信息来做条件过滤的场景。
发明内容
本申请实施例的目的是提供一种数据处理方法、装置及电子设备,能够解决现有技术无法适应基于存储对象的更多属性信息来做条件过滤的场景的问题。
第一方面,本申请实施例提供了一种数据处理方法,该方法包括:
获取数据的筛选条件;
获取与所述筛选条件相关联的至少两个位切片索引BSI对象;
根据所述筛选条件,对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果;
显示所述运算结果。
第二方面,本申请实施例提供了一种数据处理装置,所述装置包括:
条件获取模块,用于获取数据的筛选条件;
BSI对象获取模块,用于获取与所述筛选条件相关联的至少两个位切片索引BSI对象;
运算模块,用于根据所述筛选条件,对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果;
结果显示模块,用于显示所述运算结果。
第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的方法的步骤。
第四方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法的步骤。
第五方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法。
第六方面,本申请实施例提供了一种计算机程序产品,所述程序产品被存储在非易失的存储介质中,所述程序产品被至少一个处理器执行以实现第一方面所述的方法的步骤。
第七方面,本申请实施例提供了一种数据处理装置,包括所述装置被配置成用于执行如第一方面所述的方法。
在本申请实施例中,能够获取数据的筛选条件,并获取与该筛选条件相关联的至少两个位切片索引BSI对象,从而根据所述筛选条件,对所述至少两个位切片索引BSI对象的属性值进行算术运算,以获得符合筛选条件的运算结果,从而显示该运算结果。由此可见,本申请的实施例,采用BSI对象存储数据,并可以根据筛选条件,对于该筛选条件相关联的至少两个位切片索引BSI对象的属性值进行算术运算处理,从而获得符合筛选条件的运算结果。即本申请的实施例,可以对BSI对象的属性值进行更多种类的运算,从而适应于更多种类的筛选,因此,本申请的实施例,可以适应基于存储对象的更多属性信息来做条件过滤的场景。
附图说明
图1是本申请实施例提供的一种数据处理方法的流程图;
图2是本申请实施例中对股票的偏好得分转换为BSI对象的过程示意 图;
图3是本申请实施例中对基金的偏好得分转换为BSI对象的过程示意图;
图4是本申请实施例中计算bsi1.B1∩bsi2.B1的示意图;
图5是本申请实施例中bsi1.Bi、bsi2.Bi、Xi、X’i对比示意图;
图6是本申请实施例提供的数据处理装置的结构框图;
图7是本申请实施例提供的一种电子设备的结构框图;
图8是本申请实施例提供的另一种电子设备的结构框图。
具体实施例
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。
此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的数据处理方法进行详细地说明。
其中,为了便于对本申请实施例的理解,下面首先对位切片索引(Bit-sliced indexes,BSI),进行如下介绍。
假设有一张表T,有一个代表对象实例id的列,以及多个代表对象实例的不同字段属性值列,那么对于某一个数值属性列G,可以用一个BSI对象来表示,即BSI是定义为使用多个Bitmap组成的一个集合,用于存储T表id列和G列的关系和值数据。其中,BSI中的每个独立的位图Bitmap称为T表C列的位切片(bit-slice),Bitmap存储的数据是由BSI的编码策略决定的。
例如将T表的id列采用用户id来代称。参考表1,B1表示id是否存在的Not-Null的Bitmap,存在为1,不存在为0;B2表示属性值是否负数的符号位Bitmap,正数为0,负数为1;B3~Bn是采用二进制范围编码 Bitmap用于代表列值,对于某个用户id,其列值进行映射后转换成二进制的第x位的值V,对应BSI对照中的B(x+2)的Bitmap中的对应id的值。
表1 BSI对象示例
Figure PCTCN2022098297-appb-000001
其中,BSI位长:也称之为BSI bit depth,代表BSI对象Bitmap的数量,在表1中位长为n。
BSI属性值范围位长,即为BSI的Bitmap集合对象中用于存储属性值的Bitmap的数量,不包括符号位。在表1中BSI属性值范围位长为:n-2。
对于BSI属性值,假设BSI定义为存储T表id列和G列的关系和值数据,则BSI属性值即为G列值。
BSI base值:是一个在范围编码的技术中用于数值映射的基准值,原始属性值通过base值映射成一个映射值,达到压缩存储的效果。BSI的属性值范围位长等于BSI的最大属性值减去base值得到的十进制结果转换成的二进制数的位数,与最小属性值减去base值得到的十进制结果转换成二进制数的位数,二者中的最大位数。其中,例如在表1中可以由基于二进制范围编码的B3~Bn所代表的值和B2所代表的符号位还原为十进制数值,再加上base值即可以得到BSI属性值。其中,一个BSI对象的base值,可以是最大属性值与最小属性值之和的二分之一。可以理解的是,base值的确定方式并不局限于此。
由上述可知,基于二进制的范围编码位切片索引技术(Base-2 Range-Encoded Bit-Slice Indexes),在Bitmap功能基础上,可以额外存储对象的属性值。
另外,目前对于BSI对象,可以对对象的属性值做指定的范围条件查询。例如,在画像标签系统中,有两个标签U1和U2,为便于理解假设U1 和U2分别代表不同应用程序的用户标签,它们有一个属性J,代表用户月启动应用的次数,则可以通过BSI“查询月启动次数在[5,10]之间的用户”。
由上述可知,BSI存储算法是一种使用多组Bitmap来解决海量带属性值的对象数据的计算和存储算法,除了常见的对象交、差、并、异或等存在性关系计算能力外,还能够实现对对象的列属性值的范围查询功能。
本申请的实施例提供了一种数据处理方法,如图1所示,该方法可以包括以下步骤101至104:
步骤101:获取数据的筛选条件。
可选的,所述获取数据的筛选条件包括:
接收第一输入;
响应于所述第一输入,获取数据的筛选条件。
即用户可以直接输入数据的筛选条件。例如在数据的查询界面中显示用输入框,则用户可以在该输入框中输入筛选条件。
步骤102:获取与所述筛选条件相关联的至少两个位切片索引BSI对象。
其中,筛选条件指示所需获取的数据所处的BSI对象,即为与该筛选条件相关联的BSI对象。
步骤103:至少两个位切片索引BSI对象根据所述筛选条件,对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果。
其中,所述筛选条件可以用于指示针对至少两个位切片索引BSI对象的属性值,进行大于、大于等于、小于、小于等于、等于、不等于进行判断,以筛选符合条件的数据,或者对至少两个位切片索引BSI对象的属性值进行加、减计算得到新的属性值。
由此可知,本申请的实施例,可以对两个BSI对象的属性值,进行大于、大于等于、小于、小于等于、等于、不等于的判断过滤,也可以对两者属性值进行加、减计算得到新的属性值,从而可以满足诸如画像标签等场景中对BSI衍生的扩展过滤和计算的需求场景。
步骤104:显示所述运算结果。
由上述步骤101至104可知,在本申请实施例中,能够获取数据的筛选条件,并获取与该筛选条件相关联的至少两个位切片索引BSI对象,从而根据所述筛选条件,对所述至少两个位切片索引BSI对象的属性值进行算术运算,以获得符合筛选条件的运算结果,从而显示该运算结果。由此 可见,本申请的实施例,采用BSI对象存储数据,并可以根据筛选条件,对于该筛选条件相关联的至少两个位切片索引BSI对象的属性值进行算术运算处理,从而获得符合筛选条件的运算结果。即本申请的实施例,可以对BSI对象的属性值进行更多种类的运算,从而适应于更多种类的筛选,因此,本申请的实施例,可以适应基于存储对象的更多属性信息来做条件过滤的场景。
可选的,所述至少两个位切片索引BSI对象包括第一BSI对象和第二BSI对象,所述第一BSI对象和所述第二BSI对象的属性值表示不同目标对象的不同字段取值;
所述筛选条件包括如下条件中的至少一个:
第一条件,所述第一条件用于指示筛选在所述第一BSI对象和所述第二BSI对象中属性值相同的目标对象;
第二条件,所述第二条件用于指示筛选在所述第一BSI对象和所述第二BSI对象中属性值不同的目标对象;
第三条件,所述第三条件用于指示筛选在所述第一BSI对象中的属性值大于在所述第二BSI对象中的属性值的目标对象;
第四条件,所述第四条件用于指示筛选在所述第一BSI对象中的属性值大于或等于在所述第二BSI对象中的属性值的目标对象;
第五条件,所述第五条件用于指示将所述第一BSI对象和所述第二BSI对象中属于同一目标对象的属性值相加;
第六条件,所述第五条件用于指示将所述第一BSI对象和所述第二BSI对象中属于同一目标对象的属性值相减。
例如存在用户1至8对股票的偏好得分,以及对基金的偏好得分,则可以将用户1至8的偏好得分转换为一个BSI对象,将用户1至8对基金的偏好得分转换为另一个BSI对象。即可以采用第一BSI对象bsi1代表投资理财偏好为股票的用户的BSI对象,采用第二BSI对象bsi2代表投资理财偏好为基金的用户的BSI对象,其中,所述偏好得分是预先通过偏好模型获得的得分,得分从0~100。
其中,在将用户1至8对股票的偏好得分转换为bsi1,将用户1至8对基金的偏好得分转换为bsi2之前,需要计算BSI base值。例如可以计算bsi1的base值,记为base1,并将用户1至8对股票的偏好得分,按照该base1转换为bsi1;计算bsi2的base值,记为base2,并将用户1至8对股票的偏好得分,按照该base2转换为bsi2。但是,此种方式转换得到的bsi1 和bsi2的位长可能会不相同。而在对BSI对象的属性值进行运算的过程中,需要BSI对象的位长相同,则按照上述方式转换得到bsi1和bsi2之后,还需要将bsi1和bsi2位长较小的按另一个位长较大的对齐。假设bsi1的位长较小,则重新创建一个BSI对象,对bsi1中的每个Bitmap按新的base值和位长进行转换,并将bsi1重新赋值为它。这样bsi1和bsi2就有一样的base值和位长。
或者,可以在初始构建bsi1和bsi2对象的时候就考虑基于同样的位长来创建。例如图2中所示的对股票的偏好得分,以及图3中所示的对基金的偏好得分中,最大值和最小值之和的二分之一为(80+3)/2=41.5,则bsi1和bsi2对象初始构建过程可以采用相同的base值:41。
另外,确定出base值之后,则可以按照图2和图3的流程转换得到bsi1和bsi2。即将每一个得分分别减去base值(即41),然后将得到的差转换为二进制数,从而将得到的二进制数映射为BSI对象的B3至B8位。其中,B3为低位,B8为高位。
此外,得到bsi1和bsi2之后,则可以根据筛选条件对bsi1和bsi2中的属性值进行算术运算,从而得到符合筛选条件的结果。例如可以筛选出bsi1和bsi2中对股票的偏好得分和对基金的偏好得分相同的用户;或者,筛选出bsi1和bsi2中对股票的偏好得分和对基金的偏好得分不同的用户;或者,筛选出bsi1和bsi2中对股票的偏好得分大于对基金的偏好得分的用户;或者,筛选出bsi1和bsi2中对股票的偏好得分大于或等于对基金的偏好得分的用户,或者,可以计算同一个用户对股票偏好得分和对基金偏好得分的和或差。
可选的,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
在所述筛选条件包括所述第一条件的情况下,所述对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果,包括:
获取在所述第一BSI对象和所述第二BSI对象中属性值均不为零的目标对象,得到第一目标集合;
在i取2至n中的每一个整数时,获取在所述第一BSI对象和所述第二BSI对象中第i位二进制值相同的目标对象,得到第i个第二目标集合;
将所述第一目标集合、第2至第n个第二目标集合的交集中包括的目标对象,确定为符合所述第一条件的目标对象;
其中,n表示所述第一BSI对象的位长。
可选的,所述获取在所述第一BSI对象和所述第二BSI对象中属性值均不为零的目标对象,得到第一目标集合,包括:
根据第一预设公式bsi1.B1∩bsi2.B1=Z,计算第一参数Z,其中,bsi1.B1表示所述第一BSI对象的第一位,bsi2.B1表示所述第二BSI对象的第一位;
将所述第一参数Z中取值为1的位置对应的目标对象保存至第一目标集合中。
可选的,所述获取在所述第一BSI对象和所述第二BSI对象中第i位二进制值相同的目标对象,得到第i个第二目标集合,包括:
根据第二预设公式bsi1.Bi⊙bsi2.Bi=Hi,计算第i个第二参数Hi,其中,bsi1.Bi表示所述第一BSI对象的第i位,bsi2.Bi表示所述第二BSI对象的第i位;
将第i个第二参数Hi中取值为1的位置对应的目标对象,保存至第i个第二目标集合中。
可选的,获取所述第一目标集合、第2至第n个第二目标集合的交集的过程包括:
对所述第一参数,以及第2至n个所述第二参数进行逻辑与运算,得到第三参数;
将所述第三参数中取值为1的位置对应的目标对象,确定为所述第一目标集合、第2至第n个第二目标集合的交集。
由上述可知,在本申请的实施例中,在筛选属性值相同的目标对象时,需要对第一BSI对象和第二BSI对象从B2~Bn的Bitmap进行同或运算,得到代表属性值相同的用户的Bitmap1,然后再用交集用户(即第一BSI对象和第二BSI对象的B 1的交集)与Bitmap1再进行交集即可。即筛选第一BSI对象和第二BSI对象中属性值相同的目标对象的计算公式为:bsi1.B1∩bsi2.B1∩(bsi1.B2⊙bsi2.B2)∩(bsi1.B3⊙bsi2.B3)∩...∩(bsi1.Bn⊙bsi2.Bn),⊙表示同或运算。
例如筛选出图2中所示的bsi1和图3中所示的bsi2中属性值相同的用户时,可以首先如图4所示计算bsi1.B1∩bsi2.B1,得到存在对股票的偏好得分和对基金的偏好得分的用户(即对股票的偏好得分和对基金的偏好得分均不为0的用户),记为第一用户;然后,计算(bsi1.B2⊙bsi2.B2)∩(bsi1.B3⊙bsi2.B3)∩...∩(bsi1.B8⊙bsi2.B8),得到对股票的偏好得 分和对基金的偏好得分相同的用户,记为第二用户。其中,由于第二用户中包括对股票的偏好得分和对基金的偏好得分都为0的用户,因此,还需要计算第一用户和第二用户的交集。
可选的,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
在所述筛选条件包括所述第二条件的情况下,所述对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果,包括:
获取在所述第一BSI对象中和所述第二BSI对象中属性值均不为零的目标对象,得到第一目标集合;
在i取2至n中的每一个整数时,获取在所述第一BSI对象和所述第二BSI对象中第i位二进制值不同的目标对象,得到第i个第三目标集合;
获取第2至第n个第三目标集合的并集;
将第2至第n个第三目标集合的并集与所述第一目标集合的交集包括的目标对象,确定为符合所述第二条件的目标对象;
其中,n表示所述第一BSI对象的位长。
可选的,所述获取在所述第一BSI对象和所述第二BSI对象中属性值均不为零的目标对象,得到第一目标集合,包括:
根据第一预设公式bsi1.B1∩bsi2.B1=Z,计算第一参数Z,其中,bsi1.B1表示所述第一BSI对象的第一位,bsi2.B1表示所述第二BSI对象的第一位;
将所述第一参数Z中取值为1的位置对应的目标对象保存至第一目标集合中。
可选的,获取在所述第一BSI对象和所述第二BSI对象中第i位二进制值不同的目标对象,得到第i个第三目标集合,包括:
根据第三预设公式bsi1.Bi xor bsi2.Bi=Li,计算第i个第四参数Li,其中,bsi1.Bi表示所述第一BSI对象的第i位,bsi2.Bi表示所述第二BSI对象的第i位;
将第i个第四参数Li中取值为1的位置对应的目标对象,保存至第i个第三目标集合中。
可选的,获取第2至第n个第三目标集合的并集的过程,包括:
对第2至n个所述第四参数进行逻辑或运算,得到第五参数;
将所述第五参数中取值为1的位置对应的目标对象,确定为第2至第n 个第三目标集合的并集。
可选的,获取第2至第n个第三目标集合的并集与所述第一目标集合的交集的过程,包括:
对所述第一参数和所述第五参数进行逻辑与运算,得到第六参数;
将所述第六参数中取值为1的位置对应的目标对象,确定为第2至第n个第三目标集合的并集与所述第一目标集合的交集。
由上述可知,在本申请的实施例中,在筛选属性值不同的目标对象时,需要对第一BSI对象和第二BSI对象从B2~Bn的Bitmap进行异或运算,得到代表属性值不同的用户的Bitmap2,然后再用交集用户(即第一BSI对象和第二BSI对象的B 1的交集)与Bitmap2再进行交集即可。即筛选第一BSI对象和第二BSI对象中属性值不同的目标对象的计算公式为:(bsi1.B1∩bsi2.B1)∩((bsi1.B2 xor bsi2.B2)∪(bsi1.B3 xor bsi2.B3)∪...∪(bsi1.Bn xor bsi2.Bn)),xor表示异或运算。
例如筛选出图2中所示的bsi1和图3中所示的bsi2中属性值不同的用户时,可以首先如图4所示计算bsi1.B1∩bsi2.B1的交集,得到存在对股票的偏好得分和对基金的偏好得分的用户(即对股票的偏好得分和对基金的偏好得分均不为0的用户),记为第一用户;然后,计算((bsi1.B2 xor bsi2.B2)∪(bsi1.B3 xor bsi2.B3)∪...∪(bsi1.B8 xor bsi2.B8)),得到对股票的偏好得分和对基金的偏好得分不同的用户,记为第三用户。其中,由于第三用户中包括只存在对股票的偏好得分的用户,以及只存在对基金的偏好得分的用户,因此,还需要计算第一用户和第三用户的交集。
可选的,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
在所述筛选条件包括所述第三条件的情况下,所述对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果,包括:
在i取3至n中的每一个整数时,执行如下过程:
根据第四预设公式Bi-Ci=Ei,计算第i个第一集合Di,并将第i个第一集合转换为二进制表示形式,得到i个第七参数Xi,其中,Bi表示所述第一BSI对象的第i位中取值为1的位置对应的目标对象组成的集合,Ci表示第二BSI对象的第i位中取值为1的位置对应的目标对象组成的集合;
根据第五预设公式Ci-Bi=Di,计算第i个第二集合Ei,并将第i个第二集合转换为二进制表示形式,得到第i个第八参数X’i;
根据第六预设公式Yi=(bsi1.Bi⊙bsi2.Bi)∩Y(i+1),计算第i个第九参数Yi,其中,Yn=bsi1.Bn⊙bsi2.Bn,bsi1.Bi表示所述第一BSI对象的第i位,bsi2.Bi表示所述第二BSI对象的第i位;
根据第七预设公式Rgt 1i=Rgt 1(i+1)∪(Xi∩Y(i+1))以及Rgt 1n=Xn,计算第十参数Rgt 13;
根据第八预设公式F 1-G=S 1,计算第三集合S 1,并将所述第三集合转换为二进制表示形式,得到第十一参数P 1,其中,F 1为Rgt 13表示的集合,G为bsi1.B2表示的集合;
根据第九预设公式Rlt 1i=Rlt 1(i+1)∪(X’i∩Y(i+1))以及Rlt 1n=X’n,计算第十二参数Rlt 13;
根据第十预设公式C2–B2=D2,计算第2个第五集合D2,并将第2个第五集合转换为二进制表示形式,得到2个第七参数X’2,其中,B2表示所述第一BSI对象的第2位中取值为1的位置对应的目标对象组成的集合B2,C2表示所述第二BSI对象的第2位中取值为1的位置对应的目标对象组成的集合;
根据第十一预设公式R 1=(bsi1.B1∩bsi2.B1)∩(P 1∪(Rlt 13∩bsi1.B2∩bsi2.B2)∪X’2),计算第十三参数R 1,并将所述第十三参数中取值为1的位置对应的目标对象,确定为符合所述第三条件的目标对象;
其中,n表示所述第一BSI对象的位长。
由此可知,用于确定在第一BSI对象中的属性值大于在第二BSI对象中的属性值的目标对象的计算公式如下所示:
Yi=(bsi1.Bi⊙bsi2.Bi)∩Y(i+1),其中,Yn=bsi1.Bn⊙bsi2.Bn;
Rgt 1i=Rgt 1(i+1)∪(Xi∩Y(i+1)),其中,Rgt 1n=Xn;
Rlt 1i=Rlt 1(i+1)∪(X’i∩Y(i+1)),其中,Rlt 1n=X’n;
R 1=(bsi1.B1∩bsi2.B1)∩(P 1∪(Rlt 13∩bsi1.B2∩bsi2.B2)∪X’2);
其中,Xi为bsi1.Bi表示的集合减去bsi2.Bi表示的集合的差集转换后的二进制数,X’i为bsi2.Bi表示的集合减去bsi1.Bi表示的集合的差集转换后的二进制数,P 1为Rgt 13表示的集合减去bsi1.B2表示的集合的差集转换后的二进制数,X’2为bsi2.B2表示的集合减去bsi1.B1表示的集合的差集转换后的二进制数,i为3至n的整数。
假设bsi1和bsi2中的属性值均为正数,对于B3~Bn的任意一个Bi,3<=i<=n,bsi1.Bi的第i位二进制值大于bsi2.Bi的第i位的二进制值的目标 对象为:bsi1.Bi表示的集合减去bsi2.Bi表示的集合的差转换后的二进制数,记为Xi。
同时,对循环各位计算过程而言,高位二进制值满足大于条件的情况下,可以跳过低位二进制比较结果;但若高位二进制值相同,则需要比较剩余的低位的二进制值。因此,bsi1中的属性值大于在bsi2中的属性值的目标对象的结果包括两部分:高位已经满足条件的结果,以及高位属性值相同但该行属性值符合大于的部分,两部分交集即为截止遍历至该行的符合条件的结果。
因此,需要同时记录下bsi1和bsi2在遍历至第i位时,二进制值相同的用户Yi=(bsi1.Bi⊙bsi2.Bi)∩Y(i+1),其中Yn为bsi1.Bn⊙bsi2.Bn。因而,对于第i位符合条件的结果为:Xi∩Y(i+1),即Xi∩Y(i+1)表示第n至i+1位相同,且第i位上bsi1大于bsi2的目标对象。
因此,i从n-1循环递减到3,根据公式Rgt 1i=Rgt 1(i+1)∪(Xi∩Y(i+1))以及Rgt 1n=Xn,得到的Rgt 13即表示bsi1中的属性值大于在bsi2中的属性值的目标对象。
此处需要说明的是,上述以bsi1和bsi2中的属性值均为正数的情况,介绍了筛选bsi1中的属性值大于在bsi2中的属性值的目标对象的过程。而如果将属性值为负数的情况也考虑进来,bsi1的属性值大于bsi2的属性值的各种情况,具体可如下表2所示。
表2 bsi1的属性值大于bsi2的属性值的情况
Figure PCTCN2022098297-appb-000002
其中,表2中的P 1表示bsi1为正数且bsi1的属性值大于bsi2的用户。
假设R 1表示bsi1的属性值大于bsi2的属性值的用户,则考虑属性值正负情况下,R 1应该是上述表2中所示的各种情况的并集与(bsi1.B1∩bsi2.B1)的交集,即R 1=(bsi1.B1∩bsi2.B1)∩(P 1∪(Rlt∩bsi1.B2∩bsi2.B2)∪X’2)。
示例性的,以图2所示的bsi1和图3所示的bsi2为例,筛选对股票的偏好得分大于对基金的偏好得分的用户的计算过程如下所述:
首先,在i取值为3至8时,分别计算bsi2.Bi表示的集合减去bsi1.Bi表示的集合的差集,并转换为二进制数,记为Xi;计算bsi1.Bi表示的集合减去bsi2.Bi表示的集合的差集,并转换为二进制数,记为X’i;其中,bsi1.Bi、bsi2.Bi、Xi、X’i对比示意图如图5所示。
其次,根据公式Yi=(bsi1.Bi⊙bsi2.Bi)∩Y(i+1),可以得到Y3至Y8的结果,如表3所示;
表3 Y3至Y8的结果
  用户1 用户2 用户3 用户4 用户5 用户6 用户7 用户8
Y3 0 0 0 0 0 0 0 0
Y4 0 0 0 0 1 0 0 0
Y5 0 0 0 0 1 0 0 0
Y6 0 0 0 0 1 0 1 0
Y7 0 1 0 1 1 0 1 0
Y8 0 1 1 1 1 0 1 1
再次,根据公式Rgt 1i=Rgt 1(i+1)∪(Xi∩Y(i+1))以及Rgt 1n=Xn,可以计算得到Rgt 18至Rgt 13,如表4所示;
表4 Rgt 18至Rgt 13的结果
  用户1 用户2 用户3 用户4 用户5 用户6 用户7 用户8
Rgt 13 1 1 1 0 1 1 0 0
Rgt 14 1 1 1 0 0 1 0 0
Rgt 15 1 1 1 0 0 1 0 0
Rgt 16 1 1 1 0 0 1 0 0
Rgt 17 1 0 1 0 0 1 0 0
Rgt 18 1 0 0 0 0 1 0 0
再次,计算Rgt 13表示的集合减去bsi1.B2表示的集合得到的差转换为二进制数,记为P 1=00001100;
再次,根据Rlt 1i=Rlt 1(i+1)∪(X’i∩Y(i+1))以及Rlt 1n=X’n,可以计算得到Rlt 18至Rlt 13,如表5所示;
表5 Rlt 18至Rlt 13的结果
  用户1 用户2 用户3 用户4 用户5 用户6 用户7 用户8
Rlt 13 0 0 0 1 1 0 1 1
Rlt 14 0 0 0 1 0 0 1 1
Rlt 15 0 0 0 1 0 0 1 1
Rlt 16 0 0 0 1 0 0 0 1
Rlt 17 0 0 0 0 0 0 0 1
Rlt 18 0 0 0 0 0 0 0 0
再次,计算Rlt 13∩bsi1.B2∩bsi2.B2的结果,如下表6所示;
表6 Rlt 13∩bsi1.B2∩bsi2.B2的结果
Figure PCTCN2022098297-appb-000003
再次,根据公式R 1=(bsi1.B1∩bsi2.B1)∩(P 1∪(Rlt 13∩bsi1.B2∩bsi2.B2)∪ X2),计算R 1的结果,如表7所示。
表7 R 1的结果
Figure PCTCN2022098297-appb-000004
即用户4和用户6为同时有股票和基金标签且股票偏好得分大于基金偏好得分的用户。
可选的,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
在所述筛选条件包括所述第四条件的情况下,所述对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果,包括:
在i取3至n中的每一个整数时,执行如下过程:
根据第四预设公式Bi-Ci=Ei,计算第i个第一集合Di,并将第i个第一集合转换为二进制表示形式,得到i个第七参数Xi,其中,Bi表示所述第一BSI对象的第i位中取值为1的位置对应的目标对象组成的集合,Ci表示第二BSI对象的第i位中取值为1的位置对应的目标对象组成的集合;
根据第五预设公式Ci-Bi=Di,计算第i个第二集合Ei,并将第i个第二集合转换为二进制表示形式,得到第i个第八参数X’i;
根据第十二预设公式Xi∪(bsi2.Bi⊙bsi1.Bi)=Wi,得到第i个第十四参数Wi,其中,bsi1.Bi表示所述第一BSI对象的第i位,bsi2.Bi表示所述第二BSI对象的第i位;
根据第十三预设公式X’i∪(bsi2.Bi⊙bsi1.Bi)=W’i,得到第i个第十五参数W’i;
根据第六预设公式Yi=(bsi1.Bi⊙bsi2.Bi)∩Y(i+1),计算第i个第九参数Yi,其中,Yn=bsi1.Bn⊙bsi2.Bn;
根据第十四预设公式Rgt 2i=Rgt 2(i+1)∪(Wi∩Y(i+1))以及Rgt 2n=Wn, 计算第十六参数Rgt 23;
根据第十五预设公式F 2-G 2=S 2,计算第四集合S 2,并将所述第四集合转换为二进制表示形式,得到第十七参数P 2,其中,F 2为Rgt 23表示的集合,G为bsi1.B2表示的集合;
根据第十六预设公式Rlt 2i=Rlt 2(i+1)∪(W’i∩Y(i+1))以及Rlt 2n=W’n,计算第十八参数Rlt 23;
根据第十预设公式C2–B2=D2,计算第2个第五集合D2,并将第2个第五集合转换为二进制表示形式,得到2个第七参数X’2,其中,B2表示所述第一BSI对象的第2位中取值为1的位置对应的目标对象组成的集合B2,C2表示所述第二BSI对象的第2位中取值为1的位置对应的目标对象组成的集合;
根据第十七预设公式R 2=(bsi1.B1∩bsi2.B1)∩(P 2∪(Rlt 23∩bsi1.B2∩bsi2.B2)∪X’2),计算第十九参数R 2,并将所述第十九参数中取值为1的位置对应的目标对象,确定为符合所述第四条件的目标对象;
其中,n表示所述第一BSI对象的位长。
由此可知,用于确定在第一BSI对象中的属性值大于或等于在第二BSI对象中的属性值的目标对象的计算公式如下所示:
Xi∪(bsi2.Bi⊙bsi1.Bi)=Wi;
X’i∪(bsi2.Bi⊙bsi1.Bi)=W’i;
Yi=(bsi1.Bi⊙bsi2.Bi)∩Y(i+1),其中,Yn=bsi1.Bn⊙bsi2.Bn;
Rgt 2i=Rgt 2(i+1)∪(Wi∩Y(i+1)),其中,Rgt 2n=Wn;
Rlt 2i=Rlt 2(i+1)∪(W’i∩Y(i+1)),其中,Rlt 2n=W’n;
R 2=(bsi1.B1∩bsi2.B1)∩(P 2∪(Rlt 23∩bsi1.B2∩bsi2.B2)∪X’2);
其中,Xi为bsi1.Bi表示的集合减去bsi2.Bi表示的集合的差集转换后的二进制数,X’i为bsi2.Bi表示的集合减去bsi1.Bi表示的集合的差集转换后的二进制数,P 2为Rgt 23表示的集合减去bsi1.B2表示的集合的差集转换后的二进制数,X’2为bsi1.B2表示的集合减去bsi2.B2表示的集合的差集转换后的二进制数,i为3至n的整数。
另外,通过对比此处“用于确定在第一BSI对象中的属性值大于或等于在第二BSI对象中的属性值的目标对象的计算公式”,与前述“用于确定在第一BSI对象中的属性值大于在第二BSI对象中的属性值的目标对象的计算公式”,可知:二者的计算过程相似,不同之处在于在“用于确定在第一 BSI对象中的属性值大于或等于在第二BSI对象中的属性值的目标对象的计算公式”中,计算出Xi和X’i之后,还需要分别计算与bsi2.Bi⊙bsi1.Bi的交集,得到Wi和W’i,然后再代入到其他公式中进行计算。其中,Wi表示bsi1和bsi2均为正数时,bsi1的第i位二进制值大于或等于bsi2的第i位二进制值的目标对象。
由上述可知,本申请的实施例,可以通过对第一BSI对象和第二BSI对象中的各个二进制值进行运算,以筛选出在第一BSI对象中的属性值大于在第二BSI对象中的属性值的目标对象,或者在第一BSI对象中的属性值大于或等于在第二BSI对象中的属性值的目标对象。
同理,也可以通过对第一BSI对象和第二BSI对象中的各个二进制值进行运算,以筛选出在第一BSI对象中的属性值小于在第二BSI对象中的属性值的目标对象,或者在第一BSI对象中的属性值小于或等于在第二BSI对象中的属性值的目标对象。具体计算公式列举如下:
第一方面,用于确定在第一BSI对象中的属性值小于在第二BSI对象中的属性值的目标对象的计算公式如下所示:
Yi=(bsi1.Bi⊙bsi2.Bi)∩Y(i+1),其中,Yn=bsi1.Bn⊙bsi2.Bn;
Rgt 3i=Rgt 3(i+1)∪(X’i∩Y(i+1)),其中,Rgt 3n=X’n;
Rlt 3i=Rlt 3(i+1)∪(Xi∩Y(i+1)),其中,Rlt 3n=Xn;
R 3=(bsi1.B1∩bsi2.B1)∩(P 3∪(Rlt 33∩bsi1.B2∩bsi2.B2));
其中,Xi为bsi1.Bi表示的集合减去bsi2.Bi表示的集合的差集转换后的二进制数,X’i为bsi2.Bi表示的集合减去bsi1.Bi表示的集合的差集转换后的二进制数,P 1为Rgt 13表示的集合减去bsi1.B2表示的集合的差集转换后的二进制数,i为3至n的整数。
第二方面,用于确定在第一BSI对象中的属性值小于或等于在第二BSI对象中的属性值的目标对象的计算公式如下所示:
Xi∪(bsi2.Bi⊙bsi1.Bi)=Wi;
X’i∪(bsi2.Bi⊙bsi1.Bi)=W’i;
Yi=(bsi1.Bi⊙bsi2.Bi)∩Y(i+1),其中,Yn=bsi1.Bn⊙bsi2.Bn;
Rgt 4i=Rgt 4(i+1)∪(W’i∩Y(i+1)),其中,Rgt 4n=W’n;
Rlt 4i=Rlt 4(i+1)∪(Wi∩Y(i+1)),其中,Rlt 4n=Wn;
R 4=(bsi1.B1∩bsi2.B1)∩(P 4∪(Rlt 23∩bsi1.B2∩bsi2.B2));
其中,Xi为bsi1.Bi表示的集合减去bsi2.Bi表示的集合的差集转换后的二进制数,X’i为bsi2.Bi表示的集合减去bsi1.Bi表示的集合的差集转换 后的二进制数,P 4为Rgt 43表示的集合减去bsi1.B2表示的集合的差集转换后的二进制数,i为3至n的整数。
由上述可知,在本申请的实施例中,在对至少两个位切片索引BSI对象的属性值进行比较时,可以采用二进制数的逻辑运算,实现对同一目标对象在不同BSI对象中的属性值的各个二进制位的比较。这样,直接基于BSI对象的属性值的二进制形式进行运算,即可获得符合筛选条件的运算结果,运算过程更加简单。
可选的,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
在所述筛选条件包括所述第五条件的情况下,所述对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果,包括:
确定第一比特图,其中,所述第一比特图用于表示第一属性值和第二属性值的第3至n位上的二进制值对应相加后是否需要进位或借位;
将所述第一属性值和所述第二属性值的第3至n位上的二进制值对应异或,得到第二比特图,并将所述第二比特图的第3位作为第三比特图的第3位;
在i取4至n中的每一个整数时,将所述第二比特图的第i位与所述第一比特图的第i-1位进行异或,得第三比特图的第i位;
确定所述第一属性值和所述第二属性值之和的第一符号;
根据所述第一符号和所述第三比特图,确定所述第一属性值和所述第二属性值之和。
其中,在计算第一BSI对象和第二BSI对象中属于第k个目标对象的属性值之和时,需要第k个目标对象在第一BSI对象中的第一属性值,与第k个目标对象在第二BSI对象中的第二属性值的正负情况分别进行处理,具体可如下情况一至三所述。
情况一:第一属性值和第二属性值均为正数或负数时,二者相加。
即在第一属性值和第二属性值均为正数或负数的情况下,将所述第一BSI对象和所述第二BSI对象中属于第k个目标对象的属性值相加的过程具体可以可如下所述:
根据第十八预设公式和第十九预设公式:计算bsi3.k.B2至bsi3.k.B(n+1),并将bsi3.k.B2与bsi3.k.B(n+1)至bsi3.k.B3组成的二进制数,确定为所述第一属性值和所述第二属性值之和;
其中,所述第一属性值为所述第一BSI对象中属于第k个所述目标对象的属性值,所述第二属性值为所述第二BSI对象中属于第k个所述目标对象的属性值;
第十八预设公式为:
Figure PCTCN2022098297-appb-000005
第十九预设公式为:
Figure PCTCN2022098297-appb-000006
bsi1.k.Bi表示所述第一属性值的第i位,bsi2.k.Bi表示所述第二属性值的第i位。
其中,Q 13~Q 1n表示上述第一比特图,i取3至n中每一个整数时,bsi1.k.Bi xor bsi2.k.Bi的结果表示第二比特图,bsi3.k.B3至bsi3.k.B(n+1)表示上述第三比特图,bsi3.k.B2表示所述第一属性值和所述第二属性值之和的第一符号。
由上述可知,在本申请实施例中,对于B3~Bn任意的一个Bi,3<=i<=n,与二进制加法的法则相同:0+0得0,0+1得1,1+1得(1,0),其中1+1的结果(1,0)代表需要向前一位进1。具体到bsi1.k(即bsi1中的第k个目标对象)和bsi2.k(即bsi1中的第k个目标对象)的Bi相加的结果bsi3.k,就会产生两个Bitmap,假设把计算后代表需要往前进一到i+1位的Bitmap结果称为Q 1i,它会被用于计算bsi3.k.B(i+1)。那么有以下计算公式:
Q 1i=(bsi1.k.Bi∩bsi2.k.Bi)∪(bsi1.k.Bi xor bsi2.k.Bi∩Q 1(i-1));
bsi3.k.Bi=bsi1.k.Bi xor bsi2.k.Bi xor Q 1(i-1)。
即Q 1i表示bsi1.k.Bi、bsi2.k.Bi及上一轮进阶过来计算的Q 1(i-1)相加后大于1的位(亦即Q 1i为1表示第i位需要向前进1,Q 1i为0表示第i位不需要向前进1),其中,Q 13=bsi1.B3∩bsi2.B3。
bsi3.k.Bi表示bsi1.k.Bi、bsi2.k.Bi及上一轮进阶过来计算的Q 1(i-1)二进制值相加后留在该位的值,且bsi3.k.B3=bsi1.k.B3 xor bsi2.k.B3,bsi3.k.B(n+1)=Q 1n。具体由这几种情况组成:0+0+0得0;0+0+1得 1;0+1+1得(1,0),留在该位的值为0;1+1+1=>(1,1),留在该位的值为1。
另外,在第一属性值和第二属性值均为正数或者负数时,bsi1.k.B2与bsi2.k.B2相同,因此,bsi3.k.B2=bsi1.k.B2或bsi2.k.B2,即第一属性值和第二属性值相加的结果的符号位的二进制值与第一属性值或者第二属性值的符号位的二进制值相同。
此外,第一属性值和第二属性值均为正数或负数,表示第一属性值和第二属性值均存在,因此,bsi3.k.B1=bsi1.k.B1∩bsi2.k.B1。
示例性的,以图2所示的bsi1和图3所示的bsi2为例,计算用户6对股票的偏好得分与对基金的偏好得分之和的过程如表8所示。
表8计算用户6对股票的偏好得分与对基金的偏好得分之和的过程
Figure PCTCN2022098297-appb-000007
其中,bsi3.k.B2=0,即为用户6对股票偏好得分与对基金偏好得分之和为正数。因此,最终得到bsi3.k的二进制为0110101,转换成十进制数为53,如果根据base值进行还原,则可以得到其真实的相加后的属性值为:53+41*2=135,其中bsi3的base值为41*2=82,这个结果符合用户6原始的属性值相加结果,即80+55=135。
情况二:第一属性值为正数,第二属性值为负数时,二者相加。
即在第一属性值为正数且第二属性值为负数的情况下,将所述第一 BSI对象和所述第二BSI对象中属于第k个目标对象的属性值相加的过程具体可以可如下所述:
根据第二十预设公式Q 2i=N 1i∪(bsi1.k.Bi⊙bsi2.k.Bi∩Q 2(i-1)),计算Q 24至Q 2n,其中,i∈[4,n]且为整数,N 1i为bsi2.k.Bi所表示的集合与bsi1.k.Bi所表示的集合之差转换后的二进制数,Q 23为bsi2.k.B3所表示的集合与bsi1.k.B3所表示的集合之差转换后的二进制数;
在Q 2n=0的情况下,根据第二十一预设公式,计算bsi3.k.B2至bsi3.k.Bn,并将bsi3.k.B2与bsi3.k.Bn至bsi3.k.B3组成的二进制数,确定为所述第一属性值和所述第二属性值之和;
在Q 2n=1的情况下,根据第二十二预设公式和第二十三预设公式,计算bsi3.k.B2至bsi3.k.Bn,并将bsi3.k.B2与bsi3.k.Bn至bsi3.k.B3组成的二进制数,确定为所述第一属性值和所述第二属性值之和;
其中,第二十一预设公式为:
Figure PCTCN2022098297-appb-000008
第二十二预设公式为:Q 3i=N 2i∪(bsi1.k.Bi⊙bsi2.k.Bi∩Q 3(i-1)),其中,i∈[4,n]且为整数,N 2i为bsi1.k.Bi所表示的集合与bsi2.k.Bi所表示的集合之差转换后的二进制数,Q 33为bsi1.k.B3所表示的集合与bsi2.k.B3所表示的集合之差转换后的二进制数;
第二十三预设公式为:
Figure PCTCN2022098297-appb-000009
所述第一属性值为所述第一BSI对象中属于第k个所述目标对象的属性值,所述第二属性值为所述第二BSI对象中属于第k个所述目标对象的属性值;
bsi1.k.Bi表示所述第一属性值的第i位,bsi2.k.Bi表示所述第二属性值的第i位。
其中,Q 23~Q 2n表示上述第一比特图,i取3至n中每一个整数时,bsi1.k.Bi xor bsi2.k.Bi的结果表示第二比特图,bsi3.k.B3至bsi3.k.Bn表示 上述第三比特图,bsi3.k.B2表示所述第一属性值和所述第二属性值之和的第一符号。
假如上述第一属性值为39,第二属性值为-14,则计算二者之和的过程可如表9所示。
表9计算39与-14之和的过程
Figure PCTCN2022098297-appb-000010
由表9可知,Q 28=0,则根据上述第二十一预设公式,计算bsi3.k.B2至bsi3.k.B8,并将bsi3.k.B2与bsi3.k.B8至bsi3.k.B3组成的二进制数,确定为所述第一属性值和所述第二属性值之和,即0011001,转换十进制数即为25,其中符号位为0,故结果为+25。
情况三:第一属性值为负数,第二属性值为正数时,二者相加。
即在第一属性值为负数且第二属性值为正数的情况下,将所述第一BSI对象和所述第二BSI对象中属于第k个目标对象的属性值相加的过程具体可以可如下所述:
根据第二十二预设公式Q 3i=N 2i∪(bsi1.k.Bi⊙bsi2.k.Bi∩Q 3(i-1)),计算Q 34至Q 3n,其中,i∈[4,n]且为整数,N 2i为bsi1.k.Bi所表示的集合与bsi2.k.Bi所表示的集合之差转换后的二进制数,Q 33为bsi1.k.B3所表示的集合与bsi2.k.B3所表示的集合之差转换后的二进制数;
在Q 3n=0的情况下,根据第二十四预设公式,计算bsi3.k.B2至bsi3.k.Bn,并将bsi3.k.B2与bsi3.k.Bn至bsi3.k.B3组成的二进制数,确定 为所述第一属性值和所述第二属性值之和;
在Q 3n=1的情况下,根据第二十预设公式和第二十五预设公式,计算bsi3.k.B2至bsi3.k.Bn,并将bsi3.k.B2与bsi3.k.Bn至bsi3.k.B3组成的二进制数,确定为所述第一属性值和所述第二属性值之和;
其中,所述第二十四预设公式为:
Figure PCTCN2022098297-appb-000011
所述第二十预设公式为:Q 2i=N 1i∪(bsi1.k.Bi⊙bsi2.k.Bi∩Q 2(i-1)),其中,i∈[4,n]且为整数,N 1i为bsi2.k.Bi所表示的集合与bsi1.k.Bi所表示的集合之差转换后的二进制数,Q 23为bsi2.k.B3所表示的集合与bsi1.k.B3所表示的集合之差转换后的二进制数;
所述第二十五预设公式为:
Figure PCTCN2022098297-appb-000012
所述第一属性值为所述第一BSI对象中属于第k个所述目标对象的属性值,所述第二属性值为所述第二BSI对象中属于第k个所述目标对象的属性值;
bsi1.k.Bi表示所述第一属性值的第i位,bsi2.k.Bi表示所述第二属性值的第i位。
其中,Q 33~Q 3n表示上述第一比特图,i取3至n中每一个整数时,bsi1.k.Bi xor bsi2.k.Bi的结果表示第二比特图,bsi3.k.B3至bsi3.k.Bn表示上述第三比特图,bsi3.k.B2表示所述第一属性值和所述第二属性值之和的第一符号。
示例性的,以图2所示的bsi1和图3所示的bsi2为例,计算用户2对股票的偏好得分与对基金的偏好得分之和(即bsi1中的属性值-31和bsi2中的属性值11之和)的过程如表10所示。
表10计算用户2对股票的偏好得分与对基金的偏好得分之和的过程
Figure PCTCN2022098297-appb-000013
由表10可知,Q 38=1,则根据上述第二十预设公式和第二十五预设公式,计算bsi3.k.B2至bsi3.k.B8,并将bsi3.k.B2与bsi3.k.B8至bsi3.k.B3组成的二进制数,确定为所述第一属性值和所述第二属性值之和,即1001100,转换十进制数即为12,其中符号位为1,故结果为-12。如果还原回原始的属性值结果,则结果为:-12+2*base=70,符合原始属性值10+60=70的结果。
可选的,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
在所述筛选条件包括所述第六条件的情况下,所述对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果,包括:
确定第四比特图,其中,所述第四比特图用于表示第一属性值和第二属性值的第3至n位上的二进制值对应相减后是否需要进位或借位;
将所述第一属性值和所述第二属性值的第3至n位上的二进制值对应异或,得到第二比特图,并将所述第二比特图的第3位作为第五比特图的第3位;
在取4至n中的每一个整数时,将所述第二比特图的第i位与所述第四比特图的第i-1位进行异或,得第五比特图的第i位;
确定所述第一属性值与所述第二属性值相减的第二符号;
根据所述第二符号和所述第五比特图,确定所述第一属性值和所述第二属性值之差。
其中,在计算第一BSI对象和第二BSI对象中属于第k个目标对象的属性值之和时,也需要第k个目标对象在第一BSI对象中的第一属性值,与第k个目标对象在第二BSI对象中的第二属性值的正负情况分别进行处理,具体可如下情况四至六所述。
情况四:第一属性值和第二属性值均为正数时,第一属性值减去第二属性值。
即在第一属性值和第二属性值均为正数的情况下,将所述第一BSI对象和所述第二BSI对象中属于第k个目标对象的属性值相减的过程具体可如下所述:
根据第二十预设公式Q 2i=N 1i∪(bsi1.k.Bi⊙bsi2.k.Bi∩Q 2(i-1)),计算Q 24至Q 2n,其中,i∈[4,n]且为整数,N 1i为bsi2.k.Bi所表示的集合与bsi1.k.Bi所表示的集合之差转换后的二进制数,Q 23为bsi2.k.B3所表示的集合与bsi1.k.B3所表示的集合之差转换后的二进制数;
在Q 2n=0的情况下,根据第二十一预设公式,计算bsi3.k.B2至bsi3.k.Bn,并将bsi3.k.B2与bsi3.k.Bn至bsi3.k.B3组成的二进制数,确定为所述第一属性值和所述第二属性值之和;
在Q 2n=1的情况下,根据第二十二预设公式和第二十三预设公式,计算bsi3.k.B2至bsi3.k.Bn,并将bsi3.k.B2与bsi3.k.Bn至bsi3.k.B3组成的二进制数,确定为所述第一属性值和所述第二属性值之和;
其中,第二十一预设公式为:
Figure PCTCN2022098297-appb-000014
第二十二预设公式为:Q 3i=N 2i∪(bsi1.k.Bi⊙bsi2.k.Bi∩Q 3(i-1)),其中,i∈[4,n]且为整数,N 2i为bsi1.k.Bi所表示的集合与bsi2.k.Bi所表示的集合之差转换后的二进制数,Q 33为bsi1.k.B3所表示的集合与bsi2.k.B3所表示的集合之差转换后的二进制数;
第二十三预设公式为:
Figure PCTCN2022098297-appb-000015
所述第一属性值为所述第一BSI对象中属于第k个所述目标对象的属性值,所述第二属性值为所述第二BSI对象中属于第k个所述目标对象的属性值;
bsi1.k.Bi表示所述第一属性值的第i位,bsi2.k.Bi表示所述第二属性值的第i位。
其中,Q 23~Q 2n表示上述第四比特图,i取3至n中每一个整数时,bsi1.k.Bi xor bsi2.k.Bi的结果表示第二比特图,bsi3.k.B3至bsi3.k.Bn表示上述第五比特图,bsi3.k.B2表示所述第一属性值和所述第二属性值相减的第二符号。
对于两个正数的属性值减法,同加法类似,对于B3~Bn任意的一个Bi,3<=i<=n,与二进制减法规则相同:0-0得0,1-1得0,1-0的1,0-1的(-1,1),其中0-1的结果(-1,1)代表有额外信息需要向前传给前一位来操作。但如果bsi2的属性值大于bsi1的情况下,每位相减结果向前传递的方式就不满足二进制的减法,这种情况下计算机是采用负数补码的方式来解决。
这里先考虑bsi1的属性值大于bsi2的属性值的情况下进行相减。具体到bsi1和bsi2的Bi相减的结果bsi3,就会产生两个Bitmap,假设把计算后代表需要往前借一到i+1行的Bitmap结果称为Q 2i,它会被用于计算bsi3.k.B(i+1)。那么有以下计算公式:
Q 2i=N 1i∪(bsi1.k.Bi⊙bsi2.k.Bi∩Q 2(i-1)),N 1i为bsi2.k.Bi所表示的集合与bsi1.k.Bi所表示的集合之差转换后的二进制数,Q 23为bsi2.k.B3所表示的集合与bsi1.k.B3所表示的集合之差转换后的二进制数;
bsi3.k.Bi=bsi1.k.Bi xor bsi2.k.Bi xor Q 2(i-1);
其中,N 1i表示bsi2.k.Bi属性值大于bsi1.k.Bi,bsi1.k.Bi⊙bsi2.k.Bi∩Q 2(i-1)代表bsi1.k.Bi和bsi2.k.Bi属性值相同但第i-1行有负数的情况。bsi3.k.Bi代表二进制值相减后留在该位的值,具体有这几种情况组成:0-0-0得0;1-0-0得1;0-1-1得(-1,0),该行只保留该行结果0;0-1-0得(-1,1);1-1-0得0;1-1-1得(-1,1)。当循环到最后一行n时,Q 2n同时作为符号位赋值给bsi3.k.B2,bsi3.B1=bsi1.B1∩bsi2.B1。
此处需要说明的是,两个正数相减,相当于一个正数和一个负数相加,因此,第一属性值和第二属性值均为正数,且二者相减的计算公式,与前述第一属性值为正数、第二属性值为负数,且二者相加的计算公式相同。具体计算过程的示例请参见前述情况二所述。
情况五:第一属性值和第二属性值均为负数时,第一属性值减去第二属性值。
即在第一属性值和第二属性值均为负数的情况下,将所述第一BSI对象和所述第二BSI对象中属于第k个目标对象的属性值相减的过程具体可如下所述:
根据第二十二预设公式Q 3i=N 2i∪(bsi1.k.Bi⊙bsi2.k.Bi∩Q 3(i-1)),计算Q 34至Q 3n,其中,i∈[4,n]且为整数,N 2i为bsi1.k.Bi所表示的集合与bsi2.k.Bi所表示的集合之差转换后的二进制数,Q 33为bsi1.k.B3所表示的集合与bsi2.k.B3所表示的集合之差转换后的二进制数;
在Q 3n=0的情况下,根据第二十四预设公式,计算bsi3.k.B2至bsi3.k.Bn,并将bsi3.k.B2与bsi3.k.Bn至bsi3.k.B3组成的二进制数,确定为所述第一属性值和所述第二属性值之和;
在Q 3n=1的情况下,根据第二十预设公式和第二十五预设公式,计算bsi3.k.B2至bsi3.k.Bn,并将bsi3.k.B2与bsi3.k.Bn至bsi3.k.B3组成的二进制数,确定为所述第一属性值和所述第二属性值之和;
其中,所述第二十四预设公式为:
Figure PCTCN2022098297-appb-000016
所述第二十预设公式为:Q 2i=N 1i∪(bsi1.k.Bi⊙bsi2.k.Bi∩Q 2(i-1)),其中,i∈[4,n]且为整数,N 1i为bsi2.k.Bi所表示的集合与bsi1.k.Bi所表示的集合之差转换后的二进制数,Q 23为bsi2.k.B3所表示的集合与bsi1.k.B3所表示的集合之差转换后的二进制数;
所述第二十五预设公式为:
Figure PCTCN2022098297-appb-000017
所述第一属性值为所述第一BSI对象中属于第k个所述目标对象的属性值,所述第二属性值为所述第二BSI对象中属于第k个所述目标对象的属性值;
bsi1.k.Bi表示所述第一属性值的第i位,bsi2.k.Bi表示所述第二属性值 的第i位。
其中,Q 33~Q 3n表示上述第四比特图,i取3至n中每一个整数时,bsi1.k.Bi xor bsi2.k.Bi的结果表示第二比特图,bsi3.k.B3至bsi3.k.Bn表示上述第五比特图,bsi3.k.B2表示所述第一属性值和所述第二属性值相减的第二符号。
此处需要说明的是,两个负数相减,相当于一个负数和一个正数相加,因此,第一属性值和第二属性值均为负数,且二者相减的计算公式,与前述第一属性值为负数、第二属性值为正数,且二者相加的计算公式相同。具体计算过程的示例请参见前述情况三所述。
情况六:第一属性值为正数且第二属性值为负数时,或者第一属性值为负数且第二属性值为正数时,第一属性值减去第二属性值。
即在第一属性值为正数且第二属性值为负数的情况下,或者在第一属性值为负数且第二属性值为正数的情况下,将所述第一BSI对象和所述第二BSI对象中属于第k个目标对象的属性值相减的过程具体可如下所述:
根据第十八预设公式和第二十六预设公式:计算bsi3.k.B2至bsi3.k.B(n+1),并将bsi3.k.B2与bsi3.k.B(n+1)至bsi3.k.B3组成的二进制数,确定为所述第一属性值和所述第二属性值之和;
其中,所述第一属性值为所述第一BSI对象中属于第k个所述目标对象的属性值,所述第二属性值为所述第二BSI对象中属于第k个所述目标对象的属性值;
所述第十八预设公式为:
Figure PCTCN2022098297-appb-000018
所述第二十六预设公式为:
Figure PCTCN2022098297-appb-000019
bsi1.k.Bi表示所述第一属性值的第i位,bsi2.k.Bi表示所述第二属性值的第i位。
其中,Q 13~Q 1n表示上述第四比特图,i取3至n中每一个整数时,bsi1.k.Bi xor bsi2.k.Bi的结果表示第二比特图,bsi3.k.B3至bsi3.k.B(n+1)表示上述第五比特图,bsi3.k.B2表示所述第一属性值和所述第二 属性值相减的第二符号。
此处需要说明的是,一个正数减去一个负数,相当于两个正数相加;一个负数减去一个正数,相当于两个负数相加,因此此处情况六中计算公式与前述情况一中计算公式基本相同,不同之处仅在于bsi3.k.B2=bsi1.k.B2,因而情况六中的计算结果的符号总是与被减数的符号相同。且具体计算过程的示例请参见前述情况一所述。
此外,需要说明的是,上述第一属性值和第二属性值包括第2至n位,其中,第2位属于符号位,第3至n位表示绝对值,并且第3位属于低位,第n位属于高位,即第2位以及第n至3位组成完整的二进制数。
由上述可知,在本申请的实施例中,在对至少两个位切片索引BSI对象的属性值进行算术运算时,采用二进制数的逻辑运算,实现对同一目标对象在不同BSI对象中的属性值的相加或相减。这样,直接基于BSI对象的属性值的二进制形式进行运算,即可获得符合筛选条件的运算结果,运算过程更加简单。
此外,对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果之后,还可以为运算结果建立新的BSI对象。并且,还可以将参加运算的BSI对象按照运算结果的BSI对象的位长进行转换。
综上所述,本申请的实施例,能够实现对BSI对象的属性值的对比,例如支持两个BSI对象属性值的大于、大于等于、小于、小于等于、等于、不等于判断过滤;并且,能够实现对BSI对象的属性值的加、减运算,以得到新的属性值。因此,本申请的实施例,可以套用至BSI对象存储同时有属性值对比计算的需求场景中。
第一方面,对于画像标签系统,尤其是人群圈选查询功能,通过对BSI对象的属性值对比计算方法,可以在圈选过程中根据两个标签的属性值进行对比过滤得到目标圈选结果。其中,属性是一个用long类型表达的数值,可以是某种固定属性、也可以是一些行为数量统计、异或是算法模型评分等等,根据不同标签和属性值代表的含义,会有很多使用场景。
或者,前述筛选对股票的偏好得分和对基金的偏好得分均不为零,且对股票的偏好得分大于对基金的偏好得分的用户的场景,可以通过构建的股票和基金用户的BSI对象,并采用前述内容所述的步骤获得相应结果,避免系统额外去提前构建一个C标签代表这批用户,这样可以大大提高灵活性来满足需求,也减轻了标签构建和存储压力。
其中,若需要筛选对股票的偏好得分和对基金的偏好得分均不为零,且对股票的偏好得分大于对基金的偏好得分的用户,还可以采用如下所述的方法实现:
首先,构建两张表T A和T B分别代表偏好为股票和基金的用户,表存在两列,一列是id,一列是score分别代表用户id和偏好得分,则可以通过sql查询语句来筛选出“对股票的偏好得分和对基金的偏好得分均不为零,且对股票的偏好得分大于对基金的偏好得分的用户”。
此种方式的弊端在于:两张表格的关联(join)效率比较差。因此,一般也会考虑将这部分计算通过离线任务来实现,但得到的结果需要再存储为另一个标签来方便后续使用。因此,每遇到类似场景,就需要开发生成新标签,从而造成较大的预计算和标签系统的存储压力。
而采用BSI对象的属性值对比计算方法,整个计算过程都是基于RoaringBitmap的交并补计算,整体计算性能较好,远好于join等实现方式。
第二方面,对于漏斗分析场景,BSI对象的属性值对比计算方法也能发挥一定作用。例如基于地理位置的基于位置的服务(Location Based Services,LBS)圈选场景,可以根据BSI属性值对比过滤实现一种满足轨迹时间顺序条件的LBS路径圈人方法,可用于对车辆的轨迹分析等需求。
例如需要圈选从T1时间到T2这段时间,依次有序经过a、b、c、d点位的车辆/用户。可以采用如下所述的方法一或者方法二。
方法一:
通过LBS查询在T1至T2时间段分别经过a、b、c、d区域的车辆去重记录,得到过车记录结果集Ra、Rb、Rc、Rd;同时循环遍历Ra和Rb中的记录,过滤并只保留车辆id同时都存在且a的过车时间小于b的过车时间的记录,设定为Rab;然后同理再同时循环遍历Rab和Rc得到
Rabc,再同时循环遍历Rabc和Rd得到Rabcd即为最终结果。此过程主要需要大量的遍历和判断,故整体计算性能表现不佳。
方法二:
采用实时流计算的复杂事件处理(CEP)能力,例如采用源流处理框架(flink)的复杂事件处理结构化查询语言(cep sql)。但此方法的缺点是:由于实时流计算CEP方案是基于时间窗口进行统计的,当目标事件间时间跨度较大时会比较大的影响性能和增加资源的开;并且,由于实时计 算需要提前布置任务,因此无法很好地满足灵活多变的分析需求。例如前述a、b、c、d的点位如果变化,已有的布置任务就不能很好满足。
而采用BSI对象的属性值对比计算方法,能够同时兼顾灵活性和性能,具体实施步骤如下步骤H1至H:
步骤H1:通过LBS查询在T1至T2时间段分别经过a、b、c、d区域的车辆去重记录,并用BSI来构建各点位去重目标id结果,BSI的属性值为经过点位的时间信息,时间信息假设采用ddhhmm(即天小时分钟)格式Long类型数据来表示,精确到分钟粒度,分别得到bsi1、bsi2、bsi3、bsi4,它们有相同位长的时间属性。
步骤H2:对各点位BSI对象的第1行Bitmap进行依次交集,即(bsi1.B1∩bsi2.B1∩bsi3.B1∩bsi3.B1),得到交集的Bitmap命名为B1。
步骤H3:对b、c、d点位套用“前述筛选属性值大于的方法”,分别求bsi2属性值大于bsi1的结果Rb,求得bsi3属性值大于bsi2的结果Rc,求得bsi4属性值大于bsi3的结果Rd。
上面各循环全部结束后,再执行R=Rb∩Rc∩Rd∩B1,得到的R即为:同时经过A、B、C、D点位,且过车时间Ta<Tb<Tc<Td的车辆结果集合。
此方案的计算过程避免了一行一行过车记录展开遍历,而是转化为几组整体的RoaringBitmap的并集计算,尤其是对过车时间的对比过滤通过BSI属性值对比的方式也转化为几组RoaringBitmap的交并补操作,使计算的性能可以得到较大的提升。
此外,还需要说明的是,BSI对象属性值对比计算,除了应用到画像系统,也可以基于此特性,应用到一些有类似索引和计算场景的系统,用作特定的数据存储和索引。
需要说明的是,本申请实施例提供的数据处理方法,执行主体可以为数据处理装置,或者该数据处理装置中的用于执行数据处理方法的控制模块。本申请实施例中以数据处理装置执行数据处理方法为例,说明本申请实施例提供的数据处理装置。
如图6所示,本申请的实施例还提供了一种数据处理装置,该装置包括:
条件获取模块601,用于获取数据的筛选条件;
BSI对象获取模块602,用于获取与所述筛选条件相关联的至少两个位切片索引BSI对象;
运算模块603,用于根据所述筛选条件,对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果;
结果显示模块604,用于显示所述运算结果。
可选的,所述至少两个位切片索引BSI对象包括第一BSI对象和第二BSI对象,所述第一BSI对象和所述第二BSI对象的属性值表示不同目标对象的不同字段取值;
所述筛选条件包括如下条件中的至少一个:
第一条件,所述第一条件用于指示筛选在所述第一BSI对象和所述第二BSI对象中属性值相同的目标对象;
第二条件,所述第二条件用于指示筛选在所述第一BSI对象和所述第二BSI对象中属性值不同的目标对象;
第三条件,所述第三条件用于指示筛选在所述第一BSI对象中的属性值大于在所述第二BSI对象中的属性值的目标对象;
第四条件,所述第四条件用于指示筛选在所述第一BSI对象中的属性值大于或等于在所述第二BSI对象中的属性值的目标对象;
第五条件,所述第五条件用于指示将所述第一BSI对象和所述第二BSI对象中属于同一目标对象的属性值相加;
第六条件,所述第五条件用于指示将所述第一BSI对象和所述第二BSI对象中属于同一目标对象的属性值相减。
可选的,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
在所述筛选条件包括所述第一条件的情况下,所述运算模块603具体用于:
获取在所述第一BSI对象和所述第二BSI对象中属性值均不为零的目标对象,得到第一目标集合;
在i取2至n中的每一个整数时,获取在所述第一BSI对象和所述第二BSI对象中第i位二进制值相同的目标对象,得到第i个第二目标集合;
将所述第一目标集合、第2至第n个第二目标集合的交集中包括的目标对象,确定为符合所述第一条件的目标对象;
其中,n表示所述第一BSI对象的位长。
可选的,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
在所述筛选条件包括所述第二条件的情况下,所述运算模块603具体 用于:
获取在所述第一BSI对象中和所述第二BSI对象中属性值均不为零的目标对象,得到第一目标集合;
在i取2至n中的每一个整数时,获取在所述第一BSI对象和所述第二BSI对象中第i位二进制值不同的目标对象,得到第i个第三目标集合;
获取第2至第n个第三目标集合的并集;
将第2至第n个第三目标集合的并集与所述第一目标集合的交集包括的目标对象,确定为符合所述第二条件的目标对象;
其中,n表示所述第一BSI对象的位长。
可选的,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
在所述筛选条件包括所述第五条件的情况下,所述运算模块603具体用于:
确定第一比特图,其中,所述第一比特图用于表示第一属性值和第二属性值的第3至n位上的二进制值对应相加后是否需要进位或借位;
将所述第一属性值和所述第二属性值的第3至n位上的二进制值对应异或,得到第二比特图,并将所述第二比特图的第3位作为第三比特图的第3位;
在i取4至n中的每一个整数时,将所述第二比特图的第i位与所述第一比特图的第i-1位进行异或,得第三比特图的第i位;
确定所述第一属性值和所述第二属性值之和的第一符号;
根据所述第一符号和所述第三比特图,确定所述第一属性值和所述第二属性值之和。
可选的,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
在所述筛选条件包括所述第六条件的情况下,所述运算模块603具体用于:
确定第四比特图,其中,所述第四比特图用于表示第一属性值和第二属性值的第3至n位上的二进制值对应相减后是否需要进位或借位;
将所述第一属性值和所述第二属性值的第3至n位上的二进制值对应异或,得到第二比特图,并将所述第二比特图的第3位作为第五比特图的第3位;
在取4至n中的每一个整数时,将所述第二比特图的第i位与所述第四 比特图的第i-1位进行异或,得第五比特图的第i位;
确定所述第一属性值与所述第二属性值相减的第二符号;
根据所述第二符号和所述第五比特图,确定所述第一属性值和所述第二属性值之差。
由上述可知,本申请实施例中的数据处理装置,能够获取数据的筛选条件,并获取与该筛选条件相关联的至少两个位切片索引BSI对象,从而根据所述筛选条件,对所述至少两个位切片索引BSI对象的属性值进行算术运算,以获得符合筛选条件的运算结果,从而显示该运算结果。由此可见,本申请实施例中的数据处理装置,采用BSI对象存储数据,并可以根据筛选条件,对于该筛选条件相关联的至少两个位切片索引BSI对象的属性值进行算术运算处理,从而获得符合筛选条件的运算结果。即本申请实施例中的数据处理装置,可以对BSI对象的属性值进行更多种类的运算,从而适应于更多种类的筛选,因此,本申请实施例中的数据处理装置,可以适应基于存储对象的更多属性信息来做条件过滤的场景。
本申请实施例中的数据处理装置可以是装置,也可以是终端中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-
mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。
本申请实施例中的数据处理装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。
本申请实施例提供的数据处理装置能够实现图1的方法实施例实现的各个过程,为避免重复,这里不再赘述。
可选地,如图7所示,本申请实施例还提供一种电子设备700,包括处理器701,存储器702,存储在存储器702上并可在所述处理器701上运行的程序或指令,该程序或指令被处理器701执行时实现上述数据处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。
图8为实现本申请实施例的一种电子设备的硬件结构示意图。
该电子设备800包括但不限于:射频单元801、网络模块802、音频输出单元803、输入单元804、传感器805、显示单元806、用户输入单元807、接口单元808、存储器809、以及处理器810等部件。
本领域技术人员可以理解,电子设备800还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器810逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图8中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。
其中,处理器810用于获取数据的筛选条件;获取与所述筛选条件相关联的至少两个位切片索引BSI对象;根据所述筛选条件,对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果;
显示单元806,用于显示所述运算结果。
由上述可知,本申请实施例中的电子设备,能够获取数据的筛选条件,并获取与该筛选条件相关联的至少两个位切片索引BSI对象,从而根据所述筛选条件,对所述至少两个位切片索引BSI对象的属性值进行算术运算,以获得符合筛选条件的运算结果,从而显示该运算结果。由此可见,本申请实施例中的电子设备,采用BSI对象存储数据,并可以根据筛选条件,对于该筛选条件相关联的至少两个位切片索引BSI对象的属性值进行算术运算处理,从而获得符合筛选条件的运算结果。即本申请实施例中的电子设备,可以对BSI对象的属性值进行更多种类的运算,从而适应于更多种类的筛选,因此,本申请实施例中的数据处理装置,可以适应基于存储对象的更多属性信息来做条件过滤的场景。
应理解的是,本申请实施例中,输入单元804可以包括图形处理器(Graphics Processing Unit,GPU)8041和麦克风8042,图形处理器8041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元806可包括显示面板8061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板8061。用户输入单元807包括触控面板8071以及其他输入设备8072。触控 面板8071,也称为触摸屏。触控面板8071可包括触摸检测装置和触摸控制器两个部分。其他输入设备8072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。存储器809可用于存储软件程序以及各种数据,包括但不限于应用程序和操作系统。处理器810可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器810中。
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述数据处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述数据处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上 述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。

Claims (17)

  1. 一种数据处理方法,所述方法包括:
    获取数据的筛选条件;
    获取与所述筛选条件相关联的至少两个位切片索引BSI对象;
    根据所述筛选条件,对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果;
    显示所述运算结果。
  2. 根据权利要求1所述的数据处理方法,其中,所述至少两个位切片索引BSI对象包括第一BSI对象和第二BSI对象,所述第一BSI对象和所述第二BSI对象的属性值表示不同目标对象的不同字段取值;
    所述筛选条件包括如下条件中的至少一个:
    第一条件,所述第一条件用于指示筛选在所述第一BSI对象和所述第二BSI对象中属性值相同的目标对象;
    第二条件,所述第二条件用于指示筛选在所述第一BSI对象和所述第二BSI对象中属性值不同的目标对象;
    第三条件,所述第三条件用于指示筛选在所述第一BSI对象中的属性值大于在所述第二BSI对象中的属性值的目标对象;
    第四条件,所述第四条件用于指示筛选在所述第一BSI对象中的属性值大于或等于在所述第二BSI对象中的属性值的目标对象;
    第五条件,所述第五条件用于指示将所述第一BSI对象和所述第二BSI对象中属于同一目标对象的属性值相加;
    第六条件,所述第五条件用于指示将所述第一BSI对象和所述第二BSI对象中属于同一目标对象的属性值相减。
  3. 根据权利要求2所述的数据处理方法,其中,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
    在所述筛选条件包括所述第一条件的情况下,所述对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算 结果,包括:
    获取在所述第一BSI对象和所述第二BSI对象中属性值均不为零的目标对象,得到第一目标集合;
    在i取2至n中的每一个整数时,获取在所述第一BSI对象和所述第二BSI对象中第i位二进制值相同的目标对象,得到第i个第二目标集合;
    将所述第一目标集合、第2至第n个第二目标集合的交集中包括的目标对象,确定为符合所述第一条件的目标对象;
    其中,n表示所述第一BSI对象的位长。
  4. 根据权利要求2所述的数据处理方法,其中,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
    在所述筛选条件包括所述第二条件的情况下,所述对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果,包括:
    获取在所述第一BSI对象中和所述第二BSI对象中属性值均不为零的目标对象,得到第一目标集合;
    在i取2至n中的每一个整数时,获取在所述第一BSI对象和所述第二BSI对象中第i位二进制值不同的目标对象,得到第i个第三目标集合;
    获取第2至第n个第三目标集合的并集;
    将第2至第n个第三目标集合的并集与所述第一目标集合的交集包括的目标对象,确定为符合所述第二条件的目标对象;
    其中,n表示所述第一BSI对象的位长。
  5. 根据权利要求2所述的数据处理方法,其中,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
    在所述筛选条件包括所述第五条件的情况下,所述对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果,包括:
    确定第一比特图,其中,所述第一比特图用于表示第一属性值和第二 属性值的第3至n位上的二进制值对应相加后是否需要进位或借位;
    将所述第一属性值和所述第二属性值的第3至n位上的二进制值对应异或,得到第二比特图,并将所述第二比特图的第3位作为第三比特图的第3位;
    在i取4至n中的每一个整数时,将所述第二比特图的第i位与所述第一比特图的第i-1位进行异或,得第三比特图的第i位;
    确定所述第一属性值和所述第二属性值之和的第一符号;
    根据所述第一符号和所述第三比特图,确定所述第一属性值和所述第二属性值之和。
  6. 根据权利要求2所述的数据处理方法,其中,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
    在所述筛选条件包括所述第六条件的情况下,所述对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果,包括:
    确定第四比特图,其中,所述第四比特图用于表示第一属性值和第二属性值的第3至n位上的二进制值对应相减后是否需要进位或借位;
    将所述第一属性值和所述第二属性值的第3至n位上的二进制值对应异或,得到第二比特图,并将所述第二比特图的第3位作为第五比特图的第3位;
    在取4至n中的每一个整数时,将所述第二比特图的第i位与所述第四比特图的第i-1位进行异或,得第五比特图的第i位;
    确定所述第一属性值与所述第二属性值相减的第二符号;
    根据所述第二符号和所述第五比特图,确定所述第一属性值和所述第二属性值之差。
  7. 一种数据处理装置,其中,所述装置包括:
    条件获取模块,用于获取数据的筛选条件;
    BSI对象获取模块,用于获取与所述筛选条件相关联的至少两个位切片 索引BSI对象;
    运算模块,用于根据所述筛选条件,对所述至少两个位切片索引BSI对象的属性值进行算术运算,获得符合所述筛选条件的运算结果;
    结果显示模块,用于显示所述运算结果。
  8. 根据权利要求7所述的数据处理装置,其中,所述至少两个位切片索引BSI对象包括第一BSI对象和第二BSI对象,所述第一BSI对象和所述第二BSI对象的属性值表示不同目标对象的不同字段取值;
    所述筛选条件包括如下条件中的至少一个:
    第一条件,所述第一条件用于指示筛选在所述第一BSI对象和所述第二BSI对象中属性值相同的目标对象;
    第二条件,所述第二条件用于指示筛选在所述第一BSI对象和所述第二BSI对象中属性值不同的目标对象;
    第三条件,所述第三条件用于指示筛选在所述第一BSI对象中的属性值大于在所述第二BSI对象中的属性值的目标对象;
    第四条件,所述第四条件用于指示筛选在所述第一BSI对象中的属性值大于或等于在所述第二BSI对象中的属性值的目标对象;
    第五条件,所述第五条件用于指示将所述第一BSI对象和所述第二BSI对象中属于同一目标对象的属性值相加;
    第六条件,所述第五条件用于指示将所述第一BSI对象和所述第二BSI对象中属于同一目标对象的属性值相减。
  9. 根据权利要求8所述的数据处理装置,其中,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
    在所述筛选条件包括所述第一条件的情况下,所述运算模块具体用于:
    获取在所述第一BSI对象和所述第二BSI对象中属性值均不为零的目标对象,得到第一目标集合;
    在i取2至n中的每一个整数时,获取在所述第一BSI对象和所述第二 BSI对象中第i位二进制值相同的目标对象,得到第i个第二目标集合;
    将所述第一目标集合、第2至第n个第二目标集合的交集中包括的目标对象,确定为符合所述第一条件的目标对象;
    其中,n表示所述第一BSI对象的位长。
  10. 根据权利要求8所述的数据处理装置,其中,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
    在所述筛选条件包括所述第二条件的情况下,所述运算模块具体用于:
    获取在所述第一BSI对象中和所述第二BSI对象中属性值均不为零的目标对象,得到第一目标集合;
    在i取2至n中的每一个整数时,获取在所述第一BSI对象和所述第二BSI对象中第i位二进制值不同的目标对象,得到第i个第三目标集合;
    获取第2至第n个第三目标集合的并集;
    将第2至第n个第三目标集合的并集与所述第一目标集合的交集包括的目标对象,确定为符合所述第二条件的目标对象;
    其中,n表示所述第一BSI对象的位长。
  11. 根据权利要求8所述的数据处理装置,其中,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
    在所述筛选条件包括所述第五条件的情况下,所述运算模块具体用于:
    确定第一比特图,其中,所述第一比特图用于表示第一属性值和第二属性值的第3至n位上的二进制值对应相加后是否需要进位或借位;
    将所述第一属性值和所述第二属性值的第3至n位上的二进制值对应异或,得到第二比特图,并将所述第二比特图的第3位作为第三比特图的第3位;
    在i取4至n中的每一个整数时,将所述第二比特图的第i位与所述第一比特图的第i-1位进行异或,得第三比特图的第i位;
    确定所述第一属性值和所述第二属性值之和的第一符号;
    根据所述第一符号和所述第三比特图,确定所述第一属性值和所述第二属性值之和。
  12. 根据权利要求8所述的数据处理装置,其中,所述第一BSI对象和所述第二BSI对象的属性值的位长相同;
    在所述筛选条件包括所述第六条件的情况下,所述运算模块具体用于:
    确定第四比特图,其中,所述第四比特图用于表示第一属性值和第二属性值的第3至n位上的二进制值对应相减后是否需要进位或借位;
    将所述第一属性值和所述第二属性值的第3至n位上的二进制值对应异或,得到第二比特图,并将所述第二比特图的第3位作为第五比特图的第3位;
    在取4至n中的每一个整数时,将所述第二比特图的第i位与所述第四比特图的第i-1位进行异或,得第五比特图的第i位;
    确定所述第一属性值与所述第二属性值相减的第二符号;
    根据所述第二符号和所述第五比特图,确定所述第一属性值和所述第二属性值之差。
  13. 一种电子设备,其中,包括处理器,存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1-6任一项所述的数据处理方法的步骤。
  14. 一种可读存储介质,其中,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1-6任一项所述的数据处理方法的步骤。
  15. 一种芯片,其中,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1-6任一项所述的数据处理方法的步骤。
  16. 一种计算机程序产品,其中,所述程序产品被存储在非易失的存 储介质中,所述程序产品被至少一个处理器执行以实现如权利要求1-6任一项所述的数据处理方法的步骤。
  17. 一种数据处理装置,其中,包括所述装置被配置成用于执行如权利要求1-6任一项所述的数据处理方法。
PCT/CN2022/098297 2021-06-15 2022-06-13 数据处理方法、装置及电子设备 WO2022262663A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110661779.1 2021-06-15
CN202110661779.1A CN113407537B (zh) 2021-06-15 2021-06-15 数据处理方法、装置及电子设备

Publications (1)

Publication Number Publication Date
WO2022262663A1 true WO2022262663A1 (zh) 2022-12-22

Family

ID=77684100

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/098297 WO2022262663A1 (zh) 2021-06-15 2022-06-13 数据处理方法、装置及电子设备

Country Status (2)

Country Link
CN (1) CN113407537B (zh)
WO (1) WO2022262663A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113407537B (zh) * 2021-06-15 2024-02-06 维沃移动通信有限公司 数据处理方法、装置及电子设备

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101295316A (zh) * 2008-05-29 2008-10-29 北京握奇数据系统有限公司 位图索引方法以及智能卡
US20120209873A1 (en) * 2011-02-16 2012-08-16 International Business Machines Corporation Set-level comparisons in dynamically formed groups
CN108733681A (zh) * 2017-04-14 2018-11-02 华为技术有限公司 信息处理方法及装置
CN109255640A (zh) * 2017-07-13 2019-01-22 阿里健康信息技术有限公司 一种确定用户分组的方法、装置及系统
CN111737264A (zh) * 2020-07-20 2020-10-02 智者四海(北京)技术有限公司 信息处理方法及系统
CN111858617A (zh) * 2020-08-06 2020-10-30 贝壳技术有限公司 用户查找方法和装置、计算机可读存储介质、电子设备
CN112182021A (zh) * 2020-11-03 2021-01-05 浙江大搜车软件技术有限公司 一种用户数据查询方法、装置和系统
CN112732722A (zh) * 2021-01-19 2021-04-30 深圳市欢太科技有限公司 数据处理方法、数据处理装置、存储介质与电子设备
CN113407537A (zh) * 2021-06-15 2021-09-17 维沃移动通信有限公司 数据处理方法、装置及电子设备

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101295316A (zh) * 2008-05-29 2008-10-29 北京握奇数据系统有限公司 位图索引方法以及智能卡
US20120209873A1 (en) * 2011-02-16 2012-08-16 International Business Machines Corporation Set-level comparisons in dynamically formed groups
CN108733681A (zh) * 2017-04-14 2018-11-02 华为技术有限公司 信息处理方法及装置
CN109255640A (zh) * 2017-07-13 2019-01-22 阿里健康信息技术有限公司 一种确定用户分组的方法、装置及系统
CN111737264A (zh) * 2020-07-20 2020-10-02 智者四海(北京)技术有限公司 信息处理方法及系统
CN111858617A (zh) * 2020-08-06 2020-10-30 贝壳技术有限公司 用户查找方法和装置、计算机可读存储介质、电子设备
CN112182021A (zh) * 2020-11-03 2021-01-05 浙江大搜车软件技术有限公司 一种用户数据查询方法、装置和系统
CN112732722A (zh) * 2021-01-19 2021-04-30 深圳市欢太科技有限公司 数据处理方法、数据处理装置、存储介质与电子设备
CN113407537A (zh) * 2021-06-15 2021-09-17 维沃移动通信有限公司 数据处理方法、装置及电子设备

Also Published As

Publication number Publication date
CN113407537B (zh) 2024-02-06
CN113407537A (zh) 2021-09-17

Similar Documents

Publication Publication Date Title
WO2019153554A1 (zh) 数据关系展示方法、装置、计算机设备及存储介质
WO2012162399A2 (en) Dynamic visual statistical data display and navigation system and method for limited display device
CN107633347A (zh) 一种数据指标统计方法及装置
CN104794221A (zh) 一种基于业务对象的多维数据分析系统
WO2022262663A1 (zh) 数据处理方法、装置及电子设备
CN110288710A (zh) 一种三维地图的处理方法、处理装置及终端设备
CN108021610A (zh) 随机游走、基于分布式系统的随机游走方法、装置以及设备
CN116305895A (zh) 产品模型生成方法、装置、计算机设备和存储介质
CN112182004A (zh) 实时查看数据方法、装置、计算机设备及存储介质
CN108255963A (zh) 一种基于互联网的新闻信息检索的控制方法及装置
KR101413987B1 (ko) 마인드맵 사용자 인터페이스를 포함하는 전자기기, 및 이를 이용한 마인드맵 작성방법
WO2021093472A1 (zh) 数据处理方法、电子设备及可读存储介质
CN117151350A (zh) 用于决策管理的可视化看板系统、方法、设备以及介质
CN113821514A (zh) 数据拆分方法、装置、电子设备和可读存储介质
TWI719488B (zh) 具有一使用者介面之資料追蹤裝置、方法及其電腦程式產品
CN107391533A (zh) 生成图形数据库查询结果的方法及装置
CN113010769A (zh) 基于知识图谱的物品推荐方法、装置、电子设备及介质
CN116883563B (zh) 标注点渲染方法、装置、计算机设备、存储介质
CN114428578B (zh) 一种动态框选页面元素的方法及装置
Wu et al. UMine: Study on Prevalent Co-locations Mining from Uncertain Data Sets
US20220051274A1 (en) Utilizing a sketching generator to adaptively generate content-campaign predictions for multi-dimensional or high-dimensional targeting criteria
CN115908852A (zh) 图像处理的方法、装置、电子设备及存储介质
CN117113039A (zh) 数据处理方法和装置
CN116610667A (zh) 业务数据处理方法、装置、计算机设备和存储介质
CN117591520A (zh) 基于位图组的时空大数据计算方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22824143

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE