STORAGE AND TRANSMISSION OF LARGE DATA SETS
Systems and methods described herein relate to a storage and transmission system that facilitates a compression process to compress a data set to reduce data size, maintain data integrity, enable improved transmission, and reduce memory footprint. The compression process transforms a large data set into a compact format. The storage and transmission system facilitates a decompression process corresponding with the compression process to transform data in the compact format into the original large data set. In some examples, the storage and transmission system facilitates the storage and transmission of a large integer list exceeding 2 million entries, such as a list of user identification numbers for a total population.
The subject matter disclosed herein generally relates to database technology. More specifically, but not exclusively, the subject matter relates to compression, decompression, storage, and transmission of large data sets, such as large sets of integers.
BACKGROUNDVarious industries use database technology for organizing, storing, analyzing, and transmitting data. As various industries become more technically advanced, the need for advancements in database technology increases. For example, as various industries become more technically advanced, the amount of data that is used to support these various industries grows in size. As a result, there is a need for advancements in database technology to store and transmit increasingly larger amounts of data to support the technical advances in these various industries. This creates various technical challenges in the field of database technology because many existing database technologies fail to efficiently store and transmit increasing large amounts of data.
Some examples are shown for purposes of illustration and not limitation in the figures of the accompanying drawings. In the drawings, which are not necessarily drawn to scale, like numerals may describe similar components in different views or examples. It should be understood that additional and alternative examples are possible without departing from the principles of the subject matter described herein.
As various industries utilizing database technologies continue to advance, the application of these database technologies becomes more complex. For example, industries such as corporate, healthcare, finance, education, government, e-commerce, and media use role-based permission systems to manage access to information. As these industries advance, the target populations, or the total number of users whose data can be accessed or managed by a permission holder, to which these industries apply database technologies grow increasingly large. The users of these target populations may be identified with unique identification numbers, and as some of these target populations may exceed millions of users, their unique identification numbers likewise range in the millions.
The storage and transmission of large data sets for these target populations poses various technical challenges in the field of database technologies. For example, some data structures store a unique identification number for each user in a target population. These data structures scale linearly with the size of the target population and have large memory footprints for large target populations. For a target population with millions of users, the memory footprint of a data structure storing the data for the target population would become prohibitively large, for example, for transmission via HTTP requests. Furthermore, transmission via other means would involve large data payloads that result in poor performance from network latency and network instability. Additionally, the large memory footprint of the data structure would prolong initialization times for local evaluation. These technical challenges are exacerbated as industries using database technologies advance and the target populations used in these industries grow larger. Thus, database technologies face technical challenges with respect to storage and transmission of large data sets.
Examples described herein seek to address these and other technical challenges arising in the field of database technologies. As an overview, the examples described herein provide for a storage and transmission system that facilitates a compression process to compress a data set to reduce data size, maintain data integrity, enable improved transmission, and reduce memory footprint. The compression process transforms a large data set (e.g., total population, integer list) into a compact format (e.g., String). The compression process involves selecting an appropriate data structure for storing the data set based on the cardinality (e.g., size, number of elements) and the distribution (e.g., sparsity, density, consecutiveness, randomness) of the data entries in the data set. Following the selection of the appropriate data structure, the compression process involves storing the data set in the selected data structure and serializing the stored data set into a binary stream (e.g., byte array). The binary stream is compressed to generate a compressed binary stream. The compressed binary stream is then encoded, for example, into a string format to generate a compressed and encoded representation of the data set. The encoded and compressed binary stream is efficiently transmitted, for example, over text-based protocols (e.g., HTTP) and decompressed to access the data set.
In some examples, the storage and transmission system adaptively selects a data structure for a data set based on characteristics (e.g., cardinality, distribution) of the data set. For example, a first data structure (e.g., HashSet) is used for data sets below a threshold size (e.g., 100,000 integers). A second data structure (e.g., Bitmap) is used for data sets equal to or exceeding the threshold size and below a threshold sparsity. A third data structure (e.g., compressed bitmap) is used for data sets equal to or exceeding the threshold size and equal to or exceeding the threshold sparsity. This adaptive approach improves memory usage by selecting the data structure appropriate for a data set based on the characteristics of the data set.
In some examples, the storage and transmission system stores a data set in a data structure (e.g., compressed bitmap) with a multi-layer architecture. In a first layer of the multi-layer data structure, an index stores keys representing the most significant bits of the elements of the data structure. For example, the first layer of the data structure stores the most significant 32 bits of long integer elements. The index uses, for example, an adaptive radix tree to store the keys. In a second layer of the multi-layer data structure, containers store values corresponding to the keys of the index. The values stored in the containers represent the least significant bits of the elements of the data structure. For example, the second layer of the data structure stores the least significant 32 bits of long integer elements in containers corresponding with the keys of the index. This multi-layer data structure supports efficient querying functions using the index of the first layer and adaptive storage using the containers of the second layer.
In some examples, the storage and transmission system dynamically converts the containers of the multi-layer data structure between container types based on the characteristics of the data set being stored in the multi-layer data structure. For example, as elements (e.g., integers, long integers) from the data set are stored in the multi-layer data structure, the least significant bits of the elements are initially stored in containers of a first type (e.g., array containers). As the elements from the data set are stored, the elements stored in a container exceeds a threshold size (e.g., 4,096 entries). The storage and transmission system converts the container to a container of a second type (e.g., run container) or a container of a third type (e.g., bitmap container) based on characteristics of the elements stored in the container so far. If the elements stored in the container so far have a distribution with consecutiveness of at least a threshold consecutiveness level, or randomness below a threshold randomness level, the container is converted to the container of the second type (e.g., run container). If the distribution of the elements stored so far has a consecutiveness below the threshold consecutiveness level, or randomness of at least the threshold randomness level, the container is converted to the container of the third type (e.g., bitmap container). As the elements from the data set are stored, the container is converted between the container of the second type (e.g., run container) and the container of the third type (e.g., bitmap container) as the distribution of the elements stored in the container changes. With this dynamic conversion approach, the elements of the data set are stored in appropriately selected containers to improve memory usage without analyzing the distribution of the data set multiple times prior to storing the data set.
In some examples, the storage and transmission system provides for reconstructing a data set from an encoded and compressed binary stream. In general, reconstructing the data set involves a decompression process of inverse operations corresponding with the operations of the compression process provided by the storage and transmission system. In the decompression process, an encoded and compressed binary stream (e.g., String) is decoded to generate a compressed binary stream (e.g., compressed byte array). The compressed binary stream is decompressed to generate a binary stream (e.g., byte array). The binary stream is deserialized to reconstruct the data set from which the encoded and compressed binary stream is generated. In some examples, the encoded and compressed binary stream includes a flag to indicate the data structure used to store the data set to facilitate the decoding and decompression of the encoded and compressed binary stream. In some examples, the data structure used to store the data set is determined based on the structure of the byte array before deserialization.
In some examples, the storage and transmission system uses data structures (e.g., HashSet, Bitmap, compressed bitmap) that facilitate set operations (e.g., AND, OR, NOT). Therefore, once an encoded and compressed binary stream is received, decoded, and decompressed, the data is ready for local evaluation. For example, in a role-based permission system, identification of whether particular users are included in a target population is readily determined from a data set stored and transmitted in accordance with the examples described herein. Further details related to the automatic creation and management of indexes for graph workspaces are provided herein.
An Application Program Interface (API) server 124 and a web server 126 provide respective programmatic and web interfaces to components of the server system 104. A specific application server 122 hosts a supply chain platform 128 and a storage and transmission system 130, each of which includes components, modules, or applications. It is noted that the supply chain platform 128 and the storage and transmission system 130 can be hosted via separate application servers in some examples.
The user device 106 can communicate with the application server 122, such as via the web interface supported by the web server 126 or via the programmatic interface provided by the API server 124. It will be appreciated that, although only a single user device 106 is shown in
The application server 122 is communicatively coupled to database servers 132, facilitating access to one or more information storage repositories, such as a database 134. In some examples, the database 134 includes storage devices that store information to be accessed, processed, modified, or deleted by the supply chain platform 128 or the storage and transmission system 130.
The application server 122 accesses application data (e.g., application data stored by the database servers 132) to provide one or more applications or software tools to the user device 106 via a web interface 114 or an app interface 116. The supply chain platform 128 is an example of a platform with one or more applications or software tools, provided via the application server 122.
The supply chain platform 128 can facilitate the tracking, coordination, and execution of supply chain activities (e.g., ranging from procurement to distribution). In some examples, the supply chain platform 128 allows organizations to streamline and digitize their procurement lifecycle using a cloud-based architecture, integrating with the database 134 for fast processing of large datasets and real-time insights. Various data objects are created and used to manage and operate the supply chain platform 128. For example, various data objects, corresponding to real-world business entities or objects, can be mapped to tables in the database 134, and such tables (and thus their data objects) can be interconnected based on hierarchies, dependencies, or references.
In some examples, the supply chain platform 128 integrates with other systems to enhance functionality, such as interfacing with the storage and transmission system 130 to ensure efficient data storage and transmission. For instance, the supply chain platform 128 may utilize the storage and transmission system 130 to store large integer data sets and transmit the large integer data sets.
In some examples, the storage and transmission system 130 is a system configured to perform a compound compression mechanism on large data sets, such as a large list of integers, to more efficiently store and transmit the large data sets. The storage and transmission system 130 applies the compound compression mechanism to a data set, stores the data set in a database or memory, and transmits the data set to a device or system requesting the data set. The storage and transmission system 130 may receive an encoded data set that has been processed with the compound compression mechanism and reconstruct the data set from which the encoded data set was generated.
For example, the storage and transmission system 130 accesses a first data set from a database. The first data set includes a large integer list for a target population. The storage and transmission system 130 applies a compound compression mechanism to determine an appropriate data structure for the first data set, serialize the first data set, compress the serialized first data set, and encode the compressed first data set. The encoded first data set is stored in the database and, in response to a request for the first data set, transmitted to the requesting system. The storage and transmission system 130 receives an encoded second data set and reconstructs a second data set from the encoded second data set based on the compound compression mechanism. The storage and transmission system 130 decodes the encoded second data set, decompresses the decoded second data set, and deserializes the decompressed second data set to reconstruct the second data set.
It is noted that the supply chain platform 128 is merely an example of a platform or system that can benefit from features of the storage and transmission system 130. The storage and transmission system 130 can, for instance, operate to store and transmit data associated with data objects related to other platforms or systems, such as human resources systems, enterprise resource planning (ERP) systems, or accounting systems.
In some examples, the application server 122 is part of a cloud-based platform provided by a software provider that allows the user 108 to utilize the tools of the supply chain platform 128, the storage and transmission system 130, and, where applicable, other systems or subsystems (e.g., a human resources system, ERP system, or accounting system, as mentioned).
One or more of the application server 122, the database servers 132, the API server 124, the web server 126, and the supply chain platform 128 may each be implemented in a computer system, in whole or in part, as described below with respect to
The network 102 may be any network that enables communication between or among machines, databases, and devices. Accordingly, the network 102 may be a wired network, a wireless network (e.g., a mobile or cellular network), or any suitable combination thereof. The network 102 may include one or more portions that constitute a private network, a public network (e.g., the Internet), or any suitable combination thereof.
The data structure selection module 202 analyzes a data set (e.g., integer list) and determines a data structure for storage of the data set. In some examples, the data structure is determined based on characteristics, such as cardinality (e.g., data set size, number of elements) and distribution (e.g., sparsity, randomness, continuity), of the data set. For example, for a data set below a threshold size (e.g., 100,000 elements), a first data structure (e.g., HashSet) is used for storage of the data set. The first data structure may be a data structure that is designed for relatively smaller data sets. For a data set of at least the threshold size, a second data structure or a third data structure is used based on the distribution of the data set. For example, for a data set of at least the threshold size and below a threshold sparsity, a second data structure (e.g., Bitmap) is used for storage of the data set. For a data set of at least the threshold size and at least the threshold sparsity, a third data structure (e.g., compressed bitmap) is used for storage of the data set. The second data structure may be a data structure designed for relatively larger and relatively denser data sets, and the third data structure may be a data structure designed for relatively larger and relatively sparser data sets.
In some examples, a sparsity of a data set is determined based on a sparseness metric. For example, the sparsity of the data set may be determined by dividing the number of elements (e.g., integers) in the data set by the difference between the maximum value and the minimum value (e.g., difference between the largest integer and the smallest integer) in the data set. The sparsity of the data set is compared with a threshold sparsity (e.g., 0.2) to determine which data structure to use to store the data set.
In some examples, the data structure in which the data set is stored is identified with a flag to indicate the type of data structure it is (e.g., first data structure, second data structure, third data structure, HashSet, Bitmap, compressed bitmap). The flag is stored, for example, as metadata associated with the data structure or as part of a header of the data structure. In some examples, the data structure used to store the data set is inferred based on the organization of the data structure.
In some examples, the data structure (e.g., first data structure) determined for a data set is a hashed data structure such as a HashSet, a LinkedHashSet, or a HashMap. This data structure stores unique elements, such as unique integers (e.g., user identification numbers) as data elements that are hashed for storage and retrieval. This data structure is sufficient for storing data sets below a threshold size (e.g., 100,000 elements). In some examples, because this data structure grows linearly with the number of elements stored, other data structures are more efficient for storing a data set that is at least the threshold size.
In some examples, the data structure (e.g., second data structure) determined for a data set is a bit array data structure, such as a Bitmap, a bit vector, or a Roaring Bitmap. This data structure stores unique elements, such as unique integers, as individual bits in a bit array. Each element in the bit array represents, for example, a unique integer, and a corresponding bit represents a Boolean value identifying whether the unique integer is present in the data set. This data structure is sufficient for storing data sets of at least a threshold size (e.g., 100,000 elements) and below a threshold sparsity (e.g., 0.2). In some examples, because this data structure represents unique elements regardless of whether an element is included in the data set, other data structures are more efficient for storing a data set that is at least the threshold sparsity.
In some examples, the data structure (e.g., third data structure) determined for a data set is a multi-layer compressed bitmap data structure. This data structure addresses technical challenges associated with storing large data sets while maintaining fast set operations and achieving a good compression ratio. This data structure includes a first layer that holds key/value pairs representing the most significant bits of elements of the data set as an index. For example, the first layer includes an adaptive radix tree with key/value pairs where the keys are 32-bit integers representing the most significant 32 bits of 64-bit integers as an index of the 64-bit integers. In a second layer of this data structure, containers store the least significant bits of the elements of the data set. In some examples, the containers are sorted array containers. The sorted array containers facilitate storage of randomly distributed integers below a threshold data size (e.g., 4096 integers). The sorted array containers facilitate binary search operations. In some examples, the containers are bitmap containers. The bitmap containers facilitate storage of densely distributed integers of at least the threshold data size. In some examples, the containers are run containers. The run containers facilitate storage of consecutive integers. In the run containers, integers are stored using pairs of initial numbers and subsequent quantities. The pairs of initial numbers and subsequent quantities are sorted for fast random access. In storing the data set in this data structure, the containers of the second layer are converted dynamically between each other based on the size, sparsity, density, continuity, consecutiveness, and randomness of the data elements stored in the data structure. For example, as data elements are added to a bitmap container, the data elements stored in the bitmap container are analyzed to the data elements stored in a bitmap container are analyzed to determine a continuity of the data elements stored in the bitmap container. The continuity is determined, for example, by calculating a number of consecutive data elements (e.g., number of integers with a difference equal to 1) or by applying a sliding window and calculating a number of windows that contain consecutive data elements. If the continuity is at least a threshold continuity, then the bitmap container is converted to a run container. As data elements are added to the run container and the continuity of the data elements falls below the threshold continuity, then the run container is converted back to the bitmap container.
The serialization module 204 serializes a data set stored in a data structure to convert the data set into a format that is readily transmitted and reconstructed. For example, after a data structure for storing a data set is determined (e.g., by the data structure selection module 202), and the data set is stored into the data structure, a serialization function (e.g., Kryo5, FST, Protobuf) is applied to convert the data set into a standardized, platform-independent format (e.g., JSON, XML, binary). By serializing the data set, the serialized data set is flattened into a linear sequence of bytes or characters, becoming more compact and more readily transmitted. This sequential binary format preserves the structural information and relationships between the elements of the data set. Furthermore, by serializing the data set, the serialized data set exhibits patterns and redundancies that facilitate higher compression ratios if the serialized data set is compressed. In some examples, metadata such as an identifier for the serialization function that was applied for the data set or an identifier for the data structure that was used for the data set is included.
The compression module 206 compresses a data set to enhance storage and transmission efficiency for the data set. For example, after a data set stored in a data structure has been serialized into a serialized data set, a compression function (e.g., gzip, LZMA, LZO, bzip2) is applied to compress the serialized data set into a compressed data set with reduced size, making the compressed data set more readily stored and transmitted. By compressing the serialized data set, the compressed data set takes advantage of redundancies in the data set to represent the information in the data set more compactly, with reduced data size.
The encoding module 208 encodes a data set to convert the data set into a format that is readily stored in text-based systems and transmitted over text-based protocols. For example, after a data set stored in a data structure has been serialized and compressed into a compressed data set, an encoding function (e.g., Base64, Base122, UTF-7) is applied to encode the compressed data set into an encoded data set (e.g., String) that is stored in text-based systems and transmitted over text-based protocols (e.g., HTTP).
In some examples, the serializing, compressing, and encoding of data sets provides an efficient approach for the storage and transmission of large data sets. The encoded data set is efficiently stored in databases or memory with reduced footprint compared to the original data set. Furthermore, the encoded data set, with its reduced footprint, is efficiently transmitted with reduced payload sizes. Upon receipt, an encoded data set is decoded, decompressed, and deserialized to reconstruct the original data set.
The reconstruction module 210 reconstructs a data set from an encoded data set. For example, a data set that has been serialized, compressed, and encoded is reconstructed by decoding the encoded data set, decompressing the decoded data set, and deserializing the decompressed data set. An encoded data set is decoded to convert the encoded data set into a compressed data set using a decoding algorithm (e.g., Base64) corresponding with the encoding algorithm used to generate the encoded data set. The compressed data set is decompressed to extract the serialized data set from the compressed data set using a decompression algorithm (e.g., gzip) corresponding with the compression algorithm used to generate the compressed data set. The serialized data set is deserialized to reconstruct the data set that was used to generate the encoded data set. The serialized data set is deserialized using a deserializing algorithm (e.g., Kryo5) corresponding with the serialization algorithm used to generate the serialized data set. In some examples, the encoding algorithm, the compression algorithm, the serialization algorithm, and the data structure in which the data set is stored are identified in metadata associated with the encoded data set. The reconstruction module 210 uses the metadata to apply the appropriate decoding algorithm, decompression algorithm, and deserialization algorithm and identify the data structure used to store the data set. In some examples, the encoding algorithm, the compression algorithm, the serialization algorithm, and the data structure are inferred based on the source of the encoded data set that is received. For example, information associated with the system from which the encoded data set is received is used to apply the appropriate decoding algorithm, decompression algorithm, and deserialization algorithm. The data structure used to store the data set is inferred from analysis of the deserialized data set.
In some examples, at least some of the components shown in
In some examples, certain components or subsystems shown in
-
- Function logic: The function logic implements the functionality of the microservice subsystem, representing a specific capability or function that the microservice provides.
- API interface: Microservices may communicate with each other components through well-defined APIs or interfaces, using lightweight protocols such as representational state transfer (REST) or messaging.
- Data storage: A microservice subsystem may be responsible for its own data storage, which may be in the form of a database, cache, or other storage mechanism (e.g., using the database 134). This enables a microservice subsystem to operate independently of other microservices.
- Service discovery: Microservice subsystems may find and communicate with other microservice subsystems of the server system 104. Service discovery mechanisms enable microservice subsystems to locate and communicate with other microservice subsystems in a scalable and efficient way.
- Monitoring and logging: Microservice subsystems may need to be monitored and logged in order to ensure availability and performance. Monitoring and logging mechanisms enable the tracking of health and performance of a microservice subsystem.
As illustrated in the block diagram 300, at 306, the data set 302 is evaluated with respect to size. The size of the data set 302 is evaluated based on the number of elements in the data set. If the size of the data set 302 is within or less than a threshold size (e.g., 100,000 elements), then at 312, a HashSet data structure is selected for storing the data set 302. If the size of the data set 302 is at least or exceeds the threshold size, then at 304, the data set 302 is evaluated with respect to sparsity. The sparsity of the data set 302 is evaluated based on the number of elements, the maximum value represented by the elements, and the minimum value represented by the elements. For example, the sparsity of the data set 302 is evaluated by dividing the number of elements by the difference between the maximum value and the minimum value represented by the elements. If the sparsity of the data set 302 is within or less than a threshold sparsity (e.g., 0.2), then at 310, a compressed bitmap data structure is selected for storing the data set 302. If the sparsity of the data set 302 is at least or exceeds the threshold sparsity, then at 308, a Bitmap data structure is selected for storing the data set 302. At 314, the data set 302, which has been stored in a HashSet data structure at 312, a compressed bitmap data structure at 310, or a Bitmap data structure at 308, is converted to a byte array, or a serialized data set, using a serialization function (e.g., Kryo5). Serializing the data set 302, as stored in the selected data structure at 308, 310 or 312, prepares the data set 302 for transmission. At 316, the byte array is compressed to a compressed byte array, or a compressed data set, using a compression function (e.g., gzip). Compressing the data set 302 reduces the data size of the data set 302, preparing the data set 302 for storage and transmission. At 318, the compressed byte array is encoded to a String, or an encoded data set, using an encoding function (e.g., Base64). Encoding the data set 302 prepares the data set 302 for transmission over text-based protocols and for storage in text-based systems.
As illustrated in the block diagram 400, the compressed bitmap data structure includes a first layer that comprises an index 402 of nodes arranged in a tree structure. In this example, the index 402 is implemented as adaptive radix tree to store the most significant bits of the data elements (e.g., most significant 32-bits of 64-bit integers) of the data set. For example, the index 402 includes one or more first nodes 404 that store the most significant bit of the data elements of the data set in a sorted order. Branching off the one or more first nodes 404, one or more second nodes 406 store the next most significant bits of the data elements of the data set in a sorted order. Branching off the one or more second nodes 406, one or more third nodes 408 store the next most significant bits of the data elements of the data set in a sorted order. In this way, the index 402 stores the most significant bits of the data elements as keys in a sorted tree structure. The keys correspond with values for the least significant bits of the data elements that are stored in a second layer of the compressed bitmap data structure using array containers 410, run containers 412, or bitmap containers 414. The array containers 410 store randomly distributed data elements below a threshold data size (e.g., 4096 integers). The array containers 410 store the randomly distributed data elements in a sorted order to facilitate binary search operations. The run containers 412 store consecutive data elements of at least the threshold data size. The run containers 412 store the consecutive data elements as pairs of initial numbers and subsequent quantities. The run containers 412 store the pairs in a sorted order to facilitate fast random access. The bitmap containers 414 store densely distributed data elements of at least the threshold data size. The bitmap containers 414 store the densely distributed data elements as bits in a sorted bitmap with the bits representing the presence of an associated data element in the data set. The array containers 410, run containers 412, and the bitmap containers 414 are dynamically converted based on the data elements stored in the compressed bitmap data structure.
As illustrated in the block diagram 500, at 502, an array container is initialized as the default container type for storing a data set. At 504, data elements are added to the array container one by one. As data elements are added to the array container, at 506, a data size of the array container is analyzed to determine a number of data elements stored in the array container. If the number of data elements is within or less than a threshold size (e.g., 4096 elements), then at 504, data elements are added to the array container. If the number of data elements is at least or exceeds the threshold size, then at 508, the data elements of the array container is analyzed to determine the continuity of the data elements. If the data elements are determined to be within or less than a threshold continuity (e.g., within or less than a threshold number of runs of continuous integers), then at 510, the array container is converted to a bitmap container. If the data elements are determined to be at least or exceed the threshold continuity, then at 512, the array container is converted to a run container. At 514, data elements are added to the bitmap container one by one. As data elements are added to the bitmap container, at 518, the data elements of the bitmap container are analyzed to determine the continuity of the data elements. If the data elements are determined to be within or less than the threshold continuity, then at 514, data elements are added to the bitmap container. If the data elements are determined to be at least or exceed the threshold continuity, then at 512, the bitmap container is converted to a run container. At 516, data elements are added to the run container one by one. As data elements are added to the run container, at 520, the data elements of the run container are analyzed to determine the continuity of the data elements. If the data elements are determined to be at least or exceed the threshold continuity, then at 516, data elements are added to the run container. If the data elements are determined to be within or less than the threshold continuity, then at 510, the run container is converted to a bitmap container. The dynamic container conversion process continues until all the data elements of the data set are stored. By dynamically converting between containers, the data elements are stored in the container appropriate for the data size and continuity of the data elements.
As illustrated in the block diagram 600, at 602, a String, or an encoded data set, is accessed. For example, the String may be received in response to a request for data. At 604, the encoded data set is decoded into a compressed byte array, or compressed data set, using a decoding function (e.g., Base64) that corresponds with the encoding function used to encode the String. At 606, the compressed byte array is decompressed into a byte array, or serialized data set, using a decompression function (e.g., gzip) that corresponds with the compression function used to compress the compressed byte array. The serialized data set is then deserialized using a deserialization function (e.g., Kryo5) corresponding with the serialization function used to serialize the serialized data set to reconstruct a data set stored in one of three data structures. At 608, the serialized data set is deserialized to reconstruct the data set stored in a Bitmap. At 610, the serialized data set is deserialized to reconstruct the data set stored in a compressed bitmap. At 612, the serialized data set is deserialized to reconstruct the data set stored in a HashSet. In some examples, the serialized data set includes metadata indicating the data structure in which the data set is stored. The reconstructed data structure is identical to the original data set that was serialized, compressed, and encoded to generate the encoded data set. The reconstructed data structure maintains all the capabilities of the original data set, including the ability to execute set operations, such as intersections, unions, and differences.
The example method 700 includes operations performed by a storage and transmission system. At operation 702, the storage and transmission system selects a data structure for storing a data set based on characteristics of the data set. At operation 704, the storage and transmission system stores the data set in the selected data structure to generate a stored data set. At operation 706, the storage and transmission system serializes the stored data set to generate a serialized data set. At operation 708, the storage and transmission system compresses the serialized data set to generate a compressed data set. At operation 710, the storage and transmission system encodes the compressed data set to generate an encoded data set. At operation 712, the storage and transmission system transmits the encoded data set, wherein the stored data set is reconstructed based on the encoded data set.
In view of the above-described implementations of subject matter this application discloses the following list of examples, wherein one feature of an example in isolation or more than one feature of an example, taken in combination and, optionally, in combination with one or more features of one or more further examples are further examples also falling within the disclosure of this application.
Example 1 is a system comprising: one or more processors; and memory storing instructions that, when executed by the one or more processors, cause the system to perform operations comprising: selecting a data structure for storing a data set based on characteristics of the data set; storing the data set in the selected data structure to generate a stored data set; serializing the stored data set to generate a serialized data set; compressing the serialized data set to generate a compressed data set; encoding the compressed data set to generate an encoded data set; and transmitting the encoded data set, wherein the stored data set is reconstructed based on the encoded data set.
In Example 2, the subject matter of Example 1 comprises wherein the characteristics of the data set comprise a cardinality of the data set and a distribution of data elements in the data set.
In Example 3, the subject matter of any of Examples 1-2 comprises wherein selecting the data structure comprises: selecting a first data structure for storing the data set based on a size of the data set being below a threshold size; selecting a second data structure for storing the data set based on the size of the data set being at least the threshold size and a sparsity of the data set being below a threshold sparsity; or selecting a third data structure for storing the data set based on the size of the data set being at least the threshold size and the sparsity of the data set being at least the threshold sparsity.
In Example 4, the subject matter of any of Examples 1-3 comprises wherein storing the data set comprises: storing most significant bits of data elements of the data set in a first layer of the data structure, the first layer comprising an index of the data elements; and storing least significant bits of the data elements in a second layer of the data structure.
In Example 5, the subject matter of any of Examples 1-4 comprises wherein storing the data set comprises: storing data elements of the data set in a first container; converting the first container to a second container based on a number of data elements stored in the first container being at least a threshold size and the data elements stored in the first container being less than a threshold continuity; and converting the second container to a third container based on the number of data elements stored in the second container being at least the threshold size and the data elements stored in the second container being at least the threshold continuity.
In Example 6, the subject matter of Example 5 comprises wherein storing the data set further comprises: converting the third container to the second container based on the number of data elements stored in the third container being at least the threshold size and the data elements stored in the third container being less than the threshold continuity.
In Example 7, the subject matter of Example 5 comprises wherein the second container stores the data elements as bits in a sorted bitmap, the bits representing presence of the data elements in the data set.
In Example 8, the subject matter of Example 5 comprises wherein the third container stores the data elements as sorted pairs, the sorted pairs comprising an initial value and a subsequent quantity.
In Example 9, the subject matter of any of Examples 1-8 comprises wherein storing the data set comprises: storing a flag indicating the selected data structure in metadata associated with the selected data structure.
In Example 10, the subject matter of any of Examples 1-9 comprises receiving a second encoded data set; decoding the second encoded data set to generate a second compressed data set; decompressing the second compressed data set to generate a second serialized data set; deserializing the second serialized data set to generate a second data set stored in a second data structure.
In Example 11, the subject matter of Example 10 comprises wherein the second data structure is determined based on a flag in the second encoded data set.
In Example 12, the subject matter of Example 10 comprises wherein the second data structure is inferred from the second serialized data set.
In Example 13, the subject matter of any of Examples 1-12 comprises wherein the data set comprises a list of integers.
In Example 14, the subject matter of any of Examples 1-13 comprises wherein the serialized data set is a byte array, the compressed data set is a compressed byte array, and the encoded data set is a String.
Example 15 is a method comprising: selecting a data structure for storing a data set based on characteristics of the data set; storing the data set in the selected data structure to generate a stored data set; serializing the stored data set to generate a serialized data set; compressing the serialized data set to generate a compressed data set; encoding the compressed data set to generate an encoded data set; and transmitting the encoded data set, wherein the stored data set is reconstructed based on the encoded data set.
In Example 16, the subject matter of Example 15 comprises wherein selecting the data structure comprises: selecting a first data structure for storing the data set based on a size of the data set being below a threshold size; selecting a second data structure for storing the data set based on the size of the data set being at least the threshold size and a sparsity of the data set being below a threshold sparsity; or selecting a third data structure for storing the data set based on the size of the data set being at least the threshold size and the sparsity of the data set being at least the threshold sparsity.
In Example 17, the subject matter of any of Examples 15-16 comprises wherein storing the data set comprises: storing data elements of the data set in a first container; converting the first container to a second container based on a number of data elements stored in the first container being at least a threshold size and the data elements stored in the first container being less than a threshold continuity; and converting the second container to a third container based on the number of data elements stored in the second container being at least the threshold size and the data elements stored in the second container being at least the threshold continuity.
Example 18 is one or more non-transitory, computer-readable media storing instructions that, when executed by a computing system, cause the computing system to perform operations comprising: selecting a data structure for storing a data set based on characteristics of the data set; storing the data set in the selected data structure to generate a stored data set; serializing the stored data set to generate a serialized data set; compressing the serialized data set to generate a compressed data set; encoding the compressed data set to generate an encoded data set; and transmitting the encoded data set, wherein the stored data set is reconstructed based on the encoded data set.
In Example 19, the subject matter of Example 18 comprises wherein selecting the data structure comprises: selecting a first data structure for storing the data set based on a size of the data set being below a threshold size; selecting a second data structure for storing the data set based on the size of the data set being at least the threshold size and a sparsity of the data set being below a threshold sparsity; or selecting a third data structure for storing the data set based on the size of the data set being at least the threshold size and the sparsity of the data set being at least the threshold sparsity.
In Example 20, the subject matter of any of Examples 18-19 comprises wherein storing the data set comprises: storing data elements of the data set in a first container; converting the first container to a second container based on a number of data elements stored in the first container being at least a threshold size and the data elements stored in the first container being less than a threshold continuity; and converting the second container to a third container based on the number of data elements stored in the second container being at least the threshold size and the data elements stored in the second container being at least the threshold continuity.
Example 21 is at least one machine-readable medium including instructions that, when executed by processing circuitry, cause the processing circuitry to perform operations to implement any of Examples 1-20.
Example 22 is an apparatus comprising means to implement any of Examples 1-20.
Example 23 is a computing system to implement any of Examples 1-20.
Example 24 is a computer-implemented method to implement any of Examples 1-20.
The representative hardware layer 804 comprises one or more processing units 806 having associated executable instructions 808. Executable instructions 808 represent the executable instructions of the software architecture 802, including implementation of the methods, modules, subsystems, and components, and so forth described herein and may also include memory and/or storage modules 810, which also have executable instructions 808. Hardware layer 804 may also comprise other hardware as indicated by other hardware 812 and other hardware 822 which represent any other hardware of the hardware layer 804, such as the other hardware illustrated as part of the software architecture 802.
In the architecture of
The operating system 814 may manage hardware resources and provide common services. The operating system 814 may include, for example, a kernel 828, services 830, and drivers 832. The kernel 828 may act as an abstraction layer between the hardware and the other software layers. For example, the kernel 828 may be responsible for memory management, processor management (e.g., scheduling), component management, networking, security settings, and so on. The services 830 may provide other common services for the other software layers. In some examples, the services 830 include an interrupt service. The interrupt service may detect the receipt of an interrupt and, in response, cause the software architecture 802 to pause its current processing and execute an interrupt service routine (ISR) when an interrupt is accessed.
The drivers 832 may be responsible for controlling or interfacing with the underlying hardware. For instance, the drivers 832 may include display drivers, camera drivers, Bluetooth® drivers, flash memory drivers, serial communication drivers (e.g., Universal Serial Bus (USB) drivers), Wi-Fi® drivers, near-field communication (NFC) drivers, audio drivers, power management drivers, and so forth depending on the hardware configuration.
The libraries 816 may provide a common infrastructure that may be utilized by the applications 820 or other components or layers. The libraries 816 typically provide functionality that allows other software modules to perform tasks in an easier fashion than to interface directly with the underlying operating system 814 functionality (e.g., kernel 828, services 830 or drivers 832). The libraries 816 may include system libraries 834 (e.g., C standard library) that may provide functions such as memory allocation functions, string manipulation functions, mathematic functions, and the like. In addition, the libraries 816 may include API libraries 836 such as media libraries (e.g., libraries to support presentation and manipulation of various media format such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG), graphics libraries (e.g., an OpenGL framework that may be used to render two-dimensional and three-dimensional in a graphic content on a display), database libraries (e.g., SQLite that may provide various relational database functions), web libraries (e.g., WebKit that may provide web browsing functionality), and the like. The libraries 816 may also include a wide variety of other libraries 838 to provide many other APIs to the applications 820 and other software components/modules.
The frameworks/middleware layer 818 may provide a higher-level common infrastructure that may be utilized by the applications 820 or other software components/modules. For example, the frameworks/middleware layer 818 may provide various graphic user interface (GUI) functions, high-level resource management, high-level location services, and so forth. The frameworks/middleware layer 818 may provide a broad spectrum of other APIs that may be utilized by the applications 820 or other software components/modules, some of which may be specific to a particular operating system or platform.
The applications 820 include built-in applications 840 or third-party applications 842. Examples of representative built-in applications 840 may include, but are not limited to, a contacts application, a browser application, a book reader application, a location application, a media application, a messaging application, or a game application. Third-party applications 842 may include any of the built-in applications as well as a broad assortment of other applications. In a specific example, the third-party application 842 (e.g., an application developed using the Android™ or iOS™ software development kit (SDK) by an entity other than the vendor of the particular platform) may be mobile software running on a mobile operating system such as iOST, Android™, Windows® Phone, or other mobile computing device operating systems. In this example, the third-party application 842 may invoke the API calls 824 provided by the mobile operating system such as operating system 814 to facilitate functionality described herein.
The applications 820 may utilize built in operating system functions (e.g., kernel 828, services 830 or drivers 832), libraries (e.g., system libraries 834, API libraries 836, and other libraries 838), and frameworks/middleware layer 818 to create user interfaces to interact with users of the system. Alternatively, or additionally, in some systems, interactions with a user may occur through a presentation layer, such as presentation layer 844. In these systems, the application/module “logic” can be separated from the aspects of the application/module that interact with a user.
Some software architectures utilize virtual machines. In the example of
Certain examples are described herein as including logic or a number of components, modules, or mechanisms. Modules or components may constitute either software modules/components (e.g., code embodied (1) on a non-transitory machine-readable medium or (2) in a transmission signal) or hardware-implemented modules/components. A hardware-implemented module/component is a tangible unit capable of performing certain operations and may be configured or arranged in a certain manner. In examples, one or more computer systems (e.g., a standalone, client, or server computer system) or one or more hardware processors may be configured by software (e.g., an application or application portion) as a hardware-implemented module/component that operates to perform certain operations as described herein.
In various examples, a hardware-implemented module/component may be implemented mechanically or electronically. For example, a hardware-implemented module/component may comprise dedicated circuitry or logic that is permanently configured (e.g., as a special-purpose processor, such as a field programmable gate array (FPGA) or an application-specific integrated circuit (ASIC)) to perform certain operations. A hardware-implemented module/component may also comprise programmable logic or circuitry (e.g., as encompassed within a general-purpose processor or another programmable processor) that is temporarily configured by software to perform certain operations.
Accordingly, the term “hardware-implemented module” or “hardware-implemented component” should be understood to encompass a tangible entity, be that an entity that is physically constructed, permanently configured (e.g., hardwired), or temporarily or transitorily configured (e.g., programmed) to operate in a certain manner or to perform certain operations described herein. Considering examples in which hardware-implemented modules/components are temporarily configured (e.g., programmed), each of the hardware-implemented modules/components need not be configured or instantiated at any one instance in time. For example, where the hardware-implemented modules/components comprise, a general-purpose processor configured using software, the general-purpose processor may be configured as respective different hardware-implemented modules/components at different times. Software may accordingly configure a processor, for example, to constitute a particular hardware-implemented module/component at one instance of time and to constitute a different hardware-implemented module/component at a different instance of time.
Hardware-implemented modules/components can provide information to, and receive information from, other hardware-implemented modules/components. Accordingly, the described hardware-implemented modules/components may be regarded as being communicatively coupled. Where multiple of such hardware-implemented modules/components exist contemporaneously, communications may be achieved through signal transmission (e.g., over appropriate circuits and buses that connect the hardware-implemented modules/components). In examples in which multiple hardware-implemented modules/components are configured or instantiated at different times, communications between such hardware-implemented modules/components may be achieved, for example, through the storage and retrieval of information in memory structures to which the multiple hardware-implemented modules/components have access. For example, one hardware-implemented module/component may perform an operation, and store the output of that operation in a memory device to which it is communicatively coupled. A further hardware-implemented module/component may then, at a later time, access the memory device to retrieve and process the stored output.
The various operations of example methods described herein may be performed, at least partially, by one or more processors that are temporarily configured (e.g., by software) or permanently configured to perform the relevant operations. Whether temporarily or permanently configured, such processors may constitute processor-implemented modules/components that operate to perform one or more operations or functions. The modules/components referred to herein may, in some examples, comprise processor-implemented modules/components.
Similarly, the methods described herein may be at least partially processor-implemented. For example, at least some of the operations of a method may be performed by one or more processors or processor-implemented modules/components. The performance of certain of the operations may be distributed among the one or more processors, not only residing within a single machine, but deployed across a number of machines.
The one or more processors may also operate to support performance of the relevant operations in a “cloud computing” environment or as a “software as a service (Saas).” For example, at least some of the operations may be performed by a group of computers (as examples of machines including processors), these operations being accessible via a network (e.g., the Internet) and via one or more appropriate interfaces (e.g., APIs).
Examples may be implemented in digital electronic circuitry, or in computer hardware, firmware, or software, or in combinations of them. Examples may be implemented using a computer program product, e.g., a computer program tangibly embodied in an information carrier, e.g., in a machine-readable medium for execution by, or to control the operation of, data processing apparatus, e.g., a programmable processor, a computer, or multiple computers.
A computer program can be written in any form of programming language, including compiled or interpreted languages, and it can be deployed in any form, including as a standalone program or as a module, subroutine, or other unit suitable for use in a computing environment. A computer program can be deployed to be executed on one computer or on multiple computers at one site or distributed across multiple sites and interconnected by a communication network.
The example computer system 900 includes a processor 902 (e.g., a central processing unit (CPU), a GPU, or both), a primary or main memory 904, and a static memory 906, which communicate with each other via a bus 908. The computer system 900 may further include a video display unit 910 (e.g., a liquid crystal display (LCD) or a cathode ray tube (CRT)). The computer system 900 also includes an alphanumeric input device 912 (e.g., a keyboard or a touch-sensitive display screen), a UI navigation (or cursor control) device 914 (e.g., a mouse), a storage unit 916, a signal generation device 918 (e.g., a speaker), and a network interface device 920.
As used herein, the term “processor” may refer to any one or more circuits or virtual circuits (e.g., a physical circuit emulated by logic executing on an actual processor) that manipulates data values according to control signals (e.g., commands, opcodes, machine code, control words, macroinstructions, etc.) and which produces corresponding output signals that are applied to operate a machine. A processor may, for example, include at least one of a Central Processing Unit (CPU), a Reduced Instruction Set Computing (RISC) Processor, a Complex Instruction Set Computing (CISC) Processor, a Graphics Processing Unit (GPU), a Digital Signal Processor (DSP), a Tensor Processing Unit (TPU), a Neural Processing Unit (NPU), a Vision Processing Unit (VPU), a Machine Learning Accelerator, an Artificial Intelligence Accelerator, an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), a Radio-Frequency Integrated Circuit (RFIC), a Neuromorphic Processor, a Quantum Processor, or any combination thereof. A processor may be a multi-core processor having two or more independent processors (sometimes referred to as “cores”) that may execute instructions contemporaneously. Multi-core processors may contain multiple computational cores on a single integrated circuit die, each of which can independently execute program instructions in parallel. Parallel processing on multi-core processors may be implemented via architectures like superscalar, VLIW, vector processing, or SIMD that allow each core to run separate instruction streams concurrently. A processor may be emulated in software, running on a physical processor, as a virtual processor or virtual circuit. The virtual processor may behave like an independent processor but is implemented in software rather than hardware.
The storage unit 916 includes a machine-readable medium 922 on which is stored one or more sets of data structures and instructions 924 (e.g., software) embodying or utilized by any one or more of the methodologies or functions described herein. The instructions 924 may also reside, completely or at least partially, within the main memory 904 or within the processor 902 during execution thereof by the computer system 900, with the main memory 904 and the processor 902 also each constituting a machine-readable medium 922.
While the machine-readable medium 922 is shown in accordance with some examples to be a single medium, the term “machine-readable medium” may include a single medium or multiple media (e.g., a centralized or distributed database, or associated caches and servers) that store the one or more instructions 924 or data structures. The term “machine-readable medium” shall also be taken to include any tangible medium that is capable of storing, encoding, or carrying instructions 924 for execution by the machine and that cause the machine to perform any one or more of the methodologies of the present disclosure, or that is capable of storing, encoding, or carrying data structures utilized by or associated with such instructions 924. The term “machine-readable medium” shall accordingly be taken to include, but not be limited to, solid-state memories, and optical and magnetic media. Specific examples of a machine-readable medium 922 include non-volatile memory, including by way of example semiconductor memory devices, e.g., erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), and flash memory devices; magnetic disks such as internal hard disks and removable disks; magneto-optical disks; and compact disc read-only memory (CD-ROM) and digital versatile disc read-only memory (DVD-ROM) disks. A machine-readable medium is not a transmission medium.
The instructions 924 may further be transmitted or received over a communications network 926 using a transmission medium. The instructions 924 may be transmitted using the network interface device 920 and any one of a number of well-known transfer protocols (e.g., hypertext transport protocol (HTTP)). Examples of communication networks include a local area network (LAN), a wide area network (WAN), the Internet, mobile telephone networks, plain old telephone (POTS) networks, and wireless data networks (e.g., Wi-Fi and Wi-Max networks). The term “transmission medium” shall be taken to include any intangible medium that is capable of storing, encoding, or carrying instructions 924 for execution by the machine, and includes digital or analog communications signals or other intangible media to facilitate communication of such software.
Although specific examples are described herein, it will be evident that various modifications and changes may be made to these examples without departing from the broader spirit and scope of the disclosure. Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense. The accompanying drawings that form a part hereof show by way of illustration, and not of limitation, specific examples in which the subject matter may be practiced. The examples illustrated are described in sufficient detail to enable those skilled in the art to practice the teachings disclosed herein. Other examples may be utilized and derived therefrom, such that structural and logical substitutions and changes may be made without departing from the scope of this disclosure. This detailed description, therefore, is not to be taken in a limiting sense, and the scope of various examples is defined only by the appended claims, along with the full range of equivalents to which such claims are entitled.
Such examples of the subject matter may be referred to herein, individually or collectively, by the term “example” merely for convenience and without intending to voluntarily limit the scope of this application to any single example or concept if more than one is in fact disclosed. Thus, although specific examples have been illustrated and described herein, it should be appreciated that any arrangement calculated to achieve the same purpose may be substituted for the specific examples shown. This disclosure is intended to cover any and all adaptations or variations of various examples. Combinations of the above examples, and other examples not specifically described herein, will be apparent to those of skill in the art upon reviewing the above description.
Some portions of the subject matter discussed herein may be presented in terms of algorithms or symbolic representations of operations on data stored as bits or binary digital signals within a machine memory (e.g., a computer memory). Such algorithms or symbolic representations are examples of techniques used by those of ordinary skill in the data processing arts to convey the substance of their work to others skilled in the art. As used herein, an “algorithm” is a self-consistent sequence of operations or similar processing leading to a desired result. In this context, algorithms and operations involve physical manipulation of physical quantities. Typically, but not necessarily, such quantities may take the form of electrical, magnetic, or optical signals capable of being stored, accessed, transferred, combined, compared, or otherwise manipulated by a machine. It is convenient at times, principally for reasons of common usage, to refer to such signals using words such as “data,” “content,” “bits,” “values,” “elements,” “symbols,” “characters,” “terms,” “numbers,” “numerals,” or the like. These words, however, are merely convenient labels and are to be associated with appropriate physical quantities.
Unless specifically stated otherwise, discussions herein using words such as “processing,” “computing,” “calculating,” “determining,” “presenting,” “displaying,” or the like may refer to actions or processes of a machine (e.g., a computer) that manipulates or transforms data represented as physical (e.g., electronic, magnetic, or optical) quantities within one or more memories (e.g., volatile memory, non-volatile memory, or any suitable combination thereof), registers, or other machine components that receive, store, transmit, or display information. Furthermore, unless specifically stated otherwise, the terms “a” and “an” are herein used, as is common in patent documents, to include one or more than one instance.
Unless the context clearly requires otherwise, throughout the description and the claims, the words “comprise,” “comprising,” and the like are to be construed in an inclusive sense, as opposed to an exclusive or exhaustive sense, e.g., in the sense of “including, but not limited to.” As used herein, the terms “connected,” “coupled,” or any variant thereof means any connection or coupling, either direct or indirect, between two or more elements; the coupling or connection between the elements can be physical, logical, or a combination thereof. Additionally, the words “herein,” “above,” “below,” and words of similar import, when used in this application, refer to this application as a whole and not to any particular portions of this application. Where the context permits, words using the singular or plural number may also include the plural or singular number, respectively. Except as otherwise indicated, the word “or” in reference to a list of two or more items, covers all of the following interpretations of the word: any one of the items in the list, all of the items in the list, and any combination of the items in the list.
Although some examples, such as those depicted in the drawings, include a particular sequence of operations, the sequence may be altered without departing from the scope of the present disclosure. For example, some of the operations depicted may be performed in parallel or in a different sequence that does not materially affect the functions as described in the examples. In other examples, different components of an example device or system that implements an example method may perform functions at substantially the same time or in a specific sequence. The term “operation” is used to refer to elements in the drawings of this disclosure for ease of reference and it will be appreciated that each “operation” may identify one or more operations, processes, actions, or steps, and may be performed by one or multiple components.
Claims
1. A system comprising:
- one or more processors; and
- memory storing instructions that, when executed by the one or more processors, cause the system to perform operations comprising: selecting a data structure for storing a data set based on characteristics of the data set. the characteristics comprising a sparsity of the data set determined by dividing a number of elements in the data set by a difference between a maximum value and a minimum value represented by the elements, the selecting being based on a comparison of the sparsity with a threshold sparsity; storing the data set in the selected data structure to generate a stored data set; serializing the stored data set to generate a serialized data set; compressing the serialized data set to generate a compressed data set; encoding the compressed data set to generate an encoded data set; and transmitting the encoded data set, wherein the stored data set is reconstructed based on the encoded data set.
2. The system of claim 1, wherein the characteristics of the data set comprise a cardinality of the data set and a distribution of data elements in the data set.
3. The system of claim 1, wherein selecting the data structure comprises:
- selecting a first data structure for storing the data set based on a size of the data set being below a threshold size;
- selecting a second data structure for storing the data set based on the size of the data set being at least the threshold size and the sparsity of the data set being below the threshold sparsity; or
- selecting a third data structure for storing the data set based on the size of the data set being at least the threshold size and the sparsity of the data set being at least the threshold sparsity.
4. The system of claim 1, wherein storing the data set comprises:
- storing most significant bits of data elements of the data set in a first layer of the data structure, the first layer comprising an index of the data elements; and
- storing least significant bits of the data elements in a second layer of the data structure.
5. The system of claim 1, wherein storing the data set comprises:
- storing data elements of the data set in a first container;
- converting the first container to a second container based on a number of data elements stored in the first container being at least a threshold size and the data elements stored in the first container being less than a threshold continuity; and
- converting the second container to a third container based on the number of data elements stored in the second container being at least the threshold size and the data elements stored in the second container being at least the threshold continuity.
6. The system of claim 5, wherein storing the data set further comprises:
- converting the third container to the second container based on the number of data elements stored in the third container being at least the threshold size and the data elements stored in the third container being less than the threshold continuity.
7. The system of claim 5, wherein the second container stores the data elements as bits in a sorted bitmap, the bits representing presence of the data elements in the data set.
8. The system of claim 5, wherein the third container stores the data elements as sorted pairs, the sorted pairs comprising an initial value and a subsequent quantity.
9. The system of claim 1, wherein storing the data set comprises:
- storing a flag indicating the selected data structure in metadata associated with the selected data structure.
10. The system of claim 1, the operations further comprising:
- receiving a second encoded data set;
- decoding the second encoded data set to generate a second compressed data set;
- decompressing the second compressed data set to generate a second serialized data set; and
- deserializing the second serialized data set to generate a second data set stored in a second data structure.
11. The system of claim 10, wherein the second data structure is determined based on a flag in the second encoded data set.
12. The system of claim 10, wherein the second data structure is inferred from the second serialized data set.
13. The system of claim 1, wherein the data set comprises a list of integers.
14. The system of claim 1, wherein the serialized data set is a byte array, the compressed data set is a compressed byte array, and the encoded data set is a String.
15. A method comprising:
- selecting a data structure for storing a data set based on characteristics of the data set, the characteristics comprising a sparsity of the data set determined by dividing a number of elements in the data set by a difference between a maximum value and a minimum value represented by the elements, the selecting being based on a comparison of the sparsity with a threshold sparsity;
- storing the data set in the selected data structure to generate a stored data set;
- serializing the stored data set to generate a serialized data set;
- compressing the serialized data set to generate a compressed data set;
- encoding the compressed data set to generate an encoded data set; and
- transmitting the encoded data set, wherein the stored data set is reconstructed based on the encoded data set.
16. The method of claim 15, wherein selecting the data structure comprises:
- selecting a first data structure for storing the data set based on a size of the data set being below a threshold size;
- selecting a second data structure for storing the data set based on the size of the data set being at least the threshold size and the sparsity of the data set being below the threshold sparsity; or
- selecting a third data structure for storing the data set based on the size of the data set being at least the threshold size and the sparsity of the data set being at least the threshold sparsity.
17. The method of claim 15, wherein storing the data set comprises:
- storing data elements of the data set in a first container;
- converting the first container to a second container based on a number of data elements stored in the first container being at least a threshold size and the data elements stored in the first container being less than a threshold continuity; and
- converting the second container to a third container based on the number of data elements stored in the second container being at least the threshold size and the data elements stored in the second container being at least the threshold continuity.
18. One or more non-transitory, computer-readable media storing instructions that, when executed by a computing system, cause the computing system to perform operations comprising:
- selecting a data structure for storing a data set based on characteristics of the data set, the characteristics comprising a sparsity of the data set determined by dividing a number of elements in the data set by a difference between a maximum value and a minimum value represented by the elements, the selecting being based on a comparison of the sparsity with a threshold sparsity;
- storing the data set in the selected data structure to generate a stored data set;
- serializing the stored data set to generate a serialized data set;
- compressing the serialized data set to generate a compressed data set;
- encoding the compressed data set to generate an encoded data set; and
- transmitting the encoded data set, wherein the stored data set is reconstructed based on the encoded data set.
19. The one or more non-transitory, computer-readable media of claim 18, wherein selecting the data structure comprises:
- selecting a first data structure for storing the data set based on a size of the data set being below a threshold size;
- selecting a second data structure for storing the data set based on the size of the data set being at least the threshold size and the sparsity of the data set being below the threshold sparsity; or
- selecting a third data structure for storing the data set based on the size of the data set being at least the threshold size and the sparsity of the data set being at least the threshold sparsity.
20. The one or more non-transitory, computer-readable media of claim 18, wherein storing the data set comprises:
- storing data elements of the data set in a first container;
- converting the first container to a second container based on a number of data elements stored in the first container being at least a threshold size and the data elements stored in the first container being less than a threshold continuity; and
- converting the second container to a third container based on the number of data elements stored in the second container being at least the threshold size and the data elements stored in the second container being at least the threshold continuity.
Type: Application
Filed: May 26, 2025
Publication Date: Nov 26, 2026
Inventors: Jun Tu (Shanghai), Yijin Hu (Shanghai), Na Zhang (Shanghai), Kun Hu (Shanghai), Fang Huang (Shanghai), Weijun Yu (Shanghai), You Li (Shanghai)
Application Number: 19/218,602