Stores data items and identifies the stored data items

By using identifiers in stream segment headers and data block headers to quickly identify and retrieve data items in a computer system, the problem of low efficiency in data item storage and retrieval in the prior art is solved, and the ability to quickly search and delete is achieved.

CN112262379BActive Publication Date: 2024-09-20MICROSOFT TECHNOLOGY LICENSING LLC
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN201980038910.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-06-08
Filing Date
2019-05-31
Publication Date
2024-09-20
Estimated Expiration
2039-05-31

AI Technical Summary

Technical Problem

Existing technologies suffer from inefficiencies in efficiently storing and retrieving large numbers of data items, especially when data items need to be searched and deleted quickly, especially when the number of data items is large and widely distributed, resulting in time-consuming storage and retrieval operations longer.

Method used

Rapidly identifying and retrieving data using these identifiers by writing the data item in a data block of the stream segment in the computer system's memory and storing a first identifier and a second identifier in the stream segment header and the data block header, respectively. items for efficient data storage and retrieval.

Benefits of technology

It realizes the ability to quickly search and retrieve data items, reduces the time of storage and retrieval operations, improves the storage and deletion efficiency of data items, and is suitable for the storage and management of a large number of data items.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112262379B_ABST
    Figure CN112262379B_ABST
Patent Text Reader

Abstract

In one aspect, a data item is written to a data block of a stream segment. The stream segment includes a stream segment header and a plurality of data blocks. A first identifier of the data item is written to a stream segment header of the stream segment. A second identifier of the data item is written to a header of a data block of the stream segment. In another aspect, a stream segment header of the stream segment is queried with a query identifier. The query operation identifies whether any data item in the data block of the stream segment has the query identifier. If any data item in the data block of the stream segment has the query identifier, the data block of the stream segment is queried using the query identifier to identify which data blocks of the stream segment have the query identifier.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to methods, computer systems and computer programs for storing data items and for identifying stored data items. Background Art

[0002] There are many situations where data is stored, usually for later use or access, etc. In some cases, there are a large number of data items that need to be stored at any time. These data items themselves are usually very small. However, the fact that the number of data items is large raises problems related to one or more of the following: efficiently writing data items to storage devices, and efficiently searching and retrieving stored data items. Summary of the invention

[0003] According to a first aspect of the disclosure, there is provided a computer program, the computer program comprising a set of computer readable instructions, when the set of computer readable instructions is executed by a computer system, the computer system is caused to perform a method of storing a data item, the method comprising:

[0004] receiving, in a computer memory of the computer system, a data item to be stored;

[0005] writing the data item into a data block of a stream segment, the stream segment comprising a stream segment header and a plurality of data blocks;

[0006] obtaining a first identifier from the data item;

[0007] writing the first identifier of the data item into the stream segment header of the stream segment to which the data item is written;

[0008] obtaining a second identifier from the data item, the second identifier being different from the first identifier; and

[0009] writing the second identifier of the data item into a header of the data block of the stream segment to which the data item is written;

[0010] Thus, the first identifier in the stream segment header can be used to identify whether any data item in any data block of the stream segment includes the first identifier, and thus, the second identifier in the header of the data block of the stream segment can be used to identify whether any data item in the data block includes the second identifier.

[0011] A non-transitory computer-readable storage medium storing the computer program as described above may be provided.

[0012] Some examples described herein provide improvements to computer technology, wherein a technical advantage is that the improved computer technology enables rapid searching and retrieval of data items, and also enables rapid deletion of data items. Data items can be searched and retrieved rapidly within a reasonable and practical time frame. Specifically, the examples described herein solve a technical problem in that searching a large number of data items stored in a computer system to identify a particular data item can be slow because each data item must typically be examined in turn.

[0013] The operations listed above may be performed in a different order. For example, in at least some examples, the method may obtain one or both of the first identifier and the second identifier, etc., before writing the data item to the data block.

[0014] Once a data block has been assembled as described above, and possibly once one or more other criteria have been met (eg, a maximum size for the block has been reached), the data block may be written to persistent storage.

[0015] In one example, the first identifier is a coarse identifier applicable to a first number of data items in the data block of the stream segment, and wherein the second identifier is a fine identifier applicable to a second, smaller number of data items in the data block of the stream segment.

[0016] According to a second aspect of the disclosure, there is provided a method for storing a data item, the method comprising:

[0017] receiving a data item to be stored in a computer memory;

[0018] writing the data item into a data block of a stream segment, the stream segment comprising a stream segment header and a plurality of data blocks;

[0019] obtaining a first identifier from the data item;

[0020] writing the first identifier of the data item into the stream segment header of the stream segment to which the data item is written;

[0021] obtaining a second identifier from the data item, the second identifier being different from the first identifier; and

[0022] writing the second identifier of the data item into a header of the data block of the stream segment to which the data item is written;

[0023] Thus, the first identifier in the stream segment header can be used to identify whether any data item in any data block of the stream segment includes the first identifier, and thus, the second identifier in the header of the data block of the stream segment can be used to identify whether any data item in the data block includes the second identifier.

[0024] In one example, the first identifier is a coarse identifier applicable to a first number of data items in the data block of the stream segment, and wherein the second identifier is a fine identifier applicable to a second, smaller number of data items in the data block of the stream segment.

[0025] At any particular point in time, there may typically be zero, one, or more data items in the data block of the stream segment to which the second identifier applies. Typically, the number of data items to which the second identifier applies will be less than the number of data items to which the first identifier applies. The data items applicable to the second identifier will typically be a subset of the data items applicable to the first identifier.

[0026] In one example, the first identifier is a tenant identifier identifying an organization, and the second identifier is a user identifier identifying an individual user who is a member of the organization.

[0027] In one example, the first identifier of the data item is written to a probabilistic data structure, wherein the probabilistic data structure is included in the stream segment header of the stream segment to which the data item is written.

[0028] In one example, the second identifier of the data item is written to a probabilistic data structure, wherein the probabilistic data structure is contained in the header of the data block of the stream segment in which the data item is written.

[0029] In one example, the method includes:

[0030] performing a consistent hashing operation on the first identifier obtained from the data item; and

[0031] The stream segment to which the data item is to be written is identified based on a result of the consistent hashing operation on the first identifier obtained from the data item.

[0032] In one example, the stream segment is part of a log stream, there are multiple log streams, each log stream contains one or more different stream segments, and the stream segment to which the data item is to be written is identified based on the result of the consistent hash operation, including: based on the result of the consistent hash operation, identifying the log stream having the stream segment.

[0033] Using multiple log streams may allow data items to be processed in parallel, which provides a high throughput of the data items.

[0034] In one example, writing the data item into a data block of the stream segment includes: writing the data item into the data block as a row entry, the row entry including a row header, and the method includes:

[0035] A mode ID is written into the row header, the mode ID identifying how to extract at least one of the first identifier and the second identifier from the data item.

[0036] The mode ID stored in the row header can be used when searching the data later for retrieval and / or deletion purposes. Storing the mode ID in the row header means that the identifier can be extracted later without having to consider the format in which the identifier is stored in the data item. It also allows data items with different modes to exist in the same block, thereby improving the functionality of the process and making it more versatile. In addition, if other (third or additional) identifiers are used, the mode IDs of these identifiers can be stored.

