Inter-core communication method, device, electronic device and storage medium

By using hardware channels composed of shared memory and register groups in the SoC chip, efficient communication between N sending cores and receiving cores is achieved, solving the problems of low communication efficiency and frequent interruptions between cores, improving communication efficiency and reducing Hardware costs.

CN114490127BActive Publication Date: 2024-11-26GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210069408.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-20
Publication Date
2024-11-26
Estimated Expiration
2042-01-20

AI Technical Summary

Technical Problem

In complex SoC chips, the efficiency of inter-core communication is low, resulting in an increase in transmission delay, which cannot meet the requirements of real-time and efficientness. Frequent interrupt triggers lead to an increase in the load of the receiving core, and interrupts and message loss may occur.

Method used

Shared memory and register groups together form an exclusive hardware channel for inter-core communication in message aggregation mode, so that N sending cores can communicate between the exclusive hardware channel and the receiving core. Only one connection and interrupt trigger are required to achieve many-to-one Transmission and interrupt multiplexing.

Benefits of technology

It significantly improves the communication efficiency between cores, reduces hardware costs and interrupt triggers, realizes the functions of memory multiplexing and interrupt multiplexing, and meets the efficient communication needs in message aggregation mode.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114490127B_ABST
    Figure CN114490127B_ABST
Patent Text Reader

Abstract

The embodiment of the present application proposes an inter-core communication method, device, electronic device and storage medium, the electronic device includes a receiving core and N sending cores, a shared memory and a register group, the register group includes a first register, a second register and a third register, the method includes: the i-th sending core reads a first value; writes target data into the shared content according to the second value and the first value; reads a third value from the third register, and triggers an interrupt event when the third value meets the interrupt triggering condition. The present application combines the shared memory and the register group to form an inter-core communication exclusive hardware channel for message aggregation mode, so that N sending cores can realize inter-core communication behavior with the receiving core through the exclusive hardware channel, reduce hardware costs, and reduce the number of interrupt triggering times, realize the functions of memory multiplexing and interrupt multiplexing in many-to-one transmission, thereby improving the efficiency of inter-core communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to an inter-core communication method, device, electronic device and storage medium. Background Art

[0002] With the development of semiconductor technology, the functions of chips are becoming more and more complex. System on Chip (SoC) chips not only contain many cores, but many of them are heterogeneous, so there is a lot of inter-core communication, which usually has strict requirements on transmission efficiency and stability. Therefore, as an important data channel, the efficiency of inter-core communication has become the main factor affecting chip performance. Summary of the invention

[0003] The embodiments of the present application provide an inter-core communication method, device, electronic device and storage medium, which can improve the efficiency of inter-core communication in a message aggregation mode scenario and reduce hardware costs.

[0004] In a first aspect, an embodiment of the present application provides an inter-core communication method, which is applied to an electronic device, wherein the electronic device includes a receiving core and N sending cores, a shared memory, and a register group, wherein the register group includes a first register, a second register, and a third register, and N is a positive integer greater than 1; the method includes:

[0005] The i-th sending core reads a first value, where the first value is the value of the second register, and i is a positive integer less than or equal to N;

[0006] The i-th sending core writes target data into the shared content according to a second value and the first value, where the second value is the value of the first register stored by the i-th sending core;

[0007] The i-th sending core reads a third value from the third register, where the third value is the length or quantity of the data written into the shared memory;

[0008] The i-th sending core determines whether an interrupt triggering condition is met according to the third value, and triggers an interrupt event when the third value meets the interrupt triggering condition.

[0009] In a second aspect, an embodiment of the present application provides an inter-core communication method, which is applied to an electronic device, wherein the electronic device includes a receiving core and N sending cores, a shared memory, and a register group, wherein the register group includes a second register, a fourth register, and a fifth register, wherein the fourth register and the fifth register are mirror registers, and N is a positive integer greater than 1; the method includes:

[0010] If an interrupt event is detected, the receiving core reads and a fourth value, the fourth value being the value of the fifth register;

[0011] The receiving core reads target data from the shared memory according to a first value and the fourth value, wherein the first value is a value of the second register stored by the receiving core.

[0012] In a third aspect, an embodiment of the present application provides an inter-core communication device, which is applied to an electronic device, wherein the electronic device includes a receiving core and N sending cores sharing a memory and a register group, wherein the register group includes a first register, a second register, and a third register, wherein N is a positive integer greater than 1; the device includes:

[0013] A reading unit, configured to read a second value and a first value, wherein the second value is a value of the first register, the first value is a value of the second register, and i is a positive integer less than or equal to N;

[0014] a writing unit, configured to write a second value and the first value into the shared content as target data, wherein the second value is a value of the first register stored in the i-th sending core;

[0015] The reading unit is further used to read a third value from the third register, wherein the third value is the length or quantity of the data written into the shared memory;

[0016] The trigger unit is used to determine whether an interrupt trigger condition is met according to the third value, and trigger an interrupt event when the third value meets the interrupt trigger condition.

[0017] In a fourth aspect, an embodiment of the present application provides an inter-core communication device, which is applied to an electronic device, wherein the electronic device includes a receiving core and N sending cores sharing a memory and a register group, wherein the register group includes a second register, a fourth register, and a fifth register, wherein the fourth register and the fifth register are mirror registers, and N is a positive integer greater than 1; the device includes:

[0018] A reading unit, configured to read a fourth value if an interrupt event is detected, wherein the fourth value is a value of the fifth register;

[0019] The reading unit is further used to read target data from the shared memory according to a first value and a fourth value, wherein the first value is a value of the second register stored in the receiving core.

[0020] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps of any method in the first aspect or the second aspect of the embodiment of the present application.

[0021] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in any method of the first aspect or the second aspect of the embodiment of the present application.

[0022] In a seventh aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in any method of the first aspect or the second aspect of the embodiment of the present application. The computer program product may be a software installation package.

[0023] In an embodiment of the present application, an electronic device includes a receiving core and N sending cores, a shared memory and a register group, wherein the register group includes a first register, a second register and a third register, wherein any of the N sending cores reads a first value, which is the value of the second register; writes target data to the shared content according to the second value and the first value, wherein the second value is the value of the first register stored by the i-th sending core; reads a third value from the third register, wherein the third value is the length or quantity of the data written in the shared memory; determines whether an interrupt triggering condition is met according to the third value, and triggers an interrupt event when the interrupt triggering condition is met. The present application combines the shared memory and the register group into an inter-core communication exclusive hardware channel for message aggregation mode, so that the N generating cores can realize inter-core communication behavior with the receiving core through the exclusive hardware channel, thereby reducing hardware costs, and reducing the number of interrupt triggering times, realizing the functions of memory multiplexing and interrupt multiplexing in a many-to-one transmission situation, thereby improving the efficiency of inter-core communication. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0025] Figure 1It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0026] Figure 2 This is a schematic diagram of inter-core communication based on memory sharing provided in an embodiment of the present application;

[0027] Figure 3 This is a schematic diagram of an inter-core communication application scenario provided by an embodiment of the present application;

[0028] Figure 4 It is a structural diagram of an inter-core communication system proposed in an embodiment of the present application;

[0029] Figure 5 It is a structural diagram of a hardware channel provided in an embodiment of the present application;

[0030] Figure 6 A schematic diagram of an inter-core communication hardware structure interaction provided in an embodiment of the present application;

[0031] Figure 7 It is a flowchart of an inter-core communication method provided in an embodiment of the present application;

[0032] Figure 8 It is a schematic diagram of a message format of target data provided by an embodiment of the present application;

[0033] Fig. 9 It is a flowchart of another inter-core communication method provided in an embodiment of the present application;

[0034] Fig.10 It is a schematic diagram of an inter-core communication device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0036] In order to better understand the solutions of the embodiments of the present application, the relevant terms and concepts that may be involved in the embodiments of the present application are first introduced below.

[0037] The electronic device may be a portable electronic device that also includes other functions such as a personal digital assistant and / or a music player function, such as a mobile phone, a tablet computer, a wearable electronic device with a wireless communication function (such as a smart watch), etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with an IOS system, an Android system, a Microsoft system, or other operating systems. The above-mentioned portable electronic device may also be other portable electronic devices, such as a laptop computer (Laptop), etc. It should also be understood that in some other embodiments, the above-mentioned electronic device may not be a portable electronic device, but a desktop computer.

[0038] A multi-core processor is a processor that integrates two or more complete computing engines (cores). In this case, the processor can support multiple processors on the system bus, and the bus controller provides all bus control signals and command signals.

[0039] Registers, the function of registers is to store binary codes. They are composed of flip-flops with storage functions. A flip-flop can store 1 bit of binary code, so a register that stores n bits of binary code needs to be composed of n flip-flops. According to different functions, registers can be divided into two categories: basic registers and shift registers. Basic registers can only input data in parallel and can only output data in parallel. The data in the shift register can be shifted right or left bit by bit under the action of the shift pulse. The data can be input and output in parallel, or input and output in serial, or input and output in parallel, which is very flexible and has a wide range of uses.

[0040] For example, Figure 1 1 shows a schematic diagram of the structure of the electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, and the like.

[0041] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0042] The processor 110 may include multiple processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Among them, different processing units may be independent components or integrated in multiple processors. Among them, the controller may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions. In some other embodiments, a memory may also be provided in the processor 110 for storing instructions and data. Exemplarily, the memory in the processor 110 may be a cache memory. The memory may store instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. In this way, repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the electronic device 100 in processing data or executing instructions is improved.

[0043] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface, etc.

[0044] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0045] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .

[0046] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, the baseband processor, and the like.

[0047] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0048] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0049] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), UWB, etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and filters it, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0050] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0051] The internal memory 121 can be used to store one or more computer programs, which include instructions. The processor 110 can execute the above instructions stored in the internal memory 121, so that the electronic device 100 executes the method of displaying page elements provided in some embodiments of the present application, as well as various applications and data processing. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system; the program storage area can also store one or more applications (such as a gallery, contacts, etc.). The data storage area can store data (such as photos, contacts, etc.) created during the use of the electronic device 100. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, flash memory components, universal flash storage (UFS), etc. In some embodiments, the processor 110 can execute the method of displaying page elements provided in the embodiments of the present application, as well as other applications and data processing by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor 110.

[0052] The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.

