# US 2024/0256163 A1 · Data Processing Method and Apparatus for Shared Memory, and Device and Medium

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

- Number: US 2024/0256163 A1
- Document ID: US20240256163A1
- Status: Published application
- Kind: A1
- Application number: 18/566,200
- Filed: 2022-04-24
- Published: 2024-08-01
- Earliest claimed: 2021-06-23
- Assignees: Beijing CHJ Information Technology Co., LTD.
- Applicants: Beijing Chj Information Technology Co., Ltd.
- Inventors: Jiaqi Ju; Liucheng Tang
- Web page: https://patentgrep.com/patent/US20240256163A1

## CPC

- G06F 3/064: {Management of blocks}
- G06F 9/544: {Buffers; Shared memory; Pipes}
- G06F 3/0604: {Improving or facilitating administration, e.g. storage management}
- G06F 3/0659: {Command handling arrangements, e.g. command buffers, queues, command scheduling}
- G06F 3/0673: {Single storage device}
- G06F 9/52: Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F 12/10: Address translation
- G06F 2212/1008: Correctness of operation, e.g. memory ordering
- G06F 2212/1024: Latency reduction
- G06F 2212/1032: Reliability improvement, data loss prevention, degraded operation etc
- G06F 2212/254: Distributed memory
- G06F 2212/656: Address space sharing
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A data processing method for a shared memory includes: receiving a writing operation request of target data, the writing operation request being configured to request to write the target data to the shared memory; obtaining a writing index value in the shared memory, and updating the writing index value, an updated writing index value being 1 greater than the writing index value obtained before the updating, and the writing index value being configured to lock a storage block to which data is to be written; determining a storage block corresponding to the updated writing index value as a target storage block; and writing the target data to the target storage block.

## Claims

### Claim 1

A data processing method for a shared memory, comprising:
receiving a writing operation request of target data, the writing operation request being configured to request to write the target data to the shared memory;
obtaining a writing index value in the shared memory, and updating the writing index value, an updated writing index value being 1 greater than the writing index value obtained before the updating, and the writing index value being configured to lock a storage block to which data is to be written;
determining a storage block corresponding to the updated writing index value as a target storage block; and
writing the target data to the target storage block.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
receiving a reading operation request of a target user equipment, the reading operation request being configured to request to read data of a first storage block in the shared memory;
detecting that a state corresponding to the first storage block is a first state, and reading the data in the first storage block, wherein the first state is configured to indicate that data writing at the first storage block is completed; and
sending a data reading message to the target user equipment based on the state corresponding to the first storage block after data reading at the first storage block is completed, the data reading message being configured to indicate a reading result of the first storage block.

### Claim 3 (depends on 2)

The method of claim 2, wherein sending the data reading message to the target user equipment based on the state corresponding to the first storage block comprises one of:
detecting that the state corresponding to the first storage block is the first state, and sending a first data reading message to the target user equipment, the first data reading message comprising the data in the first storage block; or
detecting that the state corresponding to the first storage block is a second state, and sending a second data reading message to the target user equipment, the second data reading message being configured to indicate a failure of the data reading at the first storage block,
wherein the second state is configured to indicate that data is being written to the first storage block.

### Claim 4 (depends on 3)

The method of claim 3, before writing the target data to the target storage block, the method further comprising:
setting a state corresponding to the target storage block to the second state;
after writing the target data to the target storage block, the method further comprising:
setting the state corresponding to the target storage block to the first state.

### Claim 5 (depends on 4)

The method of claim 4, after setting the state corresponding to the target storage block to the first state, the method further comprising:
updating a storage index value in the shared memory, an updated storage index value being 1 greater than the storage index value obtained before the updating, and the storage index value being configured to indicate a storage block where data writing is completed in the shared memory.

### Claim 6 (depends on 5)

The method of claim 5, before determining that the state corresponding to the first storage block is the first state, the method further comprising:
obtaining a reading index value corresponding to the target user equipment, wherein the reading index value is configured to indicate a storage block in the shared memory where the target user equipment completes data reading; and
determining that the storage index value is greater than the reading index value.

### Claim 7 (depends on 6)

The method of claim 6, after sending the first data reading message to the target user equipment, the method further comprising:
sending an update message of the reading index value to the target user equipment, the update message being configured to indicate the target user equipment to update the reading index value, and an updated reading index value being 1 greater than the reading index value obtained before the updating.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
sending a third data reading message to a target user equipment, the third data reading message being configured to indicate the target user equipment to read data from the shared memory.

### Claim 9 (depends on 1)

The method of claim 1, wherein writing the target data to the target storage block comprises:
determining that the target storage block is a first storage block in the shared memory and that data is stored in the first storage block; and
storing the target data to the first storage block by replacing the data stored in the first storage block with the target data.