[0037] In one example, the method includes:

[0038] Data related to the data item is written to a stream partition such that the stream partition indexes the stream segment to which the data item is written.

[0039] The data related to the data item may be one or more of: the file name of the stream segment to which the data item is written, a time related to the data item, and the first identifier of the data item. This enables subsequent searches for data items to be performed faster and more efficiently.

[0040] In another example, a computer system is provided, comprising:

[0041] at least one processor;

[0042] and at least one memory including computer program instructions;

[0043] The at least one memory and the computer program instructions are configured to, together with the at least one processor, cause the computer system to perform the method of storing data items as described above.

[0044] According to a third aspect of the disclosure, there is provided a computer program comprising a set of computer readable instructions, which, when executed by a computer system, causes the computer system to perform a method of identifying a data item stored in the computer system based on a query identifier of the data item, the method comprising:

[0045] querying a stream segment header of a stream segment using a query identifier, wherein the stream segment comprises a stream segment header and one or more data blocks, wherein each data block comprises data items, and the stream segment header comprises identifiers of the data items in the data blocks, wherein the querying of the stream segment header is used to identify: whether any of the data items in the data blocks of the stream segment has the query identifier; and

[0046] If any of the data items in the data blocks of the stream segment has the query identifier, querying the data blocks of the stream segment using the query identifier to identify which data blocks of the stream segment have the query identifier; and

[0047] Perform at least one of the following: retrieve at least one data item with the query identifier among the data items in at least one of the data blocks of the stream fragment; and delete at least one data item with the query identifier among the data items in at least one of the data blocks of the stream fragment.

[0048] A non-transitory computer-readable storage medium storing a computer program as described above is provided.

[0049] In one example, the method includes: for all data blocks in the stream segment having the query identifier, querying the data items in the data blocks to identify which data items in the data blocks have the query identifier; and

[0050] Perform at least one of the following: retrieve all data items in the data items in all data blocks in the data blocks of the stream segment that have the query identifier; and delete all data items in the data items in all data blocks in the data blocks of the stream segment that have the query identifier.

[0051] In one example, the identifier of the data item in the stream segment header is contained in a probabilistic data structure.

[0052] In one example, the identifier of the data item is a first identifier, each data block has a header, the header includes a second identifier of the data item in the data block, the second identifier is different from the first identifier, and the method comprises:

[0053] For each data block of the stream segment having the first query identifier, the header of each data block is queried using a second query identifier to identify whether any data item in the data block has the second query identifier.

[0054] In one example, the method includes: for a data block identified as containing a data item having the second query identifier, querying the data items in the data block to identify which data items in the data block have the second query identifier.

[0055] In one example, the first identifier is a coarse identifier applicable to a first number of data items in the data block of the stream segment, and wherein the second identifier is a fine identifier applicable to a second, smaller number of data items in the data block of the stream segment.

[0056] In one example, the first identifier is a tenant identifier identifying an organization, and the second identifier is a user identifier identifying an individual user who is a member of the organization.

[0057] In one example, the second identifier of the data item is contained in a probabilistic data structure in the header of the data block.

[0058] In one example, the data items are row entries in the data block, each row entry includes a row header, each row header includes a pattern ID identifying how to extract an identifier from the data item, and querying the data items in the data block to identify which data items in the data block have the query identifier includes: checking the pattern ID from the row header of the row entry, and extracting the identifier from the row entry using the identified pattern.

[0059] In another example, a computer system is provided, comprising:

[0060] at least one processor;

[0061] and at least one memory including computer program instructions;

[0062] The at least one memory and the computer program instructions are configured to, together with the at least one processor, cause the computer system to perform the method of identifying data items stored in the computer system as described above.

[0063] In another example, a method of identifying a data item stored in a computer system as described above is provided.

[0064] This summary is provided to introduce in simplified form a selection of concepts that will be further described in the detailed description below. This summary is not intended to identify key features or essential features of the present invention, nor is it intended to limit the scope of protection of the present invention. In addition, the present invention is not limited to solving any or all of the disadvantages stated herein. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] To aid understanding of the present disclosure and to show how the embodiments may be effected, reference is made, by way of example only, to the accompanying drawings, in which:

[0066] Figure 1 Schematically illustrates a computer system according to some examples described herein, and an example of a user interacting with the computer system;

[0067] Figure 2 An overview of the operation and data structure of an example of the present disclosure is schematically shown;

[0068] Figure 3 Schematically illustrates an example structure of a block of an example of the present disclosure;

[0069] Figure 4 Schematically illustrates an example of a stream segment of an example of the present disclosure;

[0070] Figure 5 schematically illustrates an example of a method of storing data items in a computer system; and

[0071] Figure 6 An example of a method of identifying data items stored in a computer system is schematically illustrated. DETAILED DESCRIPTION

[0072] As previously mentioned, there are many situations in which data is stored, usually for later use or access, etc. Typically, there are a large number of data items that need to be stored at any time. These data items themselves are usually very small. However, the fact that the number of data items is large (and in some cases can indeed be very large) raises problems related to one or more of the following: efficiently writing data items to storage devices, and efficiently searching and retrieving stored data items.

[0073] In computer systems, data items can be generated by (human) users, devices, and software applications. Examples of these data items include system logs, data sets for training machine learning models, logs of services and systems that encounter errors or other problems, data (results) generated by analysis, and other data required for analysis. This type of data item is usually generated at a high rate and is often unpredictable. However, it is often necessary to be able to search for such data items based on one or more criteria to identify data items that meet one or more criteria. For large amounts of data, this may be difficult to achieve in a short period of time.