[0053] With the development of semiconductor technology, the functions of chips in electronic devices are becoming more and more complex. A SoC chip not only contains many cores, but many of the cores are heterogeneous. These processor cores themselves are not designed to communicate with each other. There are a lot of inter-core communication phenomena in the modules of the Modem chip, such as the protocol stack, physical layer, data plane, etc. Inter-core communication is an indispensable part of the chip. Therefore, as an important data channel, the efficiency of inter-core communication becomes the main factor affecting chip performance. The inter-core communication solution requires a close integration of software and hardware. The current solution is mainly carried out in the form of shared memory, using shared memory as the medium and using inter-core interrupts to notify each other. The inter-core communication process is as follows: Figure 2 shown.

[0054] Depend on Figure 2 It can be seen that in order to realize communication between heterogeneous multi-cores, when designing the chip, the sender will write the message data into the shared memory, and then send an interrupt notification to the receiver. The receiver executes the corresponding interrupt handler to enter the address transfer and read the message, and realizes data transfer by sharing a memory area. Figure 3 In the application scenario shown, that is, the message aggregation model (N sending cores send different message contents to one receiving core), each sending core needs to establish a connection with the receiving core, apply for shared memory, and then send the data of each sending core to the receiving core according to the communication method of the one-to-one communication mechanism. This increases the transmission delay in this application scenario, resulting in the inability to meet the real-time and high-efficiency requirements of inter-core communication. In addition, when there is only one receiving core, frequent interrupt triggering will increase the load on the receiving core, and interrupts and message losses may occur due to untimely system response.

[0055] To solve the above problems, the present application proposes an inter-core communication method, in which shared memory and register groups together constitute an inter-core communication exclusive hardware channel for message aggregation mode, so that when N sending cores realize inter-core communication with receiving cores through a specific hardware channel, they only need to perform a connection establishment operation once and trigger an interrupt to complete many-to-one inter-core communication, which reduces hardware costs and significantly improves the efficiency of inter-core communication.

[0056] See also Figure 4, Figure 4 Schematic diagram of the structure of an inter-core communication system proposed in the embodiment of the present application. Figure 4 As shown, the system includes N sending cores, a receiving core and a hardware channel, and the hardware channel includes a shared memory and a register group. Each sending core is connected to the hardware channel, and the receiving core is also connected to the hardware channel, and a memory area shared by the N sending cores and the receiving core is established (shared memory in the hardware channel). When the N sending cores need to communicate with the receiving core, each sending core writes data to the shared memory according to the value of the register in the register group. When the total length or total number of data written by the N sending cores meets the preset conditions, the N sending cores trigger only one interrupt to the receiving core through the register. After the receiving core detects the interrupt event, it reads data from the shared memory and processes the data according to the value of the register in the register group.

[0057] Among them, Figure 5 As shown, Figure 5 Schematic diagram of a hardware channel structure provided by an embodiment of the present application. Figure 5 As shown, the shared memory and the register group together constitute the hardware channel in this application. The shared memory is a ring buffer used to store message content. The register group includes a control register and an interrupt register. The control register is used to manage the writing and / or reading of the shared memory by the sending core or the receiving core, and the interrupt register is used to control the triggering and clearing of interrupt events.

[0058] For example, the control registers may include a read pointer register RPR, a write pointer register WPR, and a received message length or number register RLEN / RNUM. The read pointer register RPR is a general register for storing a read pointer of a ring buffer in a hardware channel. The write pointer register WPR is a general register with exclusive access and is used to store a write pointer of each sending core. The received message length or number register RLEN / RNUM is also a general register with exclusive access and is used to store the length or number of total written messages in the ring buffer in the hardware channel.

[0059] For example, the above-mentioned interrupt register may include a write pointer receiving register WPR_R and a write pointer observation register WPR_O, wherein the write pointer receiving register WPR_R and the write pointer observation register WPR_O are double-word mirror registers used to store the write pointer of the ring buffer in the hardware channel. The write pointer receiving register WPR_R is used as the low field, and the write pointer observation register WPR_O is used as the high field. Writing a value in the low field can trigger an interrupt, while writing a value in the high field can clear the interrupt, and the content of the low field will be automatically copied to the high field. All operations on the write pointer receiving register WPR_R and the write pointer observation register WPR_O are atomic operations, so the efficient and reliable message transmission can be guaranteed.

[0060] Specifically, when the value of the write pointer register WPR is written to the value of the write pointer receiving register WPR_R, an interrupt signal is generated and sent to the receiving core. After the receiving core detects the interrupt signal, it clears the interrupt by writing to the write pointer observation register WPR_O. At the same time, the value in the write pointer receiving register WPR_R will be automatically copied to the write pointer observation register WPR_O. Therefore, the receiving core can read the value of the write pointer register WPR from the write pointer observation register WPR_O.

[0061] Furthermore, the message content in the shared memory can be managed through a read pointer and a write pointer, and the sending core and / or the receiving core can control the transmission process by reading or writing the values ​​of the read pointer register RPR and the write pointer register WPR. Each sending core can know the total length or total number of the sent messages through the length or number register RLEN / RNUM of the received messages. Therefore, when the sent message meets the condition of the total length or total number of messages, N sending cores trigger an interrupt to the receiving core. The write pointer for managing the message content in the shared memory is not maintained by the sending core, but is obtained by reading a shared write pointer register WPR, but the read pointer for managing the message content in the shared memory still needs to be maintained by the receiving core. Therefore, the sending core can determine whether the interrupt trigger condition is met by reading the length or number register RLEN / RNUM of the received message to obtain the length or number of the written message.

