# US 2022/0067041 A1 · Methods and systems for processing and storing streamed event data

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2022/0067041 A1
- Document ID: US20220067041A1
- Status: Published application
- Kind: A1
- Application number: 17/004,126
- Filed: 2020-08-27
- Published: 2022-03-03
- Earliest claimed: 2020-08-27
- Assignees: Shopify Inc.
- Applicants: Shopify Inc.
- Inventors: Erik Wright; Michael Highstead; David Muto; David Sugden; James Hall
- Web page: https://patentgrep.com/patent/US20220067041A1

## CPC

- G06F 16/2477: {Temporal data queries}
- G06F 16/128: {Details of file system snapshots on the file-level, e.g. snapshot creation, administration, deletion (error detection or correction of the data by redundancy in operations or in hardware G06F11/14, G06F11/16)}
- G06F 16/219: {Managing data history or versioning (querying versioned data G06F16/2474; querying temporal data G06F16/2477)}
- G06F 16/24556: {Aggregation; Duplicate elimination}
- G06F 16/24568: {Data stream processing; Continuous queries}
- G06F 16/248: Presentation of query results
- G06F 16/11: File system administration, e.g. details of archiving or snapshots (error detection or correction of the data by redundancy in operations G06F11/14)
- G06F 16/21: Design, administration or maintenance of databases
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods and systems for processing real-time event data by aggregating event data over various time windows and storing aggregate event data records containing the aggregated data. The method may include receiving event data at a current time, determining that the event data relates to a time prior to the beginning of a current time window, and identifying, based on the time, one or more stored aggregate event records each associated with a respective previous time window. The method may include creating, for each of the identified one or more stored aggregate event records, a new aggregate event record containing updated aggregate event data adjusted by the event data, and storing each new aggregate event record in association with its respective previous time window and a creation timestamp reflecting the current time.

## Claims

### Claim 1

A computer-implemented method for processing streamed event data, the method comprising:
receiving event data at a current time;
determining that the event data relates to a time prior to the beginning of a current time window;
identifying, based on the time, one or more stored aggregate event records each associated with a respective previous time window;
creating, for each of the identified one or more stored aggregate event records, a new aggregate event record containing updated aggregate event data adjusted by the event data; and
storing each new aggregate event record in association with its respective previous time window and a creation timestamp reflecting the current time.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein identifying includes determining that the time prior to the beginning of the current time window falls with the respective previous time window.

### Claim 3 (depends on 2)

The computer-implemented method of claim 2, wherein identifying further includes identifying two or more stored aggregate event records associated with a same previous time window and selecting one of the two or more stored aggregate event records based on it having a most recent creation timestamp.

### Claim 4 (depends on 2)

The computer-implemented method of claim 2, wherein creating includes, for each of the identified one or more stored aggregate event records, generating a copy of that stored aggregate event record, adjusting aggregate event data within the copy based on the received event data, and storing the copy containing adjusted aggregate event data as the new aggregate event record.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, further comprising:
receiving additional event data relating to the current time window;
adjusting a current aggregate event parameter based on the additional event data;
determining that the current time matches an end of the current time window; and
responsive to determining that the current time matches an end of the current time window, storing the current aggregate event parameter in a current aggregate event record.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, wherein each stored aggregate event record includes metadata, and the metadata associated with a given stored aggregate record includes an associated previous time window for the given record and a creation timestamp for the given record.

### Claim 7 (depends on 6)

The computer-implemented method of claim 6, wherein the metadata further includes at least one of a merchant identifier, a store identifier, or a product identifier.

### Claim 8 (depends on 6)

The computer-implemented method of claim 6, wherein the metadata further includes a window start time and a window end time for the associated previous time window.

### Claim 9 (depends on 1)

The computer-implemented method of claim 1, wherein the event data relates to a sales metric and wherein each stored aggregate event record includes a respective aggregated total sales metric associated with the previous time window.

### Claim 10

A non-transitory computer-readable medium storing processor-executable instructions for processing streamed event data, wherein the instructions, when executed by one or more processors, are to cause the one or more processors to:
receive event data at a current time;
determine that the event data relates to a time prior to the beginning of a current time window;
identify, based on the time, one or more stored aggregate event records each associated with a respective previous time window;
create, for each of the identified one or more stored aggregate event records, a new aggregate event record containing updated aggregate event data adjusted by the event data; and
store each new aggregate event record in association with its respective previous time window and a creation timestamp reflecting the current time.

### Claim 11

A computer-implemented method of providing a client device with aggregated event data, the method comprising:
receiving, from the client device, a query associated with a start time, an end time, and a snapshot time;
identifying a plurality of stored aggregate event records, each having an associated time window, wherein the associated time windows of the plurality of stored aggregate event records are non-overlapping and span a window from the start time to the end time;
for each identified stored aggregate event record for which there are multiple versions present, selecting a version of that stored aggregate event record having an associated creation timestamp not exceeding the snapshot time; and
providing, to the client device, aggregated data from the identified and selected aggregate event records.

### Claim 12 (depends on 11)

The method of claim 11, wherein selecting includes selecting the version of that stored aggregate event record based on its creation timestamp being closest to, and not exceeding, the snapshot time.

### Claim 13 (depends on 11)

The method of claim 11, wherein the start time includes a start date and time, the end time includes an end date and time, and the snapshot time includes a snapshot date and time.

### Claim 14 (depends on 11)

The method of claim 11, wherein identifying includes selecting a minimum number of stored aggregate event records to span the window from the start time to the end time.

### Claim 15 (depends on 14)

The method of claim 14, wherein selecting the minimum number includes selecting, from amongst possible stored aggregate event records, at least one stored aggregate event records having the longest associated time window that fits within the window from the start time to the end time.

### Claim 16 (depends on 11)

The method of claim 11, wherein the request further includes a specified window length, and wherein identifying the plurality of stored aggregate event records includes selecting stored aggregate event records on the basis that their associated time window has the specified window length.

### Claim 17 (depends on 16)

The method of claim 16, wherein providing, to the client device, aggregated data from the identified and selected aggregate event records includes extracting aggregate data from the identified and selected stored aggregate event records and providing the client device with the extracted aggregate data.

### Claim 18 (depends on 11)

The method of claim 11, wherein providing, to the client device, aggregated data from the identified and selected aggregate event records includes:
extracting aggregate data from each of the identified stored aggregate event records;
aggregating the extracted aggregate data to produce an aggregated total; and
providing the client device with the aggregated total.

### Claim 19 (depends on 11)

The method of claim 11, wherein providing, to the client device, aggregated data from the identified and selected aggregate event records further includes providing the client device with real-time event data.

### Claim 20

A non-transitory computer-readable medium storing processor-executable instructions for providing a client device with aggregate event data, wherein the instructions, when executed by one or more processors, are to cause the one or more processors to:
receive, from the client device, a query associated with a start time, an end time, and a snapshot time;
identify a plurality of stored aggregate event records, each having an associated time window, wherein the associated time windows of the plurality of stored aggregate event records are non-overlapping and span a window from the start time to the end time;
for each identified stored aggregate event record for which there are multiple versions present, select a version of that stored aggregate event record having an associated creation timestamp not exceeding the snapshot time; and
provide, to the client device, aggregated data from the identified and selected aggregate event records.