[0074] A specific current issue of growing importance is user privacy and the use and retention of user data by organizations. Many countries have introduced or are in the process of introducing legislation that, among other things, requires organizations to disclose to users the data that the organization holds about them. This is often referred to as the "right to access." Additionally, many countries have introduced or are in the process of introducing legislation that, among other things, requires organizations to delete data that the organization holds about them upon request by the user. This is often referred to as the "right to be forgotten." As a specific example at the time of this writing, the European Union has passed the General Data Protection Regulation (GDPR), which is primarily intended to give users control over their personal data and sets strict timelines for organizations to comply with requirements to disclose the data they use and to delete it upon request. (For example, currently to comply with the GDPR, organizations must comply with a user's deletion request within 30 days.)

[0075] However, reading the entire amount of data upon request and returning the result within a given period may be very costly and in some cases impossible or at least practically impossible. In order to avoid these problems, many organizations have changed their data retention policies to be less than the maximum processing time allowed (e.g., deletion requests). Although this approach is satisfactory in some cases, in some cases, data (which includes system logs or other information related to the user) must be stored for a longer period of time. What is needed is a technical solution to this problem.

[0076] Some examples described herein provide improved computer systems that enable rapid search and retrieval of data as needed, and rapid deletion of data. The data may be related to clients and (human) users. By improving the efficiency of these operations, the default shorter retention time for high-impact data can be avoided, and the amount of data that can be retained can be increased.

[0077] Some specific examples of the present disclosure will be described in detail below.It should be noted that not all components described below are required in all cases or in all implementations.

[0078] The specific examples discussed herein will be given according to the example of a real-time software system or service in which data is generated as part of the operation of the system. An example of stored data is a system log (particularly a usage log) that records detailed information about user interactions with the system. Such a usage log can provide information about how these interactions affect system performance and behavior. For example, when a user of a web-based document editing suite makes changes to a document, such a log will contain information about when the user logged in, the IP (Internet Protocol) address where the login occurred, the document that was changed, the time of the change, how many bytes were changed, how much these operations cost, and so on. However, the present disclosure can also be applied to other types of data, including, for example, data sets used to train machine learning models, logs of services and systems that encounter errors or other problems, data (results) generated by analysis, and other data required for analysis (for example, it includes data about system alerts, emails, posts on social media accounts, etc.). A specific example of data analysis that can be applied is the source of learning data (for example, a specific user, device, software function, etc.).

[0079] As mentioned above, especially with the introduction of legislation on how to handle the data related to users, it is hoped to ensure that all data related to a given user can be traced back to the user, and located, retrieved and deleted (if necessary or required). In addition, service providers must often ensure that the operation can be completed within a strict response time. In the context of enterprise software systems, customer groups or organizations (e.g., enterprises (companies)) (referred to herein as "tenants") can also request to delete all data related to their individual users. In order to promote data retrieval for both users and tenants, the example described herein effectively associates two identifiers with each piece of data being stored, that is, associates tenants and user identifiers (IDs). These IDs can be unique, or at least valid or actually unique. For example, a tenant ID can be a universal unique identifier (UUID), which is also referred to as a globally unique identifier (GUID). UUID or GUID is a 128-bit number for identifying information in a computer system. It should be noted that usage logs have already included these identifiers in most cases, because they are usually necessary for debugging problems efficiently and performing usage analysis.

[0080] Usage logs are generated in an ad-hoc manner as users interact with a software system. Each interaction of a user with the system can generate one or more records that detail the behavior of the various software components. The log is typically constructed by appending one line after another in chronological order as user interactions occur.

[0081] Because logs are generated and written in a known system, a comprehensive search for all data related to a particular user would require a linear scan of the entire log volume. Although logs can be classified based on, for example, user and tenant IDs, this is not traditionally done because it is difficult to keep consistent with the way the logs are generated. That is, building such an index or classification stream would require: a) retaining large amounts of data in memory for long periods of time; b) reading previously written logs and reprocessing them in a batch manner (both memory and input / output intensive); and c) a combination of the two. The cost of each of these approaches makes it difficult to efficiently support the retrieval and deletion of customer data for large amounts of system logs (and other types of data generated in a similar manner).

[0082] In general, in one aspect, the present disclosure provides a method for storing a data item in a persistent storage device. A data item to be stored is received in a computer memory. The data item is written to a data block of a stream segment, the stream segment including a stream segment header and a plurality of data blocks. A first identifier is obtained from the data item. The first identifier of the data item is written to the stream segment header of the stream segment to which the data item is written. A second identifier is obtained from the data item, the second identifier being different from the first identifier. The second identifier of the data item is written to the header of the data block of the stream segment to which the data item is written. The first identifier in the stream segment header can be used to identify whether any data item in any data block of the stream segment includes the first identifier. The second identifier in the header of the data block of the stream segment can be used to identify whether any data item in the data block includes the second identifier.

[0083] In a specific example described herein, the first identifier may be a tenant ID that identifies an organization (e.g., an enterprise / company). In this specific example, the second identifier may be a user ID that identifies a (human) user of the system. These users may be associated with one or more tenants. For example, each user may be an employee of a tenant. The use of the first and second identifiers obtained, stored, and used as described herein provides a hierarchical or layered approach to one or more operations in rapid search, retrieval, and deletion of data. The first identifier may be used as a relatively coarse filter, and the second identifier may be used as a relatively fine filter. In some examples, there may be more than two layers of identifiers / filters that provide progressively finer filters and / or alternative filters. As just one example, another identifier that may be used as a filter is a (geographic) region. For example, there are tenants in multiple regions. In this case, it is possible to use a triple in the form of <tenant ID, region, user ID>. For example, there may be a triple <tenant ID, Europe, user ID> and another triple <tenant ID, Asia, user ID>, and so on. The order (i.e., hierarchy) of these identifiers may be changed according to the desired results.

[0084] Another example of a hierarchical identifier is for a specific device, where a coarse ID might be the IP address of the device and a fine ID might be the MAC address of the device. There are also different types of identifiers used to identify mobile devices, which can be used in situations where the data represents usage logs. Another example of an identifier that might be of interest in usage logs is a combination of operating system and browser (e.g.,<iOS,Safari> ,<Android,Chrome> ,<Windows,Edge> ); in these cases, the coarse and fine keys are each dependent on a specific usage log. It is also possible to tie mobile traffic to a cell tower: for example, the coarse ID identifies the cell tower, while the fine ID identifies the mobile device. As another example, if data flows through a set of functions as part of a process, then the identifiers that specify those functions may be of interest. If a function is found to be malfunctioning, the data can be associated with that function. The coarse ID could then be associated with functions that processed more than a given number of data items, while the fine ID could correspond to functions that processed less than a given threshold. This also opens up the possibility of multi-layer solutions.

[0085] Now refer to Figure 1, which schematically illustrates an example of a computer system 10 with which a user 20 can interact via a user computer 22, according to an example of the present disclosure. The computer system 10 has one or more processors 12, a working memory or RAM (random access memory) 14 (typically a volatile memory), and a persistent (non-volatile) storage device 16. The persistent storage device 16 can be, for example, one or more hard disks, non-volatile semiconductor memories (e.g., solid-state drives or SSDs), etc. The computer system 10 can be provided by a single computer or multiple separate computers. The user computer 22 also has the usual one or more processors 24, RAM 26, and persistent storage device 28. The user computer 22 can interact with the computer system 10 via a network 30, which can be one or more of a local area network and the Internet, and may involve wired and / or wireless connections.

[0086] The computer system 10 can provide software services to users, some specific examples of which are discussed above. In the specific examples considered here, at least some of the users 20 are associated with an organization (e.g., a business, etc.) and can, for example, be employees of the organization. Such an organization is referred to as a "tenant" in this article (because the organization can be regarded as "renting" the services provided by the computer system 10). The computer system 10 can, for example, provide a "cloud computing" service in which the computer system 10 is remote from the user 20 and stores, manages, and processes the data of the user 20, wherein the connection between the user 20 and the computer system includes the Internet, rather than being performed by a local server or personal computer.

[0087] Reference now Figure 2 , Figure 2 An overview of the operation of an example of the present disclosure is schematically shown. As mentioned above, this is not required in all cases or in all implementations. Figure 2 All items shown and described in detail below. Figure 2 1 and 1 . The flowchart of an example method for storing data items in the persistent storage device 16 of the computer system 10 is shown schematically. It should be noted that the specific examples and Figure 2 Certain operations in the method may be performed in an order different from the order schematically indicated in FIG. Figure 2 The data structures used in this example are also shown schematically.