[0062] Specifically, Figure 6As shown, the i-th sending core among the N sending cores reads the value of the read pointer register RPR respectively. According to the value of the read pointer register RPR and the value of the write pointer register WRP maintained by it, the i-th sending core can calculate the data length or data quantity currently stored in the shared memory, and then according to the storage size of the shared memory, the current remaining storage space of the shared memory can be calculated. Then the i-th sending core determines whether the current remaining memory space can write its message content. If the current remaining storage space is sufficient to write the message content of the i-th sending core, the i-th sending core writes the message content to the storage space pointed to by the write pointer of the shared memory, and updates the write pointer according to the data length or data quantity of the message content written this time, and writes the updated write pointer to the write pointer register WPR. After that, the i-th sending core reads the value from the length or number register RLEN / RNUM of the received message, obtains the message length or message quantity written in the shared memory before writing the message memory this time, compares the value in the length or number register RLEN / RNUM of the received message and the sum of the data length or data quantity of the message content written by the i-th sending core with the preset data length or data quantity, to determine whether the interrupt trigger condition is currently met. If not, the i-th sending core writes the latest data length or data quantity into the length or quantity register RLEN / RNUM of the received message for update, and then the i+1-th sending core writes the message content according to the above method and determines whether the interrupt condition is met, until i=N or the data length or data quantity of the written message content meets the interrupt condition; if it is met, the i-th sending core initializes the length or quantity register RLEN / RNUM of the received message, and writes the value of the write pointer register WPR into the write pointer receiving register WPR_R to trigger the interrupt. Among them, when the value of the write pointer receiving register WPR_R is written into the write pointer receiving register WPR_R, an interrupt signal is generated and sent to the receiving core. Therefore, the receiving core detects that there is an interrupt event in the hardware channel, that is, after the receiving core receives the interrupt signal, it clears the interrupt by writing to the write pointer observation register WPR_O, and the value of the write pointer register WPR_R is automatically copied to the write pointer observation register WPR_O. The receiving core then determines the data length or quantity of the message content to be read based on the value of the read pointer register maintained by it and the value of the write pointer read from the write pointer observation register WPR_O, and then reads the message content in the storage space pointed to by the read pointer, and updates the read pointer register RPR based on the data length or data quantity of the message content read this time. Finally, the receiving core processes the read message content.

[0063] In the embodiment of the present application, a message aggregation transmission mechanism is implemented through a hardware channel composed of a shared memory and a register group, which reduces the hardware deployment and software operations of shared memory, registers, etc., improves transmission efficiency, and reduces hardware costs. In addition, the hardware channel can achieve a one-time connection establishment and memory application, triggering only one interrupt, which significantly improves the inter-core communication efficiency of the message aggregation mode.

[0064] See also Figure 7 , Figure 7 The present application embodiment provides a flow chart of an inter-core communication method, which is applied to Figure 2 The inter-core communication system shown in Figure 1 is shown in Figure 2. Figure 7 As shown, the inter-core communication method includes the following operations.

[0065] S710 , the i th sending core reads a first value, where the first value is the value of the second register, and i is a positive integer less than or equal to N.

[0066] In the present application, in the application scenario of the message aggregation mode, when N sending cores need to communicate with the receiving core, the N sending cores respectively establish a connection with the hardware channel, the receiving core establishes a connection with the hardware channel, and applies for the shared memory of the N sending cores and the receiving core. Then, the inter-core communication in the application scenario of the message aggregation mode is realized according to the inter-core communication method proposed in the present application.

[0067] Among them, the second register can be the above-mentioned read pointer register RPR. In order to obtain whether there is storage space in the current shared memory to store the data sent by the i-th sending core, the i-th sending core can read the write pointer that manages the message content in the shared memory through the value of the write pointer register WPR, and read the read pointer that manages the message content in the shared memory by reading the value of the pointer register RPR. In other words, the first value is the memory address pointed to by the read pointer of the message content in the shared memory. Therefore, by reading the first value, the i-th sending core can calculate the current remaining memory space in the shared memory.

[0068] S720: The i-th sending core writes target data into the shared content according to a second value and the first value, where the second value is the value of the first register stored in the i-th sending core.

[0069] In an embodiment of the present application, the first register may be the above-mentioned write pointer register WPR, and the second value may be the memory address pointed to by the write pointer of the message content in the shared memory. The i-th sending core may check the remaining space of the shared memory by managing the difference between the read pointer and the write pointer of the message content in the shared memory to determine whether there is storage space in the shared memory to store the data sent by the i-th sending core. When the shared memory has space to store the data sent by the i-th sending core, the i-th sending core may write the target data it needs to send into the remaining space of the shared memory.

[0070] For example, if the remaining storage space of the shared memory is insufficient to store the data sent by the i-th sending core, the i-th sending core can generate and display a notification message to inform the user that the currently allocated shared content is insufficient to store the data to be sent, and whether to abandon the data transmission or reallocate the memory; or the i-th sending core re-applies for a piece of shared memory shared by the N sending cores and the receiving core or expands the storage space of the current shared memory to store the data.

