CN113190506B - Object attribute preservation method and device - Google Patents

Object attribute preservation method and device Download PDF

Info

Publication number
CN113190506B
CN113190506B CN202110486599.4A CN202110486599A CN113190506B CN 113190506 B CN113190506 B CN 113190506B CN 202110486599 A CN202110486599 A CN 202110486599A CN 113190506 B CN113190506 B CN 113190506B
Authority
CN
China
Prior art keywords
bitmap
attribute
target
value
object attribute
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110486599.4A
Other languages
Chinese (zh)
Other versions
CN113190506A (en
Inventor
郝国伟
严永亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202110486599.4A priority Critical patent/CN113190506B/en
Publication of CN113190506A publication Critical patent/CN113190506A/en
Application granted granted Critical
Publication of CN113190506B publication Critical patent/CN113190506B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method and a device for preserving object attributes, and belongs to the technical field of communication. The method comprises the following steps: acquiring a target object to be stored and an object attribute corresponding to the target object; determining a target bitmap file according to the object attribute; the target bitmap file comprises n first bitmap files and one second bitmap file, wherein n is a positive integer greater than or equal to 1; determining bitmap identification bits in the target bitmap file according to the object identification of the target object; and storing the object attribute based on the bitmap identification bit and the first bitmap file, and storing object attribute indicating information of the target object based on the bitmap identification bit and the second bitmap file.

Description

Object attribute preservation method and device
Technical Field
The application belongs to the technical field of communication, and particularly relates to an object attribute preservation method and device.
Background
With the advent of the big data age, the number of internet users is increasing, and some properties and behaviors of the users can generate a large amount of data, so that in order to make the data generate greater value, some internet platforms integrate the scattered data, normalize and subdivide the data, and push the normalized and subdivision results to an interactive marketing environment.
In the internet platform, the scattered data is structured and attributed by taking the user as a basic unit, and the attributes are calculated according to the service scene, so that various users can be accurately described. One common design is to store all users possessing the attribute in a Bitmap data structure with the attribute as dimension, and perform analysis and calculation.
The existing Bitmap data structure can save space through byte storage, and the computing performance is improved through Bit operation. However, there is a drawback in that the Bitmap has only one storage dimension, i.e. only the user is stored, and is not suitable for a scenario in which both the user and the user value are stored. For example, for a point attribute, the attribute may store users who possess points, but cannot store a point score corresponding to each user.
Disclosure of Invention
The embodiment of the application aims to provide an object attribute preservation method and device, which can solve the problem that a Bitmap in the prior art has only one storage dimension and is not suitable for storing objects and object attributes.
In a first aspect, an embodiment of the present application provides a method for saving an object attribute, where the method includes:
Acquiring a target object to be stored and an object attribute corresponding to the target object;
Determining a target bitmap file according to the object attribute; the target bitmap file comprises n first bitmap files and one second bitmap file, wherein n is a positive integer greater than or equal to 1;
Determining bitmap identification bits in the target bitmap file according to the object identification of the target object;
And storing the object attribute based on the bitmap identification bit and the first bitmap file, and storing object attribute indicating information of the target object based on the bitmap identification bit and the second bitmap file.
In a second aspect, an embodiment of the present application provides an object attribute saving apparatus, including:
the object attribute acquisition module is used for acquiring a target object to be stored and an object attribute corresponding to the target object;
the target bitmap file determining module is used for determining a target bitmap file according to the object attribute; the target bitmap file comprises n first bitmap files and one second bitmap file, wherein n is a positive integer greater than or equal to 1;
The bitmap identification bit determining module is used for determining bitmap identification bits in the target bitmap file according to the object identification of the target object;
And the object attribute storage module is used for storing the object attribute based on the bitmap identification bit and the first bitmap file and storing the object attribute indication information of the target object based on the bitmap identification bit and the second bitmap file.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, and a program or an instruction stored on the memory and executable on the processor, where the program or the instruction implements the steps of the object attribute preserving method according to the first aspect when executed by the processor.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which, when executed by a processor, implement the steps of the object property preservation method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction, and implement the method for preserving an object attribute according to the first aspect.
In the embodiment of the application, a target bitmap file is determined according to object attributes by acquiring a target object to be stored and object attributes corresponding to the target object, the target bitmap file comprises n first bitmap files and a second bitmap file, n is a positive integer greater than or equal to 1, bitmap identification bits in the target bitmap file are determined according to object identifications of the target object, the object attributes are stored on the basis of the bitmap identification bits and the first bitmap files, and object attribute indication information of the target object is stored on the basis of the bitmap identification bits and the second bitmap files. The embodiment of the application can solve the problem that the bitmap in the prior art has only one storage dimension and is not suitable for storing the object and the object attribute by combining a plurality of bitmap files to realize the storage of the object and the object attribute.
Drawings
FIG. 1 is a flowchart showing steps of a method for saving object attributes according to an embodiment of the present application;
FIG. 2 is a schematic diagram of segment storage according to an embodiment of the present application;
Fig. 3 is a schematic structural diagram of an object attribute storing device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions of the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which are obtained by a person skilled in the art based on the embodiments of the present application, fall within the scope of protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The method for saving object attributes provided by the embodiment of the application is described in detail below through specific embodiments and application scenarios thereof with reference to the accompanying drawings.
Referring to fig. 1, a step flowchart of an object attribute saving method provided by an embodiment of the present application is shown, and as shown in fig. 1, the object attribute saving method specifically may include the following steps:
step 101: and obtaining a target object to be stored and an object attribute corresponding to the target object.
The embodiment of the application can be applied to a scene for storing the object and the object attribute based on the bitmap file.
The target object refers to an object that needs to be stored, and in this example, the target object may be an object such as a user, and specifically, may be determined according to a service requirement, which is not limited in this embodiment.
The object attribute refers to an attribute of a target object, and in this example, the object attribute may be a numerical value, for example, the target object is exemplified by users, the object attribute may be an age attribute, and the like, and the age of each user is a numerical value.
It will be appreciated that the above examples are only examples listed for better understanding of the technical solution of the embodiments of the present application, and are not to be construed as the only limitation of the present embodiments.
When the object and the object attribute are required to be stored, a target object to be stored and the object attribute corresponding to the target object can be obtained.
After the target object to be stored and the object attribute corresponding to the target object are acquired, step 102 is executed.
Step 102: determining a target bitmap file according to the object attribute; the target bitmap file comprises n first bitmap files and one second bitmap file, wherein n is a positive integer greater than or equal to 1.
The target bitmap file refers to a bitmap file (bitmap) for storing the target object and the object attribute of the target object.
In a specific implementation, a bitmap is a Value corresponding to an element marked by a bit, and a Key is the element. Because the Bit is adopted as a unit to store data, the storage space can be greatly saved.
In this example, the target bitmap file may include n first bitmap files for storing object attributes of the target object and one second bitmap file for storing object attribute indication information of the target object, where n is a positive integer greater than or equal to 1.
After the target object to be stored and the object attribute corresponding to the target object are acquired, the target bitmap file may be determined according to the object attribute. The process of determining the target bitmap file may be described in detail in connection with the following specific implementation.
In a specific implementation of the present application, the step 102 may include:
substep A1: and obtaining the target object attribute with the largest attribute value in the object attributes.
In this embodiment, the target object attribute is an object attribute with the largest attribute value in the object attributes, for example, the object attribute includes a user 1, a user 2, and a user 3, where the age of the user 1 is 24, the age of the user 2 is 34, and the age of the user 3 is 12, and in this case, the age attribute corresponding to the user 2 may be taken as the target object attribute.
It will be appreciated that the above examples are only examples listed for better understanding of the technical solution of the embodiments of the present application, and are not to be construed as the only limitation of the present embodiments.
After the target object and the object attribute corresponding to the target object are obtained, the target object attribute with the largest attribute value in the object attributes can be obtained.
After the target object attribute having the largest attribute value among the object attributes is acquired, the sub-step A2 is performed.
Substep A2: and determining the bitmap files of the target number according to the target object attribute and a preset attribute value algorithm, and taking the bitmap files of the target number as the target bitmap files.
The preset attribute value algorithm refers to an algorithm preset by a service person for calculating an attribute value of an object attribute, and in this example, a specific calculation manner of the preset attribute value algorithm may be determined according to a service requirement, which is not limited in this embodiment.
The target number refers to the number of bitmaps for storing the object attribute and the object attribute indicating information of the target object, and in this example, the target number is equal to n+1.
After the target object attribute with the largest attribute value in the object attributes is obtained, a target number of bitmap files may be determined according to the target object attribute and a preset attribute value algorithm, and the target number of bitmap files may be used as the target bitmap files, which may be illustrated in the following table 1.
Table 1:
As shown in table 1 above, the ID may be used to indicate the object identifier of the target object, and in a specific implementation, in the system storage, a corresponding object identifier is allocated for each object, so as to distinguish different objects, and in table 1 above, the ID may be used as the identifier of the object. In this embodiment, the preset attribute value algorithm is a sum value algorithm based on 2 and the angle of bitmap is the power, for example, taking ID as1 as an example, the object attribute value of the object is 1, that is, 2 0. The object with ID 2 has an object attribute value of 6, i.e., 2 1+22. When the attribute value of the maximum object attribute is 13, then 2 0+22+23 may be calculated, where the maximum subscript is 3, that is, the number of bitmaps of the saved object attribute is 4, and one bitmap of the saved object attribute indicating information is added, that is, 5 bitmaps are needed to save the object attribute of the target object and the object attribute of the target object, that is, after knowing the preset attribute value algorithm and the maximum object attribute, the number of bitmap files is determined by means of reverse calculation, and then the bitmap files with the number is used as the target bitmap file.
It will be appreciated that the above examples are only examples listed for better understanding of the technical solution of the embodiments of the present application, and are not to be construed as the only limitation of the present embodiments.
Compared with the scheme that only attribute users can not store attribute values of the attribute users in the prior art, the embodiment of the application can be suitable for scenes in which both users and user values are to be stored.
After determining the target bitmap file from the object properties, step 103 is performed.
Step 103: and determining bitmap identification bits in the target bitmap file according to the object identification of the target object.
The bitmap identification bits refer to bit bits in the target bitmap file that match the object identification of the target object.
After determining the target bitmap file according to the object attribute, the bitmap identification bit in the target bitmap file may be determined according to the object identification of the target object, for example, taking table 1 as an example, where each target object corresponds to an ID, in the target bitmap file, the object identification corresponding to each bit may be indicated in advance, for example, the first bit corresponds to the object identification 1, the second bit corresponds to the object identification 2.
It will be appreciated that the above examples are only examples listed for better understanding of the technical solution of the embodiments of the present application, and are not to be construed as the only limitation of the present embodiments.
After the bitmap identification bits in the target bitmap file are determined according to the object identification of the target object, step 104 is performed.
Step 104: and storing the object attribute based on the bitmap identification bit and the first bitmap file, and storing object attribute indicating information of the target object based on the bitmap identification bit and the second bitmap file.
After the bitmap identification bit in the target bitmap file is determined according to the object identification of the target object, the object attribute of the target object may be saved based on the bitmap identification bit and the first bitmap file, and the object attribute indication information of the target object may be saved based on the bitmap identification bit and the second bitmap file, where the object attribute indication information may be used to indicate whether the attribute value of the target object exists, for example, using table 1 and the user integral described above as an example, when the user has an integral, if there is an integral of the user, 1 may be used as the object attribute indication information, and if there is no integral of the user, 0 may be used as the object attribute indication information.
The embodiment of the application can solve the problem that the bitmap in the prior art has only one storage dimension and is not suitable for storing users and user values by combining a plurality of bitmap files to realize the storage of the objects and the object attributes.
In this embodiment, after the object and the object attribute are saved by the plurality of bitmap files, the operation between the object attributes may be performed, and the operations such as intersection, union, complement, etc. may be performed between the plurality of bitmaps. For example, calculating intersections of three attributes of Bitmap1, bitmap2 and Bitamp, firstly judging bit values corresponding to the same lower label bit of the three bitmaps, if the bit values are all 1, indicating that the user exists in the three bitmaps, and as a result, the lower label bit in the bitmaps is also 1. Conversely, if the lower level of any Bitmap is 0, then the lower level of the resulting Bitmap is set to 0, as shown in Table 2 below:
Table 2:
After the intersection operation is performed on the Bitmap1, bitmap2, bitamp, the obtained Bitmap can be shown in the following table 3:
Table 3:
Bitmap 0 1 0 0 0 0
It will be appreciated that the above examples are only examples listed for better understanding of the technical solution of the embodiments of the present application, and are not to be construed as the only limitation of the present embodiments.
In this embodiment, for the case that the attribute value of the object attribute of the target object is a negative number, a non-integer, or a date attribute value, the following detailed description may be made in connection with the following specific implementation manner.
In a specific implementation of the present application, the step 104 may include:
substep B1: and when the object attribute is a non-integer value, adjusting the object attribute to obtain an adjustment attribute value, wherein the adjustment attribute value is an integer value.
In this embodiment, when the object attribute is a non-integer value, the object attribute may be adjusted to obtain an adjustment attribute value, and when the object attribute is 23.5, for example, the object attribute may be multiplied by 10 to obtain an adjustment attribute value 235. When the object attribute is 2.05, the object attribute may be multiplied by 100 to obtain the adjustment attribute value 205, etc.
It will be appreciated that the above examples are only examples listed for better understanding of the technical solution of the embodiments of the present application, and are not to be construed as the only limitation of the present embodiments.
After the object properties are adjusted to obtain the adjusted property values, sub-step B2 is performed.
Substep B2: and storing the adjustment attribute value based on the bitmap identification bit and the first bitmap file.
After the object attribute is adjusted to obtain an adjustment attribute value, the adjustment attribute value can be saved based on the bitmap identification bit and the first bitmap file, namely, the adjustment attribute value is saved by combining a preset algorithm at the bitmap identification bit in the first bitmap file, and the object attribute indication information corresponding to the adjustment attribute value is saved through the second bitmap file.
According to the embodiment of the application, the object attribute of the non-integer value is adjusted in advance and then stored in the bitmap file, so that the storage of the object attribute of the non-integer value can be realized.
In another specific implementation of the present application, the step 104 may include:
substep C1: and configuring a first reference attribute value in the case that the object attribute is a negative value.
In this embodiment, the first reference attribute value refers to a reference attribute that matches the object attribute, and in this example, the first reference attribute value may convert the object attribute with a negative value, that is, convert the negative value attribute into a positive value, and then store the positive value in the target bitmap file. In a specific implementation, the first reference attribute value may be 1, or may be 0, or may be, specifically, may be determined according to a service requirement, which is not limited in this embodiment.
In the case that the object attribute is a negative value, the first reference attribute value may be configured, in practical application, the first reference attribute value may be configured by a service personnel, or may be specified by a system, or the like, and specifically, the configuration manner of the first reference attribute value may be determined according to the service requirement, which is not limited in this embodiment.
After configuring the first reference attribute value, sub-step C2 is performed.
Substep C2: and determining a first numerical value corresponding to the object attribute according to the first reference attribute value.
The first value refers to a value obtained after converting the object attribute based on the first reference attribute value.
After the first reference attribute value is configured, a first numerical value corresponding to the object attribute may be determined according to the first reference attribute value.
After determining the first value corresponding to the object attribute according to the first reference attribute value, a sub-step C3 is performed.
Substep C3: and storing the object attribute to the first bitmap file according to the first numerical value and the bitmap identification bit.
After the first value corresponding to the object attribute is obtained, the object attribute may be saved to the first bitmap file according to the first value and the bitmap identification bit, specifically, the saving of the first value may be performed by combining a preset algorithm at the bitmap identification bit in the first bitmap file, and the object attribute indication information corresponding to the first value may be saved through the second bitmap file.
According to the embodiment of the application, the object attribute of the negative value is adjusted through the configured reference attribute value and then stored in the bitmap file, so that the object attribute of the negative value can be stored.
In another specific implementation of the present application, the step 104 may include:
Substep D1: and configuring a second reference attribute value in the case that the object attribute is a date attribute.
In this embodiment, the second reference attribute value refers to a reference attribute that matches the date attribute, and in this example, the second reference attribute value may convert the date attribute, that is, convert the date attribute into a numerical value of an integer, and then store the numerical value in the target bitmap file. In a specific implementation, the second reference attribute value may be a specific date, such as 20000101, and in particular, may be determined according to the service requirement, which is not limited in this embodiment.
In the case where the object attribute is a date attribute, a second reference attribute value may be configured.
After configuring the second reference property value, sub-step D2 is performed.
Substep D2: and determining a second numerical value corresponding to the object attribute according to the second reference attribute value.
The second value refers to a value obtained after converting the object attribute based on the second reference attribute value.
After the second reference attribute value is configured, a second value corresponding to the object attribute may be determined according to the second reference attribute value, for example, the second reference attribute value is a reference date, for example 20000101, the reference date may be stored as 1, and the date attribute 20200201 is converted, and the obtained value is 31.
It will be appreciated that the above examples are only examples listed for better understanding of the technical solution of the embodiments of the present application, and are not to be construed as the only limitation of the present embodiments.
And after determining the second value corresponding to the object attribute according to the second reference attribute value, executing the substep D3.
Substep D3: and storing the object attribute to the first bitmap file according to the second numerical value and the bitmap identification bit.
After the second value corresponding to the object attribute is obtained, the object attribute may be saved to the first bitmap file according to the second value and the bitmap identification bit, specifically, the saving of the second value may be performed by combining a preset algorithm at the bitmap identification bit in the first bitmap file, and the object attribute indication information corresponding to the second value may be saved through the second bitmap file.
According to the embodiment of the application, the date object attribute is adjusted through the configured reference attribute value and then stored in the bitmap file, so that the date attribute can be stored.
In this embodiment, after the target object and the object attribute of the target object are saved by the target bitmap file, the target bitmap file may be further stored in a distributed manner, and specifically, the following detailed description may be provided in connection with the following specific implementation manner.
In another specific implementation of the present application, after the step 104, the method may further include:
Step S1: and carrying out segmentation processing on the target bitmap file according to the set object number to obtain a plurality of segmented bitmap files corresponding to the target bitmap file.
In this embodiment, the number of set objects refers to the number of objects preset by the business personnel for segmenting the target bitmap file, and the specific value of the number of set objects may be determined according to the business requirement, which is not limited in this embodiment.
After the target object and the object attribute corresponding to the target object are stored in the target bitmap file, the target bitmap file may be subjected to segmentation processing according to the set number of objects, so as to obtain a plurality of segmented bitmap files corresponding to the target bitmap file, for example, the number of target objects stored in the target bitmap file is 1000, that is, the target bitmap file has 1000 bitmap identification bits, and the preset number of objects is 10, so that the target bitmap file may be divided into 100 segmented bitmap files, that is, 1-10, 11-20, and 991-1000.
It will be appreciated that the above examples are only examples listed for better understanding of the technical solution of the embodiments of the present application, and are not to be construed as the only limitation of the present embodiments.
After the target bitmap file is segmented according to the set number of objects to obtain a plurality of segmented bitmap files corresponding to the target bitmap file, step S2 is executed.
Step S2: and storing the plurality of segmented bitmap files in a slicing way.
After the target bitmap file is segmented to obtain a plurality of segmented bitmap files corresponding to the target bitmap file, the segmented bitmap files may be stored in a segmented manner, for example, as shown in fig. 2, a large attribute may be segmented into a plurality of non-repeated small segments by cutting Bit bits of a user, and stored on a plurality of computing nodes.
After storing the plurality of segmented bitmap files in segments, distributed query can be performed, firstly, after the coordination and summarization node receives a request with a query expression, the request is distributed to different segments (Shard), each segment contains a plurality of segments, the query is calculated in parallel in each segment, and the result of each segment is summarized to the segment. The fragments gather the results and then return the results to the coordination node, and the coordination node gathers the results of all fragments and returns the results to the final result of the user. In the query process of each segment, firstly, the query expression is analyzed and a query grammar tree is generated, and the corresponding attributes are respectively queried in the storage medium according to the query grammar tree. If the attribute is a non-numerical attribute, directly returning to the Bitmap; if the attribute is the numerical attribute, returning to BSI, filtering the users meeting the conditions according to the numerical query range, and returning Bimtap results. The query grammar tree performs bit operation on the bitmaps returned by the multiple calculations according to a query operator (intersection/union/complement), and generates a final Bitmap result.
According to the object attribute preservation method provided by the embodiment of the application, the object to be stored and the object attribute corresponding to the object are obtained, the object bitmap file is determined according to the object attribute, the object bitmap file comprises n first bitmap files and one second bitmap file, n is a positive integer greater than or equal to 1, the bitmap identification bit in the object bitmap file is determined according to the object identification of the object, the object attribute is preserved based on the bitmap identification bit and the first bitmap file, and the object attribute indication information of the object is preserved based on the bitmap identification bit and the second bitmap file. The embodiment of the application can solve the problem that the bitmap in the prior art has only one storage dimension and is not suitable for storing the object and the object attribute by combining a plurality of bitmap files to realize the storage of the object and the object attribute.
It should be noted that, in the object attribute saving method provided in the embodiment of the present application, the execution body may be an object attribute saving device, or a control module in the object attribute saving device for executing the object attribute saving method. In the embodiment of the present application, an object attribute saving device executes an object attribute saving method as an example, and the object attribute saving device provided in the embodiment of the present application is described.
Referring to fig. 3, a schematic structural diagram of an object attribute preserving apparatus according to an embodiment of the present application is shown, and as shown in fig. 3, the object attribute preserving apparatus 300 may specifically include the following modules:
An object attribute obtaining module 310, configured to obtain a target object to be stored and an object attribute corresponding to the target object;
A target bitmap file determining module 320, configured to determine a target bitmap file according to the object attribute; the target bitmap file comprises n first bitmap files and one second bitmap file, wherein n is a positive integer greater than or equal to 1;
A bitmap identification bit determining module 330, configured to determine a bitmap identification bit in the target bitmap file according to an object identification of the target object;
An object attribute saving module 340, configured to save the object attribute based on the bitmap identification bit and the first bitmap file, and save object attribute indication information of the target object based on the bitmap identification bit and the second bitmap file.
Optionally, the target bitmap file determining module 320 includes:
A target object attribute obtaining unit, configured to obtain a target object attribute with a maximum attribute value in the object attributes;
And the target bitmap file acquisition unit is used for determining the bitmap files of the target number according to the target object attribute and a preset attribute value algorithm, and taking the bitmap files of the target number as the target bitmap files.
Optionally, the object attribute saving module 340 includes:
An adjustment attribute value obtaining unit, configured to adjust the object attribute to obtain an adjustment attribute value when the object attribute is a non-integer value, where the adjustment attribute value is an integer value;
and the adjustment attribute value storage unit is used for storing the adjustment attribute value based on the bitmap identification bit and the first bitmap file.
Optionally, the object attribute saving module 340 includes:
A first reference attribute configuration unit configured to configure a first reference attribute value in a case where the object attribute is a negative value;
A first value determining unit, configured to determine a first value corresponding to the object attribute according to the first reference attribute value;
and the first object attribute storage unit is used for storing the object attribute into the first bitmap file according to the first numerical value and the bitmap identification bit.
Optionally, the object attribute saving module 340 includes:
a second reference attribute configuration unit configured to configure a second reference attribute value in a case where the object attribute is a date attribute;
A second value determining unit, configured to determine a second value corresponding to the object attribute according to the second reference attribute value;
and the second object attribute storage unit is used for storing the object attribute into the first bitmap file according to the second numerical value and the bitmap identification bit.
Optionally, the apparatus further comprises:
The segmented bitmap file acquisition module is used for carrying out segmented processing on the target bitmap file according to the number of the set objects to obtain a plurality of segmented bitmap files corresponding to the target bitmap file;
and the segmented bitmap file storage module is used for storing the segmented bitmap files in a segmented mode.
According to the object attribute storage device provided by the embodiment of the application, the object to be stored and the object attribute corresponding to the object are obtained, the object bitmap file is determined according to the object attribute, the object bitmap file comprises n first bitmap files and one second bitmap file, n is a positive integer greater than or equal to 1, the bitmap identification bit in the object bitmap file is determined according to the object identification of the object, the object attribute is stored based on the bitmap identification bit and the first bitmap file, and the object attribute indication information of the object is stored based on the bitmap identification bit and the second bitmap file. The embodiment of the application can solve the problem that the bitmap in the prior art has only one storage dimension and is not suitable for storing the object and the object attribute by combining a plurality of bitmap files to realize the storage of the object and the object attribute.
The object attribute preservation device in the embodiment of the application can be a device, and can also 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. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), etc., and the non-mobile electronic device may be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a Television (TV), a teller machine, a self-service machine, etc., and the embodiments of the present application are not limited in particular.
The object attribute saving device in the embodiment of the application can be a device with an operating system. The operating system may be an Android operating system, an ios operating system, or other possible operating systems, and the embodiment of the present application is not limited specifically.
The object attribute saving device provided by the embodiment of the present application can implement each process implemented by the method embodiment of fig. 1, and in order to avoid repetition, a description is omitted here.
Optionally, as shown in fig. 4, the embodiment of the present application further provides an electronic device 400, including a processor M401, a memory 402, and a program or an instruction stored in the memory 402 and capable of running on the processor 401, where the program or the instruction implements each process of the above embodiment of the object attribute preservation method when executed by the processor 401, and the process can achieve the same technical effect, and for avoiding repetition, a description is omitted herein.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device.
Fig. 5 is a schematic hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 500 includes, but is not limited to: radio frequency unit 501, network module 502, audio output unit 503, input unit 504, sensor 505, display unit 506, user input unit 507, interface unit 508, memory 509, and processor 510.
Those skilled in the art will appreciate that the electronic device 500 may further include a power source (e.g., a battery) for powering the various components, and that the power source may be logically coupled to the processor 510 via a power management system to perform functions such as managing charging, discharging, and power consumption via the power management system. The electronic device structure shown in fig. 5 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than shown, or may combine certain components, or may be arranged in different components, which are not described in detail herein.
The processor 510 is configured to obtain a target object to be stored and an object attribute corresponding to the target object; determining a target bitmap file according to the object attribute; the target bitmap file comprises n first bitmap files and one second bitmap file, wherein n is a positive integer greater than or equal to 1; determining bitmap identification bits in the target bitmap file according to the object identification of the target object; and storing the object attribute based on the bitmap identification bit and the first bitmap file, and storing object attribute indicating information of the target object based on the bitmap identification bit and the second bitmap file.
The embodiment of the application can realize the storage of the object and the object attribute, and can solve the problem that the bitmap in the prior art has only one storage dimension and is not suitable for storing the object and the object attribute.
Optionally, the processor 510 is further configured to obtain a target object attribute with a maximum attribute value of the object attributes; and determining the bitmap files of the target number according to the target object attribute and a preset attribute value algorithm, and taking the bitmap files of the target number as the target bitmap files.
Optionally, the processor 510 is further configured to, if the object attribute is a non-integer value, adjust the object attribute to obtain an adjusted attribute value, where the adjusted attribute value is an integer value; and storing the adjustment attribute value based on the bitmap identification bit and the first bitmap file.
Optionally, the processor 510 is further configured to configure a first reference attribute value if the object attribute is negative; determining a first numerical value corresponding to the object attribute according to the first reference attribute value; and storing the object attribute to the first bitmap file according to the first numerical value and the bitmap identification bit.
Optionally, the processor 510 is further configured to configure a second reference attribute value if the object attribute is a date attribute; determining a second numerical value corresponding to the object attribute according to the second reference attribute value; and storing the object attribute to the first bitmap file according to the second numerical value and the bitmap identification bit.
Optionally, the processor 510 is further configured to perform segmentation processing on the target bitmap file according to the set number of objects, to obtain a plurality of segmented bitmap files corresponding to the target bitmap file; and storing the plurality of segmented bitmap files in a slicing way.
The embodiment of the application can improve the subsequent data query efficiency by storing the bitmap file in a distributed manner, and can support mass data storage of hundreds of millions of levels.
It should be appreciated that in embodiments of the present application, the input unit 504 may include a graphics processor (Graphics Processing Unit, GPU) 5041 and a microphone 5042, with the graphics processor 5041 processing image data of still pictures or video obtained by an image capture device (e.g., a camera) in a video capture mode or an image capture mode. The display unit 506 may include a display panel 5061, and the display panel 5061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 507 includes a touch panel 5071 and other input devices 5072. Touch panel 5071, also referred to as a touch screen. Touch panel 5071 may include two parts, a touch detection device and a touch controller. Other input devices 5072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and so forth, which are not described in detail herein. The memory 509 may be used to store software programs as well as various data including, but not limited to, application programs and an operating system. Processor 510 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 510.
The embodiment of the application also provides a readable storage medium, on which a program or an instruction is stored, which when executed by a processor, implements each process of the above embodiment of the object attribute preservation method, and can achieve the same technical effects, so that repetition is avoided, and no further description is given here.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium such as a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.
The embodiment of the application further provides a chip, which comprises a processor and a communication interface, wherein the communication interface is coupled with the processor, and the processor is used for running programs or instructions to realize the processes of the embodiment of the object attribute preservation method, and the same technical effects can be achieved, so that repetition is avoided, and the description is omitted here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.