[0088] Next, we will give Figure 2 A brief overview of the major items shown in . Each major item and its usage will then be discussed in more detail.

[0089] At 200, data enters or is generated by computer system 10. In this particular example, the data is a system log generated as part of the operation or use of computer system 10. A specific example of data is a usage log, which records details of a user's interaction with computer system 10.

[0090] In this particular example, the total amount of data input at 200 (here, generated logs) is divided into a plurality of "log streams" 202, Figure 2 202#1, 202#2, ..., 202#N. This allows the logs to be processed in parallel while keeping the memory footprint and other system resource usage manageable. This provides high data throughput and can also better utilize multi-core (and multi-computer) configurations. However, in other examples, for example, when the total amount of data to be processed per unit time is small, it is not necessary to split the data into multiple log streams.

[0091] Each log stream 202 includes at least one stream partition 204. Stream partitions 204 can be viewed as a data structure. Typically, each log stream 202 includes multiple stream partitions 204. In one example, stream partitions 204 are created according to a definable strategy, which can be based on, for example, time, data size, or both. Specific examples thereof will be discussed further below. Stream partitions 204 index or reference files that hold actual data (e.g., stream fragments 206 in the example discussed below). Stream partitions 204 can be annotated using, for example, metadata, which can make data searches faster and more efficient. Annotations can also more efficiently search for given data directly. Similarly, specific examples thereof will be discussed further below.

[0092] Each stream partition 204 indexes (e.g., references) a set of stream segments 206. In this example, a stream segment 206 is a unit for storing data in the computer system 10 (e.g., a unit for managing data in the computer system 10). The stream segment 206 can be considered as a data structure. Figure 4As schematically shown in FIG. 1 , each stream segment 206 includes a segment header 208. In one example, the segment header 208 includes a segment filter, which is a probabilistic data structure that allows a quick determination of whether the data within the stream segment 206 must be examined more thoroughly. The segment filter is populated with a first identifier of the data. In one example, the first identifier is a relatively coarse, higher-order identifier. In a specific example where the data is a user log and the user 20 is associated with a tenant, the first identifier may be a tenant ID (that is, an identifier of a business or other organization associated with the user 20). Typically, there will be multiple tenants, each with its own tenant ID, each with its own associated set of users 20. In the operation of the exemplary segment filter, the first identifier is used as a keyword in the probabilistic segment filter to identify the stream segment 206 containing data associated with the first identifier, as will be discussed further below. The segment header 208 may also include other information, such as segment length and other optional metadata (e.g., in the case where multiple different processes / computer systems / machines provide input to the computer system 10, it includes information identifying each process / computer system / machine), etc.

[0093] In addition to the segment header 208 with the segment filters, each stream segment 206 also contains a set of "chunks" 210. The chunks 210 can again be viewed as data structures. Each chunk 210 contains a number of data items (e.g., log entries for a user log in this particular example). Each chunk 210 also contains a chunk filter 212 (see also the discussion further below). Figure 3 ). The block filter 212 is a probabilistic data structure, which is similar to a fragment filter. However, the block filter 212 is populated with a second identifier of the data. In one example, the second identifier is a relatively fine-grained low-order identifier. In the specific example where the data is a user log, the second identifier can be directly tied to the end user associated with the generation of the particular data item and can be, for example, a unique user identifier or user ID for that user. In the operation of the example of the block filter 212, the second identifier is used as a keyword in the probabilistic block filter 212 to identify the block 210 containing data associated with the second identifier, as will be discussed further below.

[0094] Each of the components outlined above will now be described in more detail, starting at the lowest level with block 210 .

[0095] Data such as user logs or other types of data discussed above that arrive at the computer system 10 is written into a block 210. The size of the block 210 may be configurable. The size of the block 210 may be subject to the following constraints: constraints on the memory consumption of the computer system 10, and the desired upper limit on how long the data should stay in the memory 14 before being persisted to one or more hard disks. Therefore, a larger capacity of the RAM 14 of the computer system 10 means that the block 210 may be larger, and vice versa. The advantage of writing data in a block-by-block manner is efficiency: larger sequential writes to the persistent storage device 16 are more efficient and provide higher throughput than smaller and more frequent random writes to the persistent storage device 16. This is particularly relevant in the case where the persistent storage device 16 is provided by a hard disk, which is still common today in view of the relatively low cost per unit of data storage (e.g., per gigabyte) provided by the hard disk. Another advantage is that this also allows a block filter 212 to be added before the block data. As described above, in one example, the block filter 212 is a probabilistic data structure that contains information about the data stored in the block. Block filter 212 is able to quickly determine whether data related to a given user is present in block 210 .

[0096] The block filter 212 (as well as the fragment filters in the fragment header 208) can use a variety of different types of probabilistic filters. The property of the probabilistic filters used in this example is that they may give a false positive rate, but no false positive rate. This means that when scanning the log (for example, when searching for data corresponding to a particular user), the block filter 212 can be queried with the user ID of that particular user before checking the actual log data itself. If the block filter 212 returns a negative response when querying the user ID of a particular user, then the block 210 can be skipped entirely because this means that none of the data stored in the block 210 contains that user ID. By adjusting the block filter 212 so that the false positive rate is small, a considerable speedup can be achieved because the amount of data that must be read and searched can be greatly reduced. (To explain further, when creating these filters, there is a trade-off between the size of the filter (in bits), the number of hash functions used (more functions reduces the probability of false positives, but at a higher cost, if the filter is large enough and not "filled up"), and the false positive rate. By making the filter large enough and having enough hash functions, it is possible to achieve extremely low false positive rates. However, this comes at the cost of increased insertion / query time and storage space costs. Filters should be tuned to be "good enough", e.g., provide a low false positive rate, but not incur unnecessary computational and storage overhead. Different trade-offs can be made here, depending on the situation.)

[0097] While the block 210 is being built, a second, finer identifier (in the example, to be used in subsequent searches of the data) is extracted from the data and added to the block filter 212. In the specific example where the data is a user log, the user's unique ID is extracted from the log line and added to the block filter 212. The block filter 212 is created based on the expected distribution of unique identifiers and the expected false positive rate. Here, a trade-off is made between the number of false positives, the cost of inserting a key value in the block filter 212, and the size of the block filter 212. When the block 210 reaches a certain desired size, it is prefixed with the block filter 212 and then written to the persistent storage device 16 (e.g., one or more hard disks).

[0098] Figure 3 The structure of an example of a complete block 210 is schematically shown. In one example, a block 210 is a unit for submitting data to a persistent storage device 16. A block 210 includes a block header 214 plus block data 216. The block header 214 includes a block filter 212 (which includes information required to reconstruct it). The block filter 212 can be serialized. That is, the block filter 212 is represented in a form that can be reconstructed. The block header 214 can also include data identifying the block length 218. The block header 214 can also include other optional metadata 220. Such other metadata 220 can include, for example, one or more of the following: time (for example, it can be the time or time range when the user 20 creates the log data 216 in the block 210 or the computer system 10 receives the log data 216 in the block 210), etc.; original text, which reflects certain text items present in the log data 216 in the block 210; information identifying each process / computer system / machine when multiple different processes / computer systems / machines provide input to the computer system 10 respectively; and so on.