[0071] Optionally, the i-th sending core writes target data to the shared content based on the second value and the first value, including: the i-th sending core calculates a first difference, the first difference is the difference between the storage size of the shared memory and the second difference, and the second difference is the difference between the second value and the first value; if the first difference is less than the data length of the target data, the i-th sending core repeatedly reads the first value; if the first difference is greater than or equal to the data length of the target data, the i-th sending core writes the target data to the storage space corresponding to the second value in the shared memory.

[0072] The i-th sending core may first calculate the second difference between the second value and the first value. Since the shared memory is a circular buffer, if the second difference is equal to 1, it means that the storage space of the shared memory is full of data and there is no remaining space, and the data of the i-th sending core cannot be stored for inter-core communication. When the second difference is greater than 1, it indicates that data has been stored in the shared content. The i-th sending core may further calculate the remaining space of the shared memory to determine whether it can store the data to be sent by the i-th sending core.

[0073] Specifically, when the second difference is greater than 1, the i-th sending core further calculates the first difference between the storage size of the shared memory and the second difference, and the first difference is the remaining storage space of the shared memory. If the remaining storage space of the shared memory is less than the storage space occupied by the target data sent by the i-th sending core, it indicates that the remaining storage space of the shared memory is insufficient to store the storage space occupied by the target data, and the i-th sending core can repeatedly read the first value for calculation until the remaining storage space of the shared memory is greater than or equal to the storage space occupied by the target data.

[0074] Furthermore, if the first difference is greater than or equal to the data length of the target data, that is, when the remaining storage space of the shared memory is greater than or equal to the storage space occupied by the target data, the i-th sending core can write the target data it needs to send into the storage space pointed to by the write pointer.

[0075] Optionally, the method also includes: after writing the target data into the storage space corresponding to the second value in the shared memory, the i-th sending core writes a fourth value into the first register, and the fourth value is the sum of the second value and the data length of the target data.

[0076] Among them, after the i-th sending core writes the target data into the shared memory, the remaining storage space of the shared memory will change. In order to enable the i+1-th sending core to write the data to be sent into the shared memory, the i-th sending core also needs to update the value of the write pointer register WPR.

[0077] Specifically, the i-th sending core updates the write pointer according to the storage space occupied by the target data written into the shared memory this time. The i-th sending core writes the sum of the second value and the data length of the target data into the write pointer register WPR, so that the write pointer for managing the message content of the shared memory points to the next storage space after the target data written by the i-th sending core.

[0078] In an embodiment of the present application, a write pointer is jointly maintained by N sending cores, so that each sending core can write the data to be sent into the shared memory according to the current write pointer, so that each sending core can obtain the total length or total number of the communication data this time, and trigger an interrupt when the total length or total number of the communication data this time meets the triggering condition, thereby achieving many-to-one inter-core communication by triggering an interrupt once, and solving the problem of frequent interrupt triggering of the receiving core in the message aggregation mode.

[0079] S730. The i-th sending core reads a third value from the third register, where the third value is the length or quantity of data written into the shared memory.

[0080] The third register is the length or quantity register RLEN / RNUM of the received message, which stores the data length or data quantity of the target data sent by the first i-1 sending cores.

[0081] S740: The i-th sending core determines whether an interrupt triggering condition is met according to the third value, and triggers an interrupt event when the third value meets the interrupt triggering condition.

[0082] In an embodiment of the present application, the data length or data quantity of the data sent in the next communication in the message aggregation model can be pre-set, and the pre-set data length or data quantity can be used as a trigger condition so that the trigger is triggered when the data currently written to the shared memory meets the trigger condition.

[0083] The register group further includes a fourth register and a fifth register, the fourth register is the write pointer receiving register WPR_R mentioned above, and the fifth register is the read write pointer observation register WPR_O mentioned above. The fourth register and the fifth register are mirror registers to each other, that is, the write operation on the fifth register will copy the value of the fourth register to the fifth register, and after the receiving core responds to the interrupt event, the values ​​of the fourth register and the fifth register remain the same.

[0084] In an embodiment of the present application, some general registers are assigned different storage contents, and together with mirror registers and shared memory, they form an inter-core communication-exclusive hardware channel for message aggregation mode to control inter-core communication behavior, thereby reducing the number of interrupt triggering times, realizing memory multiplexing and interrupt multiplexing functions in many-to-one transmission situations, and improving inter-core communication efficiency.

[0085] Optionally, judging whether an interrupt trigger condition is met according to the third value, and triggering an interrupt event when the third value meets the interrupt trigger condition, includes: the i-th sending core judging whether a fifth value is greater than or equal to a preset value, the fifth value being the sum of the third value and the data length or data quantity of the target data; if the fifth value is greater than or equal to the preset value, the i-th sending core writes the fourth value into the fourth register to trigger an interrupt event, and initializes the third value.

[0086] Specifically, the i-th sending core calculates the sum of the data length or data quantity of the target data and the value of the length or number register RLEN / RNUM of the received message. If the sum is greater than the preset value, it means that the data length or data quantity of the data currently written in the shared memory has reached the preset data length or data quantity, and the interrupt triggering condition is met. The i-th sending core can initialize the length or number register RLEN / RNUM of the received message for the next data communication; and write the value of the write pointer register WPR into the write pointer receiving register WPR_R, triggering an interrupt event.

[0087] Among them, when the write pointer receiving register WPR_R writes the value of the pointer register WPR, an interrupt signal is generated and sent to the receiving core. The receiving core responds to the interrupt and writes the write pointer observation register WPR_O to clear the interrupt. At the same time, the value in the write pointer receiving register WPR_R will be automatically copied to the write pointer observation register WPR_O.

[0088] Optionally, the method further includes: if the fifth value is less than the preset value, the i-th sending core writes the fifth value into the third register.

[0089] Furthermore, when the sum of the data length or data quantity of the target data and the value of the length or data quantity register RLEN / RNUM of the received message is less than a preset value, it indicates that the data length or data quantity of the data currently written in the shared memory has not reached the preset data length or data quantity, and the i-th sending core may write the sum of the read value of the length or data quantity register RLEN / RNUM of the received message and the data length or data quantity of the target data into the length or data quantity register RLEN / RNUM of the received message for updating. Then the i+1-th sending core writes the target data to be sent into the shared memory according to the above method until the sum of the read value of the length or data quantity register RLEN / RNUM of the received message and the data length or data quantity of the target data is greater than or equal to the preset value.

[0090] S750: If an interrupt event is detected, the receiving core reads the fourth value, where the fourth value is the value of the fifth register;

[0091] The receiving core can detect in real time whether there is an interrupt event in the hardware channel, and when the receiving core detects the interrupt event, it enters the interrupt service. Specifically, the receiving core maintains a read pointer for managing the message content of the shared memory, and accesses the write pointer observation register WPR_O, thereby obtaining the first value and the fourth value to calculate the available data that the receiving core needs to read in the shared memory.

[0092] Optionally, before reading the fourth value, the method further includes: the receiving core initializing the fifth register.

[0093] In an embodiment of the present application, when the receiving core receives an interrupt signal, it can access the write pointer observation register WPR_O, read the value of the write pointer register WPR from the write pointer observation register WPR_O and clear the interrupt. Specifically, the receiving core initializes the write pointer observation register WPR_O after reading the value of the write pointer observation register WPR_O. Since the fourth register and the fifth register are mirror registers of each other, when the receiving core initializes the write pointer observation register WPR_O, the write pointer receiving register WPR_R will also be initialized.

[0094] S760. The receiving core reads the target data from the shared memory according to the first value and the fourth value, where the first value is the value of the second register stored in the receiving core.

[0095] In an embodiment of the present application, the receiving core can determine the size of the data to be read based on the difference between the read pointer and the write pointer of the message content of the management shared memory. The above first value is the value of the read pointer register RPR storing the read pointer, which represents the first address of the data stored in the shared memory. The above fourth value is the value of the write pointer register WPR storing the write pointer stored in the write pointer observation register WPR_O, which represents the first address of the memory space in the shared memory where data can be written.

[0096] Optionally, the receiving core reads the target data from the shared memory according to the first value and the fourth value, including: the receiving core calculates a third difference, where the third difference is the difference between the fourth value and the first value, and determines the data length of the target data according to the third difference; the receiving core reads the target data with the third difference data length from the storage space corresponding to the first value in the shared memory.

[0097] Specifically, the receiving core calculates the difference between the value of the write pointer register WPR and the value of the read pointer register RPR to obtain the data size of this inter-core communication, and then the receiving core reads data of the third difference data length from the memory address pointed to by the value of the read pointer register RPR in the shared memory.

[0098] Optionally, the method further includes: the receiving core writing a sixth value into the second register, the sixth value being the sum of the first value and the third difference value.

[0099] Furthermore, after the receiving core reads the target data from the shared memory, the remaining storage space of the shared memory will change. For the next normal inter-core communication, the receiving core also needs to update the value of the read pointer register RPR.

[0100] Specifically, the receiving core updates the storage space pointed to by the read pointer according to the storage space occupied by the target data read from the shared memory this time. The receiving core writes the sum of the first value and the data length of the target data into the read pointer register RPR, so that the read pointer for managing the message content of the shared memory points to the next storage space after the target data.

[0101] Optionally, the target data includes a service ID and message content, and the service ID is used to identify the software service program ID of the receiving core.

[0102] When sending data, the sending core may carry the software service program ID of the receiving core in the target data to indicate which receiving core receives the target data for processing.

[0103] For example, Figure 8 As shown, Figure 8 Schematic diagram of a message format of target data provided by an embodiment of the present application. Figure 8 As shown, the target data includes service ID (Service id), message content (User payload), message length (MU Nums) and message ID (Message id). The Service id is used to indicate the ID of the receiving core software service program; the User payload is used to indicate the message content of the inter-core communication; the MU Nums is used to indicate the length of the message; and the Message id is used to indicate the message type of the message content.

[0104] In the embodiment of the present application, N sending cores can simultaneously write the target data into the shared memory until the length or amount of data written into the shared memory is greater than a preset value. For example, N sending cores write the target data into the shared memory respectively. If the length or amount of data in the shared memory is greater than a preset value after the Nth sending core writes the target data into the shared content, the Nth sending core triggers an interrupt event to realize inter-core communication in the application scenario of the message aggregation mode. Specifically, Fig. 9As shown, the sending core 1 reads the values ​​of the read pointer register RPR and the write pointer register WRP respectively, and the sending core 1 checks the remaining storage space in the shared memory according to the value of the read pointer register RPR. When the remaining storage space is sufficient to write the target data of the sending core 1, the sending core 1 writes the target data to the shared memory, and updates the value of the write pointer register WRP according to the data length or data quantity of the target data written this time. After that, the sending core 1 reads the value of the length or number register RLEN / RNUM of the received message, and determines whether the interrupt trigger condition is currently met according to its value. If not met, the sending core 1 writes the latest data length or data quantity into the length or number register RLEN / RNUM of the received message for update. Then, the sending core 1 writes the target data according to the above method and determines whether the interrupt condition is met, until i=N or the data length or data quantity of the written target data meets the interrupt condition. If the value of the length or number register RLEN / RNUM of the received message read by the sending core N meets the interrupt trigger condition, the sending core N initializes the length or number register RLEN / RNUM of the received message, and writes the value of the write pointer register WPR into the write pointer receiving register WPR_R. The write pointer receiving register WPR_R generates an interrupt signal and sends it to the receiving core. After receiving the interrupt signal, the receiving core writes to the write pointer observation register WPR_O to clear the interrupt. This operation automatically copies the value of the write pointer receiving register WPR_R to the write pointer observation register WPR_O. Then the receiving core reads the target data from the shared memory according to the value of the read pointer register it maintains and the value of the write pointer read from the write pointer observation register WPR_O, and updates the read pointer register RPR according to the target data read this time.

[0105] It can be seen that the inter-core communication method proposed in the embodiment of the present application, the electronic device includes a receiving core and N sending cores, a shared memory and a register group, the register group includes a first register, a second register and a third register, any sending core among the N sending cores reads a first value, the first value is the value of the second register; writes target data into the shared content according to the second value and the first value, the second value is the value of the first register stored by the i-th sending core; reads the third value from the third register, and triggers an interrupt event when the third value meets the interrupt triggering condition. The present application combines the shared memory and the register group into an inter-core communication exclusive hardware channel for the message aggregation mode, so that the N generating cores can realize the inter-core communication behavior with the receiving core through the exclusive hardware channel, reduce the hardware cost, and reduce the number of interrupt triggering times, realize the functions of memory multiplexing and interrupt multiplexing in the case of many-to-one transmission, and thus improve the efficiency of inter-core communication.

[0106] It is understandable that, in order to realize the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.

[0107] In this embodiment, the electronic device can be divided into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0108] In the case of dividing each functional module into corresponding functional modules, Fig.10 A schematic diagram of an inter-core communication device is shown, such as Fig.10 As shown, the inter-core communication device 1000 is applied to an electronic device, and the inter-core communication device 1000 may include: a reading unit 1100 , a writing unit 1200 and a triggering unit 1300 .

[0109] The reading unit 1100 may be used to support the electronic device in executing the above-mentioned S710, S730, S750, S760, etc., and / or other processes for the technology described herein.

[0110] The writing unit 1200 may be used to support the electronic device to execute the above-mentioned S720 and the like, and / or other processes for the technology described herein.

[0111] The trigger unit 1300 may be used to support the electronic device to execute the above-mentioned S740, etc., and / or other processes for the technology described herein.

[0112] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0113] The electronic device provided in this embodiment is used to execute the above-mentioned inter-core communication method, and thus can achieve the same effect as the above-mentioned implementation method.

[0114] In the case of using an integrated unit, the electronic device may include a processing module, a storage module and a communication module. Among them, the processing module can be used to control and manage the actions of the electronic device, for example, it can be used to support the electronic device to execute the steps performed by the above-mentioned reading unit 1100, writing unit 1200 and triggering unit 1300. The storage module can be used to support the electronic device to execute stored program codes and data, etc. The communication module can be used to support the communication between the electronic device and other devices.

[0115] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.

[0116] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a Figure 1 Device of the structure shown.

[0117] This embodiment also provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the inter-core communication method in the above-mentioned embodiment.

[0118] This embodiment also provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute the above-mentioned related steps to implement the inter-core communication method in the above-mentioned embodiment.

[0119] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer execution instructions, and when the device is running, the processor may execute the computer execution instructions stored in the memory so that the chip executes the inter-core communication method in the above-mentioned method embodiments.

[0120] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above and will not be repeated here.

[0121] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0122] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0123] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0124] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0125] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0126] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for inter-core communication, It is characterized in that Applied to an electronic device, the electronic device comprises a receiving core and N sending cores, a shared memory and a register group; the register group comprises a first register, a second register and a third register, and N is a positive integer greater than 1; the method comprises: The i-th sending core reads a first value, where the first value is the value of the second register, and i is a positive integer less than or equal to N; The i-th sending core writes target data into the shared memory according to a second value and the first value, where the second value is the value of the first register stored by the i-th sending core; The i-th sending core reads a third value from the third register, where the third value is the length or quantity of the data written into the shared memory; The i-th sending core determines whether an interrupt triggering condition is met according to the third value, and triggers an interrupt event when the third value meets the interrupt triggering condition; Among them, the register group also includes a fourth register and a fifth register, the fourth register and the fifth register are mirror registers of each other, when the fourth register writes the value of the first register, the i-th sending core triggers the interrupt event so that the receiving core responds to the interrupt event and writes to the fifth register to clear the interrupt, and at the same time, the value in the fourth register is automatically copied to the fifth register, so that the receiving core reads the fourth value in the fifth register, and reads the target data from the shared memory according to the first value and the fourth value.