Claims (11)

1. An object attribute preservation method, comprising:
Acquiring a target object to be stored and an object attribute corresponding to the target object;
Determining a target bitmap file according to the object attribute; the target bitmap file comprises n first bitmap files and one second bitmap file, wherein n is a positive integer greater than or equal to 1;
Determining bitmap identification bits in the target bitmap file according to the object identification of the target object;
storing the object attribute based on the bitmap identification bit and the first bitmap file, and storing object attribute indication information of the target object based on the bitmap identification bit and the second bitmap file;
The determining the target bitmap file according to the object attribute comprises the following steps:
acquiring a target object attribute with the largest attribute value in the object attributes;
and determining the bitmap files of the target number according to the target object attribute and a preset attribute value algorithm, and taking the bitmap files of the target number as the target bitmap files.
2. The method of claim 1, wherein the saving the object attribute based on the bitmap identification bits and the first bitmap file comprises:
When the object attribute is a non-integer value, adjusting the object attribute to obtain an adjustment attribute value, wherein the adjustment attribute value is an integer value;
and storing the adjustment attribute value based on the bitmap identification bit and the first bitmap file.
3. The method of claim 1, wherein the saving the object attribute based on the bitmap identification bits and the first bitmap file comprises:
configuring a first reference attribute value in the case that the object attribute is negative;
determining a first numerical value corresponding to the object attribute according to the first reference attribute value;
and storing the object attribute to the first bitmap file according to the first numerical value and the bitmap identification bit.
4. The method of claim 1, wherein the saving the object attribute based on the bitmap identification bits and the first bitmap file comprises:
configuring a second reference attribute value in the case that the object attribute is a date attribute;
determining a second numerical value corresponding to the object attribute according to the second reference attribute value;
And storing the object attribute to the first bitmap file according to the second numerical value and the bitmap identification bit.
5. The method of claim 1, further comprising, after said storing said object attribute based on said bitmap identification bit and said first bitmap file, and storing said object attribute indication information of said target object based on said bitmap identification bit and said second bitmap file:
according to the number of the set objects, carrying out segmentation processing on the target bitmap file to obtain a plurality of segmented bitmap files corresponding to the target bitmap file;
and storing the plurality of segmented bitmap files in a slicing way.
6. An object attribute saving apparatus, comprising:
the object attribute acquisition module is used for acquiring a target object to be stored and an object attribute corresponding to the target object;
the target bitmap file determining module is used for determining a target bitmap file according to the object attribute; the target bitmap file comprises n first bitmap files and one second bitmap file, wherein n is a positive integer greater than or equal to 1;
The bitmap identification bit determining module is used for determining bitmap identification bits in the target bitmap file according to the object identification of the target object;
the object attribute preservation module is used for preserving the object attribute based on the bitmap identification bit and the first bitmap file and preserving object attribute indication information of the target object based on the bitmap identification bit and the second bitmap file;
the target bitmap file determining module includes:
A target object attribute obtaining unit, configured to obtain a target object attribute with a maximum attribute value in the object attributes;
And the target bitmap file acquisition unit is used for determining the bitmap files of the target number according to the target object attribute and a preset attribute value algorithm, and taking the bitmap files of the target number as the target bitmap files.
7. The apparatus of claim 6, wherein the object property preservation module comprises:
An adjustment attribute value obtaining unit, configured to adjust the object attribute to obtain an adjustment attribute value when the object attribute is a non-integer value, where the adjustment attribute value is an integer value;
and the adjustment attribute value storage unit is used for storing the adjustment attribute value based on the bitmap identification bit and the first bitmap file.
8. The apparatus of claim 6, wherein the object property preservation module comprises:
A first reference attribute configuration unit configured to configure a first reference attribute value in a case where the object attribute is a negative value;
A first value determining unit, configured to determine a first value corresponding to the object attribute according to the first reference attribute value;
and the first object attribute storage unit is used for storing the object attribute into the first bitmap file according to the first numerical value and the bitmap identification bit.
9. The apparatus of claim 6, wherein the object property preservation module comprises:
a second reference attribute configuration unit configured to configure a second reference attribute value in a case where the object attribute is a date attribute;
A second value determining unit, configured to determine a second value corresponding to the object attribute according to the second reference attribute value;
and the second object attribute storage unit is used for storing the object attribute into the first bitmap file according to the second numerical value and the bitmap identification bit.
10. The apparatus of claim 6, wherein the apparatus further comprises:
The segmented bitmap file acquisition module is used for carrying out segmented processing on the target bitmap file according to the number of the set objects to obtain a plurality of segmented bitmap files corresponding to the target bitmap file;
and the segmented bitmap file storage module is used for storing the segmented bitmap files in a segmented mode.
11. An electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the object property preservation method of any one of claims 1-5.
CN202110486599.4A 2021-04-30 2021-04-30 Object attribute preservation method and device Active CN113190506B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110486599.4A CN113190506B (en) 2021-04-30 2021-04-30 Object attribute preservation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110486599.4A CN113190506B (en) 2021-04-30 2021-04-30 Object attribute preservation method and device