[0099] The block data 216 includes a set of data rows. In the specific example where the data is a user log, the block data 216 includes a set of log rows 222. Each log row 222 in turn includes the data necessary to reconstruct it when it is queried. Each log row 222 also includes the necessary information to facilitate the extraction of the tenant ID and user ID in the specific example and optional other IDs. Specifically, in one example, each log row 222 includes a small log row header 224 and an actual log entry 226. In the example shown, the log row header 224 includes information 228 related to the total length of the log row 222. In the example shown, the log row header 224 also includes a pattern identifier 230. When determining how to extract various identifiers from the raw data contained in each log entry 226, the pattern identifier 230 is used, which allows the extraction of various identifiers regardless of the format used when they are stored in the raw data. By associating a set of methods or functions for extracting identifiers with the pattern identifier 230, different log modes can be supported in a universal manner. It also allows log entries 226 with different modes to appear in the same block 210, thereby improving the functionality of the process as it makes it more versatile. Figure 3 , the block length 218, the information 228 about the total length of the log line 222, and the mode identifier 230 begin with "unit". This is an "unsigned integer", i.e., the integer is only positive.

[0100] Although the block 210 is the unit of committing data to the persistent storage device 16, the blocks 210 are instead stored together in the stream segment 206. Figure 4 206. The stream segment 206 includes a plurality of blocks 210 and is stored as a single file in a persistent storage device 16 (e.g., one or more hard disks), a shared / distributed network connection system (e.g., Hadoop File System (HDFS)), etc. Therefore, the stream segment 206 serves as a unit for managing data in the computer system 10.

[0101] Similar to block 210, and as described above, a filter structure is also maintained for stream segments 206. However, the segment filter is not populated with the same identifiers as those present in block filter 212. Instead, a first identifier is used in the segment filter, in one example providing a "coarser" filter than the second identifier used in block 210 itself. The coarseness of this first identifier is important: if it is not coarse enough, all stream segments 206 will contain it and the value of the segment filter is reduced. In the specific example where the data is a user log, the first identifier is the tenant ID, as described above. In practice, the tenant ID is a reasonable choice because it captures the temporality of usage. In particular, it is common that most, if not all, users belonging to a single tenant are active during roughly the same time periods each day. If the false positive rate of the segment filter is kept low, stream segments 206 corresponding to inactive time periods for users belonging to that tenant can be effectively excluded.

[0102] If the tenant ID is used in the segment filter, this allows to quickly determine if there are any logs originating from any user of a given tenant in the stream segment 206, since only the segment filter needs to be used for this: there is no need to check every block 210 in the stream segment 206 itself at this stage. If the answer is yes, then the individual blocks 210 within the stream segment 206 (or more precisely its filters 212) are then checked for data originating from one or more specific users.

[0103] Since a stream segment 206 contains multiple chunks 210, and each chunk 210 itself potentially contains a large amount of data (in the log line 222 in the example above), it is often not feasible to store all of the stream segments 206 in the memory 14 of the computer system 10. In this case, there are options for how to generate and store the segment filters. These three possible options include:

[0104] (1) The segment filter is appended to the end of the stream segment 206. This results in an additional seek operation when the block 210 of the stream segment 206 is to be searched.

[0105] (2) By determining the size of the segment filter in advance, the necessary space can be reserved at the beginning of the stream segment 206. Then, when the stream segment 206 is completed, the segment filter can be written to that space. This requires an additional seek operation when writing.

[0106] (3) Segment filters are not stored in the stream segment files themselves, but rather in the individual stream partitions 204 that index the stream segments 206. This makes it possible to avoid having to read the stream segments 206 (at least initially for initial searches), but means that these stream partitions 204 must be used when querying.

[0107] While each of these approaches has its merits, option (2) may be particularly advantageous in some cases. This is because throughput is more important than latency when writing log data, and additional seek operations when reading often slow down the reading of data (e.g., this is usually avoided when data related to a specific tenant and / or user must be located quickly).

[0108] In this particular example, the hierarchy of data structures is stream partitions 204. Stream partitions 204 can be viewed as collections of stream segments 206. Stream partitions 204 do not store any raw log entry data, but rather retain information needed to locate stream segment files belonging to stream partitions 204. Thus, stream partitions 204 serve as reference or index structures and are used to guide searches for stream segment files when computer system 10 is servicing data retrieval and deletion requests.

[0109] To support efficient searching, each stream partition 204 can be richly annotated with metadata. Rules or stream policies that govern how stream partitions 204 are created can be used to generate stream partitions 204 that map well to expected query patterns. For example, one policy for generating stream partitions 204 is about time: stream partitions corresponding to data recorded within 1 hour, 1 day, 1 week, and so on can be created. Another policy is to cap stream partitions 204 based on size. A hybrid approach can also be used, such as having a stream partition 204 covering at most one day, but never exceeding N GB in size.

[0110] In order to avoid relying on complex index structures that must be kept in memory or parsed in a particular way, stream partitions 204 can be implemented as flat text files that contain headers and file names of corresponding stream segment files indexed by stream partitions 204. The header can contain metadata useful for determining whether a query to the computer system 10 requires evaluation of stream partitions 204. An example of such metadata is the time interval covered by stream partitions 204. Another example of a specific example of data being a user log is a list of tenants (tenant IDs) that have data in stream partitions 204. This enables queries to deterministically determine that stream partitions 204 contain data for a particular tenant (e.g., for audit purposes). For completeness, it is noted that stream partitions 204 do not need to have headers if a very limited set of metadata is required. Instead, the necessary metadata can be incorporated into the file name of the stream partition 204 file itself. Such metadata can be, for example, the start time of the stream partition 204. The computer system 10 can also automatically add some metadata.

[0111] As described above, in this particular example, the total amount of data entering 200 (here, the generated logs) is divided into multiple "log streams" 202. Figure 2 denoted as 202#1, 202#2, ..., 202#N. This allows high data throughput and better utilization of multi-core (and multi-computer) configurations.

[0112] In this example, each log stream 202 receives data entering the computer system 10 200 via its own queue 232. The log stream 202 is further divided into the stream partitions 204 described above. When a piece of data enters the computer system 10 200, the data is consistently hashed 234 to one of the log streams 202 and placed in its corresponding queue 232. (Persistent hashing is a special type of hashing, so when the size of the hash table is adjusted, only K / n keys need to be remapped on average, where K is the number of keys and n is the number of slots). In contrast, in most traditional hash tables, changes in the number of array slots result in almost all key remappings because the mapping between keys and slots is defined by modular operations. The key used for this hash is the same as the "rough key" used in the fragment filter discussed above. This effectively limits the number of files that must be evaluated when processing subsequent data retrieval or deletion requests. For example, if a tenant ID is used for the hash key value, all data corresponding to or related to the tenant will reside in the same log stream 202. Double hashing techniques may also be used to accommodate imbalances in the amount of data stored in different log streams 202. For example, if after hashing it is determined that the target log stream 202 will contain too much data, a second hash function may be applied to the key to determine an alternative log stream 202 for that data. At query time, the same hash function may be applied to the ID of the tenant whose data should be retrieved or deleted. By doing so, all files belonging to different log streams 202 may be quickly excluded. Figure 2 In the schematically shown example, this is achieved by associating a single folder 236 with each log stream 202. All stream segment files belonging to that log stream 202 are then stored in that folder 236, and only the stream segment files in that folder 236 are candidates for evaluation at query time.