2. The method according to claim 1, It is characterized in that The i-th sending core writes target data to the shared memory according to the second value and the first value, comprising: The i-th sending core calculates a first difference value, where the first difference value is a difference between a storage size of the shared memory and a second difference value, and the second difference value is a difference between the second value and the first value; If the first difference is less than the data length of the target data, the i-th sending core repeatedly reads the first value; If the first difference is greater than or equal to the data length of the target data, the i-th sending core writes the target data into a storage space corresponding to the second value in the shared memory.

3. The method according to claim 2, It is characterized in that The method further comprises: After writing the target data into the storage space corresponding to the second value in the shared memory, the i-th sending core writes a fourth value into the first register, where the fourth value is the sum of the second value and the data length of the target data.

4. The method according to claim 3, It is characterized in that The register set also includes a fourth register; The step of judging whether an interrupt triggering condition is satisfied according to the third value, and triggering an interrupt event when the third value satisfies the interrupt triggering condition, includes: The i-th sending core determines whether a fifth value is greater than or equal to a preset value, the fifth value being the sum of the third value and the data length or data quantity of the target data; If the fifth value is greater than or equal to the preset value, the i-th sending core writes the fourth value into the fourth register to trigger an interrupt event, and initializes the third value.

5. The method according to claim 4, It is characterized in that The method further comprises: If the fifth value is less than the preset value, the i-th sending core writes the fifth value into the third register.

6. The method according to any one of claims 1 to 5, It is characterized in that The target data includes a service ID and message content, wherein the service ID is used to identify the software service program ID of the receiving core.

7. A method for inter-core communication, It is characterized in that An electronic device applied to the method according to any one of claims 1 to 6, the electronic device comprising a receiving core and N sending cores, a shared memory and a register group; the register group comprises a second register, a fourth register and a fifth register, the fourth register and the fifth register are mirror registers, and N is a positive integer greater than 1; the method comprises: If an interrupt event is detected, the receiving core initializes the fifth register to clear the interrupt, and reads a fourth value, the fourth value being the value of the fifth register, and the interrupt event is triggered when the value of the first register is written into the fourth register; The receiving core reads target data from the shared memory according to a first value and the fourth value, wherein the first value is a value of the second register stored by the receiving core.

8. The method according to claim 7, It is characterized in that The receiving core reads target data from the shared memory according to the first value and the fourth value, including: The receiving core calculates a third difference value, where the third difference value is a difference between the fourth value and the first value, and determines a data length of the target data according to the third difference value; The receiving core reads the target data of the third difference data length from the storage space corresponding to the first value in the shared memory.

9. The method according to claim 8, It is characterized in that The method further comprises: The receiving core writes a sixth value into the second register, where the sixth value is the sum of the first value and the third difference value.

10. The method according to any one of claims 7 to 9, It is characterized in that The target data service ID and message content, the service ID is used to identify the software service program ID of the receiving core.

11. An inter-core communication device, It is characterized in that Applied to an electronic device, the electronic device comprises a receiving core and N sending cores sharing a memory and a register group; the register group comprises a first register, a second register and a third register, wherein N is a positive integer greater than 1; the device comprises: A reading unit, configured for the i-th sending core to read a first value, where the first value is a value of the second register, and i is a positive integer less than or equal to N; a writing unit, configured for the i-th sending core to write target data into the shared memory according to a second value and the first value, wherein the second value is a value of the first register stored in the i-th sending core; The reading unit is further used for the i-th sending core to read a third value from the third register, where the third value is the length or quantity of the data written into the shared memory; A trigger unit, used for the i-th sending core to judge whether an interrupt trigger condition is met according to the third value, and trigger an interrupt event when the third value meets the interrupt trigger condition; wherein the register group also includes a fourth register and a fifth register, the fourth register and the fifth register are mirror registers of each other, when the fourth register writes the value of the first register, the i-th sending core triggers the interrupt event so that the receiving core responds to the interrupt event and writes to the fifth register to clear the interrupt, and at the same time, the value in the fourth register is automatically copied to the fifth register, so that the receiving core reads the fourth value in the fifth register, and reads the target data from the shared memory according to the first value and the fourth value.

12. An inter-core communication device, It is characterized in that The electronic device applied to the apparatus according to claim 11 comprises a receiving core and N sending cores sharing a memory and a register group; the register group comprises a second register, a fourth register and a fifth register, the fourth register and the fifth register are mirror registers, and N is a positive integer greater than 1; the apparatus comprises: a reading unit, configured to initialize the fifth register to clear the interrupt if an interrupt event is detected, and read a fourth value, wherein the fourth value is the value of the fifth register, and the interrupt event is triggered when the value of the first register is written into the fourth register; The reading unit is further used to read target data from the shared memory according to a first value and a fourth value, wherein the first value is a value of the second register stored in the receiving core.

13. An electronic device, It is characterized in that The method comprises a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for executing the steps in the method according to any one of claims 1 to 6 or claims 7 to 10.

14. A computer-readable storage medium, It is characterized in that A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 6 or claims 7 to 10.