Publications (2)

Publication Number Publication Date
CN113190506A CN113190506A (en) 2021-07-30
CN113190506B true CN113190506B (en) 2024-07-09

Family

ID=76983439

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110486599.4A Active CN113190506B (en) 2021-04-30 2021-04-30 Object attribute preservation method and device

Country Status (1)

Country Link
CN (1) CN113190506B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108415978A (en) * 2018-02-09 2018-08-17 北京腾云天下科技有限公司 User tag storage method, user's portrait computational methods and computing device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1211610A1 (en) * 2000-11-29 2002-06-05 Lafayette Software Inc. Methods of organising data and processing queries in a database system
US20050216518A1 (en) * 2004-03-26 2005-09-29 Oracle International Corporation Database management system with persistent, user-accessible bitmap values
US9280780B2 (en) * 2014-01-27 2016-03-08 Umbel Corporation Systems and methods of generating and using a bitmap index
CN105930366A (en) * 2016-04-13 2016-09-07 郑州悉知信息科技股份有限公司 Statistical method and device
CN106445588B (en) * 2016-09-08 2018-05-04 腾讯科技(深圳)有限公司 The update method and device of attribute information
CN108415952B (en) * 2018-02-02 2020-10-16 北京腾云天下科技有限公司 User data storage method, label calculation method and calculation equipment
CN110134721B (en) * 2019-05-17 2021-05-28 智慧足迹数据科技有限公司 Data statistics method and device based on bitmap and electronic equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108415978A (en) * 2018-02-09 2018-08-17 北京腾云天下科技有限公司 User tag storage method, user's portrait computational methods and computing device

