# US 2022/0291929 A1 · Method for multi-core communication, electronic device 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/0291929 A1
- Document ID: US20220291929A1
- Status: Published application
- Kind: A1
- Application number: 17/354,587
- Filed: 2021-06-22
- Published: 2022-09-15
- Earliest claimed: 2021-03-12
- Assignees: Beijing Xiaomi Mobile Software Co., Ltd.
- Applicants: Beijing Xiaomi Mobile Software Co., Ltd.
- Inventors: Xiang XIAO
- Web page: https://patentgrep.com/patent/US20220291929A1

## CPC

- G06F 9/441: {Multiboot arrangements, i.e. selecting an operating system to be loaded}
- G06F 9/5077: {Logical partitioning of resources; Management or configuration of virtualized resources (specific details on emulation or internal functioning of virtual machines G06F9/455)}
- G06F 9/542: {Event management; Broadcasting; Multicasting; Notifications}
- G06F 9/544: {Buffers; Shared memory; Pipes}
- G06F 9/546: {Message passing systems or structures, e.g. queues}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present disclosure relates to a method for multi-core communication, an electronic device and a storage medium. The method includes controlling a plurality of cores to run; establishing a communication connection between a publishing core and a receiving core in the plurality of cores based on a communication layer; performing, by the publishing core, an operation on a topic message through calling a preset interface of the communication layer via a publish-subscribe layer; and accessing the topic message in response to the receiving core calling a preset interface of the publish-subscribe layer.

## Claims

### Claim 1

A method for multi-core communication, applicable to a multi-core communication system comprising a plurality of cores, a publish-subscribe layer, and a communication layer, the method comprising:
controlling the plurality of cores to run;
establishing a communication connection between a publishing core and a receiving core in the plurality of cores based on the communication layer;
performing, by the publishing core, an operation on a topic message through calling a preset interface of the communication layer via the publish-subscribe layer, wherein the operation comprises one of the following: publication of the topic message and broadcast of a topic name of the topic message; and
accessing the topic message in response to the receiving core calling a preset interface of the publish-subscribe layer, wherein the accessing comprises one of the following:
subscribing to the topic message, and obtaining the topic message.

### Claim 2 (depends on 1)

The method for multi-core communication of claim 1, wherein the communication layer is in an openAMP framework mode, and the publish-subscribe layer is in a uORB mode.

### Claim 3 (depends on 1)

The method for multi-core communication of claim 1, wherein controlling the plurality of cores to run comprises:
controlling a master core in the plurality of cores to boot, and controlling a remote core in the plurality of cores to boot based on the communication layer;
obtaining, by the remote core, a resource table; wherein the resource table is defined by the master core, and the resource table comprises: a regional division principle of an inter-core buffer; and
executing, by the master core and the remote core, a same configuration item based on the resource table.

### Claim 4 (depends on 3)

The method for multi-core communication of claim 3, wherein obtaining, by the remote core, the resource table comprises:
obtaining, by the remote core, the resource table from an address space, wherein the master core loads the resource table to the address space.

### Claim 5 (depends on 1)

The method for multi-core communication of claim 1, wherein establishing the communication connection between the publishing core and the receiving core in the plurality of cores based on the communication layer comprises:
creating respective ports in the publishing core and the receiving core based on the communication layer; and
establishing, by the publishing core, the communication connection with the receiving core in response to a port name of the publishing core being the same as a port name of the receiving core.

### Claim 6 (depends on 1)

The method for multi-core communication of claim 1, wherein performing, by the publishing core, the operation on the topic message through calling the preset interface of the communication layer via the publish-subscribe layer comprises:
calling, by the publishing core, a first set interface of the publish-subscribe layer, wherein the first set interface is configured to call the preset interface of the communication layer to transmit the topic message to a buffer; and
notifying the receiving core of the topic name of the broadcast topic message in an interrupt mode.

### Claim 7 (depends on 6)

The method for multi-core communication of claim 6, wherein when the publishing core calls the first set interface of the publish-subscribe layer, the method further comprises:
establishing, by the publishing core and the receiving core, respective buffer spaces, wherein the buffer spaces correspond to the topic name.

### Claim 8 (depends on 7)

The method for multi-core communication of claim 7, wherein performing, by the publishing core, the operation on the topic message through calling the preset interface of the communication layer via the publish-subscribe layer further comprises:
calling, by the publishing core, a second set interface of the publish-subscribe layer, wherein the second set interface is configured to call the preset interface of the communication layer to publish the topic message in the buffer.

### Claim 9 (depends on 1)

The method for multi-core communication of claim 1, wherein accessing the topic message in response to the receiving core calling the set interface of the publish-subscribe layer comprises:
obtaining the topic message from the buffer in response to the receiving core calling a third set interface of the publish-subscribe layer; wherein the third set interface comprises an orb_subscribe and an orb_copy; and
storing the topic message in a buffer space of a preset core.

### Claim 10 (depends on 8)

The method for multi-core communication of claim 8, wherein the first set interface is an orb_advertise, and the second set interface is an orb_publish; wherein the preset interface is a rpmsg_send_message.

### Claim 11

An electrical device, comprising:
a processor;
a memory configured to store instructions executable by the processor;
wherein, the processor is configured to execute the method for multi-core communication comprising:
controlling a plurality of cores of a multi-core communication system to run;
establishing a communication connection between a publishing core and a receiving core in the plurality of cores based on a communication layer of the multi-core communication system;
performing, by the publishing core, an operation on a topic message through calling a preset interface of the communication layer via a publish-subscribe layer of the multi-core communication system, wherein the operation comprises one of the following: publication of the topic message and broadcast of a topic name of the topic message; and
accessing the topic message in response to the receiving core calling a preset interface of the publish-subscribe layer, wherein the accessing comprises one of the following: subscribing to the topic message, and obtaining the topic message.

### Claim 12 (depends on 11)

The electrical device claim 11, wherein the communication layer is in an openAMP framework mode, and the publish-subscribe layer is in a uORB mode.

### Claim 13 (depends on 11)

The electrical device claim 11, wherein controlling the plurality of cores to run comprises:
controlling a master core in the plurality of cores to boot, and controlling a remote core in the plurality of cores to boot based on the communication layer;
obtaining, by the remote core, a resource table; wherein the resource table is defined by the master core, and the resource table comprises: a regional division principle of an inter-core buffer; and
executing, by the master core and the remote core, a same configuration item based on the resource table.

### Claim 14 (depends on 11)

The electrical device claim 11, wherein establishing the communication connection between the publishing core and the receiving core in the plurality of cores based on the communication layer comprises:
creating respective ports in the publishing core and the receiving core based on the communication layer; and
establishing, by the publishing core, the communication connection with the receiving core in response to a port name of the publishing core being the same as a port name of the receiving core.

### Claim 15 (depends on 11)

The electrical device claim 11, wherein performing, by the publishing core, the operation on the topic message through calling the preset interface of the communication layer via the publish-subscribe layer comprises:
calling, by the publishing core, a first set interface of the publish-subscribe layer, wherein the first set interface is configured to call the preset interface of the communication layer to transmit the topic message to a buffer; and
notifying the receiving core of the topic name of the broadcast topic message in an interrupt mode.

### Claim 16 (depends on 15)

The electrical device claim 15, wherein when the publishing core calls the first set interface of the publish-subscribe layer, the method further comprises:
establishing, by the publishing core and the receiving core, respective buffer spaces, wherein the buffer spaces correspond to the topic name.

### Claim 17 (depends on 16)

The electrical device claim 16, wherein performing, by the publishing core, the operation on the topic message through calling the preset interface of the communication layer via the publish-subscribe layer further comprises:
calling, by the publishing core, a second set interface of the publish-subscribe layer, wherein the second set interface is configured to call the preset interface of the communication layer to publish the topic message in the buffer.

### Claim 18 (depends on 11)

The electrical device claim 11, wherein accessing the topic message in response to the receiving core calling the set interface of the publish-subscribe layer comprises:
obtaining the topic message from the buffer in response to the receiving core calling a third set interface of the publish-subscribe layer; wherein the third set interface comprises an orb_subscribe and an orb_copy; and
storing the topic message in a buffer space of a preset core.

### Claim 19 (depends on 17)

The electrical device claim 17, wherein the first set interface is an orb_advertise, and the second set interface is an orb_publish; wherein the preset interface is a rpmsg_send_message.

### Claim 20

A non-transitory computer-readable storage medium, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is caused to execute the method for multi-core communication comprising:
controlling a plurality of cores of a multi-core communication system to run;
establishing a communication connection between a publishing core and a receiving core in the plurality of cores based on a communication layer of the multi-core communication system;
performing, by the publishing core, an operation on a topic message through calling a preset interface of the communication layer via a publish-subscribe layer of the multi-core communication system, wherein the operation comprises one of the following: publication of the topic message and broadcast of a topic name of the topic message; and
accessing the topic message in response to the receiving core calling a preset interface of the publish-subscribe layer, wherein the accessing comprises one of the following: subscribing to the topic message, and obtaining the topic message.