[0113] As mentioned above, many different types of probabilistic filters can be used for block filters 212 and fragment filters. Specific examples include so-called Bloom filters and Cuckoo filters. These (at least like some other probabilistic filters) have characteristics that can produce false alarm rates, but will not produce missed alarms. Due to their implementation, Bloom filters provide better performance when inserting new key values. However, Bloom filters do not support deletions. Instead, the filter needs to be recalculated by inserting all remaining identifiers. On the other hand, Cuckoo filters natively support deletion operations and do not have to recalculate the filter when a key is deleted. If it is desired to make the filter completely consistent with the contents of the block 210 and / or stream fragment 206, the filter structure to be used depends largely on the operation mix. If many deletions are expected, Cuckoo filters can be used. In the case of few deletions, Bloom filters provide a less expensive solution. Cleaning / recalculation of the filter can also be postponed by temporarily storing the key values ​​to be deleted and then deleting or deleting / recalculating the key values ​​from the filter in a batch manner.

[0114] When a data entry is deleted from a block 210 (and therefore from a stream segment 206), the data can be reclaimed from the deleted entry in either an "eager" or "lazy" manner. An example of an eager reclamation strategy is to remove the entry from the block 210 by iterating over all entries (keeping only those that should not be deleted), and then rewriting the block 210. This will result in unused space between the end of the modified block 210 and the next block 210 in the stream segment 206, which can be reclaimed by moving the subsequent block 210. Another approach is to lazily reclaim: instead of reclaiming the unused space upon deletion, the block 210 (and stream segment 206) is marked as "dirty" (this can be achieved by setting the "dirty bit" in the block header 214 and the stream segment header 208), and the bytes holding the deleted item are zeroed. The log entry itself is then marked as deleted (e.g., by setting a specific pattern ID in the header of the row). Later queries to the computer system 10 can use the length of the entry plus being marked as deleted to skip the record. The reclamation routine is then executed at some later point in time (e.g., on a scheduled schedule or when certain specific conditions are met). This can also handle delayed deletion / recalculation of filter structures if an aperiodic or policy-based delayed compaction / reclamation scheme is used. To avoid negatively impacting the query performance (retrieval and deletion of data) of the computer system 10, the job to reclaim unused space can be scheduled to run when the computer system 10 is lightly loaded.

[0115] Reference now Figure 5 , which schematically illustrates an example of a method of storing data items in a computer system.

[0116] At 500, a data item to be stored is received. At 510, the data item is written to a data block of a stream segment. Figure 5 In the example method of , a stream segment includes a stream segment header and a plurality of data blocks.

[0117] At 520, a first identifier is obtained from the data item. In some examples, the first identifier may be considered a coarse identifier. According to some examples described herein, the first identifier is a tenant ID that identifies a "tenant," which may be, for example, an organization (e.g., a business / company). In other examples used in different applications, the first identifier may be some other identifier.

[0118] At 530, a first identifier of the data item is written into a stream segment header of the stream segment to which the data item is written.

[0119] At 540, a second identifier is obtained from the data item. The second identifier is different from the first identifier. In some examples, the second identifier can be considered to be a less coarse or fine identifier. According to some examples described herein, the second identifier is a user ID that identifies a (human) user of the system. In the case where the first identifier is a tenant ID, the user can be associated with one or more tenants. For example, each user can be an employee of a tenant. In other examples used in different applications, the second identifier can be some other identifier.

[0120] At 550, a second identifier of the data item is written into a header of a data block of the stream segment to which the data item is written.

[0121] As a result, the first identifier in the stream segment header can be used to identify whether any data item in any data block of the stream segment includes the first identifier, and the second identifier in the data block header of the stream segment can be used to identify whether any data item in the data block includes the second identifier.

[0122] Operational flow may then return to 500 where new or additional data items to be stored are received and operations continue as described above.

[0123] Reference now Figure 6 , which schematically shows an example of a method for identifying data items stored in a computer system. In practice, a large number of data items may be stored in a computer system.

[0124] At 600, a stream segment header is queried for a stream segment using a query identifier. Figure 6In an example method, a stream segment includes a stream segment header and one or more data blocks. Each data block includes data items, and the stream segment header includes identifiers of the data items in the data block. A query on the stream segment header is used to identify whether any data item in the data block of the stream segment can have a query identifier.

[0125] At 610, if none of the data items in the data block of the stream segment have a query identifier, the flow returns to 600. The query identifier can then be used to query the stream segment header of another stream segment (e.g., the next stream segment). Otherwise, at 610, if any of the data items in the data block of the stream segment have a query identifier, the flow moves to 620.

[0126] At 620, the data chunks of the stream segment are queried using the query identifier to identify which data chunks of the stream segment have the query identifier.

[0127] At 630, for at least one data block in the stream segment with the query identifier: at least one of the data items in the data block is obtained; or at least one of the data items in the data block is deleted; or at least one of the data items in the data block is retrieved and deleted. Then, the process can return to 600 to prepare to query the stream segment header of the stream segment with another query identifier.

[0128] Now, below are descriptions of some specific examples of how to perform the following operations: how to insert or log data into computer system 10, how to retrieve data from computer system 10, and how to delete data from computer system 10. These examples are given based on the specific examples discussed above, where the data represents user logs, and where the tenant ID is used as a coarse first identifier or key value for consistent hashing and populating the fragment filter, and the fine second identifier or key value within the block filter 212 is a unique user ID. It should be understood that the same principles can be applied in other applications for different types of data and using different identifiers. It should also be understood that not all operations described herein are required in all embodiments.

[0129] In one example, data logging in computer system 10 may be summarized as follows:

[0130] 1. A log entry is created as a result of some interaction between a user and a computer system.

[0131] a. The log line header 224 is populated with the pattern ID 230 that matches the log line 222 and the combined total length (size) 228 of the log entry data 226 and the log line header 224 .

[0132] 2. Consistently hash 234 the log entry into one of the log streams 202 by:

[0133] a. To extract the tenant ID to use as the hash key, use the schema ID 230 in the log line header 224 to look up a method or function that can perform the operation.

[0134] b. The method or function from a is applied to the entry to extract the tenant ID to be used as the hash key.

[0135] c. Pass the key value to the hash function.

[0136] d. Place the entry on the queue 232 corresponding to the hash result.

[0137] 3. The entry is dequeued from the flow queue 232 and processed in the following manner:

[0138] a. Evaluate the flow partitioning strategy and, if necessary, create new flow partitions 204 by:

[0139] i. Write the current block 210 to the current stream segment file.