Also Published As

Publication number Publication date
CN113190506A (en) 2021-07-30

Similar Documents

Publication Publication Date Title
CN107102941B (en) Test case generation method and device
CN111159413A (en) Log clustering method, device, equipment and storage medium
US11615607B2 (en) Convolution calculation method, convolution calculation apparatus, and terminal device
CN113190741B (en) Search method, search device, electronic equipment and storage medium
CN112035320A (en) Service monitoring method and device, electronic equipment and readable storage medium
CN114840565A (en) Sampling query method, device, electronic equipment and computer readable storage medium
CN114254014A (en) Business data display method, device, equipment and storage medium
EP3564833B1 (en) Method and device for identifying main picture in web page
CN113190506B (en) Object attribute preservation method and device
CN116597443A (en) Material tag processing method and device, electronic equipment and medium
CN113590447B (en) Buried point processing method and device
CN113364915B (en) Information display method and device and electronic equipment
CN115408547A (en) Dictionary tree construction method, device, equipment and storage medium
CN111858395B (en) Data management method and device
CN114969444A (en) Data processing method and device, electronic equipment and storage medium
CN113590322A (en) Data processing method and device
CN113032402B (en) Method, device, equipment and storage medium for storing data and acquiring data
CN111506737B (en) Graph data processing method, searching method, device and electronic equipment
CN113705722B (en) Method, device, equipment and medium for identifying operating system version
US20230418878A1 (en) Multi-model enrichment memory and catalog for better search recall with granular provenance and lineage
CN110909190B (en) Data searching method and device, electronic equipment and storage medium
CN114328676A (en) Time window detection method and device
CN115659953A (en) Address similarity real-time calculation method, system, storage medium and computer equipment
CN116450439A (en) Lookup table testing method and device and electronic equipment
CN115858699A (en) Data warehouse construction method and device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant