CN-122019451-A - Inter-core communication method, device, system, equipment and computer readable storage medium
Abstract
The application discloses an inter-core communication method, a device, a system, equipment and a computer readable storage medium, which aim to realize stable and efficient inter-core communication and are applied to an inter-core communication assembly comprising a plurality of first data channel groups, wherein each first data channel group comprises a first data transmission channel and a first data receiving channel which are mutually corresponding; the method comprises the steps of receiving first communication data sent by a first kernel, selecting a first target data channel group, storing the first communication data to a first target storage position corresponding to a first target data sending channel in the first target data channel group, sending an interrupt notification to a second kernel to enable the second kernel to obtain the first communication data at the first target storage position, receiving first response data sent by the second kernel, storing the first response data to a second target storage position corresponding to a first target data receiving channel in the first target data channel group, and sending the interrupt notification to the first kernel to enable the first kernel to obtain the first response data at the second target storage position.
Inventors
- MA BIN
Assignees
- 山东云海国创云计算装备产业创新中心有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260130
Claims (10)
- 1. An inter-core communication method, which is applied to an inter-core communication component, wherein the inter-core communication component comprises a plurality of first data channel groups, each first data channel group comprises a first data sending channel and a first data receiving channel which correspond to each other, and the method comprises the following steps: Receiving first communication data sent by a first kernel, selecting a first target data channel group from a plurality of first data channel groups, and storing the first communication data to a first target storage position bound by a first target data sending channel in the first target data channel group; Sending a first interrupt notification to a second kernel, so that the second kernel acquires the first communication data at the first target storage position according to the first interrupt notification; receiving first response data sent by the second kernel, and storing the first response data to a second target storage position bound by a first target data receiving channel in the first target data channel group; and sending a second interrupt notification to the first kernel so that the first kernel acquires the first response data at the second target storage position according to the second interrupt notification.
- 2. The method of inter-core communication according to claim 1, wherein selecting a first target data channel group from a plurality of the first data channel groups, storing the first communication data to a first target storage location to which a first target data transmission channel in the first target data channel group is bound, comprises: selecting a first data channel group which is not provided with a data zone bit in the state registers corresponding to a first data sending channel and a first data receiving channel from a plurality of first data channel groups as the first target data channel group; And storing the first communication data to the first target storage position bound by the first target data sending channel in the first target data channel group.
- 3. The inter-core communication method of claim 1, wherein sending a first interrupt notification to a second core to cause the second core to obtain the first communication data at the first target storage location according to the first interrupt notification comprises: transmitting a channel message of the first target data transmission channel to the first kernel so that the first kernel writes an interrupt flag bit in a control register corresponding to the first target data transmission channel to generate the first interrupt notification; And sending the first interrupt notification to the second kernel so that the second kernel acquires the first communication data at the first target storage position according to the first interrupt notification.
- 4. The inter-core communication method of claim 3, wherein sending a second interrupt notification to the first core to cause the first core to obtain the first response data at the second target storage location according to the second interrupt notification comprises: sending the second interrupt notification to the first kernel so as to enable the first kernel to be converted from a dormant state to an awake state, and acquiring the first response data at the second target storage position according to the second interrupt notification in the awake state; the first kernel is switched from the wake-up state to the sleep state after writing the interrupt flag bit into a control register corresponding to the first target data transmission channel.
- 5. The inter-core communication method of claim 1, wherein sending a second interrupt notification to the first core to cause the first core to obtain the first answer data at the second target storage location according to the second interrupt notification further comprises: Receiving a first zero clearing notification through a state zero clearing register corresponding to the first target data sending channel, wherein the first zero clearing notification is generated by writing a zero clearing flag bit into the state zero clearing register corresponding to the first target data sending channel after the second kernel sends the first response data; Releasing the first target data transmission channel according to the first zero clearing notification; Receiving a second zero clearing notification through a state zero clearing register corresponding to the first target data receiving channel, wherein the second zero clearing notification is generated by writing a zero clearing flag bit into the state zero clearing register corresponding to the first target data receiving channel after the first kernel receives the first response data; and releasing the second target data receiving channel according to the second zero clearing notification.
- 6. The method according to any one of claims 1 to 5, wherein the inter-core communication component further comprises a plurality of first event channel groups, each of the first event channel groups comprising a first event transmission channel and a first event reception channel corresponding to each other, the method further comprising: Receiving a first event notification sent by the first kernel, and selecting a first target event channel group from a plurality of first event channel groups; Sending a third interrupt notification to the second kernel, so that the second kernel obtains the first event notification through a first target event sending channel in the first target event channel group according to the third interrupt notification; Receiving a first response event sent by the second kernel, wherein the first response event corresponds to the first event notification; And sending a fourth interrupt notification to the first kernel so that the first kernel acquires the first response event through a first target event receiving channel in the first target event channel group according to the fourth interrupt notification.
- 7. An inter-core communication device, which is applied to an inter-core communication component, wherein the inter-core communication component comprises a plurality of first data channel groups, each first data channel group comprises a first data transmission channel and a first data receiving channel which correspond to each other, and the device comprises: The first receiving module is used for receiving first communication data sent by a first kernel, selecting a first target data channel group from a plurality of first data channel groups, and storing the first communication data to a first target storage position bound by a first target data sending channel in the first target data channel group; the first sending module is used for sending a first interrupt notification to the second kernel so that the second kernel can acquire the first communication data at the first target storage position according to the first interrupt notification; the second receiving module is used for receiving the first response data sent by the second kernel, and storing the first response data to a second target storage position bound by a first target data receiving channel in the first target data channel group; And the second sending module is used for sending a second interrupt notification to the first kernel so that the first kernel acquires the first response data at the second target storage position according to the second interrupt notification.
- 8. An inter-core communication system, comprising an inter-core communication component, a first core and a second core, wherein the inter-core communication component is respectively in communication connection with the first core and the second core, the inter-core communication component comprises a plurality of first data channel groups, each first data channel group comprises a first data sending channel and a first data receiving channel which correspond to each other, and the inter-core communication component is used for realizing the steps of the inter-core communication method according to any one of claims 1 to 6.
- 9. An electronic device, comprising: A memory for storing a computer program; processor for implementing the steps of the inter-core communication method according to any of claims 1 to 6 when executing said computer program.
- 10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the inter-core communication method according to any of claims 1 to 6.
Description
Inter-core communication method, device, system, equipment and computer readable storage medium Technical Field The present application relates to the field of communications technologies, and in particular, to an inter-core communication method, and further, to an inter-core communication device, a system, an electronic apparatus, and a computer readable storage medium. Background With the development of technologies such as artificial intelligence, cloud computing, big data and 5G communication, servers have come up with new development opportunities, and the current processor chip is designed to be more complex and more powerful, and the processor chip is gradually developed from a single core to multiple cores, and the cores may be loaded with different operating systems for realizing different functions. For many kernel and many operating systems, cooperative processing tasks are often needed, for cooperatively completing some functions, inter-kernel communication between multiple kernels is essential, and the inter-kernel communication mechanism of the multiple kernels affects the performance of the whole system. Currently, inter-core communication can be realized based on soft interrupt and shared memory in the related art, when a CPU core of a sender needs to send data, the data is placed in the shared memory, then the soft interrupt is triggered to notify the CPU core of a receiver, and the CPU core of the receiver traverses the shared memory to receive the data. However, the multiple cores can operate the shared memory simultaneously, if the multiple cores write data into the same position of the shared memory simultaneously, a conflict occurs, so that communication fails, and when the receiving CPU core receives the soft interrupt, the receiving CPU core needs to traverse the shared memory to search the position of the target data in the shared memory, then the target data can be read, the position of the target data can not be found by the soft interrupt, and the efficiency is low. Therefore, the conventional inter-core communication method has problems of low communication efficiency and unstable communication. Therefore, how to achieve more stable and efficient inter-core communication is a problem to be solved by those skilled in the art. Disclosure of Invention Another object of the present application is to provide an inter-core communication method that can achieve more stable and efficient inter-core communication, and an inter-core communication apparatus, system, electronic device, computer-readable storage medium, and computer program product, each having the above-mentioned advantageous effects. In a first aspect, the present application provides an inter-core communication method applied to an inter-core communication assembly, where the inter-core communication assembly includes a plurality of first data channel groups, each of the first data channel groups includes a first data transmission channel and a first data reception channel that correspond to each other, and the method includes: Receiving first communication data sent by a first kernel, selecting a first target data channel group from a plurality of first data channel groups, and storing the first communication data to a first target storage position bound by a first target data sending channel in the first target data channel group; Sending a first interrupt notification to a second kernel, so that the second kernel acquires the first communication data at the first target storage position according to the first interrupt notification; receiving first response data sent by the second kernel, and storing the first response data to a second target storage position bound by a first target data receiving channel in the first target data channel group; and sending a second interrupt notification to the first kernel so that the first kernel acquires the first response data at the second target storage position according to the second interrupt notification. Optionally, selecting a first target data channel group from the plurality of first data channel groups, and storing the first communication data to a first target storage location bound by a first target data sending channel in the first target data channel group, including: selecting a first data channel group which is not provided with a data zone bit in the state registers corresponding to a first data sending channel and a first data receiving channel from a plurality of first data channel groups as the first target data channel group; And storing the first communication data to the first target storage position bound by the first target data sending channel in the first target data channel group. Optionally, sending a first interrupt notification to a second kernel, so that the second kernel obtains the first communication data at the first target storage location according to the first interrupt notification, including: transmitting a channel message of the first targ