Method for multi-core communication, electronic device and storage medium
AssigneeBeijing Xiaomi Mobile Software Co., Ltd.
InventorXiang XIAO
Life of this patent
Estimating the term…
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.
Claims20
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.
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.
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.
Dependencies are inferred from the claim text.