Object data processing method and device, equipment and storage medium
Through object distribution storage and bitmap data sharding technology, the problem of uncontrollable object data storage update cycle and low bitmap computing efficiency in the prior art is solved, and efficient massive data processing and query performance is achieved.
Patent Information
- Application Number
- CN202310497621.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-05
- Publication Date
- 2024-11-15
AI Technical Summary
When storing object data in the prior art, wide table schemes lead to uncontrollable update cycles and long writing time; vertical table schemes have sharply reduced bitmap computing efficiency in massive data scenarios and cannot meet performance requirements.
By obtaining the object data to be stored, using the full number of objects identified continuously to realize object distribution storage, aggregate the granularity to object attribute information, bitmap conversion and data sharding of the object attribute table, distributed storage to multiple data tables, supporting infinite horizontal expansion.
It improves data sharding, storage and query efficiency, is suitable for massive data scenarios, significantly improves computing efficiency and update timeliness, and realizes the distributed query performance of bitmap data.
Smart Images

Figure CN118964674A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an object data processing method, apparatus, device and storage medium. Background Art
[0002] Object data includes object attribute information and identification information of objects, and is the data foundation of related object businesses. It is widely used in scenarios such as business delivery, recommendation, and growth operations to improve core business indicators such as daily active users and click-through rates. The current storage of object data is mainly based on the storage structure of wide tables and vertical tables. In the wide table solution, various types of object attribute data are combined to form a large wide table, which is then imported into the corresponding storage engine for storage and query. In the vertical table solution, the object data is converted into a list, and then the object attribute data corresponding to the object attribute information is stored in a bitmap. The former solution needs to wait for various attribute data to be updated, resulting in an uncontrollable update cycle for the stored object data and a long writing time. When the latter solution is applied to massive data scenarios, the computing efficiency of the bitmap drops sharply, the update timeliness is poor, and it cannot meet performance requirements. Summary of the invention
[0003] The present application provides an object data processing method, apparatus, device and storage medium, which specifically include the following schemes.
[0004] In one aspect, the present application provides a method for processing object data, the method comprising:
[0005] Acquire object data to be stored, the object data to be stored including a unique object identifier of all objects and object attribute information of at least one attribute dimension of the all objects, the unique object identifier of the all objects being a continuous number, and the object attribute information being used to characterize an attribute category of the object;
[0006] Aggregating the unique object identifiers of all objects with the object attribute information as the aggregation granularity to obtain an attribute object table, wherein the attribute object table includes the unique object identifiers of objects corresponding to the same object attribute information;
[0007] Performing bitmap conversion on the attribute object table to obtain object bitmap data corresponding to each object attribute information;
[0008] Slice the bitmap data of each object based on the unique object identifier to obtain a plurality of bitmap data slices of each object bitmap data, wherein the bitmap data slices include a plurality of unique object identifiers in the object attribute table;
[0009] Based on the correspondence between the object attribute information and the object bitmap data, a plurality of bitmap data slices of each object bitmap data are distributed and stored in a plurality of data tables, and the data tables are used for associatively storing the bitmap data slices and the object attribute information.
[0010] Another aspect provides an object data processing device, the device comprising:
[0011] An object data acquisition module is used to acquire object data to be stored, wherein the object data to be stored includes a unique object identifier of all objects and object attribute information of at least one attribute dimension of the all objects, wherein the unique object identifier of the all objects is a continuous number, and the object attribute information is used to characterize the attribute category of the object;
[0012] Attribute aggregation module: used to aggregate the unique object identifiers of all objects with the object attribute information as the aggregation granularity to obtain an attribute object table, wherein the attribute object table includes the unique object identifiers of objects corresponding to the same object attribute information;
[0013] A bitmap conversion module: used to perform bitmap conversion on the attribute object table to obtain object bitmap data corresponding to each object attribute information;
[0014] A data slicing module: used for slicing the bitmap data of each object based on the unique object identifier to obtain a plurality of bitmap data slices of each object bitmap data, wherein the bitmap data slices include a plurality of unique object identifiers in the object attribute table;
[0015] Slice storage module: used to distribute and store multiple bitmap data slices of each object bitmap data into multiple data tables based on the correspondence between the object attribute information and the object bitmap data, and the data tables are used to associate and store the bitmap data slices with the object attribute information.
[0016] On the other hand, a computer device is provided, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the object data processing method as described above.
[0017] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored in the storage medium, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the object data processing method as described above.
[0018] On the other hand, a server is provided, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the object data processing method as described above.
[0019] On the other hand, a terminal is provided, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the object data processing method as described above.
[0020] On the other hand, a computer program product or a computer program is provided, which includes computer instructions, and when the computer instructions are executed by a processor, the object data processing method as described above is implemented.
[0021] The object data processing method, apparatus, device, storage medium, server, terminal, computer program and computer program product provided by this application have the following technical effects:
[0022] The present application first obtains the object data to be stored, the object data to be stored includes the unique object identifier of the whole object and the object attribute information of at least one attribute dimension of the whole object, the unique object identifier of the whole object is a continuous number, and the object attribute information is used to characterize the attribute category of the object, so as to realize the distributed storage of objects through the whole object with continuous identifiers, meet the digital type requirements of bitmap data, and help improve the subsequent data sharding, storage and query efficiency; then, the unique object identifier of the whole object is aggregated with the object attribute information as the aggregation granularity to obtain the attribute object table, which includes the unique object identifier of the object corresponding to the same object attribute information, so as to realize attribute classification, so as to realize the attribute classification storage and Query; then perform bitmap conversion on the attribute object table to obtain object bitmap data corresponding to each object attribute information, and perform data slicing on each object bitmap data based on a unique object identifier with a numerical continuity property to obtain multiple bitmap data slices of each object bitmap data; based on the correspondence between the object attribute information and the object bitmap data, distribute and store the multiple bitmap data slices of each object bitmap data in multiple data tables; perform distributed storage based on the bitmap data slices for objects of each type of object attribute information, and support unlimited horizontal expansion, which can be applicable to massive data scenarios, effectively improve computing efficiency and update timeliness, and at the same time can realize distributed query of bitmap data, significantly improving data query performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 is a schematic diagram of an application environment provided by an embodiment of the present application;
[0025] Figure 2 It is a flowchart of an object data processing method provided in an embodiment of the present application;
[0026] Figure 3 is a flowchart of another object data processing method provided in an embodiment of the present application;
[0027] Figure 4 It is a schematic diagram of the principle of an identification conversion method provided in an embodiment of the present application;
[0028] Figure 5 It is a schematic diagram of the principle of an object bitmap data sharding storage and query method provided in an embodiment of the present application;
[0029] Figure 6 It is a schematic diagram of a multi-table query in an object data storage in the prior art;
[0030] Figure 7 This is a schematic diagram of a framework of an object data storage method provided in an embodiment of the present application;
[0031] Figure 8 This is a flow diagram of a method for storing object data provided by an embodiment of the present application;
[0032] Fig. 9 It is an experimental data diagram of the object data processing method provided in the embodiment of the present application;
[0033] Fig.10 is a schematic diagram of a framework of an object data processing device provided by an embodiment of the present application;
[0034] Fig.11 It is a hardware structure block diagram of an electronic device of an object data processing method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0036] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server comprising a series of steps or submodules is not necessarily limited to those steps or submodules clearly listed, but may include other steps or submodules that are not clearly listed or inherent to these processes, methods, products or devices.
[0037] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0038] Bitmap: A compact computer data structure in which each bit represents a number and can perform logical operations. It is widely used in the computer field.
[0039] Object attribute information: is information that describes the characteristics, operations, or requirements of an object, and is intended to better understand the target object. It can be applied to products and services targeting the object.
[0040] There are two main ways to store object data: 1) Based on wide tables, object data of various object attribute information are merged into a large wide table (Table 1), and then imported into the corresponding storage engine for query; 2) Based on vertical tables, object data is converted into a list (Table 2), the bitmap of the corresponding object attribute information is stored, and then the logical operation of the bitmap is used to support object attribute analysis, export and other functions.
[0041] Table 1
[0042] Object origin ID gender age a male 25 b male 30 c female 35
[0043] Table 2
[0044] Tag Name Tag value Bitmap gender male [a, b] gender female [c]
[0045] The above existing solutions will experience a sharp decline in performance, poor compatibility, and update timeliness when the number of large data objects is greater than 10 billion. Specifically, the wide table-based solution needs to wait for the update of the source table data of various object attribute information to be completed, resulting in the uncontrollable entire update cycle and a long import time. The vertical table-based solution only supports digital object IDs and is not compatible with string object IDs, such as device numbers. The upper limit of a single bitmap storage ID is 2. 32 , can only support a maximum of 4 billion identification storage, which does not meet the needs of massive data scenarios, and has poor scalability. When the object size increases (e.g., the number of objects with gender = male exceeds 1 billion), the bitmap operation efficiency drops sharply and the performance cannot meet the requirements. In view of this, in order to solve at least one of the above existing problems, this application proposes the following technical solution.
[0046] See also Figure 1 , Figure 1 is a schematic diagram of an application environment provided by an embodiment of the present application, such as Figure 1 As shown, the application environment may include at least a terminal 01 and a server 02. In practical applications, the terminal 01 and the server 02 may be directly or indirectly connected via wired or wireless communication, which is not limited in this application.
[0047] The server 02 in the embodiment of the present application can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0048] Specifically, cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or a local area network to achieve data computing, storage, processing, and sharing. Cloud technology can be applied to various fields, such as medical cloud, cloud Internet of Things, cloud security, cloud education, cloud conferencing, artificial intelligence cloud services, cloud applications, cloud calls, and cloud social networking. Cloud technology is based on the cloud computing business model application. It distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space, and information services as needed. The network that provides resources is called a "cloud". The resources in the "cloud" are infinitely expandable in the eyes of users, and can be obtained at any time, used on demand, expanded at any time, and paid for by use. As a basic capability provider for cloud computing, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service)) platform will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.
[0049] According to the logical function division, the PaaS (Platform as a Service) layer can be deployed on the IaaS layer, and the SaaS (Software as a Service) layer can be deployed on the PaaS layer, or SaaS can be directly deployed on IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is a variety of business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.
[0050] Specifically, the server 02 mentioned above may include a physical device, which may specifically include a network communication submodule, a processor, a memory, etc., and may also include software running in the physical device, which may specifically include an application program, etc.
[0051] Specifically, terminal 01 may include physical devices such as smart phones, desktop computers, tablet computers, laptops, digital assistants, augmented reality (AR) / virtual reality (VR) devices, intelligent voice interaction devices, smart home appliances, smart wearable devices, and vehicle-mounted terminal devices, and may also include software running in physical devices, such as applications.
[0052] In an embodiment of the present application, terminal 01 can be used to send the original object identifier of the object to server 02, as well as collect data related to the object attribute information of the object and send it to server 02; server 02 can generate the object data to be stored based on the data related to the object attribute information, and through operations such as data aggregation, bitmap conversion and data sharding with the object attribute information as the aggregation granularity, the unique object identifier and object attribute information in the object data to be stored are distributedly associated and stored in multiple data tables.
[0053] Furthermore, it is understandable that Figure 1 What is shown is merely an application environment of an object data processing method, and the application environment may include more or fewer nodes, and the present application does not impose any limitation thereto.
[0054] The application environment involved in the embodiment of the present application, or the terminal 01 and the server 02 in the application environment, etc., can be a distributed system formed by connecting a client and multiple nodes (any form of computing devices in the access network, such as a server, a user terminal) through network communication. The distributed system can be a blockchain system, which can provide the above-mentioned object data processing services and data storage services, etc.
[0055] The following is an introduction to an object data processing method of the present application based on the above application environment. The present application embodiment can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc. Please refer to Figure 2 , Figure 2It is a flow chart of an object data processing method provided by an embodiment of the present application. This specification provides method operation steps such as the embodiment or flow chart, but more or less operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the order of many steps, and does not represent the only execution order. When the system or server product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiment or the accompanying drawings (for example, a parallel processor or a multi-threaded processing environment). The technical solution of the present application can be applied to scenarios such as precise delivery, object recommendation, and growth operation, and can help improve the core indicators of the business such as DAU (daily active objects), object duration, CTR (click-through rate), etc. For example, in object recommendation, short-term object interest data helps to push content of interest to the object, improve business experience, or in precise delivery scenarios, relevant information can be pushed to objects of a class of attribute categories to obtain a higher conversion rate. Among them, DAU refers to the number of independent objects that visit or use a specific application, website, or platform within a specific date (usually one day). CTR (click-through rate) is a widely used metric in the advertising industry, which represents the ratio between the number of times an ad is clicked and the number of times the ad is displayed. Object duration refers to the average time an object stays on an application, website, or platform. It usually refers to the time each object stays in a single session. It is used to measure the object's stickiness and engagement with the product.
[0056] Specifically, Figure 2 As shown, the method may include the following steps S201-S209.
[0057] S201: Acquire object data to be stored, where the object data to be stored includes a unique object identifier of all objects and object attribute information of at least one attribute dimension of all objects.
[0058] Specifically, all objects refer to all objects that need to be stored, and objects refer to entities that can interact with related businesses, such as application accounts or devices; each object in the full set of objects uniquely corresponds to a unique object identifier, and the unique object identifier is obtained by converting the original object identifier of the object; the unique object identifier of the full set of objects is a continuous number, that is, the unique object identifier of each object in the full set of objects is a continuous number. For example, if the full set of objects includes 1 billion objects, the unique object identifiers of the 1 billion objects can be 1, 2, 3, 4...1 billion, respectively, which are continuous natural numbers.
[0059] Specifically, the attribute dimension is used to characterize the category to which the object attribute information belongs, which can be a label category, such as activity level, gender or age, etc.; the object attribute information is used to characterize the attribute category of the object, which can be a label value of the object, such as activity level value, gender code or age range, etc. It can be understood that the same object can have multiple object attribute information.
[0060] In some embodiments, the unique object identifier is obtained using the following method S301-S309:
[0061] S301: Obtain all object identification data and the latest identifications of multiple object partitions.
[0062] Specifically, the full object identification data includes the original object identification of the full object. The original object identification refers to the identification information that uniquely corresponds to the object. The original object identification can be information of any data type, such as a string or an integer, etc. The type of the unique object identification is a number. The original object identification can be an identification obtained by the SDK module in the client based on the basic information of the object through ID conversion. It has uniqueness and continuity, that is, the same object uniquely corresponds to one original object identification, and the original object identification generated by the same object on different devices or environments is the same. Specifically, the current latest identification of each object partition can be obtained each time.
[0063] Specifically, the object partition is used to associate and store the original object identifier and the unique object identifier of the same object. Multiple object partitions may refer to all object partitions preset for associating and storing the original object identifier and the unique object identifier. The current latest identifier is used to indicate the unique object identifier with the largest value currently stored in the object partition. As mentioned above, the unique object identifiers of all objects are consecutive numbers, and the unique object identifiers of each object are assigned based on the order of values from small to large. In each object partition, the unique object identifier with the largest value is the current latest identifier, that is, the most recently written identifier. Exemplarily, the unique object identifier with the largest value in object partition 1 is 1570, and the current latest identifier of object partition 1 is 1570.
[0064] It can be understood that in the initial state, there is no historical full object table, and accordingly, each object partition is empty.
[0065] Specifically, refer to Figure 4, M object partitions can be preset, and the preset number of object partitions M can be determined based on the estimated number of original object identifiers (i.e., the number of objects in the full object). Exemplarily, the full object identifier data includes 10 billion original object identifiers, and 1,000 object partitions are pre-allocated. Each partition is responsible for a corresponding digital range. Object partition 0 is responsible for original object identifiers with unique object identifiers of 0-10 million, object partition 1 is responsible for original object identifiers with unique object identifiers of 10 million-20 million, and so on. Accordingly, obtaining the full object identifier data may include S3011-S3012:
[0066] S3011: Acquire a current full object table and a historical full object table; the historical full object table is a full object table updated in a previous update cycle corresponding to the current full object table, and the full object table stores at least the original object identifier of the object;
[0067] S3012: Perform a connection operation on the current full object table and the historical full object table to obtain full object identification data.
[0068] Specifically, the current full object table includes the original object identifier of the full object of the current update cycle, and the full object of the current update cycle includes the historical original object identifier in the historical full object table and the updated incremental original object identifier. The update cycle refers to the time interval for periodically updating the full object table. Exemplarily, the update cycle can be, for example, 1 hour. It can be understood that in the initial state, if there is no historical full object table, the current full object table (T) is used as the full object identification data, and after obtaining the full object table of the next cycle, the current full object table is used as the historical full object table (T-1). Specifically, the connection operation refers to the join operation, that is, joining the current full object table and the historical full object table, and the output connection result set is the full object identification data. Specifically, the join operation can specifically include searching and merging the same original object identifiers in the current full object table and the historical full object table, and incrementing the incremental original object identifier. In this way, by storing the full object tables of two adjacent update cycles, it is convenient for subsequent incremental object determination, thereby avoiding repeated identification conversion of historical original object identifiers, reducing data calculation volume, and improving data update efficiency.
[0069] S303: Determine, from the plurality of object partitions, a target object partition corresponding to the original object identifier of each object in the full set of objects.
[0070] Specifically, the original object identifier is hash partitioned to determine the target object partition to which it belongs. Hash partitioning is a data partitioning method that divides the original object identifier into different object partitions based on hash operations. Hash partitioning may include but is not limited to modulo method, virtual bucket or consistent hashing, etc. Specifically, the full amount of object identifier data may be a connected table, each row is the original object identifier of an object, and the row number of the original object identifier may be hashed to obtain a hash operation value, and the hash operation value may be partitioned (such as modulo operation) to obtain a hash result of the original object identifier (such as a remainder value), so as to determine the object partition corresponding to the hash result as the target object partition of the original object identifier. Exemplarily, in a scenario of 10 billion objects, the row number starts from 0, and so on. The row number is modulo 1000 (number of partitions), and the value obtained is the hash operation value. If the remainder value of the hash operation value is 1 (such as row number 1), then object partition 1 (10-20 million) is the target object partition. The hash result of the original object identifier uniquely corresponds to an object partition.
[0071] S305: For each original object identifier, search the target object partition for a unique object identifier associated with the original object identifier.
[0072] Specifically, the object partition is used to associate and store the original object identifier and the unique object identifier, which can be stored in a table form, and the original object identifier and the unique object identifier of the same object are stored in the same row. The target object partition to which the original object identifier belongs is searched to see whether the unique object identifier has been assigned to the object.
[0073] S307: For the incremental original object identifier for which no associated unique object identifier is found, perform incremental identifier conversion of the incremental original object identifier based on the current latest identifier corresponding to the incremental original object identifier to obtain the unique object identifier corresponding to the incremental original object identifier.
[0074] Specifically, the incremental original object identifier is the original object identifier for which the associated unique object identifier is not found in the target object partition to which it belongs, and the unique object identifier was not assigned in the last update cycle. The current latest identifier corresponding to the incremental original object identifier refers to the current latest identifier in the target object partition to which the incremental original object identifier belongs. Incremental identifier conversion refers to assigning a unique object identifier on the basis of the current latest identifier, so that it increments the current latest identifier as the unique object identifier of the object; when there are multiple incremental original object identifiers in the same target object partition, on the basis of the current latest identifier obtained above, the current latest identifier is incremented in sequence to obtain multiple unique object identifiers that are incremented in sequence, so that the unique object identifiers stored in the target object partition before and after the update are continuous numbers with increasing values. Exemplarily, the current latest identifier of the target object partition 0 (0-10 million) is 10000, and there are 2 incremental original object identifiers, then the unique object identifiers after the corresponding incremental identifier conversion are 10001 and 10002 respectively.
[0075] Specifically, the method for converting the original object identifier into a unique object identifier may be Id-mapping. Id-mapping is a technology for converting ids and supports a technical solution for converting any type of (string, number) information into numbers.
[0076] S309: for the historical original object identifier with the associated unique object identifier found, reuse the unique object identifier associated with the historical original object identifier.
[0077] Specifically, the historical original object identifier refers to the original object identifier that has been assigned a unique object identifier in the corresponding target object partition. If it has been assigned or has a unique object identifier in the previous update cycle, the original unique object identifier is directly reused to ensure the continuity of the unique object identifier.
[0078] In this way, the original object identifier is stored through object partitions, and the corresponding unique object identifier is stored in each partition, which improves the efficiency of subsequent identifier queries, realizes incremental identifier allocation and reuse of existing identifiers, avoids repeated identifier conversion operations, reduces resource waste, and improves identifier update efficiency.
[0079] In some embodiments, the method further includes S311-S313:
[0080] S311: associate and store the incremental original object identifier and the unique object identifier corresponding to the incremental original object identifier in the target object partition;
[0081] S313: Update the current latest identifier of the target object partition based on the unique object identifier corresponding to the incremental original object identifier.
[0082] Specifically, after the unique object identifier of the incremental original object identifier is generated, it is associated and stored in the target object partition to which the incremental original object identifier belongs. After the incremental data update is completed, the current latest identifier in each target object partition is updated to facilitate the incremental allocation of identifiers in the subsequent update process and improve the efficiency of identifier conversion.
[0083] In one embodiment, each row in the full object table stores the original object identifier of an object. Figure 4 , the current full object table T and the historical full object table T-1, as well as the current latest identifier of each object partition, can be read through the identifier mapping module, and the connection table is obtained after joining T and T-1. The row number of each row of the original identifier data in the link table is hashed to obtain the hash result uid. If it is 0, it is assigned to object partition 0, and so on; if the unique object identifier of the original object identifier has been assigned in the partition (such as aaa and bbb), direct reuse can meet the continuity of the unique object identifier; if it is not assigned (such as ccc and zzz), the unique object identifier is incrementally assigned (the unique object identifiers of ccc and zzz are 3 and 4 respectively); and the historical full object table of T-1 is retained, so that the unique object identifier assigned in the previous update cycle can be obtained in the current update cycle, and the current latest identifier is updated based on T. Specifically, the identifier mapping module can be built based on the spark program.
[0084] S203: Aggregate the unique object identifiers of all objects using the object attribute information as the aggregation granularity to obtain an attribute object table.
[0085] Specifically, the attribute object table includes the unique object identifier of the object corresponding to the same object attribute information, that is, the same attribute object table only stores the unique object identifier of the same object attribute information. It can be understood that the same unique object identifier can be written into multiple attribute object tables. The attribute object table can be specifically an identifier list.
[0086] Specifically, the aggregation granularity refers to the cluster of clusters, which is the object attribute information, and can be specifically a certain label value. Aggregating the unique object identifiers of all objects with the object attribute information as the aggregation granularity means that for each object attribute information in the object attribute information of at least one attribute dimension mentioned above, the objects with the object attribute information are found from all objects, and an attribute object table is generated based on the unique object identifiers of the found objects. Exemplarily, the unique object identifiers of all male objects in the total objects can be aggregated with the male gender as the aggregation granularity to generate an attribute object table corresponding to the male gender. Preferably, the attribute object table can be sorted based on the numerical order of the unique object identifiers.
[0087] S205: Perform bitmap conversion on the attribute object table to obtain object bitmap data corresponding to each object attribute information.
[0088] Specifically, each object bitmap data is a Bitmap, which is a compact computer data structure in which each bit represents a number, which can represent a unique object identifier and can perform logical operations. In this application, a 32-bit Bitmap is used as the storage structure of the object bitmap data, and its bitmap storage capacity is 2 32 , that is, the upper limit of the number of unique object identifiers that can be stored is 4 billion. Bitmap conversion refers to converting list data into a bitmap, which can be done by existing methods and is not limited in this application. For each object attribute information, its corresponding attribute object table is converted into a bitmap associated with the object attribute information to obtain its corresponding object bitmap data.
[0089] In some embodiments, in a big data scenario, the number of objects is huge, such as more than 10 billion, and the object of a single object attribute information may also be very large. The number of unique object identifiers may exceed the capacity of a single bitmap (such as the aforementioned 4 billion). If it is replaced with a 64-bit bitmap storage, it will cause a lot of storage waste. To solve the problem of bitmap capacity, S205 may include the following steps S401-S405:
[0090] S401: For each object attribute information, if the number of objects in the full object is greater than the bitmap storage capacity, the attribute object table is split based on the bitmap storage capacity to obtain multiple object sub-tables, and the object number is used to represent the number of objects included in the full object;
[0091] S403: converting the plurality of object sub-tables into a plurality of object bitmap data, wherein the object sub-tables correspond to the object bitmap data one by one;
[0092] S405: If the number of objects in the full set of objects is less than or equal to the bitmap storage capacity, convert the attribute object table into object bitmap data.
[0093] Specifically, the object subtable is a subset of the attribute object table. Table splitting can be to range segment the unique object identifiers of the full amount of objects by the bitmap storage capacity, and each split segment can accommodate the number of unique object identifiers of the bitmap storage capacity; the table splitting can be further sorted in order of the numerical value of the unique object identifier, and then split by the bitmap storage capacity as the splitting unit, and each range segment is used to accommodate the unique object identifier whose value belongs to the range segment, so that each unique object identifier corresponding to the single object attribute information is written into the corresponding object bitmap data according to the numerical range to which it belongs. If the number of objects of the full amount of objects does not exceed the bitmap storage capacity, a single bitmap can meet the identification storage, and there is no need to split the table, and each attribute object table is directly converted into the corresponding object bitmap data.
[0094] Specifically, the values in different range segments corresponding to the table splitting are not repeated and there is no value overlap, and the value ranges corresponding to each range segment are continuous, so that when querying, the numerical segmented query of the unique object identifier can be realized, and the direct addition of the data found by multiple bitmaps can be realized, which reduces the complexity of data aggregation and ensures the accuracy of the query results. After the object attribute table is split, each object sub-table is converted into a bitmap to obtain the object bitmap data of the sub-table, and a single object attribute information can obtain one or more object bitmap data. In this way, the attribute object table is split based on the bitmap storage capacity to support the problem of exceeding the maximum identification capacity of the bitmap, realize the rapid expansion of data storage, and can perform separate operations on multiple object bitmap data, so that when querying, the search is calculated on multiple bitmaps respectively, improving the query efficiency.
[0095] Taking 4 billion as the bitmap storage capacity and the unique object identifier of all objects being a natural number and exceeding 8 billion as an example, the upper limit of the number of sub-tables that the table can be split into is 3, that is, it can be split into up to 3 sub-tables, with range segments of [0-4 billion), [4 billion-8 billion), and [8 billion-12 billion), respectively. The object sub-table of [0-4 billion) is used to store the unique object identifier of [0-4 billion), the object sub-table of [4 billion-8 billion) is used to store the unique object identifier of [4 billion-8 billion), and the object sub-table of [8 billion-12 billion) is used to store the unique object identifier of [8 billion-12 billion). Of course, more segments can be split to meet the needs of a larger number of full objects.
[0096] Specifically, the number of bitmap data corresponding to all object attribute information can be determined by the number of all objects, that is, the upper limit of the number of sub-tables to be split. The number of all objects is divided by the number of bitmap data, and the obtained value is rounded up. The result is used as the upper limit of the number of sub-tables to be split. It can be understood that the upper limit of the number of sub-tables is greater than or equal to 2. In this way, after generating each object attribute table, there is no need to count the number of single tables again. It can be directly split into corresponding range segments according to the value of the unique object identifier, which reduces the amount of calculation and improves the operation efficiency. In the bitmap of different object bitmap data, the unique object identifier corresponding to the same bit position is the same, which reduces the complexity of data storage and significantly improves the query and data aggregation efficiency.
[0097] For each object attribute information, if the value range of the unique object identifier in its attribute object table is only included in a single range segment, such as the value of the largest unique object identifier is within the bitmap storage capacity (such as within 4 billion), or the value range of the unique object identifier is within 4 billion-8 billion, etc., then the upper limit of the number of sub-tables is 1, and the attribute object table is converted into an object bitmap data; on the contrary, if the value of the unique object identifier is distributed in two or more range segments, such as distributed in the range segments of [0-4 billion) and [4 billion-8 billion), it can be split into 2 sub-tables to generate the corresponding object bitmap data. The following Table 3 shows an example of the design of the underlying table structure, based on the example data structure in the table, it is written into the corresponding underlying storage engine for bitmap conversion and storage.
[0098] Table 3
[0099]
[0100] S207: Slice the bitmap data of each object based on the unique object identifier to obtain a plurality of bitmap data slices of each object bitmap data.
[0101] Specifically, a bitmap data slice (tablet) includes multiple unique object identifiers in the object attribute table, which are obtained by data splitting of the object bitmap data (bitmap). Each object attribute information corresponds to at least one object bitmap data, and then the data is split for each object bitmap data to obtain multiple bitmap data slices for easy shard storage. Each bitmap data slice is equivalent to a sub-Bitmap of the object bitmap data. Data sharding refers to a method of dividing data into different shards based on preset sharding rules. Tablet is a horizontal expansion solution based on sharding tables. The sub-table of each shard is named tablet. In this solution, each tablet represents a sub-bitmap.
[0102] In some embodiments, the preset sharding rule may be determined based on a hash operation, that is, data sharding is performed based on a hash operation, and S207 may include the following steps S501-S503:
[0103] S501: For each object bitmap data, perform a hash operation on each unique object identifier corresponding to the object bitmap data to obtain a hash result of the unique object identifier.
[0104] Specifically, the hash result is used to indicate the bitmap data shard to which the unique object identifier belongs, and the hash result corresponds to the bitmap data shard one by one. The hash operation may include but is not limited to the modulus method, virtual bucket, and consistent hashing. In the modulus method, the hash result may be the modulus value of the hash value obtained after the hash calculation of the unique object identifier, such as the result of rounding up the remainder of the hash value, which is similar to the aforementioned hash operation and will not be described in detail here.
[0105] S503: Perform hash sharding on the object bitmap data based on the hash result to obtain a plurality of bitmap data shards corresponding to each object bitmap data.
[0106] Specifically, for each object bitmap data, the unique object identifiers pointing to the same bitmap data slice with hash results are aggregated into a bitmap data slice, thereby obtaining multiple bitmap data slices. The hash results generated by each unique object identifier in the same bitmap data slice are consistent. If it is preset to be divided into 6 slices, the unique object identifier is rounded up after taking the modulo 6. If the obtained value is 3, it points to bitmap data slice 3 (tablet 3). In this way, a horizontal splitting scheme for object bitmap data is implemented, which can support the distribution and storage of each bitmap data slice of the same object bitmap data in different data tables, support the storage of massive object data, and only need to implement concurrent identification query of the same object attribute information in different data tables based on the same sharding principle when querying, while improving storage and query efficiency, and realizing seamless data expansion.
[0107] Specifically, the number of unique object identifiers corresponding to a single object bitmap data may be relatively large. For example, if the number of unique object identifiers for male gender exceeds 1 billion, the logical operation performance of a single bitmap or subsequent search will drop sharply. Accordingly, the operation on the object bitmap data is also horizontally split, and the unique object identifiers in the object bitmap data are divided into multiple data segments based on a preset numerical range to achieve concurrent data sharding operations (such as hash operations). The preset numerical range can be set based on actual needs. Exemplarily, the horizontal split of the unique object identifier value range between 0-100 can be split into (0-50)+(50-100), and the bitOr operation is used between the two data segments.
[0108] S209: Based on the correspondence between the object attribute information and the object bitmap data, multiple bitmap data pieces of each object bitmap data are distributed and stored in multiple data tables.
[0109] Specifically, the data table is used to associate and store bitmap data slices and object attribute information. The data table is a vertical table, in which each row includes object attribute information and at least one bitmap data slice corresponding to the object attribute information. For a single object bitmap data, the multiple bitmap data slices obtained by splitting are set in a one-to-one correspondence with multiple data tables. It can be understood that the number of data tables and the number of split slices can be set based on actual needs. Distributed storage refers to storing each bitmap data slice in multiple bitmap data slices of each object bitmap data in a unique corresponding manner in one of the multiple data tables, and the table identifier of the data table is associated with the slice identifier of the object data slice one-to-one. For example, the object bitmap data of male gender is split into N bitmap data slices, and N data tables are set. In a specific example, the data table can be a local table in a database such as clickhouse.
[0110] In some embodiments, S209 may include the following steps S601-S605:
[0111] S601: Determine, from multiple data tables, a data table to which the bitmap data fragment belongs based on a preset correspondence between a hash result and a data table;
[0112] S603: constructing a mapping relationship between the bitmap data fragments and the object attribute information based on the corresponding relationship between the object attribute information and the object bitmap data;
[0113] S605: For each object bitmap data, based on the mapping relationship, the bitmap data slice and the object attribute information corresponding to the bitmap data slice are stored in the data table to which the bitmap data slice belongs.
[0114] As mentioned above, the hash results of the unique object identifiers of the same bitmap data slice are consistent, and the preset corresponding relationship is used to indicate the association relationship between the hash result and the data table, and then associate the bitmap data slice with the data table. For example, when the hash result is 1, it is associated with data table 1, etc. Correspondingly, after obtaining the hash result of each unique object identifier, the data table associated with the hash result is found from multiple data tables according to the preset corresponding relationship, as the data table to which the corresponding bitmap data slice belongs. It can be understood that the object attribute information corresponds to at least one object bitmap data, and then a mapping relationship between each bitmap data slice of the object bitmap data and the object attribute information is constructed, and then the bitmap data slice and the mapped object attribute information can be stored in a row in the data table to which it belongs. Exemplarily, the object bitmap data of the male gender is split into N bitmap data slices, and N data tables are set, and one of the N bitmap data slices is stored in each data table, such as the object data slice 1 with a hash result of 1 is stored in data table 1, and the object data slice 2 with a hash result of 2 is stored in data table 2, and so on. In this way, based on the hash result as the basis for data sharding and table routing storage, multi-step addressing is achieved after a hash operation, improving data storage efficiency and query efficiency.
[0115] After grouping, aggregating, bitmap converting and data slicing each object attribute information for the unique object identifier of the full object, each bitmap data slice generated by each object attribute information is scattered and stored in multiple data tables, and each data table includes the respective bitmap data slice of each object attribute information. The storage structure in the data table can be in units of rows, with each row storing a bitmap data slice of one object attribute information, or each row storing a bitmap data slice of one object bitmap data. It can be understood that when the number of objects of the full object is greater than the bitmap storage capacity, that is, the object attribute table can be divided into multiple object sub-tables, the table structures corresponding to the above two storage structures are different. For each row storing a bitmap data slice of one object attribute information, each row can store bitmap data slices of multiple object bitmap data corresponding to the object attribute information, and different rows store different object attribute information. The data table can be specifically as shown in the following Table 4.
[0116] Table 4
[0117]
[0118] For each row, a bitmap data slice of an object bitmap data is stored. Each row may store a bitmap data slice of an object bitmap data. Object attribute information stored in different rows may be the same. The data table may be specifically shown in the following Table 5.
[0119] Table 5
[0120]
[0121] Based on the data table structure, the bitmap data of each object attribute information is distributed and stored to support concurrent requests during subsequent queries, and the feedback data can be obtained by simply aggregating the results.
[0122] In summary, combined with the above-mentioned scheme, the present application realizes object distributed storage through the full amount of objects with continuous identification, meets the digital type requirements of bitmap data, and is conducive to improving the subsequent data segmentation, storage and query efficiency, and through attribute classification, further realizes the attribute classification storage and query of objects; in addition, based on the unique object identifier with numerical continuity properties, the bitmap data of each object is segmented separately to obtain multiple bitmap data segments of each object bitmap data, and then distributed storage based on the bitmap data segmentation is performed for each object of each object attribute information, which can support unlimited horizontal expansion, is suitable for massive data scenarios, effectively improves computing efficiency and update timeliness, and can realize distributed query of bitmap data, significantly improving data query performance.
[0123] refer to Figure 5 After obtaining the object bitmap data corresponding to the object attribute information, it is hashed and split into N tablets and written into each corresponding data table. The Hash (ID) in the figure refers to the hash result obtained by hashing the unique object identifier; in the subsequent query process, the client receives the object data query request, such as the number of gender = male, and concurrently queries the tablets with gender as male from the data tables in each Shard, aggregates to obtain a unique object identifier set with gender as male, and then determines the number.
[0124] In some embodiments, the number of shards and the corresponding number of data tables required to split each object bitmap data can be manually preset, such as estimated and set based on the estimated object data of the full amount of objects. In other embodiments, the number of shards and the number of data tables are predetermined based on the number of objects in the attribute object table. Accordingly, before S207, the method may further include the following steps:
[0125] S701: Determine the number of shards according to the shard capacity and the number of objects in each attribute object table;
[0126] S703: Construct multiple data tables based on the number of shards.
[0127] Specifically, the shard capacity is used to indicate the upper limit number of objects that a bitmap data shard can store, that is, the upper limit number of unique object identifiers that a single bitmap data shard can store. The shard capacity can be set based on actual needs, and this application does not impose specific restrictions. The number of objects in the attribute object table refers to the number of unique object identifiers in the attribute object table. In some embodiments, each object attribute information corresponds to an attribute object table, and the number of objects in the attribute object table of all object attribute information is obtained, and the number of objects with the largest value is determined as the number of shards. The number of shards can be calculated by dividing the number of objects in the attribute object table by the shard capacity and rounding up. Specifically, the number of constructed data tables is determined based on the number of shards. In some embodiments, for an object bitmap data of the same object attribute information, each bitmap data shard uniquely corresponds to a data table, and the number of constructed data tables is equal to the number of shards to achieve a one-to-one correspondence between data tables and bitmap data shards. Specifically, multiple data tables are distributed and stored in at least one database partition. The database partition (shard) can be set on one server. Multiple database partitions are distributed in a storage server cluster. Each database partition stores at least one data table (Local_Table). Each data table includes a bitmap data slice (Tablet) of each object attribute information. In this way, the number of slices corresponding to the object bitmap data in the data slice is dynamically determined to support the change of the attribute object scale and achieve the automatic expansion effect.
[0128] Based on some or all of the above implementations, the storage and update of object data is realized. Accordingly, the method may also include the following object data query method, referring to Figure 3 , specifically may include steps S801-S805:
[0129] S801: In response to an object data query request carrying object attribute information to be queried, determine a target data table corresponding to the object attribute information to be queried and a target database partition to which each target data table belongs based on a query configuration file.
[0130] Specifically, the object data query request may be sent from the terminal to the server. The server may be provided with a query request server and a data storage server, wherein the query request server is used to receive and forward the object data query request, and the data storage server is used to store the object data.
[0131] Specifically, the object data query request may carry at least one object attribute information to be queried, such as two object attribute information of gender male and gender female. The query configuration file is used to store the association between object attribute information, bitmap data slices, data tables and database partitions. The query configuration file is generated based on the data storage conditions in multiple data tables after the object data storage is updated. Specifically, it may include the address, table name, database partition IP, etc. of each data table, the bitmap data slice information stored in each data table, such as the slice name of the stored bitmap data slice and the object attribute information encoding mapped thereto, and the routing rules for request forwarding. According to the information stored in the query configuration file, determine in which data tables the bitmap data slices of the object attribute information to be queried are stored as the target data tables. It can be understood that all data tables may be target data tables.
[0132] S803: Forward the object data query request to each target database partition respectively, so that the target database partition searches for and feeds back the bitmap data slice corresponding to the object attribute information to be queried from the target data table stored therein.
[0133] Specifically, the query request server receives the object data query request and reads the query configuration file for routing addressing, and forwards the object data query request to each target database partition, so that the storage server of the target database partition searches for the bitmap data slice of the attribute information of the object to be queried from each stored target data table. In this way, the query request server can directly communicate with the storage server storing each target data table without transfer, thereby realizing concurrent data reading and improving query efficiency.
[0134] In some embodiments, the query request server sets a thread pool to manage multiple threads, and sets a thread for each request forwarding to the target database partition for request forwarding and subsequent bitmap data shard aggregation.
[0135] In some embodiments, each query request server stores a query configuration file. The query configuration file is generated by the storage server cluster after the object data storage is updated and sent to each query request server to issue corresponding routing rules. In other embodiments, a separate configuration server or a fixed storage server can be set to store the query configuration file. After the query request server receives the object data query request, it reads the query configuration file from the server to forward the request. By storing the object data storage information through the query configuration file and updating it in real time, it can support the dynamic expansion and contraction of large-scale storage and improve the query efficiency in the massive data scenario.
[0136] S805: Aggregate the bitmap data slices corresponding to the attribute information of the object to be queried to obtain target object data.
[0137] Specifically, data aggregation means that for each object attribute information, the bitmap data slices corresponding to the object attribute information are aggregated into object bitmap data based on the shard storage rules of the object storage, and then the target object data is generated. The target object data can be a bitmap, or an identification table or identification set after the object bitmap data is converted. Specifically, data aggregation can be a shard data addition operation, which adds and counts the bitmap data slices of each object attribute information to obtain the target object data of each object attribute information, so as to determine the unique object identifier, the number of objects and other information corresponding to each object attribute information, and then the intersection and union calculations can be performed on the target object data of different object attribute information.
[0138] It can be understood that in the above scheme, an attribute information table of an object attribute information can generate multiple object bitmap data. In the query process, the storage server can automatically split the forwarded object data query request to perform separate calculations on multiple object bitmap data, and add the results after obtaining them to feedback the query results. The identification value intervals of the range segments on each object bitmap data do not overlap, so aggregation can be achieved by directly adding them.
[0139] In existing solutions, the conventional way to read data (such as ClickHouse) is to obtain data from each local table through a distributed table, and aggregate data through a distributed table engine. Figure 6 This solution will be affected by query diffusion when the query includes multiple tables. In the clickhouse solution, when the query includes multiple distributed tables, the query process will undergo multiple rounds of diffusion (from the server-side woker0 to woker1 and woker2, and then from woker1 to woker0 and woker2, etc.), and the query data will be repeated. In the big data scenario, the calculation and query efficiency are extremely low. The technical solution of the present application first marks all objects based on the unique object identifier of continuous values, and then groups and aggregates the granularity based on the object data information. Through bitmap conversion and data sharding, distributed storage of multiple bitmap data shards of each object attribute information on multiple data tables is realized. After the object data query request is triggered, concurrent data searches can be performed directly for each data table based on the query configuration file, without the need for multiple query traversal and query diffusion, greatly improving query efficiency. Combined with Figure 7 , based on the data writing module, the tablets of each object attribute information can be written into the data tables of each database partition in the storage server cluster, and the query configuration file can be updated. In the query process, the query configuration file can be read through the data query module to read data from the storage server cluster. The data writing module can run on the storage server cluster or on the middleware, and the data query module can run on the query server.
[0140] In combination with the above scheme, the system that implements the present technical scheme may include a label mapping module, a data segmentation module, a data writing module and a data query module; the label mapping module is used to execute the above S301-S313, mainly used to realize the generation of a unique object identifier for subsequent bitmap construction; the data segmentation module is used to execute the above S203-S205, used to classify objects belonging to a certain type of object attribute value (such as gender = male), obtain the unique object identifier (digital ID) of all objects under this category, and split the attribute object table whose number exceeds the bitmap storage capacity, and store it in different bitmaps to support the storage of more than 10 billion objects; the data writing module is used to execute the above S207-S209, shard the bitmap based on the sharding principle, write it into the storage engine, so as to write the tablet into different data tables; the data query module is used to execute the above S801-S805, so as to concurrently obtain the tablet data of the bitmap based on the object data query request, and aggregate to obtain the final result.
[0141] Combination Figure 8 The process of the object data storage method of the present application includes: the object data to be stored of the current full object is input into an identification mapping module to realize the conversion of the original object identification of the full object into a unique object identification, and then input into a data segmentation module to split the objects of the full object when the number of objects exceeds the bitmap data capacity to generate multiple bitmaps; and then input into a data writing module to perform data slicing on each bitmap and write into each data table. In the figure, data table L belongs to data tables 1 to N, and its first row stores the bitmap data slices [1,31,…] and bitmap data slices [40…1,…] of gender = male, and the second row stores the bitmap data slices [41,…] and bitmap data slices [40…61,…] of gender = female.
[0142] Combination Fig. 9 , compared to the traditional clickhouse storage solution (see Figure 6), object data is stored and queried based on the technical solution of this application. When the object data query request carries 1, 2, 3 and 4 types of object attribute information to be queried (corresponding to the count of 1 condition to the count of 4 conditions in the figure respectively), the query performance is significantly improved. Among them, in the case of 3 types of object attribute information to be queried (count of 3 conditions), the computing performance is improved by 77%. The more types of object attribute information, the better the optimization effect. In addition, this application can support tens of billions of IDs based on 32-bit bitmap, which saves 60% of memory overhead compared to directly using 64-bit bitmap storage, while ensuring real-time update of object data, reducing delay time, and reducing the update cycle to less than 1h.
[0143] The present application embodiment also provides an object data processing device 10, such as Fig.10 As shown, Fig.10 A schematic diagram of the structure of an object data processing device provided in an embodiment of the present application is shown, and the device may include the following modules.
[0144] The object data acquisition module 11 is used to acquire the object data to be stored, where the object data to be stored includes a unique object identifier of all objects and object attribute information of at least one attribute dimension of all objects, where the unique object identifier of all objects is a continuous number, and the object attribute information is used to characterize the attribute category of the object;
[0145] Attribute aggregation module 12: used to aggregate unique object identifiers of all objects with object attribute information as aggregation granularity to obtain an attribute object table, which includes unique object identifiers of objects corresponding to the same object attribute information;
[0146] The bitmap conversion module 13 is used to perform bitmap conversion on the attribute object table to obtain object bitmap data corresponding to each object attribute information;
[0147] The data slicing module 14 is used to slice the bitmap data of each object based on the unique object identifier to obtain a plurality of bitmap data slices of each object bitmap data, wherein the bitmap data slices include a plurality of unique object identifiers in the object attribute table;
[0148] The fragment storage module 15 is used for distributing and storing a plurality of bitmap data fragments of each object bitmap data into a plurality of data tables based on the correspondence between the object attribute information and the object bitmap data. The data tables are used for associatively storing the bitmap data fragments and the object attribute information.
[0149] In some embodiments, the bitmap conversion module 13 may include:
[0150] Table splitting submodule: for each object attribute information, if the number of objects in the full object is greater than the bitmap storage capacity, the attribute object table is split based on the bitmap storage capacity to obtain multiple object sub-tables. The number of objects is used to represent the number of objects contained in the full object;
[0151] Sub-table conversion sub-module: used to convert multiple object sub-tables into multiple object bitmap data, and the object sub-tables correspond to the object bitmap data one by one.
[0152] In some embodiments, the data sharding module 14 may include:
[0153] Hash operation submodule: for performing hash operation on each unique object identifier corresponding to each object bitmap data to obtain a hash result of the unique object identifier, the hash result is used to indicate the bitmap data slice to which the unique object identifier belongs, and the hash result corresponds to the bitmap data slice one by one;
[0154] Hash sharding submodule: used to perform hash sharding on the object bitmap data based on the hash result to obtain multiple bitmap data shards corresponding to each object bitmap data.
[0155] In some embodiments, the shard storage module 15 may include:
[0156] Table determination submodule: used to determine the data table to which the bitmap data fragment belongs from multiple data tables based on the preset correspondence between the hash result and the data table;
[0157] Mapping construction submodule: used to construct a mapping relationship between bitmap data fragments and object attribute information based on the corresponding relationship between object attribute information and object bitmap data;
[0158] Table storage submodule: for storing the bitmap data slice and the object attribute information corresponding to the bitmap data slice in the data table to which the bitmap data slice belongs based on the mapping relationship for each object bitmap data.
[0159] In some embodiments, the apparatus may further include:
[0160] A shard number determination module: used to determine the number of shards according to the shard capacity and the number of objects in each attribute object table before sharding the bitmap data of each object based on the unique object identifier to obtain a plurality of bitmap data shards of each object bitmap data, wherein the shard capacity indicates the upper limit number of objects that can be stored in the bitmap data shard;
[0161] Data table construction module: used to construct multiple data tables based on the number of shards. The multiple data tables are distributed and stored in at least one database partition. The number of constructed data tables is determined based on the number of shards.
[0162] In some embodiments, the apparatus may further include:
[0163] A target partition determination module is used to respond to an object data query request carrying object attribute information to be queried, and determine a target data table corresponding to the object attribute information to be queried and a target database partition to which each target data table belongs based on a query configuration file, wherein the query configuration file is used to store the association relationship between the object attribute information, the bitmap data fragments, the data table, and the database partition;
[0164] Request forwarding module: used to forward object data query requests to each target database partition respectively, so that the target database partition searches and feeds back the bitmap data slice corresponding to the attribute information of the object to be queried from the target data table stored therein;
[0165] Data aggregation module: used to aggregate the bitmap data slices corresponding to the attribute information of the query object to obtain the target object data.
[0166] In some embodiments, the object data acquisition module 11 may include:
[0167] Data acquisition submodule: used to obtain full object identification data and the current latest identification of multiple object partitions. The full object identification data includes the original object identification of the full object. The object partition is used to associate and store the original object identification and the unique object identification of the same object. The current latest identification is used to indicate the unique object identification with the largest value currently stored in the object partition.
[0168] The object partition determination submodule is used to determine the target object partition corresponding to the original object identifier of each object in the full amount of objects from multiple object partitions;
[0169] The identification search submodule is used to search for a unique object identification associated with the original object identification from the target object partition for each original object identification;
[0170] The identification conversion submodule is used to perform an incremental identification conversion on the incremental original object identification for which no associated unique object identification is found, based on the current latest identification corresponding to the incremental original object identification, to obtain a unique object identification corresponding to the incremental original object identification.
[0171] In some embodiments, the object data acquisition module 11 may further include an identifier reuse submodule: configured to reuse the unique object identifier associated with the historical original object identifier for the historical original object identifier for which the associated unique object identifier is found.
[0172] In some embodiments, the apparatus may further include:
[0173] Partition identifier storage module: used for associating and storing the incremental original object identifier and the unique object identifier corresponding to the incremental original object identifier in the target object partition;
[0174] Latest identification update module: used to update the current latest identification of the target object partition based on the unique object identification corresponding to the incremental original object identification.
[0175] In some embodiments, the data acquisition submodule may include:
[0176] Object table acquisition module: used to acquire the current full object table and the historical full object table, the historical full object table is the full object table updated in the previous update cycle corresponding to the current full object table, and the full object table at least stores the original object identifier of the object;
[0177] Table connection module: used to connect the current full object table and the historical full object table to obtain full object identification data.
[0178] It should be noted that the above device embodiment and method embodiment are based on the same implementation method.
[0179] An embodiment of the present application provides an object data processing device, which can be a terminal or a server, including a processor and a memory, in which at least one instruction or at least one program is stored. The at least one instruction or the at least one program is loaded and executed by the processor to implement the object data processing method provided in the above method embodiment.
[0180] The memory can be used to store software programs and modules. The processor executes various functional applications and object data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.
[0181] The method embodiments provided in the embodiments of the present application can be executed in electronic devices such as mobile terminals, computer terminals, servers or similar computing devices. Fig.11 1 is a hardware structure block diagram of an electronic device of an object data processing method provided in an embodiment of the present application. Fig.11As shown, the electronic device 900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 910 (the processor 910 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 930 for storing data, and one or more storage media 920 (such as one or more mass storage devices) for storing application programs 923 or data 922. Among them, the memory 930 and the storage medium 920 can be short-term storage or permanent storage. The program stored in the storage medium 920 may include one or more modules, each of which may include a series of instruction operations in the electronic device. Furthermore, the central processing unit 910 can be configured to communicate with the storage medium 920 and execute a series of instruction operations in the storage medium 920 on the electronic device 900. The electronic device 900 may also include one or more power supplies 960, one or more wired or wireless network interfaces 950, one or more input and output interfaces 940, and / or, one or more operating systems 921, such as Windows Server TM , Mac OS X TM , Unix TM , LinuxTM, FreeBSDTM, etc.
[0182] The input / output interface 940 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the electronic device 900. In one example, the input / output interface 940 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 940 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0183] It can be understood by those skilled in the art that Fig.11 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.11 More or fewer components as shown, or with Fig.11 Different configurations shown.
[0184] An embodiment of the present application also provides a computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to an object data processing method in a method embodiment, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the object data processing method provided by the above method embodiment.
[0185] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0186] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above-mentioned various optional implementations.
[0187] It can be seen from the embodiments of the object data processing method, device, equipment, server, terminal, storage medium and program product provided by the present application that the present application first obtains the object data to be stored, and the object data to be stored includes the unique object identifier of the full object and the object attribute information of at least one attribute dimension of the full object. The unique object identifier of the full object is a continuous number, and the object attribute information is used to characterize the attribute category of the object, so as to realize object distributed storage through the full object with continuous identification, meet the digital type requirements of bitmap data, and help improve the subsequent data sharding, storage and query efficiency; then, the unique object identifier of the full object is aggregated with the object attribute information as the aggregation granularity to obtain an attribute object table, which includes the unique object identifier of the object corresponding to the same object attribute information, To realize attribute classification, so as to realize attribute classification storage and query of objects; then perform bitmap conversion on the attribute object table to obtain object bitmap data corresponding to each object attribute information, and perform data slicing on each object bitmap data based on a unique object identifier with numerical continuity to obtain multiple bitmap data slices of each object bitmap data; based on the correspondence between object attribute information and object bitmap data, multiple bitmap data slices of each object bitmap data are distributed and stored in multiple data tables; for each object of each object attribute information, distributed storage based on bitmap data slices is performed, and unlimited horizontal expansion is supported, which can be applied to massive data scenarios, effectively improve computing efficiency and update timeliness, and can realize distributed query of bitmap data, significantly improving data query performance.
[0188] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of the present application are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0189] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0190] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by instructing the relevant hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0191] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for processing object data, characterized in that: The method comprises: Acquire object data to be stored, the object data to be stored including a unique object identifier of all objects and object attribute information of at least one attribute dimension of the all objects, the unique object identifier of the all objects being a continuous number, and the object attribute information being used to characterize an attribute category of the object; Aggregating the unique object identifiers of all objects with the object attribute information as the aggregation granularity to obtain an attribute object table, wherein the attribute object table includes the unique object identifiers of objects corresponding to the same object attribute information; Performing bitmap conversion on the attribute object table to obtain object bitmap data corresponding to each object attribute information; Slice the bitmap data of each object based on the unique object identifier to obtain a plurality of bitmap data slices of each object bitmap data, wherein the bitmap data slices include a plurality of unique object identifiers in the object attribute table; Based on the correspondence between the object attribute information and the object bitmap data, a plurality of bitmap data slices of each object bitmap data are distributed and stored in a plurality of data tables, and the data tables are used for associatively storing the bitmap data slices and the object attribute information.
2. The method according to claim 1, characterized in that: The bitmap conversion of the attribute object table to obtain the object bitmap data corresponding to each object attribute information includes: For each object attribute information, if the number of objects in the full object is greater than the bitmap storage capacity, the attribute object table is split based on the bitmap storage capacity to obtain multiple object sub-tables, and the object number is used to represent the number of objects included in the full object; The plurality of object sub-tables are converted into a plurality of object bitmap data, wherein the object sub-tables correspond to the object bitmap data in a one-to-one manner.
3. The method according to claim 1, characterized in that The step of performing data slicing on each object bitmap data based on the unique object identifier to obtain a plurality of bitmap data slicing of each object bitmap data comprises: for each object bitmap data, performing a hash operation on each unique object identifier corresponding to the object bitmap data to obtain a hash result of the unique object identifier, the hash result being used to indicate the bitmap data slicing to which the unique object identifier belongs, and the hash result being in one-to-one correspondence with the bitmap data slicing; The object bitmap data is hashed based on the hash result to obtain a plurality of bitmap data slices corresponding to each object bitmap data.
4. The method according to claim 3, characterized in that Based on the correspondence between the object attribute information and the object bitmap data, distributing and storing the plurality of bitmap data pieces of each object bitmap data into a plurality of data tables comprises: Based on a preset correspondence between the hash result and the data table, determining the data table to which the bitmap data slice belongs from the multiple data tables; Constructing a mapping relationship between the bitmap data slice and the object attribute information based on the corresponding relationship between the object attribute information and the object bitmap data; For each object bitmap data, based on the mapping relationship, the bitmap data slice and the object attribute information corresponding to the bitmap data slice are correspondingly stored in the data table to which the bitmap data slice belongs.
5. The method according to any one of claims 1 to 4, characterized in that Before performing data slicing on each object bitmap data based on the unique object identifier to obtain a plurality of bitmap data slices of each object bitmap data, the method further includes: Determine the number of shards according to the shard capacity and the number of objects in each attribute object table, wherein the shard capacity is used to indicate the upper limit number of objects that the bitmap data shard can store; A plurality of data tables are constructed based on the number of shards. The plurality of data tables are distributed and stored in at least one database partition. The number of constructed data tables is determined based on the number of shards.
6. The method according to claim 5, characterized in that The method further comprises: In response to an object data query request carrying object attribute information to be queried, determining a target data table corresponding to the object attribute information to be queried and a target database partition to which each target data table belongs based on a query configuration file, wherein the query configuration file is used to store an association relationship between the object attribute information, the bitmap data fragment, the data table, and the database partition; Forwarding the object data query request to each of the target database partitions respectively, so that the target database partition searches for and feeds back the bitmap data slice corresponding to the object attribute information to be queried from the target data table stored therein; Data aggregation is performed on the bitmap data slices corresponding to the attribute information of the object to be queried to obtain target object data.
7. The method according to any one of claims 1 to 4, characterized in that The unique object identifier is obtained by the following method: Obtaining full object identification data and current latest identifications of multiple object partitions, wherein the full object identification data includes the original object identification of the full object, the object partition is used to associate and store the original object identification and the unique object identification of the same object, and the current latest identification is used to indicate the unique object identification with the largest value currently stored in the object partition; Determine, from the multiple object partitions, a target object partition corresponding to the original object identifier of each object in the full amount of objects; For each original object identifier, searching the target object partition for a unique object identifier associated with the original object identifier; For the incremental original object identifier for which no associated unique object identifier is found, an incremental identifier conversion is performed on the incremental original object identifier based on the current latest identifier corresponding to the incremental original object identifier to obtain a unique object identifier corresponding to the incremental original object identifier.
8. The method according to claim 7, characterized in that The method further comprises: For the historical original object identifier whose associated unique object identifier is found, the unique object identifier associated with the historical original object identifier is reused.
9. The method according to claim 7, characterized in that: The method further comprises: The incremental original object identifier and the unique object identifier corresponding to the incremental original object identifier are associated and stored in the target object partition; The current latest identifier of the target object partition is updated based on the unique object identifier corresponding to the incremental original object identifier.
10. The method according to claim 7, characterized in that The obtaining of the full amount of object identification data includes: Acquire a current full object table and a historical full object table, wherein the historical full object table is a full object table updated in a previous update cycle corresponding to the current full object table, and the full object table stores at least an original object identifier of the object; A connection operation is performed on the current full object table and the historical full object table to obtain the full object identification data.
11. An object data processing device, characterized in that: The device comprises: An object data acquisition module is used to acquire object data to be stored, wherein the object data to be stored includes a unique object identifier of all objects and object attribute information of at least one attribute dimension of the all objects, wherein the unique object identifier of the all objects is a continuous number, and the object attribute information is used to characterize the attribute category of the object; Attribute aggregation module: used to aggregate the unique object identifiers of all objects with the object attribute information as the aggregation granularity to obtain an attribute object table, wherein the attribute object table includes the unique object identifiers of objects corresponding to the same object attribute information; A bitmap conversion module: used to perform bitmap conversion on the attribute object table to obtain object bitmap data corresponding to each object attribute information; A data slicing module: used for slicing the bitmap data of each object based on the unique object identifier to obtain a plurality of bitmap data slices of each object bitmap data, wherein the bitmap data slices include a plurality of unique object identifiers in the object attribute table; Slice storage module: used to distribute and store multiple bitmap data slices of each object bitmap data into multiple data tables based on the correspondence between the object attribute information and the object bitmap data, and the data tables are used to associate and store the bitmap data slices with the object attribute information.
12. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the object data processing method according to any one of claims 1 to 10.
13. A computer device, characterized in that: The device includes a processor and a memory, wherein at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the object data processing method according to any one of claims 1 to 10.
14. A computer program product or a computer program, characterized in that The computer program product or computer program comprises computer instructions, and when the computer instructions are executed by a processor, the object data processing method according to any one of claims 1 to 10 is implemented.
Citation Information
Cited By
Layer-based ladder diagram type centralized dispatching system station yard storage and display method
CN119847654A