[0140] ii. Complete the current fragment file by adding the fragment filter of the current fragment file and storing it in the persistent storage device 16.

[0141] iii. Add the segment file name and any metadata to the current stream partition 204.

[0142] iv. Update any fields in the header of the current stream partition file and write the current stream partition 204 to the persistent storage device 16.

[0143] V. Create a new stream partition file.

[0144] b. Extract the tenant ID of the log entry and insert it into the filter of the current stream segment 206 .

[0145] c. Extract the user ID of the log entry and insert it into the block filter 212 of the current block 210 of the current stream segment 206.

[0146] d. Append the log entry to the current block data 216.

[0147] i. If the result in block 210 becomes full:

[0148] 1. Append chunk 210 to the stream segment file and persist to disk.

[0149] 2. If this results in stream segment 206 being full, then for:

[0150] a. Write the segment filter into the stream segment 206.

[0151] b. Add the fragment file name to the current stream partition file.

[0152] c. Create a new stream segment 206.

[0153] 3. Create a new block 210.

[0154] In one example, identifying and / or retrieving all data corresponding to a given user from a particular tenant may be summarized as follows:

[0155] 1. The tenant ID of the tenant is consistently hashed 234 to determine which log stream 202 contains the data for that tenant.

[0156] 2. Determine the set of stream partition files that must be evaluated by:

[0157] a. Get all stream partition file sets in stream folder 236.

