# US 2022/0035666 A1 · Method and apparatus for data processing, server and storage medium

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

- Number: US 2022/0035666 A1
- Document ID: US20220035666A1
- Status: Published application
- Kind: A1
- Application number: 17/214,121
- Filed: 2021-03-26
- Published: 2022-02-03
- Earliest claimed: 2020-07-31
- Assignees: Beijing Xiaomi Mobile Software Co., Ltd.
- Applicants: Beijing Xiaomi Mobile Software Co., Ltd.
- Inventors: Fuye WANG; Xiaobing MAO; Zenghui LIU
- Web page: https://patentgrep.com/patent/US20220035666A1

## CPC

- G06F 9/4887: {involving deadlines, e.g. rate based, periodic}
- G06F 9/542: {Event management; Broadcasting; Multicasting; Notifications}
- G06F 13/1668: {Details of memory controller}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method includes that: a user event to be processed is received; the user event to be processed is stored into an event queue corresponding to an event attribute of the user event to be processed, user events with different event attributes corresponding to different event queues; the user event is read from the event queue through multiple processes and is processed; and the processed user event is deleted from the event queue.

## Claims

### Claim 1

A method for data processing, comprising:
receiving a user event to be processed;
storing the user event to be processed into an event queue corresponding to an event attribute of the user event to be processed, wherein user events with different event attributes correspond to different event queues;
reading the user event from the event queue through multiple processes and processing the user event; and
deleting the processed user event from the event queue.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
determining a priority of the user event in a same event queue; and
adjusting a position of the user event in the same event queue according to the priority,
wherein the user event enters the event queue from a tail of the event queue and is taken out by the multiple processes from a head of the event queue.

### Claim 3 (depends on 2)

The method of claim 2, wherein determining the priority of the user event in the same event queue comprises:
acquiring time information of the user event in the same event queue; and
determining the priority of the user event in the same event queue based on time corresponding to the time information, wherein the priority is positively correlated with the time corresponding to the time information of the user event.

### Claim 4 (depends on 1)

The method of claim 1, wherein reading the user event from the event queue through the multiple processes and processing the user event comprises:
reading the user event from a head of an event queue through one process in the multiple processes, and determining whether trigger time for reading the user event is reached; and
processing the read user event when the trigger time for reading the user event is reached.

### Claim 5 (depends on 1)

The method of claim 1, wherein reading the user event from the event queue through the multiple processes and processing the user event comprises:
reading the user event from different event queues in a polling mode through the multiple processes and processing the user event.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
randomly sorting the different event queues; and
wherein reading the user event from the different event queues in the polling mode through the multiple processes and processing the user event comprises:
reading the user event from the randomly sorted different event queues in the polling mode through the multiple processes and processing the user event.

### Claim 7 (depends on 1)

The method of claim 1, wherein the event attribute comprises a user identifier indicating a user to which the user event belongs; and user events with different user identifiers correspond to different event queues.

### Claim 8 (depends on 7)

The method of claim 7, wherein storing the user event to be processed into the event queue corresponding to the event attribute of the user event to be processed comprises:
processing the user identifier of the user event to be processed through a consistent hashing algorithm to obtain a hash value; and
storing the user event to be processed into the event queue corresponding to the hash value.

### Claim 9 (depends on 1)

The method of claim 1, wherein reading the user event from the event queue through the multiple processes and processing the user event comprises:
reading, in a script call mode, the user event from the event queue through the multiple processes and processing the user event.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
adding one or more event queues when a capacity expansion condition is met; or
forbidding storing the user event into one or more event queues when a capacity reduction condition is met, and deleting the event queue in response to the user event in the event queue being processed.

### Claim 11

An apparatus for data processing, comprising:
a network interface, configured to receive a user event to be processed;
a memory, configured to store the user event to be processed into an event queue corresponding to an event attribute of the user event to be processed, wherein user events with different event attributes correspond to different event queues; and
a processing component, connected to the network interface and the memory, configured to read the user event from the event queue through multiple processes and process the user event; and delete the processed user event from the event queue.

### Claim 12 (depends on 11)

The apparatus of claim 11, wherein the processor is further configured to:
determine a priority of the user event in a same event queue; and
adjust a position of the user event in the same event queue according to the priority, and wherein the user event enters the event queue from a tail of the event queue and is taken out by the multiple processes from a head of the event queue.

### Claim 13 (depends on 12)

The apparatus of claim 12, wherein the processing component is configured to: acquire time information of the user event in the same event queue; and determine the priority of the user event in the same event queue based on time corresponding to the time information, wherein the priority is positively correlated with the time corresponding to the time information of the user event.

### Claim 14 (depends on 11)

The apparatus of claim 11, wherein the processing component is configured to read the user event from a head of an event queue through one process in the multiple processes, and determine whether trigger time for reading the user event is reached; and process the read user event when the trigger time for reading the user event is reached.

### Claim 15 (depends on 11)

The apparatus of claim 11, wherein the processing component is configured to read the user event from different event queues in a polling mode through the multiple processes and process the user event.

### Claim 16 (depends on 15)

The apparatus of claim 15, wherein the processor is further configured to:
randomly sort the different event queues; and
read the user event from the randomly sorted different event queues in the polling mode through the multiple processes and processing the user event.

### Claim 17 (depends on 11)

The apparatus of claim 11, wherein the event attribute comprises a user identifier indicating a user to which the user event belongs; and user events with different user identifiers correspond to different event queues.

### Claim 18 (depends on 17)

The apparatus of claim 17, wherein the memory is configured to process the user identifier of the user event to be processed through a consistent hashing algorithm to obtain a hash value; and store the user event to be processed into the event queue corresponding to the hash value.

### Claim 19 (depends on 11)

The apparatus of claim 11, wherein the processing component is configured to:
read, in a script call mode, the user event from the event queue through the multiple processes and processing the user event; or
add one or more event queues when a capacity expansion condition is met; or
forbid storing the user event into one or more event queues when a capacity reduction condition is met, and delete the event queue in response to the user event in the event queue being processed.

### Claim 20

A non-transitory computer-readable storage medium, storing instructions that, when executed by a processor of a server, cause the server to implement:
receiving a user event to be processed;
storing the user event to be processed into an event queue corresponding to an event attribute of the user event to be processed, wherein user events with different event attributes correspond to different event queues;
reading the user event from the event queue through multiple processes and processing the user event; and
deleting the processed user event from the event queue.