### Claim 10

(canceled)

### Claim 11

An electronic device, comprising:
one or more processors; and
a storage device, configured to store one or more programs,
wherein when the one or more programs are executed by the one or more processors, the one or more processors are configured to:
receive a writing operation request of target data, the writing operation request being configured to request to write the target data to the shared memory;
obtain a writing index value in the shared memory, and update the writing index value, an updated writing index value being 1 greater than the writing index value obtained before the updating, and the writing index value being configured to lock a storage block to which data is to be written;
determine a storage block corresponding to the updated writing index value as a target storage block; and
write the target data to the target storage block.

### Claim 12

A non-transitory computer readable storage medium having a computer program stored thereon, wherein, when the computer program is executed by a processor, a data processing method for a shared memory is performed, the method comprising:
receiving a writing operation request of target data, the writing operation request being configured to request to write the target data to the shared memory;
obtaining a writing index value in the shared memory, and updating the writing index value, an updated writing index value being 1 greater than the writing index value obtained before the updating, and the writing index value being configured to lock a storage block to which data is to be written;
determining a storage block corresponding to the updated writing index value as a target storage block; and
writing the target data to the target storage block.

### Claim 13

(canceled)

### Claim 14

(canceled)

### Claim 15 (depends on 11)

The electronic device of claim 11, wherein the one or more processors are further configured to:
receive a reading operation request of a target user equipment, the reading operation request being configured to request to read data of a first storage block in the shared memory;
detect that a state corresponding to the first storage block is a first state, and read the data in the first storage block, wherein the first state is configured to indicate that data writing at the first storage block is completed; and
send a data reading message to the target user equipment based on the state corresponding to the first storage block after data reading at the first storage block is completed, the data reading message being configured to indicate a reading result of the first storage block.

### Claim 16 (depends on 15)

The electronic device of claim 15, wherein when sending the data reading message to the target user equipment based on the state corresponding to the first storage block, the one or more processors are further configured to one of:
detect that the state corresponding to the first storage block is the first state, and send a first data reading message to the target user equipment, the first data reading message comprising the data in the first storage block; or
detect that the state corresponding to the first storage block is a second state, and send a second data reading message to the target user equipment, the second data reading message being configured to indicate a failure of the data reading at the first storage block,
wherein the second state is configured to indicate that data is being written to the first storage block.

### Claim 17 (depends on 16)

The electronic device of claim 16, wherein before writing the target data to the target storage block, the one or more processors are further configured to:
set a state corresponding to the target storage block to the second state;
after writing the target data to the target storage block, the one or more processors are further configured to comprising:
set the state corresponding to the target storage block to the first state.

### Claim 18 (depends on 17)

The electronic device of claim 17, after setting the state corresponding to the target storage block to the first state, the one or more processors are further configured to:
update a storage index value in the shared memory, an updated storage index value being 1 greater than the storage index value obtained before the updating, and the storage index value being configured to indicate a storage block where data writing is completed in the shared memory.

### Claim 19 (depends on 18)

The electronic device of claim 18, before detecting that the state corresponding to the first storage block is the first state, the one or more processors are further configured to:
obtain a reading index value corresponding to the target user equipment, wherein the reading index value is configured to indicate a storage block in the shared memory where the target user equipment completes data reading; and
determine that the storage index value is greater than the reading index value.

### Claim 20 (depends on 19)

The electronic device of claim 19, after sending the first data reading message to the target user equipment, the one or more processors are further configured to:
send an update message of the reading index value to the target user equipment, the update message being configured to indicate the target user equipment to update the reading index value, and an updated reading index value being 1 greater than the reading index value obtained before the updating.

### Claim 21 (depends on 11)

The electronic device of claim 11, wherein the one or more processors are further configured to:
send a third data reading message to a target user equipment, the third data reading message being configured to indicate the target user equipment to read data from the shared memory.

### Claim 22 (depends on 11)

The electronic device of claim 11, wherein when writing the target data to the target storage block, the one or more processors are further configured to:
determine that the target storage block is a first storage block in the shared memory and that data is stored in the first storage block; and
store the target data to the first storage block by replacing the data stored in the first storage block with the target data.

### Claim 23 (depends on 12)

The non-transitory computer readable storage medium of claim 12, wherein the data processing method for a shared memory further comprises:
receiving a reading operation request of a target user equipment, the reading operation request being configured to request to read data of a first storage block in the shared memory;
detecting that a state corresponding to the first storage block is a first state, and reading the data in the first storage block, wherein the first state is configured to indicate that data writing at the first storage block is completed; and
sending a data reading message to the target user equipment based on the state corresponding to the first storage block after data reading at the first storage block is completed, the data reading message being configured to indicate a reading result of the first storage block.