[0158] b. Use any provided metadata (eg, the start date of the tenant's customer relationship) to reduce the set of stream partitions 204 that need to be evaluated.

[0159] 3. For each stream partition file that must be evaluated:

[0160] a. Read the list of stream segment files in stream partition 204

[0161] b. For each stream segment file:

[0162] i. Query the fragment filter with the tenant ID

[0163] 1. If the filter returns "false", continue with the next stream segment file. (This reflects that stream segment 206 may typically have data / log entries for multiple tenants.)

[0164] 2. If the filter returns "true", the stream segment file is scanned by evaluating each block 210 of the stream segment file as follows:

[0165] a. Query the block filter 212 using the user ID.

[0166] b. If the block filter 212 returns "false", continue with the next block 210.

[0167] c. If the block filter 212 returns "true", the block 210 is scanned line by line in the following manner:

[0168] i. Extract the pattern ID 230 from the log line header 224

[0169] ii. Find the method to extract the tenant ID using mode ID 230

[0170] iii. Extract the tenant ID from log line 222

[0171] iv. If the tenant ID of log line 222 does not match the tenant ID in the query, continue to the next log line 222

[0172] v. Otherwise, use pattern ID 230 to find a method for extracting the user ID

[0173] vi. Extract the user ID from log line 222

[0174] vii. Compare the user ID in log line 222 with the user ID in the query

[0175] viii. If the user ID matches, log line 222 is added to the result set.

[0176] 4. Return the result set.

[0177] In one example, identifying and / or retrieving all data corresponding to a given tenant (rather than all data corresponding to a given user of a particular tenant as in the above example) may be summarized as follows:

[0178] l. Consistently hash 234 the tenant's tenant ID to determine which log stream 202 contains the tenant's data.

[0179] 2. Determine the set of stream partition files that must be evaluated by:

[0180] a. Get all stream partition file sets in stream folder 236.

[0181] b. Use any provided metadata (eg, the start date of the tenant's customer relationship) to reduce the set of stream partitions 204 that need to be evaluated.

[0182] 3. For each stream partition file that must be evaluated:

[0183] a. Read the list of stream segment files in stream partition 204

[0184] b. For each stream segment file:

[0185] i. Query the fragment filter with the tenant ID

[0186] 1. If the filter returns "false", continue with the next stream segment file. (This reflects that stream segment 206 may typically have data / log entries for multiple tenants.)

[0187] 2. If the filter returns "true", the stream segment file is scanned by evaluating each block 210 of the stream segment file as follows:

[0188] a. Scan block 210 line by line in the following manner:

[0189] i. Extract the pattern ID 230 from the log line header 224

[0190] ii. Find the method to extract the tenant ID using mode ID 230

[0191] iii. Extract the tenant ID from log line 222

[0192] iv. If the tenant ID of log line 222 does not match the tenant ID in the query, continue to the next log line 222

[0193] v. Otherwise, log line 222 is added to the result set.

[0194] 4. Return the result set.

[0195] Finally, in the example of reclaiming the space used by deleted log line entries, you can do the following:

[0196] 1. For each stream fragment file:

[0197] a. If stream segment 206 is not marked as dirty, continue with the next stream segment file

[0198] b. Otherwise, reclaim space in the stream fragment file by:

[0199] i. Set the initial offset for stream segment 206 to zero (the offset is the (logical) distance from the current point in the file to the next point in the file)

[0200] ii. For each block 210 in stream segment 206:

[0201] 1. If block 210 is not marked as dirty, continue with the next block 210

[0202] 2. Iterate over each log line 222 in block 210

[0203] a. If log line 222 is not marked as deleted, add it to the log line 222 collection for retention

[0204] b. Extract the user ID from log line 222

[0205] c. Add the user ID to the new block filter 212

[0206] 3. Write the new block 210 (and its filter 212) to the stream segment file at the current segment offset

[0207] 4. Update the current fragment offset by adding the size of the compressed block 210.

[0208] It should be noted that some of the examples described herein do not exclude the use of, for example, data compression or encryption, to further enable compact storage of data. Specifically, a first identifier and a second identifier of the data are obtained from the data and stored separately (for the first identifier, in a stream segment header of a stream segment written to the data item, and for the second identifier, in a header of a data block of a stream segment written to the data item), and the data itself may be compressed and / or encrypted, because it is not necessary to examine the data itself when searching for data associated with the first and / or second identifier.

[0209] Much of the above detailed description has been given with respect to a specific example where the data is a user log and the user is associated with an organization such as a company. In this case, the first identifier is a tenant ID (e.g., the ID of the organization) and the second identifier is a user ID (e.g., the ID of a user associated with that (or another) organization). As another example of a type of hierarchy or layered structure of identifiers, the first identifier may be an ID of a parent and the user ID may be an ID of a child of that parent.

[0210] Reference is made herein to data storage for storing data. Data storage may be provided by a single device or multiple devices. Suitable devices include, for example, hard disks and non-volatile semiconductor memories (e.g., solid-state drives or SSDs), shared / distributed network connection systems (e.g., Hadoop file systems (HDFS)), etc.

[0211] Although at least some aspects of the embodiments described herein with reference to the accompanying drawings include computer processes executed in a processing system or processor, the present invention can also be extended to computer programs suitable for putting the present invention into practice, in particular computer programs on or in a carrier. The program can be in the form of a non-temporary source code, an object code, a code between an intermediate source code and an object code (for example, a partially compiled form), or any other non-temporary form suitable for implementing a process according to the present invention. The carrier can be any entity or device capable of carrying the program. For example, the carrier can include a storage medium (for example, a solid state drive (SSD) or other semiconductor-based RAM, ROM (for example, a CD ROM or a semiconductor ROM), a magnetic recording medium (for example, a floppy disk or a hard disk); a general optical storage device, etc.

[0212] It should be understood that the processor or processing system or circuit referred to herein may actually be provided by a single chip or integrated circuit or multiple chips or integrated circuits (optionally provided as a chipset, an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a digital signal processor (DSP), a graphics processing unit (GPU), etc.). One or more chips may include circuits (and possible firmware) for embodying at least one or more of the following: one or more data processors, one or more digital signal processors, baseband circuits, and radio frequency circuits, which are configurable to operate according to exemplary embodiments. In this regard, it may be implemented at least in part by computer software stored in a (non-temporary) memory and executable by a processor, or by hardware, or by a combination of tangibly stored software and hardware (and tangibly stored firmware).

[0213] The examples described herein should be understood as illustrative examples of embodiments of the present invention. Further embodiments and examples are contemplated. Any feature described with respect to any example or embodiment may be used alone or in combination with other features. In addition, any feature described with respect to any example or embodiment may also be used in combination with one or more features of any other example or embodiment, or any combination of any other examples or embodiments in these examples or embodiments. In addition, within the scope of the present invention as defined in the claims, equivalents and modifications not described herein may also be adopted.

Claims

1. A computer program comprising a set of computer readable instructions which, when executed by a computer system, causes the computer system to perform a method of storing data items, the method include: receiving, in a computer memory of the computer system, a data item to be stored; writing the data item into a data block of a stream segment, the stream segment comprising a stream segment header and a plurality of data blocks; obtaining a first identifier from the data item; writing the first identifier of the data item into the stream segment header of the stream segment to which the data item is written; obtaining a second identifier from the data item, the second identifier being different from the first identifier; as well as writing the second identifier of the data item into a header of the data block of the stream segment to which the data item is written; Thus, the first identifier in the stream segment header can be used to identify whether any data item in any data block of the stream segment includes the first identifier, and thus, the second identifier in the header of the data block of the stream segment can be used to identify whether any data item in the data block includes the second identifier.

2. A method for storing data items, the method include: receiving a data item to be stored in a computer memory; writing the data item into a data block of a stream segment, the stream segment comprising a stream segment header and a plurality of data blocks; obtaining a first identifier from the data item; writing the first identifier of the data item into the stream segment header of the stream segment to which the data item is written; obtaining a second identifier from the data item, the second identifier being different from the first identifier; as well as writing the second identifier of the data item into a header of the data block of the stream segment to which the data item is written; Thus, the first identifier in the stream segment header can be used to identify whether any data item in any data block of the stream segment includes the first identifier, and thus, the second identifier in the header of the data block of the stream segment can be used to identify whether any data item in the data block includes the second identifier.

3. The method according to claim 2, in, The first identifier is a coarse identifier applicable to a first number of data items in the data block of the stream segment, and wherein the second identifier is a fine identifier applicable to a second, smaller number of data items in the data block of the stream segment.

4. The method according to any one of claims 2 to 3, in, The first identifier of the data item is written into a probabilistic data structure, wherein the probabilistic data structure is contained in the stream segment header of the stream segment to which the data item is written.

5. The method according to any one of claims 2 to 3, in, The second identifier of the data item is written into a probabilistic data structure, wherein the probabilistic data structure is contained in the header of the data block of the stream segment in which the data item is written.

6. The method according to any one of claims 2 to 3, in: Writing the data item into a data block of the stream segment comprises: writing the data item into the data block as a row entry, the row entry comprising a row header, and the method comprises: A mode ID is written into the row header, the mode ID identifying how to extract at least one of the first identifier and the second identifier from the data item.

7. The method according to any one of claims 2 to 3, include: Data related to the data item is written to a stream partition such that the stream partition indexes the stream segment to which the data item is written.

8. A computer program comprising a set of computer readable instructions which, when executed by a computer system, cause the computer system to perform a method of identifying a data item stored in the computer system based on a query identifier of the data item, the method include: querying a stream segment header of a stream segment using a query identifier, wherein the stream segment comprises a stream segment header and one or more data blocks, wherein each data block comprises data items, and the stream segment header comprises identifiers of the data items in the data blocks, wherein the querying of the stream segment header is used to identify: whether any of the data items in the data blocks of the stream segment has the query identifier; If any of the data items in the data blocks of the stream segment has the query identifier, querying the data blocks of the stream segment using the query identifier to identify which data blocks of the stream segment have the query identifier; and Perform at least one of the following: retrieve at least one data item with the query identifier among the data items in at least one of the data blocks of the stream fragment; and delete at least one data item with the query identifier among the data items in at least one of the data blocks of the stream fragment.

9. A method for identifying a data item stored in a computer system based on a query identifier of the data item, the method include: querying a stream segment header of a stream segment using a query identifier, wherein the stream segment comprises a stream segment header and one or more data blocks, wherein each data block comprises data items, and the stream segment header comprises identifiers of the data items in the data blocks, wherein the querying of the stream segment header is used to identify: whether any of the data items in the data blocks of the stream segment has the query identifier; If any of the data items in the data blocks of the stream segment has the query identifier, querying the data blocks of the stream segment using the query identifier to identify which data blocks of the stream segment have the query identifier; and Perform at least one of the following: retrieve at least one data item with the query identifier among the data items in at least one of the data blocks of the stream fragment; and delete at least one data item with the query identifier among the data items in at least one of the data blocks of the stream fragment.

10. The method according to claim 9, in, The method comprises: for all data blocks in the stream segment having the query identifier, querying the data items in the data blocks to identify which data items in the data blocks have the query identifier; and Perform at least one of the following: retrieve all data items in the data items in all data blocks in the data blocks of the stream segment that have the query identifier; and delete all data items in the data items in all data blocks in the data blocks of the stream segment that have the query identifier.

11. The method according to any one of claims 9 to 10, in, The identifier of the data item is a first identifier, each data block has a header including a second identifier of the data item in the data block, the second identifier being different from the first identifier, and wherein the computer readable instructions cause the method to include: For each data block of the stream segment having a first query identifier, the header of each of the data blocks is queried using a second query identifier to identify whether any data item in the data block has the second query identifier.

12. The method according to claim 11, in, The method includes, for a data block identified as containing a data item having the second query identifier, querying the data items in the data block to identify which data items in the data block have the second query identifier.

13. The method according to claim 11, in, The first identifier is a coarse identifier applicable to a first number of data items in the data block of the stream segment, and wherein the second identifier is a fine identifier applicable to a second, smaller number of data items in the data block of the stream segment.

14. The method according to claim 11, in, The second identifier of the data item is contained in a probabilistic data structure of the header of the data block.

15. The method according to claim 9, in, The data items are row entries in the data block, each row entry includes a row header, each row header includes a pattern ID identifying how to extract an identifier from the data item, and wherein the computer-readable instructions cause querying the data items in the data block to identify which data items in the data block have the query identifier, including: checking the pattern ID from the row header of the row entry, and extracting the identifier from the row entry using the identified pattern.

Citation Information

Cited By

  • Data storage and acquisition method and system based on point location identification

    CN121560893A

  • A data storage and acquisition method and system based on point location identification

    CN121560893B