WO2022037176A1 - 核间通信方法、装置、电子组件以及电子设备 - Google Patents

核间通信方法、装置、电子组件以及电子设备 Download PDF

Info

Publication number
WO2022037176A1
WO2022037176A1 PCT/CN2021/097310 CN2021097310W WO2022037176A1 WO 2022037176 A1 WO2022037176 A1 WO 2022037176A1 CN 2021097310 W CN2021097310 W CN 2021097310W WO 2022037176 A1 WO2022037176 A1 WO 2022037176A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
core
communication channel
transmitted
communication
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2021/097310
Other languages
English (en)
French (fr)
Inventor
李丁义
周利宾
王梁
高金泽
黄健辉
李启明
苏伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to EP21857277.4A priority Critical patent/EP4203548A4/en
Publication of WO2022037176A1 publication Critical patent/WO2022037176A1/zh
Priority to US18/148,417 priority patent/US12399859B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/17Interprocessor communication using an input/output type connection, e.g. channel, I/O port
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/545Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4265Bus transfer protocol, e.g. handshake; Synchronisation on a point to point bus
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/167Interprocessor communication using a common memory, e.g. mailbox
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/173Interprocessor communication using an interconnection network, e.g. matrix, shuffle, pyramid, star, snowflake
    • G06F15/17337Direct connection machines, e.g. completely connected computers, point to point communication networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control

Definitions

  • the present application relates to the field of electronic technology, and more particularly, to an inter-core communication method, apparatus, electronic component, electronic device, and storage medium.
  • a dual-core solution is used to improve performance and user experience.
  • dual cores of electronic devices communicate with each other to implement some business functions.
  • the present application proposes an inter-core communication method, apparatus, electronic component, electronic device, and storage medium to improve the above problems.
  • the present application provides an inter-core communication method, which is applied to an electronic device, the electronic device includes at least a first core and a second core, and there are multiple channels between the first core and the second core. communication channels, and the communication performances of the plurality of communication channels are different, the method includes: acquiring data to be transmitted, the data to be transmitted is data transmitted between the first core and the second core;
  • the communication channel corresponding to the data to be transmitted is obtained from the plurality of communication channels as a target communication channel; the data to be transmitted is transmitted through the target communication channel.
  • the present application provides an inter-core communication device, which runs on an electronic device, the electronic device includes at least a first core and a second core, and there are multiple communication channels between the first core and the second core communication channels, and the communication performances of the plurality of communication channels are different, the device includes: a data acquisition unit, configured to acquire data to be transmitted, the data to be transmitted is in the first core and the second core. The data transmitted between them; the channel selection unit is used to obtain the communication channel corresponding to the data to be transmitted from the plurality of communication channels, as the target communication channel; the data communication unit is used to transmit all the data through the target communication channel. data to be transmitted.
  • the present application provides an electronic assembly, including a first core and a second core, a plurality of communication channels between the first core and the second core, and each of the plurality of communication channels The communication performance is different; the first core is used to obtain the data to be transmitted; the communication channel corresponding to the data to be transmitted is obtained from the multiple communication channels as a target communication channel; the target communication channel is used to transmit the to-be-transmitted data. Transfer data to the second core.
  • the present application provides an electronic device including a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the above method.
  • the present application provides a computer-readable storage medium, where a program code is stored in the computer-readable storage medium, wherein the above-mentioned method is executed when the program code is executed by a processor.
  • FIG. 1 shows a schematic diagram of a multi-core architecture in an electronic device proposed by an embodiment of the present application
  • FIG. 2 shows a flowchart of a first core actively transmitting data to a second core according to an embodiment of the present application
  • FIG. 3 shows a flowchart of a first core actively reading data from a second core according to an embodiment of the present application
  • FIG. 4 shows a schematic diagram of a communication architecture in an electronic device proposed by an embodiment of the present application
  • FIG. 5 shows a flowchart of an inter-core communication method proposed by an embodiment of the present application
  • FIG. 6 shows a flowchart of an inter-core communication method proposed by another embodiment of the present application.
  • FIG. 7 shows a schematic diagram of a sending buffer in an embodiment of the present application.
  • FIG. 8 shows a schematic diagram of splitting data to be transmitted in an embodiment of the present application
  • FIG. 9 shows a schematic diagram of the most forward transmission position in the embodiment of the present application.
  • FIG. 10 shows a flowchart of an inter-core communication method proposed by still another embodiment of the present application.
  • FIG. 11 shows a schematic diagram of a data transmission path in the embodiment of FIG. 10 of the present application.
  • FIG. 12 shows a structural block diagram of an inter-core communication apparatus proposed by an embodiment of the present application.
  • FIG. 13 shows a structural block diagram of an electronic device of the present application for executing the method for inter-core communication according to an embodiment of the present application
  • FIG. 14 is a storage unit for storing or carrying a program code for implementing the inter-core communication method according to the embodiment of the present application according to the embodiment of the present application.
  • the electronic equipment can be equipped with more devices for data processing.
  • data processing can be performed by configuring a multi-core processor in an electronic device.
  • Multi-core processor refers to the integration of two or more complete computing engines (cores) in one processor.
  • the processor can support multiple processors on the system bus, and the bus controller provides all bus control signals and command signal.
  • data processing can also be performed by configuring a variety of processors in the electronic device.
  • data processing can be performed by configuring a CPU and an MCU (Microcontroller Unit).
  • the data to be processed can be understood as being actually processed by the cores in the CPU and the cores in the MCU, and the corresponding CPU and the MCU communicate with each other.
  • it also corresponds to the communication between the cores in the CPU and the cores in the MCU, wherein the cores in the CPU and the cores in the MCU can be understood as modules responsible for data processing.
  • the inventor proposes an inter-core communication method, device, electronic component, electronic device and storage medium that can improve the above-mentioned problems in the present application. Therefore, when the electronic device includes at least a first core and a second core, there are multiple communication channels between the first core and the second core, and the respective communication performances of the multiple communication channels are different, the After acquiring the to-be-transmitted data transmitted between the first core and the second core, a communication channel corresponding to the to-be-transmitted data can be selected from multiple communication channels as a target communication channel, and then communicate through the target The channel transmits the data to be transmitted. Therefore, by the above method, when data needs to be transmitted between the first core and the second core, the data to be transmitted can be transmitted through a communication channel adapted to the required transmission data, thereby improving the flexibility of the communication method between the dual cores. sex.
  • a first core 10 and a second core 20 are exemplarily shown.
  • the communication channel 30 includes a data line 31 for data transmission, and a time sequence line 32 for timing control. Under the control of the time sequence line 32, both the first core 10 and the second core 20 can actively transmit data based on the data line 31. transmission.
  • the data line 31 is a data line based on a serial peripheral interface SPI (Serial Peripheral Interface) communication protocol.
  • SPI Serial Peripheral Interface
  • the sequence of data transmission based on the communication channel 30 will be introduced below through the content shown in FIG. 2 and FIG. 3 .
  • the sequence of the first core 10 actively transmitting data to the second core 20 includes:
  • the timing of actively transmitting data from the second core 20 to the first core 10 includes:
  • S111 lock the SPI bus
  • timing line 32 may include the first signal line, the second signal line, the third signal line and the fourth signal line.
  • the first level signal may be a rising edge signal
  • the second level signal may be a falling edge signal
  • the third level signal may be a high level signal.
  • the communication channel 40 includes a data line 41 for data transmission and a flow control line 42 for flow control.
  • the flow control line 42 can be used to control the start and stop of data transmission in the data line 41 .
  • the data line 41 may be a data line based on an asynchronous serial communication protocol (Universal Asynchronous Receiver/Transmitter).
  • the communication performance of the communication channel 40 is high in real-time and stable in transmission.
  • the communication channel 50 includes a data line 51 for the first core 10 to request the second core 20 for the working status and register status of the second core 20 , and a data line 52 for the second core 20 to output log data to the first core 10 .
  • the data line 51 may be a data line based on the SWD (Serial wire debug) communication protocol.
  • the data line 51 may include a SWDIO data line and a SWCLK clock line.
  • the structure shown in FIG. 1 is only exemplary, and the electronic device may include a larger number of cores in addition to the first core 10 and the second core 20 in FIG. 1 , and more The communication channel between the core and other cores can also be in the way shown in FIG. 1 .
  • the communication channel between the first core 10 and the second core 20 may also include some communication channels among the aforementioned three communication channels. For example, only communication channel 30 and communication channel 40 may be included, in which case data originally transmitted by communication channel 50 may be transmitted by communication channel 30 and/or communication channel 40 . For another example, only the communication channel 30 and the communication channel 50 may be included, in which case the data originally transmitted by the communication channel 40 may be transmitted by the communication channel 30 and/or the communication channel 50 .
  • first core 10 and the second core 20 may belong to the same processor, or may belong to different processors respectively.
  • first core 10 may be a core (eg, CPU) that carries an operating system (eg, Android)
  • the second core 20 may be a core (eg, MCU) that carries sensor data.
  • the first corresponding service will generate the data to be transmitted as the data to be transmitted, and the data to be transmitted will be transmitted from the subsequent SPI communication protocol,
  • One of the UART communication protocol and the SWD communication protocol is selected as the protocol for transmitting the data to be transmitted.
  • a protocol can also be determined as the protocol for transmitting the data to be transmitted through the foregoing method.
  • selecting a protocol here can be understood as selecting a target communication channel for the data to be transmitted.
  • the SPI communication protocol involved in FIG. 4 can be understood as the SPI communication protocol in which the timing line 32 in FIG. 1 is added to the corresponding control line.
  • an inter-core communication method provided by an embodiment of the present application is applied to an electronic device.
  • the electronic device includes at least a first core and a second core, and the first core and the second core are connected between the first core and the second core.
  • S210 Acquire data to be transmitted, where the data to be transmitted is data transmitted between the first core and the second core.
  • the data to be transmitted in this embodiment is the data to be transmitted between the first core and the second core.
  • the data to be transmitted is the data transmitted by the first core to the second core.
  • the data to be transmitted is the data transmitted by the second core to the first core.
  • the data to be transmitted may be data generated by the service layer.
  • the data to be transmitted may be the firmware required to be transmitted.
  • the data to be transmitted may also be a control command or status reply data, or the like.
  • S220 Acquire a communication channel corresponding to the data to be transmitted from the plurality of communication channels as a target communication channel.
  • the communication performance of different communication channels may be different.
  • At least one communication channel is selected from the plurality of communication channels as the communication channel corresponding to the data to be transmitted.
  • the communication performance in the embodiments of the present application may be understood as the ability to transmit data, for example, transmission rate, real-time performance, and stability.
  • An inter-core communication method provided by the present application includes at least a first core and a second core in an electronic device, there are multiple communication channels between the first core and the second core, and the multiple communication channels
  • the communication channel corresponding to the data to be transmitted can be selected from the plurality of communication channels as the data to be transmitted.
  • a target communication channel, and then the data to be transmitted is transmitted through the target communication channel. Therefore, by the above method, when data needs to be transmitted between the first core and the second core, the data to be transmitted can be transmitted through a communication channel adapted to the required transmission data, thereby improving the flexibility of the communication method between the dual cores. sex.
  • an inter-core communication method provided by an embodiment of the present application is applied to an electronic device, where the electronic device includes at least a first core and a second core, and the communication between the first core and the second core is between the first core and the second core.
  • the method includes:
  • S310 Acquire data to be transmitted, where the data to be transmitted is data transmitted between the first core and the second core.
  • the target communication channel of the data to be transmitted may be determined according to the current data transmission model.
  • the current data transfer mode may be determined according to the throughput between the first core and the second core.
  • the throughput between the first core and the second core may change in real time according to the actual situation. For example, in the process of running more programs on the electronic device, there may be more data that needs to be interacted between the first core and the second core, which will make the throughput between the first core and the second core relatively larger.
  • the electronic device when the electronic device is in a dormant state, the electronic device does not need to perform more data processing, and thus the data to be transmitted between the first core and the second core is relatively less.
  • the throughput between the first core and the second core is not greater than the specified transmission threshold, it can be determined that the current first data transmission mode in which the data to be transmitted is relatively small can be detected.
  • the throughput between the first core and the second core is greater than the specified transmission threshold, it is determined that the current is the second data transmission mode in which the data to be transmitted is relatively large.
  • the throughput can be characterized by obtaining the usage rate of the specified send buffer.
  • the data to be transmitted whose target communication channel has been determined can be stored in the sending buffer first, and then the data to be sent is taken out of the sending buffer and sent through the corresponding target communication channel.
  • it includes a sending buffer 60 and a communication channel 30. After determining that the target communication channel corresponding to the data A to be sent is the communication channel 30, the data A to be sent can be stored in the sending buffer 60. , and the communication channel 30 can directly read data from the sending buffer 60 for sending.
  • the data in the send buffer also needs to be sent in sequence, and the larger the data to be sent in the send buffer, the higher the usage rate of the send buffer. For example, if the usage rate of the send buffer is 50%, it means that half of the send buffer area is occupied by the data to be sent.
  • the specified transmission threshold may be the usage threshold.
  • the usage rate threshold is 50%, and then when the usage rate of the specified sending buffer is lower than 50%, it can be determined that the current is the first data transmission mode mentioned above, and the usage rate of the specified sending buffer can be not low. At 50%, it is determined that the current is the aforementioned second data transmission mode.
  • the throughput between the first core and the second core may fluctuate.
  • it can be further detected that the current is the first data transmission when the throughput between the first core and the second core is not greater than the specified transmission threshold within the specified time period.
  • the specified time period can be 1000ms.
  • the current is the aforementioned In the first data transmission mode, if it is detected within 1000ms that the usage rate of the designated sending buffer is not lower than 50%, it is determined that the current is the aforementioned second data transmission mode.
  • the specified send buffer may be a send buffer corresponding to a certain communication channel.
  • it may be the send buffer corresponding to the first communication channel.
  • the sending buffer corresponding to the communication channel can be understood as the data buffered in the sending buffer are all transmitted through the corresponding communication channel.
  • the data transmission mode can also be determined according to the current operating scenario. It should be noted that the electronic device may need to collect more data in the process of running some programs, thereby causing more frequent data transmission between different cores.
  • the wearable device when the wearable device is in the user's motion data monitoring scenario, it needs to acquire the data collected by the sensor for motion monitoring at a higher frequency to perform some state identification.
  • the data collection of the sensor can be controlled by the second core, and the state recognition is performed by the first core, then the second core will transmit the sensor's collected data to the first core at a higher frequency. in one core for faster state recognition by the first core.
  • the first core after the first core completes the state identification, it will continue to send some control commands to the second core, which will also cause the first core to have more data to be transmitted to the second core.
  • the electronic device can identify the current scene, and use the data transmission mode corresponding to the current scene as the current data transmission mode according to the pre-established corresponding relationship between the scene and the data transmission mode.
  • the scene in which the electronic device is located may include a motion detection scene and a sleep scene, wherein the motion detection scene corresponds to the aforementioned second data transmission mode, and the sleep scene corresponds to the aforementioned first data transmission mode.
  • S330 Determine a communication channel corresponding to the data to be transmitted from the plurality of communication channels based on the data transmission mode, as a target communication channel.
  • the plurality of communication channels include a first communication channel and a second communication channel.
  • the data transmission rate of the first communication channel is higher than the data transmission rate of the second communication channel
  • the real-time transmission of the second communication channel is higher than the real-time transmission of the first communication channel
  • the first communication The power consumption of the channel is lower than the power consumption of the second communication channel.
  • determining the communication channel corresponding to the data to be transmitted from the plurality of communication channels based on the data transmission mode, as the target communication channel includes: if the current data transmission mode is the first data transmission mode, setting the The first communication channel in the plurality of communication channels is used as the target communication channel; if the current mode is the second data transmission mode, obtain the data type of the data to be transmitted; determine the data type from the plurality of communication channels based on the data type The communication channel corresponding to the data to be transmitted is used as the target communication channel.
  • the throughput in the first data transmission mode is lower than that in the second data transmission mode, and when the data transmission mode is the first data transmission mode, only The first communication channel is used for data transmission between the first core and the second core, so as to reduce power consumption due to the low power consumption characteristic of the first communication channel while ensuring normal data transmission.
  • the second data transmission mode relatively more data needs to be transmitted, so that both the first communication channel and the second communication channel can be used as target communication channels, and in order to further improve the flexibility of transmission, different Types of data may be transmitted from the first communication channel or from the second communication channel, respectively.
  • determining the communication channel corresponding to the data to be transmitted from the plurality of communication channels based on the data type, as the target communication channel includes: if the data to be transmitted is real-time data, setting the communication channel to be transmitted. The second communication channel is used as the target communication channel; if the data to be transmitted is non-real-time data, at least the first communication channel is used as the target communication channel.
  • the second communication channel has better real-time performance than the first communication channel, which can enable data to be transmitted to the destination in a more timely manner.
  • the data to be transmitted is real-time data
  • the second communication channel can be channel as the target communication channel.
  • the data to be transmitted is non-real-time data, the data to be transmitted does not have to be transmitted to the destination in time, and the data to be transmitted can be transmitted through the first communication channel alone, or the data to be transmitted can be transmitted through the first communication channel alone.
  • Data is jointly transmitted through the first communication channel and the second communication channel.
  • the first communication channel is used as the target communication channel, including: if the data to be transmitted is non-real-time data, Obtain the occupancy level of the second communication channel; if the occupancy level is higher than the occupancy level threshold, use the first communication channel as the target communication channel; if the occupancy level is not higher than the occupancy level threshold, set the occupancy level
  • the data to be transmitted is divided into a first part and a second part, and the first part and the second part are respectively corresponding to the numbers used for orderly reorganization; the first communication channel is used as the target communication channel of the first part, and The second communication channel is used as the target communication channel of the second part.
  • the second communication channel has high real-time communication performance, but the electronic device may not always transmit real-time data.
  • the second communication channel is relatively idle (for example, the aforementioned If the occupancy level of the second communication channel is not higher than the occupancy level threshold), making the second communication channel also used to transmit non-real-time data can be beneficial to further improve data transmission efficiency.
  • both the communication channel 30 and the communication channel 40 can be used as the target communication channel, and then the data B to be transmitted can be divided into a first part b1 and a second part b2, and the first part b1 can be configured.
  • the target channel of b2 is the communication channel 30, and the target communication channel of the second part b2 is the communication channel 40.
  • the communication channel 30 is the first communication channel
  • the communication channel 40 is the second communication channel.
  • different parts of the split data to be transmitted are transmitted by different communication channels, so that the time points at which different parts are transmitted to the destination may be different, and the corresponding The numbering can reorganize the different parts according to the predetermined order, so as to ensure the completeness and sequence of the data to be transmitted.
  • the first part b1 is numbered n1
  • the second part b1 is numbered n2
  • n1 is ranked before n2
  • the first part b1 and the second part b2 can be reorganized.
  • the second part b2 is spliced to the tail of the first part b1.
  • the occupancy degree of the second communication channel in this embodiment may be determined in various ways.
  • the occupancy degree of the second communication channel may be characterized by the data volume of the data transmitted by the content through the second communication channel in a specified time period.
  • a sending buffer may be configured in the electronic device corresponding to each communication channel.
  • the occupancy level of the second communication channel can be determined by acquiring the usage rate of the sending buffer corresponding to the second communication channel. For example, if the usage rate of the sending buffer corresponding to the second communication channel is greater than 50%, it is determined that the occupancy is occupied. The occupancy level is higher than the occupancy level threshold, otherwise, if the usage rate of the sending buffer corresponding to the second communication channel is not greater than 50%, it is determined that the occupancy level is not higher than the occupancy level threshold.
  • the communication channel between the first core and the second core may include the aforementioned first communication channel and second communication channel.
  • the plurality of communication channels may further include a third channel. Obtaining the communication channel corresponding to the data to be transmitted from the plurality of communication channels as the target communication channel further includes: if the data to be transmitted is status type data, obtaining the third communication channel from the plurality of communication channels as the target communication channel. target communication channel.
  • S340 Transmit the data to be transmitted through the target communication channel.
  • the data to be transmitted can be transmitted through the corresponding target communication channel.
  • real-time data may need to be transmitted to the destination in a more immediate manner.
  • the second data communication channel may still have more data waiting to be transmitted, so in order to facilitate real-time transmission Types of data can be transmitted faster.
  • transmitting the data to be transmitted through the second communication channel includes: If the current mode is the second data transmission mode and the data to be transmitted is real-time data, configure the data to be transmitted to the most forward transmission position in the sending buffer of the second communication channel for transmission.
  • the second communication channel 40 corresponds to a sending buffer 61 , and it is determined that the data that needs to be transmitted through the second communication channel 40 will be buffered into the sending buffer 61 first, and then read into the sending buffer 61 .
  • the transmission is performed in the second communication channel 40 .
  • the sending buffer 61 will include a plurality of transmission positions for storing the buffered data, and each transmission position corresponds to a different transmission order, wherein, the transmission order corresponding to the earlier transmission position has a higher priority .
  • the front can be understood as the exit to the sending buffer. It can be understood that the data in the sending buffer 61 is moved out of the sending buffer through the exit of the sending buffer and written to the second buffer.
  • the transmission position that is closer to the exit of the sending buffer can be understood as the forward transmission position, and the data stored in the most forward transmission position in the sending buffer is transmitted first. Then, in order to facilitate the data to be transmitted to the second core as soon as possible, when it is determined that the data to be transmitted is real-time data, the data to be transmitted can be configured to the most forward transmission position in the send buffer for transmission. . For example, as shown in FIG.
  • the data B to be sent is currently transmitted in the second communication channel 40 , and the data to be sent C and the data D to be sent are the ones to be sent in sequence, then the data type judgment is currently being performed.
  • the data E to be sent is the data E to be sent, and if the data E to be sent is determined to be real-time data, the data E to be sent can be configured to the most forward transmission position in the sending buffer for transmission.
  • the first communication channel may be the communication channel 30 in the aforementioned FIG. 1
  • the second communication channel may be the communication channel 40 in FIG. 1
  • the third communication channel may be the communication channel 40 in FIG. 1 .
  • communication channel 50 the first communication channel includes a data line for transmitting data between the first core and the second core, a first timing line for controlling the first core to actively send data to the second core, and a first timing line for controlling The second time sequence line through which the second core actively sends data to the first core.
  • the status type data may include data about working status, data about register status and log data
  • the third communication channel includes a first core requesting the second core for the working status and register status of the second core , and a fourth line for the second core to output log data to the first core.
  • An inter-core communication method provided by the present application can make it possible to transmit data to be transmitted through a communication channel adapted to the required transmission data when data needs to be transmitted between the first core and the second core, thereby improving the Flexibility in the way of communication between the dual cores.
  • the first communication channel among the plurality of communication channels in this embodiment has the characteristics of high data transmission rate
  • the second communication channel has the characteristics of high real-time transmission, so that it is possible to select according to the current data transmission mode.
  • One communication channel for data transmission or the second communication channel for data transmission so as to improve the flexibility of data transmission, it can also have good real-time transmission and transmission rate.
  • an inter-core communication method provided by an embodiment of the present application is applied to an electronic device, where the electronic device includes at least a first core and a second core, and the first core and the second core are connected between There are multiple communication channels, and the respective communication performances of the multiple communication channels are different, and the method includes:
  • S410 Acquire data to be transmitted, where the data to be transmitted is data transmitted between the first core and the second core.
  • S430 If the data to be transmitted is status type data, acquire the third communication channel from the plurality of communication channels as a target communication channel.
  • S440 If the data to be transmitted is non-state type data, determine a communication channel corresponding to the data to be transmitted from the plurality of communication channels based on the data transmission mode, as a target communication channel.
  • S450 Transmit the data to be transmitted through the target communication channel.
  • the upper-layer service may be an application-layer service, for example, a user's operation data monitoring service, or other debugging services.
  • the upper layer service When the upper layer service generates data that needs to be transmitted to another core, the data will then be used as data to be transmitted. After the data to be transmitted is obtained, the type of the data to be transmitted will be identified first. If the data of the state type is identified, the third communication channel will be used as the target communication channel, so that the data to be transmitted will be transmitted through the third communication channel. .
  • the current data transmission mode will be identified, and if the current data transmission mode is the aforementioned first data transmission mode, the first data transmission mode will be directly determined.
  • a communication channel is the target communication channel, and then the data to be transmitted is stored in the first sending buffer corresponding to the first communication channel.
  • the first data selector in it will determine whether the data to be transmitted is real-time data; if it is real-time data, the first data selector can The data is transmitted to the queue-inserting module, so that the queue-inserting module stores it in the second sending buffer corresponding to the second communication channel.
  • the second data transmitter can determine whether to store the data to be transmitted in the first sending buffer according to the foregoing method, Or split the data to be transmitted into a first part stored in the first sending buffer and a second part stored in the second sending buffer.
  • an identification table of real-time type data and a sequence-dependent identification table may be preconfigured.
  • the first data selector may query whether there is an identification of the data to be transmitted in the identification table of the data of the real-time type, and if yes, determine that the data to be transmitted is real-time. type of data.
  • the data to be transmitted is real-time data, it is possible to further query whether the data to be transmitted can be queued to the most forward transmission position in the second communication channel for transmission through the sequence dependency identification table.
  • the queue will not be interrupted to the second communication.
  • the most forward transmission position in the channel is transmitted, but it will be configured to transmit after the unsent data it depends on.
  • An inter-core communication method provided by this application can first obtain the type of data to be transmitted, for state type data, it can be transmitted directly through a third communication channel, and for non-state type data, it can be combined with the current data transmission mode to determine the corresponding target communication channel, and through the above method, when data needs to be transmitted between the first core and the second core, the data to be transmitted can be transmitted through the communication channel adapted to the required transmission data, thereby improving the The flexibility of the communication method between the dual cores, and different types of data can be transmitted through different communication channels, which is beneficial to isolate different types of data transmission from each other, avoid interference, and improve the rate of data transmission. It also improves the stability of data transmission.
  • an inter-core communication apparatus 400 provided by an embodiment of the present application operates on an electronic device, and the electronic device includes at least a first core and a second core, and the first core and the second core are between the first core and the second core.
  • the apparatus 400 includes:
  • a data acquisition unit 510 configured to acquire data to be transmitted, where the data to be transmitted is data transmitted between the first core and the second core;
  • a channel selection unit 520 configured to obtain a communication channel corresponding to the data to be transmitted from the plurality of communication channels, as a target communication channel;
  • the data communication unit 530 is configured to transmit the data to be transmitted through the target communication channel.
  • the channel selection unit 520 is specifically configured to obtain the current data transmission mode
  • a communication channel corresponding to the data to be transmitted is determined from the plurality of communication channels as a target communication channel.
  • the communication performance includes data transmission rate and real-time transmission.
  • the channel selection unit 520 is specifically configured to use the first communication channel in the plurality of communication channels as the target communication channel if the current mode is the first data transmission mode; if the current mode is the second data transmission mode, obtain the The data type of the data to be transmitted; the communication channel corresponding to the data to be transmitted is determined from the plurality of communication channels based on the data type as the target communication channel; wherein, the data transmission rate of the first communication channel is higher than The data transmission rate of the second communication channel, the real-time transmission of the second communication channel is higher than the real-time transmission of the first communication channel.
  • the data transmission rate of the first communication channel is higher than the data transmission rate of the second communication channel, and the real-time transmission of the second communication channel is higher than the real-time transmission of the first communication channel.
  • the channel selection unit 520 is specifically configured to use the second communication channel as the target communication channel if the data to be transmitted is real-time data; if the data to be transmitted is non-real-time data , and at least the first communication channel is used as the target communication channel.
  • the channel selection unit 520 is specifically configured to obtain the occupancy level of the second communication channel if the data to be transmitted is non-real-time data; if the occupancy level is higher than the occupancy level threshold, select the first communication channel as the target communication channel; if the occupancy level is not higher than the occupancy level threshold, the data to be transmitted is divided into a first part and a second part, and the first part and the second part are respectively used for orderly reorganization
  • the number of the first communication channel is used as the target communication channel of the first part, and the second communication channel is used as the target communication channel of the second part.
  • the channel selection unit 520 is also specifically configured to configure the data to be transmitted in the sending buffer of the second communication channel, if the current mode is the second data transmission mode and the data to be transmitted is real-time data. Transfer from the previous transfer position.
  • the channel selection unit 520 is specifically configured to acquire the usage rate of the sending buffer; and determine the current data transmission mode based on the usage rate.
  • the channel selection unit 520 is specifically configured to, if the usage rate is greater than the usage rate threshold, determine that the current is the first data transmission mode; if the usage rate is not greater than the usage rate threshold, determine that the current is the first data transmission mode. The second data transmission mode is described.
  • the channel selection unit 520 is specifically configured to acquire a third communication channel from the plurality of communication channels as a target communication channel if the data to be transmitted is status type data.
  • An inter-core communication device provided by the present application can transmit data to be transmitted through a communication channel adapted to the required transmission data when data needs to be transmitted between the first core and the second core by the above method, thereby improving the Flexibility in the way of communication between the dual cores.
  • the first communication channel among the plurality of communication channels in this embodiment has the characteristics of high data transmission rate
  • the second communication channel has the characteristics of high real-time transmission, so that it is possible to select according to the current data transmission mode.
  • One communication channel for data transmission or the second communication channel for data transmission so as to improve the flexibility of data transmission, it can also have good real-time transmission and transmission rate.
  • An electronic component provided by an embodiment of the present application includes a first core and a second core, there are multiple communication channels between the first core and the second core, and the respective communication performances of the multiple communication channels different;
  • the first core is used to acquire the data to be transmitted; acquire the communication channel corresponding to the data to be transmitted from the plurality of communication channels as a target communication channel; transmit the data to be transmitted to the target communication channel through the target communication channel the second core.
  • An electronic component provided by the present application can transmit data to be transmitted through a communication channel adapted to the required transmission data when data needs to be transmitted between the first core and the second core through the above method, thereby improving the Flexibility in how the dual cores communicate.
  • another embodiment of the present application further provides an electronic device 200 that can execute the foregoing inter-core communication method.
  • the electronic device 200 may be a wearable device such as a smart bracelet or a smart watch, or may be a smart phone, a tablet computer, or the like.
  • the electronic device 200 includes a processor 102, a memory 104, a network module 106, and a microcontroller unit 108 (MCU).
  • the memory 104 stores a program that can execute the content in the foregoing embodiments, and the processor 102 can execute the program stored in the memory 104 .
  • the internal structure of the processor 102 may be as shown in FIG. 1 .
  • the processor 102 may include one or more cores for processing data and a message matrix unit.
  • the processor 102 uses various interfaces and lines to connect various parts of the entire electronic device 200, and executes by running or executing the instructions, programs, code sets or instruction sets stored in the memory 104, and calling the data stored in the memory 104.
  • the processor 102 may adopt at least one of digital signal processing (Digital Signal Processing, DSP), field-programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). implemented in a hardware form.
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA programmable logic array
  • the processor 102 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), a modem, and the like.
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit
  • the CPU mainly deals with the operating system, user interface and application programs, etc.
  • the GPU is used for rendering and drawing of the display content
  • the modem is used for handling wireless communication. It can be understood that, the above-mentioned modem may not be integrated into the processor 102, and is implemented by a communication chip alone.
  • the memory 104 may include a random access memory (Random Access Memory, RAM), or may include a read-only memory (Read-Only Memory, ROM). Memory 104 may be used to store instructions, programs, codes, sets of codes, or sets of instructions.
  • the memory 104 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing the operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, and the like.
  • means for inter-core communication may be stored in the memory 104 .
  • the apparatus for performing inter-core communication may be the aforementioned apparatus 400 .
  • the storage data area may also store data created by the terminal 100 during use (such as phone book, audio and video data, chat record data) and the like.
  • the network module 106 is used for receiving and sending electromagnetic waves, realizing mutual conversion between electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices, for example, communicate with an audio playback device.
  • the network module 106 may include various existing circuit elements for performing these functions, eg, antennas, radio frequency transceivers, digital signal processors, encryption/decryption chips, subscriber identity module (SIM) cards, memory, etc. .
  • the network module 106 can communicate with various networks such as the Internet, an intranet, a wireless network, or communicate with other devices through a wireless network.
  • the aforementioned wireless network may include a cellular telephone network, a wireless local area network, or a metropolitan area network.
  • the network module 106 may interact with the base station for information.
  • FIG. 14 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable medium 1100 stores program codes, and the program codes can be invoked by the processor to execute the methods described in the above method embodiments.
  • the computer-readable storage medium 1100 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 1100 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 1100 has storage space for program code 1110 that performs any of the method steps in the above-described methods. These program codes can be read from or written to one or more computer program products. Program code 1110 may be compressed, for example, in a suitable form.
  • the electronic device includes at least a first core and a second core, the first core and the second core
  • the first core and the second core When there are multiple communication channels between cores, and the respective communication performances of the multiple communication channels are different, after acquiring the data to be transmitted between the first core and the second core, you can The communication channel corresponding to the data to be transmitted is selected from the plurality of communication channels as the target communication channel, and the data to be transmitted is then transmitted through the target communication channel. Therefore, by the above method, when data needs to be transmitted between the first core and the second core, the data to be transmitted can be transmitted through a communication channel adapted to the required transmission data, thereby improving the flexibility of the communication method between the dual cores. sex.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)

Abstract

本申请实施例公开了一种核间通信方法、装置、电子组件、电子设备以及存储介质。所述电子设备至少包括第一核以及第二核,所述第一核和所述第二核之间有多条通信通道,且所述多条通信通道各自的通信性能不同,所述方法包括:获取待传输数据,所述待传输数据为在所述第一核和所述第二核之间传输的数据;从所述多条通信通道中获取所述待传输数据对应的通信通道,作为目标通信通道;通过所述目标通信通道传输所述待传输数据。从而通过上述方式可以使得需要在第一核和第二核之间传输数据时,可以通过所需传输数据适配的通信通道来传输待传输数据,进而提升了在双核之间的通信方式的灵活性。

Description

核间通信方法、装置、电子组件以及电子设备
相关申请的交叉引用
本申请要求于2020年08月18日提交的申请号为202010832873.4的中国申请的优先权,其在此出于所有目的通过引用将其全部内容并入本文。
技术领域
本申请涉及电子技术领域,更具体地,涉及一种核间通信方法、装置、电子组件、电子设备以及存储介质。
背景技术
在电子设备中,为提升性能并提升用户使用体验会采用双核方案。在一些情况下,电子设备的双核之间会相互通信以实现一些业务功能。
发明内容
鉴于上述问题,本申请提出了一种核间通信方法、装置、电子组件、电子设备以及存储介质,以改善上述问题。
第一方面,本申请提供了一种核间通信方法,应用于电子设备,所述电子设备至少包括第一核以及第二核,所述第一核和所述第二核之间有多条通信通道,且所述多条通信通道各自的通信性能不同,所述方法包括:获取待传输数据,所述待传输数据为在所述第一核和所述第二核之间传输的数据;
从所述多条通信通道中获取所述待传输数据对应的通信通道,作为目标通信通道;通过所述目标通信通道传输所述待传输数据。
第二方面,本申请提供了一种核间通信装置,运行于电子设备,所述电子设备至少包括第一核以及第二核,所述第一核和所述第二核之间有多条通信通道,且所述多条通信通道各自的通信性能不同,所述装置包括:数据获取单元,用于获取待传输数据,所述待传输数据为在所述第一核和所述第二核之间传输的数据;通道选择单元,用于从所述多条通信通道中获取所述待传输数据对应的通信通道,作为目标通信通道;数据通信单元,用于通过所述目标通信通道传输所述待传输数据。
第三方面,本申请提供了一种电子组件,包括第一核以及第二核,所述第一核和所述第二核之间有多条通信通道,且所述多条通信通道各自的通信性能不同;所述第一核, 用于获取待传输数据;从所述多条通信通道中获取所述待传输数据对应的通信通道作为目标通信通道;通过所述目标通信通道传输所述待传输数据到所述第二核。
第四方面,本申请提供了一种电子设备,包括处理器以及存储器;一个或多个程序被存储在所述存储器中并被配置为由所述处理器执行以实现上述的方法。
第五方面,本申请提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有程序代码,其中,在所述程序代码被处理器运行时执行上述的方法。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出了本申请实施例提出的电子设备中多核的架构示意图;
图2示出了本申请一实施例提出的一种第一核主动向第二核传输数据的流程图;
图3示出了本申请一实施例提出的一种第一核主动从第二核读取数据的流程图;
图4示出了本申请实施例提出的电子设备中通信架构的示意图;
图5示出了本申请一实施例提出的一种核间通信方法的流程图;
图6示出了本申请另一实施例提出的一种核间通信方法的流程图;
图7示出了本申请实施例中发送缓冲区的示意图;
图8示出了本申请实施例中待传输数据进行拆分的示意图;
图9示出了本申请实施例中最靠前的传输位置的示意图;
图10示出了本申请再一实施例提出的一种核间通信方法的流程图;
图11示出了本申请图10实施例中一种数据传输路径的示意图;
图12示出了本申请实施例提出的一种核间通信装置的结构框图;
图13示出了本申请的用于执行根据本申请实施例的核间通信方法的一种电子设备的结构框图;
图14是本申请实施例的用于保存或者携带实现根据本申请实施例的核间通信方法的程序代码的存储单元。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
随着电子设备所具备的功能日益丰富,电子设备所需处理的数据的数据量也逐渐增多。为了具备能 够处理更多数据的能力,电子设备可以配置更多的进行数据处理的器件。例如,电子设备中可以通过配置多核处理器来进行数据处理。多核处理器是指在一枚处理器中集成两个或多个完整的计算引擎(核),此时处理器能支持系统总线上的多个处理器,由总线控制器提供所有总线控制信号和命令信号。再者,电子设备中也可以通过配置多种处理器来进行数据处理。示例性的,可以通过配置CPU和MCU(Microcontroller Unit)来进行数据处理。其中,需要说明的是,在CPU和MCU进行数据处理的过程中,所需处理的数据可以理解为实际是由CPU中的核与MCU中的核进行处理的,对应的CPU和MCU进行通信的过程中,也对应是由CPU中的核与MCU中的核之间进行的通信,其中,CPU中的核和MCU中的核均可以理解为负责数据处理的模块。
但是,发明人在对相关的多核处理器或者多种处理器进行数据处理的方案进行研究后发现,该相关的多核处理器之间以及相关的多种处理器之间还存在数据通信性能较差,缺乏灵活性的问题。例如,在电子设备具有多种处理器的情况下,多种处理器之间只有一条通信通道,进而使得无论何种类型的数据都只能通过该条通信通道进行传输,进而使得数据通信较为缺乏灵活性。并且,因为只有一条通信通道来进行数据传输,也造成数据传输的速率、实时性以及稳定性方面有待提升。
因此,发明人在研究中发现上述问题后,提出了本申请中可以改善上述问题的核间通信方法、装置、电子组件、电子设备以及存储介质。从而在电子设备至少包括第一核以及第二核,所述第一核和所述第二核之间有多条通信通道,且所述多条通信通道各自的通信性能不同的情况下,在获取到在所述第一核和所述第二核之间传输的待传输数据后,可以从多条通信通道中选择与待传输数据对应的通信通道作为目标通信通道,进而通过所述目标通信通道传输所述待传输数据。从而通过上述方式可以使得需要在第一核和第二核之间传输数据时,可以通过所需传输数据适配的通信通道来传输待传输数据,进而提升了在双核之间的通信方式的灵活性。
下面先对本申请实施例中所涉及的电子设备的硬件架构进行介绍。
如图1所示,在图1所示的电子设备的架构中,示例性的示出了第一核10以及第二核20。其中,第一核10和第二核20之间有通信通道30、通信通道40以及通信通道50。
该通信通道30包括进行数传输的数据线路31,以及用于时序控制的时序线路32,在该时序线路32的控制下,第一核10和第二核20均可以基于数据线路31主动进行数据传输。可选的,该数据线路31为基于串行外设接口SPI(Serial Peripheral Interface)通信协议的数据线路。其中,该通信通道30的通信性能为数据收发速度高、功耗低以及鲁棒性强。
下面通过图2和图3所示的内容对基于通信通道30进行数据传输的时序进行介绍。
如图2所示的为第一核10主动向第二核20传输数据的时序,包括:
S101:等待第一信号线置位;
S102:第一信号线触发第一电平信号;
S103:上锁SPI总线;
S104:等待第二信号线置位;
S105:第二信号线触发第一电平信号;
S106:向第二核写入数据;
S107:等待第二信号线的复位;
S108:第二信号线触发第二电平信号;
S109:解锁SPI总线;
S110:第一信号线复位。
再如图3所示,第二核20主动向第一核10传输数据的时序,包括:
S110:等待数据;
S111:上锁SPI总线;
S112:准备发送的数据;
S113:等待第三信号线置位;
S114:第三信号线触发第一电平信号;
S115:从第二核中读取数据;
S116:等待第四信号线的信号;
S117:第四信号线触发第三电平信号;
S118:第三信号线复位;
S119:解锁SPI总线。
其中,需要说明的是,前述的时序线路32可以包括其中的第一信号线、第二信号线、第三信号线以及第四信号线。其中,第一电平信号可以为上升沿信号,第二电平信号可以为下降沿信号,第三电平信号可以为高电平信号。
该通信通道40包括有进行数据传输的数据线路41以及进行流量控制的流控线路42。该流控线路42可以用于对数据线路41中的数据传输的开启和停止进行控制。可选的,该数据线路41可以为基于异步串口通信协议(Universal Asynchronous Receiver/Transmitter)的数据线路。其中,通信通道40的通信性能为实时性高且传输稳定。
该通信通道50包括有第一核10向第二核20请求第二核20的工作状态以及寄存器状态的数据线路51,以及第二核20向第一核10输出日志数据的数据线路52。可选的,数据线路51可以为基于SWD(Serial wire debug)通信协议的数据线路,在这种方式下,数据线路51可以包括有SWDIO数据线以及SWCLK时钟线。
需要说明的是,图1所示的结构只是示例性的,电子设备除了包括图1中的第一核10和第二核20外,还可以包括更多数量的核,且所包括的更多的核其他核之间的通信通道也可以为图1中所示的方式。再者,第一核10和第二核20之间的通信通道也可以包括前述三条通信通道中的部分通信通道。例如,可以只包括通信通道30和通信通道40,在这种情况下原本由通信通道50所传输的数据可以由通信通道30和/或通信通道40进行传输。再例如,也可以只包括通信通道30和通信通道50,在这种情况下原本由通信通道40所传输的数据可以由通信通道30和/或通信通道50进行传输。
再者,还需要说明的是,其中的第一核10和第二核20可以属于同一个处理器,也可以分别属于不同的处理器。示例性的,该第一核10可以为承载操作系统(例如,Android)的核(例如,CPU),该第二核20可以为承载传感器数据的核(例如,MCU)。
下面再对本申请实施例所涉及的一种通信架构进行介绍。
如图4所示,在图4所示的通信架构中第一个对应的业务会产生所需传输的数据作为待传输数据,而待传输数据会经过数据路由算法来从后续的SPI通信协议、UART通信协议以及SWD通信协议中选择一种协议作为对待传输数据进行传输的协议。类似的,对于第二核对应的业务所产生的所需传输的数据也可以经过前述方式来确定一种协议作为对待传输数据进行传输的协议。其中,需要说明的是,前述的多条通信通道是基于不同通信协议实施的,那么这里的选择一种协议可以理解为为待传输数据选择目标通信通道。
需要说明的是,图4中所涉及的SPI通信协议可以理解为对应的控制线路增加有图1中时序线路32的SPI通信协议。
下面将结合附图具体描述本申请的各实施例。
请参阅图5,本申请实施例提供的一种核间通信方法,应用于电子设备,所述电子设备至少包括第一核以及第二核,所述第一核和所述第二核之间有多条通信通道,且所述多条通信通道各自的通信性能不同, 所述方法包括:
S210:获取待传输数据,所述待传输数据为在所述第一核和所述第二核之间传输的数据。
需要说明的是,本实施例中的待传输数据为在第一核和第二之间进行传输的数据。可选的,若由第一核执行本实施例所提供的方法,则待传输数据为第一核传输给第二核的数据,若由第二核执行本实施例所提供的方法,则待传输数据为第二核传输给第一核的数据。
其中,待传输数据可以为业务层所产生的数据。示例性的,若在第一核向第二核传输第二核所需的固件的过程中,待传输数据可以为该所需传输的固件。再者,该待传输数据还可以为控制指令或者状态回复数据等。
S220:从所述多条通信通道中获取所述待传输数据对应的通信通道,作为目标通信通道。
其中,在第一核和第二核之间会如前述所示的配置有多条通信通道,而不同的通信通道所具有的通信性能可以是不同的,进而在获取到待传输数据之后,可以从多条通信通道中选择至少一条通信通道作为待传输数据对应的通信通道。其中,本申请实施例中的通信性能可以理解为传输数据的能力,例如,传输速率、实时性以及稳定性等。
S230:通过所述目标通信通道传输所述待传输数据。
本申请提供的一种核间通信方法,在电子设备至少包括第一核以及第二核,所述第一核和所述第二核之间有多条通信通道,且所述多条通信通道各自的通信性能不同的情况下,在获取到在所述第一核和所述第二核之间传输的待传输数据后,可以从多条通信通道中选择与待传输数据对应的通信通道作为目标通信通道,进而通过所述目标通信通道传输所述待传输数据。从而通过上述方式可以使得需要在第一核和第二核之间传输数据时,可以通过所需传输数据适配的通信通道来传输待传输数据,进而提升了在双核之间的通信方式的灵活性。
请参阅图6,本申请实施例提供的一种核间通信方法,应用于电子设备,所述电子设备至少包括第一核以及第二核,所述第一核和所述第二核之间有多条通信通道,且所述多条通信通道各自的通信性能不同,所述方法包括:
S310:获取待传输数据,所述待传输数据为在所述第一核和所述第二核之间传输的数据。
S320:获取当前的数据传输模式。
需要说明的是,在本实施例中可以根据当前的数据传输模型来确定待传输数据的目标通信通道。
在本实施例中可以有多种方式来确定当前的数据传输模式。
作为一种方式,可以根据第一核和第二核之间的吞吐量来确定当前的数据传输模式。需要说明的是,第一核和第二核之间的吞吐量可能会根据实际情况而实时进行变动。例如,在电子设备运行较多程序的过程中,第一核和第二核之间可能会有较多的数据需要进行交互,进而就会使得第一核和第二核之间的吞吐量相对较大。再例如,在电子设备处于休眠状态时,电子设备并不需要进行较多的数据处理,进而第一核和第二核之间需要进行传输的数据会相对较少。在这种方式下,可以在检测到第一核和第二核之间的吞吐量不大于指定传输阈值时,确定当前为需要传输的数据相对较小的第一数据传输模式,可以在检测到第一核和第二核之间的吞吐量大于指定传输阈值时,确定当前为需要传输的数据相对较大的第二数据传输模式。
其中,可选的,可以通过获取指定发送缓冲区的使用率来表征吞吐量。需要说明的是,在本实施例中对于已经确定目标通信通道的待传输数据可以先存放到发送缓冲区中,然后再从该发送缓冲区中取出待发送数据通过对应的目标通信通道进行发送。示例性的,如图7所示,其中包括发送缓冲区60以及通信通道30,在确定待发送数据A对应的目标通信通道为通信通道30后,可以将待发送数据A存放到发送缓冲区60中,进而通信通道30可以直接从发送缓冲区60读取数据进行发送。因为发送缓冲区中的数据也是需要依次发送的,进而当发送缓冲区中所需发送的数据越大,也就意味着发送缓冲区的使用率也就越高。例如,若发送缓冲区的使用率为50%,那么也就意味着发送缓冲区有一半的区域被待发送数据占用。
那么在获取指定发送缓冲区的使用率来作为吞吐量的情况下,指定传输阈值可以为使用率阈值。可选的,该使用率阈值为50%,进而可以在指定发送缓冲区的使用率低于50%时,确定当前为前述的第一数据传输模式,可以在指定发送缓冲区的使用率不低于50%时,确定当前为前述的第二数据传输模式。
需要说明的是,第一核和第二核之间的吞吐量可能会有波动。为了能够更为准确的识别当前的数据传输模式,进一步的可以检测到在指定时间段内第一核和第二核之间的吞吐量均不大于指定传输阈值时,确定当前为第一数据传输模式,对应的,可以检测到在指定时间段内第一核和第二核之间的吞吐量均大于指定传输阈值时,确定当前为第二数据传输模式。示例性的,以指定发送缓冲区的使用率为例,该指定时间段可以为1000ms,对应的,若在1000ms内检测到指定发送缓冲区的使用率均低于50%时,确定当前为前述的第一数据传输模式,若在1000ms内检测到指定发送缓冲区的使用率均不低于50%时,确定当前为前述的第二数据传输模式。
可选的,其中的指定发送缓冲区可以为某个通信通道对应的发送缓冲区。例如,可以为第一通信通道对应的发送缓冲区。需要说明的是,通信通道对应的发送缓冲区可以理解为发送缓冲区中的所缓冲的数据均通过对应的通信通道进行传输。
再者,作为另外一种方式,还可以通过当前所处的运行场景来确定数据传输模式。需要说明的是,电子设备在运行一些程序的过程中可能需要收集较多的数据,进而就使得不同核之间有较为频繁的数据传输。
例如,以电子设备为穿戴设备为例,当穿戴设备处于用户的运动数据监测场景下,需要更高频率的获取到进行运动监测的传感器的采集数据,以进行一些状态识别。可选的,传感器的数据采集可以是由第二核控制的,而其中的状态识别是由第一核来执行的,那么第二核就会以较高频率的将传感器的采集数据传输到第一核中以便第一核进行更快速的状态识别。对应的,第一核在完成状态识别之后,也会不断的向第二核发送一些控制指令,进而也会使得第一核有较多的数据需要传输给第二核。进而,电子设备可以识别当前所处的场景,根据预先建立的场景与数据传输模式对应关系,以将当前场景所对应的数据传输模式作为当前的数据传输模式。可选的,电子设备所处的场景可以包括有运动检测场景以及休眠场景,其中运动检测场景对应前述的第二数据传输模式,休眠场景对应前述的第一数据传输模式。
S330:基于所述数据传输模式从所述多条通信通道中确定所述待传输数据对应的通信通道,作为目标通信通道。
作为一种方式,所述多条通信通道包括第一通信通道和第二通信通道。所述第一通信通道的数据传输速率高于所述第二通信通道的数据传输速率,所述第二通信通道的传输实时性高于所述第一通信通道的传输实时性,且第一通信通道的功耗低于第二通信通道的功耗。
在这方式下,所述基于所述数据传输模式从所述多条通信通道中确定所述待传输数据对应的通信通道,作为目标通信通道,包括:若当前为第一数据传输模式,将所述多条通信通道中的第一通信通道作为目标通信通道;若当前为第二数据传输模式,获取所述待传输数据的数据类型;基于所述数据类型从所述多条通信通道中确定所述待传输数据对应的通信通道,作为目标通信通道。
需要说明的是,如前述内容所示,第一数据传输模式下的吞吐量是低于第二数据传输模式下的吞吐量的,进而在当数据传输模式为第一数据传输模式下,可以仅使用第一通信通道来进行第一核和第二核之间的数据传输,以便在保障正常的数据传输的同时,因为第一通信通道的低功耗特性而降低功耗。而在第二数据传输模式下,所需传输的数据相对更多,进而可以使得第一通信通道和第二通信通道均可以作为目标通信通道,并且为了进一步的提升传输的灵活性,可以使得不同类型的数据可以分别从第一通信通道进行传输或者从第二通信通道进行传输。
可选的,所述基于所述数据类型从所述多条通信通道中确定所述待传输数据对应的通信通道,作为目标通信通道,包括:若所述待传输数据为实时类型的数据,将所述第二通信通道作为目标通 信通道;若所述待传输数据为非实时类型的数据,至少将所述第一通信通道作为目标通信通道。
可以理解的是,第二通信通道相比第一通信通道具有更好的实时性,可以使得数据能够更加及时的被传输到目的端。那么在第一通信通道和第二通信通道均可以作为目标通信通道的情况下,若待传输数据为实时类型的数据,为了使得待传输数据能够更加及时的传输到目的端,可以将第二通信通道作为目标通信通道。而若所述待传输数据为非实时类型的数据的情况下,待传输数据并不是必须及时的传输到目的端,进而可以将待传输数据单独通过第一通信通道进行传输,也可以将待传输数据通过第一通信通道和第二通信通道共同传输。
作为一种共同传输方式,所述若所述待传输数据为非实时类型的数据,至少将所述第一通信通道作为目标通信通道,包括:若所述待传输数据为非实时类型的数据,获取所述第二通信通道的占用程度;若所述占用程度高于占用程度阈值,将所述第一通信通道作为目标通信通道;若所述占用程度不高于所述占用程度阈值,将所述待传输数据拆分为第一部分和第二部分,所述第一部分和第二部分分别对应有用于按顺序重组的编号;将所述第一通信通道作为所述第一部分的目标通信通道,以及将所述第二通信通道作为所述第二部分的目标通信通道。
可以理解的是,第二通信通道具有实时性高的通信性能,但是电子设备不一定随时都会进行实时类型的数据的传输,在这种情况下,在第二通信通道较为空闲(例如,前述的第二通信通道的占用程度不高于所述占用程度阈值)的情况下,使第二通信通道也用于传输非实时类型的数据可以有利于进一步的提升数据传输效率。示例性的,如图8所示,其中有通信通道30和通信通道40均可以作为目标通信通道,进而可以将待传输数据B拆分为第一部分b1以及第二部分b2,并配置第一部分b1的目标通道为通信通道30,而第二部分b2的目标通信通道为通信通道40。其中,通信通道30为第一通信通道,通信通道40为第二通信通道。
需要说明的是,对于被拆分的待传输数据的不同部分是由不同的通信通道进行传输的,进而使得不同部分被传输到目的端的时间点可能不同,进而通过前述指出的每个部分对应的编号就可以将不同部分按照既定的顺序重组,以便保证待传输数据的完成性和顺序性。示例性的,若前述的第一部分b1的编号为n1,第二部分b1的编号为n2,进而在识别到n1排序在n2之前的情况下,可以在对第一部分b1以及第二部分b2进行重组时,将第二部分b2拼接在第一部分b1的尾部。
作为一种方式,本实施例中第二通信通道的占用程度可以通过多种方式来进行确定。可选的,可以通过在指定时间段内容通过第二通信通道进行传输的数据的数据量来表征第二通信通道的占用程度。再者,电子设备中可以对应于每个通信通道都配置一个发送缓冲区。对应的,可以通过获取第二通信通道对应的发送缓冲区的使用率来确定第二通信通道的占用程度,例如,若第二通信通道对应的发送缓冲区的使用率大于50%,则判定占用程度高于占用程度阈值,反之若第二通信通道对应的发送缓冲区的使用率不大于50%,则判定占用程度不高于占用程度阈值。
还有第一核和第二核之间的通信通道除了可以包括前述的第一通信通道和第二通信通道外,可选的,所述多条通信通道还包括第三通道,所述从所述多条通信通道中获取所述待传输数据对应的通信通道作为目标通信通道还包括:若所述待传输数据为状态类型数据,从所述多条通信通道中获取所述第三通信通道作为目标通信通道。
S340:通过所述目标通信通道传输所述待传输数据。
在通过前述方式确定待传输数据的目标通信通道后,即可以将待传输数据通过对应的目标通信通道进行传输。其中,需要说明的是,对于实时类型的数据可能需要更为即时的传输到目的端,但是,在一些情况下,第二数据通信通道可能当前还有较多的数据等待传输,那么为了便于实时类型的数据可以更快的进行传输,可选的,所述若当前为第二数据传输模式且所述待传输数据为实时数据,通过所述第二通信通道传输所述待传输数据,包括:若当前为第二数据传输模式且所述待传输数据为实时类型的 数据,将所述待传输数据配置到所述第二通信通道的发送缓冲区中最靠前的传输位置进行传输。可选的,如图9所示,第二通信通道40对应有一个发送缓冲区61,确定需要通过第二通信通道40传输的数据会先缓冲到该发送缓冲区61中,然后再读取到第二通信通道40中进行传输。其中,发送缓冲区61中会包括有多个传输位置用于存放所缓冲的数据,并且每个传输位置对应有不同的传输顺序,其中,越靠前的传输位置所的对应的传输顺序越优先。
需要说明的是,其中的靠前可以理解为靠向发送缓冲区的出口,可以理解的是,发送缓冲区61中的数据是通过发送缓冲区的出口被移出发送缓冲区而写入到第二通信通道40中的,那么越靠近发送缓冲区的出口的传输位置,则可以理解为越靠前的传输位置,进而在发送缓冲区中最靠前的传输位置所存放的数据最为优先进行传输。那么为了便于待传输数据能够尽快的被传输到第二核,则可以在确定待传输数据为实时类型的数据的情况下,将待传输数据配置到发送缓冲区中最靠前的传输位置进行传输。例如,如图9所示,当前在第二通信通道40中进行传输的为待发送数据B,而后续依次进行发送的为待发送数据C以及待发送数据D,那么当前在进行数据类型判断的为待发送数据E,进而在确定待发送数据E为实时类型的数据的情况下,则可以将待发送数据E配置到发送缓冲区中最靠前的传输位置进行传输。
需要说明的是,在本实施例中,第一通信通道可以为前述图1中的通信通道30,第二通信通道可以为图1中个的通信通道40,第三通信通道可以为图1中的通信通道50。再者,所述第一通信通道包括用于第一核与所述第二核之间传输数据的数据线路,控制第一核主动向第二核发送数据的第一时序线路,以及用于控制第二核主动向第一核发送数据的第二时序线路。其中状态类型数据可以包括有关于工作状态的数据、关于寄存器状态的数据以及日志数据,那么所述第三通信通道包括有第一核向第二核请求所述第二核的工作状态以及寄存器状态的第三线路,以及第二核向第一核输出日志数据的第四线路。
本申请提供的一种核间通信方法,通过上述方式可以使得需要在第一核和第二核之间传输数据时,可以通过所需传输数据适配的通信通道来传输待传输数据,进而提升了在双核之间的通信方式的灵活性。并且,在本实施例中的多条通信通道中的第一通信通道具有数据传输速率高,第二通信通道具有传输实时性高的特点,进而使得可以根据当前的数据传输模式来选择是通过第一通信通道来进行数据传输,还是通过第二通信通道来进行数据传输,以提升数据传输有较高灵活性的同时,也可以具有好的传输实时性和传输速率。
请参阅图10,本申请实施例提供的一种核间通信方法,应用于电子设备,所述电子设备至少包括第一核以及第二核,所述第一核和所述第二核之间有多条通信通道,且所述多条通信通道各自的通信性能不同,所述方法包括:
S410:获取待传输数据,所述待传输数据为在所述第一核和所述第二核之间传输的数据。
S420:获取所述待传输数据的类型。
S430:若所述待传输数据为状态类型数据,从所述多条通信通道中获取所述第三通信通道作为目标通信通道。
S440:若所述待传输数据为非状态类型数据,基于所述数据传输模式从所述多条通信通道中确定所述待传输数据对应的通信通道,作为目标通信通道。
S450:通过所述目标通信通道传输所述待传输数据。
需要说明的是,本实施例中的基于所述数据传输模式从所述多条通信通道中确定所述待传输数据对应的通信通道与前述实施例中的方式相同,下面通过图11所示的示意图来再次对本实施例的整体流程进行说明。其中的上层业务可以为应用层业务,例如,可以为用户的运行数据监测业务,或者其他的调试业务。在当上层业务产生需要传输到另外的核的数据时,该数据进而会被作为待传输数据。在获取到待传输数据后,会先识别该待传输数据的类型,若识别到类型为状态类型的数据则会将第三通信通道作为目标通信通道,以便通过第三通信通道传输该待传输数据。若识别到类型为 非状态类型的数据(其中,非状态类型的数据可以理解为业务数据),则会识别当前的数据传输模式,若当前为前述的第一数据传输模式,则会直接确定第一通信通道为目标通信通道,进而将待传输数据存放到第一通信通道对应的第一发送缓冲区。若当前为前述的第二数据传输模式,则会通过其中的第一数据选择器来确定待传输数据是否为实时类型的数据,若为实时类型的数据,第一数据选择器则可以将待传输数据传输给插队模块,以便插队模块存放到第二通信通道对应的第二发送缓冲区。
若为非实时类型的数据,则会进一步的将待传输数据传输到第二数据选择器,进而第二数据传输器可以根据前述的方式来确定是将待传输数据存放到第一发送缓冲区,还是将待传输数据拆分为存放到第一发送缓冲区的第一部分,以及存放到第二发送缓冲区的第二部分。
需要说明的是,在本实施例中,可以预先配置有实时类型的数据的标识表以及顺序依赖标识表。可选的,第一数据选择器可以在获取到待传输数据后,在该实时类型的数据的标识表中查询是否有该待传输数据的标识,若查询到有,则确定待传输数据为实时类型的数据。再者,在确定待传输数据为实时类型的数据时,可以再进一步通过顺序依赖标识表查询待传输数据是否可以插队到第二通信通道中最靠前的传输位置进行传输。可选的,若检测到待传输数据还需要依赖第一缓冲区或者第二缓冲区中还未发送的数据,则即使识别到待传输数据为实时类型的数据,依然不会插队到第二通信通道中最靠前的传输位置进行传输,而是会配置到所依赖的未发送的数据之后进行传输。
本申请提供的一种核间通信方法,可以先获取待传输数据的类型,对于状态类型数据则可以直接通过第三通信通道进行传输,而对于非状态类型的数据则可以再结合当前的数据传输模式来确定对应的目标通信通道,进而通过上述方式可以使得需要在第一核和第二核之间传输数据时,可以通过所需传输数据适配的通信通道来传输待传输数据,进而提升了在双核之间的通信方式的灵活性,并且对于不同类型的数据可以通过不同的通信通道来进行传输,有利于是的不同类型的数据传输相互隔离,避免造成干扰,进而提升数据传输的速率的同时还提升了数据传输的稳定性。
请参阅图12,本申请实施例提供的一种核间通信装置400,运行于电子设备,所述电子设备至少包括第一核以及第二核,所述第一核和所述第二核之间有多条通信通道,且所述多条通信通道各自的通信性能不同,所述装置400包括:
数据获取单元510,用于获取待传输数据,所述待传输数据为在所述第一核和所述第二核之间传输的数据;
通道选择单元520,用于从所述多条通信通道中获取所述待传输数据对应的通信通道,作为目标通信通道;
数据通信单元530,用于通过所述目标通信通道传输所述待传输数据。
作为一种方式,通道选择单元520,具体用于获取当前的数据传输模式;
基于所述数据传输模式从所述多条通信通道中确定所述待传输数据对应的通信通道,作为目标通信通道。
其中,可选的,所述通信性能包括数据传输速率和传输实时性。对应的,通道选择单元520,具体用于若当前为第一数据传输模式,将所述多条通信通道中的第一通信通道作为目标通信通道;若当前为第二数据传输模式,获取所述待传输数据的数据类型;基于所述数据类型从所述多条通信通道中确定所述待传输数据对应的通信通道,作为目标通信通道;其中,所述第一通信通道的数据传输速率高于所述第二通信通道的数据传输速率,所述第二通信通道的传输实时性高于所述第一通信通道的传输实时性。其中,所述第一通信通道的数据传输速率高于所述第二通信通道的数据传输速率,所述第二通信通道的传输实时性高于所述第一通信通道的传输实时性。
其中,可选的,通道选择单元520,具体用于若所述待传输数据为实时类型的数据,将所述第二通信通道作为目标通信通道;若所述待传输数据为非实时类型的数据,至少将所述第一通信通道作为目标通信通 道。
通道选择单元520,具体用于若所述待传输数据为非实时类型的数据,获取所述第二通信通道的占用程度;若所述占用程度高于占用程度阈值,将所述第一通信通道作为目标通信通道;若所述占用程度不高于所述占用程度阈值,将所述待传输数据拆分为第一部分和第二部分,所述第一部分和第二部分分别对应有用于按顺序重组的编号;将所述第一通信通道作为所述第一部分的目标通信通道,以及将所述第二通信通道作为所述第二部分的目标通信通道。
再者,通道选择单元520,还具体用于若当前为第二数据传输模式且所述待传输数据为实时数据,将所述待传输数据配置到所述第二通信通道的发送缓冲区中最靠前的传输位置进行传输。
其中,作为一种方式,通道选择单元520,具体用于获取发送缓冲区的使用率;基于所述使用率确定当前的数据传输模式。可选的,通道选择单元520,具体用于若所述使用率大于使用率阈值,确定当前为所述第一数据传输模式;若所述使用率不大于所述使用率阈值,确定当前为所述第二数据传输模式。
还有,作为一种方式,通道选择单元520,具体用于若所述待传输数据为状态类型数据,从所述多条通信通道中获取第三通信通道作为目标通信通道。
本申请提供的一种核间通信装置,通过上述方式可以使得需要在第一核和第二核之间传输数据时,可以通过所需传输数据适配的通信通道来传输待传输数据,进而提升了在双核之间的通信方式的灵活性。并且,在本实施例中的多条通信通道中的第一通信通道具有数据传输速率高,第二通信通道具有传输实时性高的特点,进而使得可以根据当前的数据传输模式来选择是通过第一通信通道来进行数据传输,还是通过第二通信通道来进行数据传输,以提升数据传输有较高灵活性的同时,也可以具有好的传输实时性和传输速率。
本申请实施例提供的一种电子组件,包括第一核以及第二核,所述第一核和所述第二核之间有多条通信通道,且所述多条通信通道各自的通信性能不同;
所述第一核,用于获取待传输数据;从所述多条通信通道中获取所述待传输数据对应的通信通道作为目标通信通道;通过所述目标通信通道传输所述待传输数据到所述第二核。
本申请提供的一种电子组件,通过上述方式可以使得需要在第一核和第二核之间传输数据时,可以通过所需传输数据适配的通信通道来传输待传输数据,进而提升了在双核之间的通信方式的灵活性。
需要说明的是,本申请中装置实施例以及电子组件实施例与前述方法实施例是相互对应的,装置实施例以及电子组件实施例中具体的原理可以参见前述方法实施例中的内容,此处不再赘述。
下面将结合图13对本申请提供的一种电子设备进行说明。
请参阅图13,基于上述的核间通信方法,本申请实施例还提供的另一种包括可以执行前述核间通信方法电子设备200。该电子设备200可以为智能手环、智能手表等穿戴设备,也可以为智能手机以及平板电脑等。
电子设备200包括处理器102、存储器104、网络模块106以及微控制单元108(MCU)。其中,该存储器104中存储有可以执行前述实施例中内容的程序,而处理器102可以执行该存储器104中存储的程序。其中的处理器102的内部结构可以如图1所示。
其中,处理器102可以包括一个或者多个用于处理数据的核以及消息矩阵单元。处理器102利用各种接口和线路连接整个电子设备200内的各个部分,通过运行或执行存储在存储器104内的指令、程序、代码集或指令集,以及调用存储在存储器104内的数据,执行电子设备200的各种功能和处理数据。可选地,处理器102可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器102可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界 面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器102中,单独通过一块通信芯片进行实现。
存储器104可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory,ROM)。存储器104可用于存储指令、程序、代码、代码集或指令集。存储器104可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。例如,存储器104中可以存储有进行核间通信的装置。其中,该进行核间通信的装置可以为前述的装置400。存储数据区还可以存储终端100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。
所述网络模块106用于接收以及发送电磁波,实现电磁波与电信号的相互转换,从而与通讯网络或者其他设备进行通讯,例如和音频播放设备进行通讯。所述网络模块106可包括各种现有的用于执行这些功能的电路元件,例如,天线、射频收发器、数字信号处理器、加密/解密芯片、用户身份模块(SIM)卡、存储器等等。所述网络模块106可与各种网络如互联网、企业内部网、无线网络进行通讯或者通过无线网络与其他设备进行通讯。上述的无线网络可包括蜂窝式电话网、无线局域网或者城域网。例如,网络模块106可以与基站进行信息交互。
请参考图14,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质1100中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。
计算机可读存储介质1100可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质1100包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质1100具有执行上述方法中的任何方法步骤的程序代码1110的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码1110可以例如以适当形式进行压缩。
综上所述,本申请提供的一种核间通信方法、装置、电子组件、电子设备以及存储介质,在电子设备至少包括第一核以及第二核,所述第一核和所述第二核之间有多条通信通道,且所述多条通信通道各自的通信性能不同的情况下,在获取到在所述第一核和所述第二核之间传输的待传输数据后,可以从多条通信通道中选择与待传输数据对应的通信通道作为目标通信通道,进而通过所述目标通信通道传输所述待传输数据。从而通过上述方式可以使得需要在第一核和第二核之间传输数据时,可以通过所需传输数据适配的通信通道来传输待传输数据,进而提升了在双核之间的通信方式的灵活性。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (20)

  1. 一种核间通信方法,其特征在于,应用于电子设备,所述电子设备至少包括第一核以及第二核,所述第一核和所述第二核之间有多条通信通道,且所述多条通信通道各自的通信性能不同,所述方法包括:
    获取待传输数据,所述待传输数据为在所述第一核和所述第二核之间传输的数据;
    从所述多条通信通道中获取所述待传输数据对应的通信通道,作为目标通信通道;
    通过所述目标通信通道传输所述待传输数据。
  2. 根据权利要求1所述的方法,其特征在于,所述从所述多条通信通道中获取所述待传输数据对应的通信通道,作为目标通信通道,包括:
    获取当前的数据传输模式;
    基于所述数据传输模式从所述多条通信通道中确定所述待传输数据对应的通信通道,作为目标通信通道。
  3. 根据权利要求2所述的方法,其特征在于,所述多条通信通道包括第一通信通道和第二通信通道,所述基于所述数据传输模式从所述多条通信通道中确定所述待传输数据对应的通信通道,作为目标通信通道,包括:
    若当前为第一数据传输模式,将所述多条通信通道中的第一通信通道作为目标通信通道;
    若当前为第二数据传输模式,获取所述待传输数据的数据类型;
    基于所述数据类型从所述多条通信通道中确定所述待传输数据对应的通信通道,作为目标通信通道;
    其中,所述第一通信通道的数据传输速率高于所述第二通信通道的数据传输速率,所述第二通信通道的传输实时性高于所述第一通信通道的传输实时性。
  4. 根据权利要求3所述的方法,其特征在于,所述基于所述数据类型从所述多条通信通道中确定所述待传输数据对应的通信通道,作为目标通信通道,包括:
    若所述待传输数据为实时类型的数据,将所述第二通信通道作为目标通信通道;
    若所述待传输数据为非实时类型的数据,至少将所述第一通信通道作为目标通信通道。
  5. 根据权利要求4所述的方法,其特征在于,所述若所述待传输数据为非实时类型的数据,至少将所述第一通信通道作为目标通信通道,包括:
    若所述待传输数据为非实时类型的数据,获取所述第二通信通道的占用程度;
    若所述占用程度高于占用程度阈值,将所述第一通信通道作为目标通信通道;
    若所述占用程度不高于所述占用程度阈值,将所述待传输数据拆分为第一部分和第二部分,所述第一部分和第二部分分别对应有用于按顺序重组的编号;
    将所述第一通信通道作为所述第一部分的目标通信通道,以及将所述第二通信通道 作为所述第二部分的目标通信通道。
  6. 根据权利要求3或4所述的方法,其特征在于,所述通过所述目标通信通道传输所述待传输数据,包括:
    若所述待传输数据为实时类型的数据,将所述待传输数据配置到所述第二通信通道的发送缓冲区中最靠前的传输位置进行传输。
  7. 根据权利要求3-6任一所述的方法,其特征在于,所述第一通信通道包括用于第一核与所述第二核之间传输数据的数据线路,控制第一核主动向第二核发送数据的第一时序线路,以及用于控制第二核主动向第一核发送数据的第二时序线路。
  8. 根据权利要求2所述的方法,其特征在于,所述获取当前的数据传输模式,包括:
    获取发送缓冲区的使用率;
    基于所述使用率确定当前的数据传输模式。
  9. 根据权利要求8所述的方法,其特征在于,所述基于所述使用率确定当前的数据传输模式,包括:
    若所述使用率大于使用率阈值,确定当前为第一数据传输模式;
    若所述使用率不大于所述使用率阈值,确定当前为第二数据传输模式。
  10. 根据权利要求1-3任一所述的方法,其特征在于,所述多条通信通道还包括第三通道,所述获取当前的数据传输模式之前还包括:
    若所述待传输数据为状态类型数据,从所述多条通信通道中获取所述第三通信通道作为目标通信通道;
    若所述待传输数据为非状态类型数据,执行所述获取当前的数据传输模式。
  11. 根据权利要求10所述的方法,其特征在于,所述第三通信通道包括有第一核向第二核请求所述第二核的工作状态以及寄存器状态的第三线路,以及第二核向第一核输出日志数据的第四线路。
  12. 一种核间通信装置,其特征在于,运行于电子设备,所述电子设备至少包括第一核以及第二核,所述第一核和所述第二核之间有多条通信通道,且所述多条通信通道各自的通信性能不同,所述装置包括:
    数据获取单元,用于获取待传输数据,所述待传输数据为在所述第一核和所述第二核之间传输的数据;
    通道选择单元,用于从所述多条通信通道中获取所述待传输数据对应的通信通道,作为目标通信通道;
    数据通信单元,用于通过所述目标通信通道传输所述待传输数据。
  13. 一种电子组件,其特征在于,包括第一核、第二核以及所述第一核和所述第二核之间的多条通信通道,且所述多条通信通道各自的通信性能不同;
    所述第一核,用于获取待传输数据;从所述多条通信通道中获取所述待传输数据对应的通信通道作为目标通信通道;通过所述目标通信通道传输所述待传输数据到所述第二核。
  14. 根据权利要求13所述的电子组件,其特征在于,所述第一核,具体用于获取当前的数据传输模式;基于所述数据传输模式从所述多条通信通道中确定所述待传输数据对应的通信通道,作为目标通信通道。
  15. 根据权利要求13或14所述的电子组件,其特征在于,所述多条通信通道包括第一通信通道和第二通信通道;
    所述第一核,具体用于若当前为第一数据传输模式,将所述多条通信通道中的第一通信通道作为目标通信通道;
    若当前为第二数据传输模式,获取所述待传输数据的数据类型;
    基于所述数据类型从所述多条通信通道中确定所述待传输数据对应的通信通道,作为目标通信通道;
    其中,所述第一通信通道的数据传输速率高于所述第二通信通道的数据传输速率,所述第二通信通道的传输实时性高于所述第一通信通道的传输实时性。
  16. 根据权利要求15所述的电子组件,其特征在于,所述第一通信通道包括用于所述第一核与所述第二核之间传输数据的数据线路,控制第一核主动向第二核发送数据的第一时序线路,以及用于控制第二核主动向第一核发送数据的第二时序线路。
  17. 根据权利要求13-16任一所述的电子组件,其特征在于,所述多条通信通道还包括第三通道,所述第一核,具体用于若所述待传输数据为状态类型数据,从所述多条通信通道中获取所述第三通信通道作为目标通信通道;若所述待传输数据为非状态类型数据,执行所述获取当前的数据传输模式。
  18. 根据权利要求17所述的电子组件,其特征在于,所述第三通信通道包括有第一核向第二核请求所述第二核的工作状态以及寄存器状态的第三线路,以及第二核向第一核输出日志数据的第四线路。
  19. 一种电子设备,其特征在于,包括第一核、第二核以及存储器;
    一个或多个程序被存储在所述存储器中并被配置为由所述第一核以及第二核执行以实现权利要求1-10任一所述的方法。
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有程序代码,其中,在所述程序代码被第一核以及第二核运行时执行权利要求1-10任一所述的方法。
PCT/CN2021/097310 2020-08-18 2021-05-31 核间通信方法、装置、电子组件以及电子设备 Ceased WO2022037176A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21857277.4A EP4203548A4 (en) 2020-08-18 2021-05-31 Inter-core communication method and apparatus, electronic assembly, and electronic device
US18/148,417 US12399859B2 (en) 2020-08-18 2022-12-29 Inter-processor communication method, electronic assembly, and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010832873.4 2020-08-18
CN202010832873.4A CN114077568B (zh) 2020-08-18 2020-08-18 核间通信方法、装置、电子组件以及电子设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/148,417 Continuation US12399859B2 (en) 2020-08-18 2022-12-29 Inter-processor communication method, electronic assembly, and electronic device

Publications (1)

Publication Number Publication Date
WO2022037176A1 true WO2022037176A1 (zh) 2022-02-24

Family

ID=80281555

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/097310 Ceased WO2022037176A1 (zh) 2020-08-18 2021-05-31 核间通信方法、装置、电子组件以及电子设备

Country Status (4)

Country Link
US (1) US12399859B2 (zh)
EP (1) EP4203548A4 (zh)
CN (2) CN114077568B (zh)
WO (1) WO2022037176A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114595182A (zh) * 2022-03-03 2022-06-07 珠海昇生微电子有限责任公司 一种多通信串口双向转换电路及方法
CN115827269A (zh) * 2022-11-18 2023-03-21 北醒(北京)光子科技有限公司 核间通信通道构建方法、装置、存储介质及激光雷达

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114780505A (zh) * 2022-03-29 2022-07-22 深圳市禾望电气股份有限公司 数据及文件交互方法
CN117370261A (zh) * 2022-06-30 2024-01-09 深圳市中兴微电子技术有限公司 数据传输的方法、多核芯片
CN117149696A (zh) * 2023-08-23 2023-12-01 鹏城实验室 核间通信方法、装置、电子设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101788973A (zh) * 2010-01-12 2010-07-28 深圳市同洲电子股份有限公司 双处理器之间进行通信的方法
CN101860894A (zh) * 2010-03-04 2010-10-13 宇龙计算机通信科技(深圳)有限公司 一种移动终端处理器间通讯的系统、方法及移动终端
US20160210255A1 (en) * 2015-01-16 2016-07-21 Oracle International Corporation Inter-processor bus link and switch chip failure recovery
CN110647494A (zh) * 2019-10-09 2020-01-03 盛科网络(苏州)有限公司 多处理器通信方法及装置

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4787028A (en) * 1985-09-03 1988-11-22 Ncr Corporation Multicommunication protocol controller
US6990534B2 (en) * 2001-07-20 2006-01-24 Flowfinity Wireless, Inc. Method for a proactive browser system for implementing background frame maintenance and asynchronous frame submissions
WO2004034676A1 (en) * 2002-10-08 2004-04-22 Koninklijke Philips Electronics N.V. Integrated circuit and method for establishing transactions
CN100485648C (zh) * 2004-11-30 2009-05-06 天津曙光计算机产业有限公司 一种片上系统
US7920474B2 (en) * 2007-10-08 2011-04-05 Samsung Electronics Co., Ltd. System and method for context-based hierarchical adaptive round robin scheduling
CN101610305A (zh) * 2008-12-19 2009-12-23 Tcl数码科技(深圳)有限责任公司 利用串口通讯实现手机对dv遥控操作的方法
US20110173352A1 (en) * 2010-01-13 2011-07-14 Mellanox Technologies Ltd Power Reduction on Idle Communication Lanes
JP4913913B2 (ja) * 2010-04-28 2012-04-11 新日鉄ソリューションズ株式会社 情報処理システム、情報処理方法及びプログラム
US9495690B2 (en) * 2012-04-04 2016-11-15 Visa International Service Association Systems and methods to process transactions and offers via a gateway
WO2015081490A1 (zh) 2013-12-03 2015-06-11 华为技术有限公司 一种核间进程通信的方法、装置及系统
CN103654855B (zh) * 2013-12-19 2015-06-03 海信集团有限公司 一种超声设备及其异常检测及恢复方法
CN104933009A (zh) * 2015-04-29 2015-09-23 中国人民解放军国防科学技术大学 一种用于多核dsp间的片上通信方法及数据通信装置
US11016742B2 (en) * 2015-06-24 2021-05-25 Altera Corporation Channel sizing for inter-kernel communication
US10033702B2 (en) * 2015-08-05 2018-07-24 Intralinks, Inc. Systems and methods of secure data exchange
CN108920392A (zh) 2018-05-17 2018-11-30 歌尔科技有限公司 一种数据接口与spi的转换装置及方法
CN110764924A (zh) * 2018-07-27 2020-02-07 普天信息技术有限公司 一种多核处理器的核间通信方法及装置
CN111026697A (zh) * 2019-11-21 2020-04-17 Oppo广东移动通信有限公司 核间通信方法、系统、电子器件以及电子设备
CN111427815A (zh) * 2020-03-05 2020-07-17 深圳震有科技股份有限公司 一种基于spi接口的核间通讯方法、终端及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101788973A (zh) * 2010-01-12 2010-07-28 深圳市同洲电子股份有限公司 双处理器之间进行通信的方法
CN101860894A (zh) * 2010-03-04 2010-10-13 宇龙计算机通信科技(深圳)有限公司 一种移动终端处理器间通讯的系统、方法及移动终端
US20160210255A1 (en) * 2015-01-16 2016-07-21 Oracle International Corporation Inter-processor bus link and switch chip failure recovery
CN110647494A (zh) * 2019-10-09 2020-01-03 盛科网络(苏州)有限公司 多处理器通信方法及装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114595182A (zh) * 2022-03-03 2022-06-07 珠海昇生微电子有限责任公司 一种多通信串口双向转换电路及方法
CN115827269A (zh) * 2022-11-18 2023-03-21 北醒(北京)光子科技有限公司 核间通信通道构建方法、装置、存储介质及激光雷达
CN115827269B (zh) * 2022-11-18 2024-04-12 北醒(北京)光子科技有限公司 核间通信通道构建方法、装置、存储介质及激光雷达

Also Published As

Publication number Publication date
EP4203548A1 (en) 2023-06-28
CN114077568A (zh) 2022-02-22
US20230140279A1 (en) 2023-05-04
CN120011107A (zh) 2025-05-16
US12399859B2 (en) 2025-08-26
EP4203548A4 (en) 2023-12-20
CN114077568B (zh) 2025-02-14

Similar Documents

Publication Publication Date Title
WO2022037176A1 (zh) 核间通信方法、装置、电子组件以及电子设备
CN111163018B (zh) 网络设备及其降低传输时延的方法
CN111191777A (zh) 一种神经网络处理器及其控制方法
CN115379512B (zh) 带宽调整方法及装置、电子设备、计算机可读存储介质
WO2020150954A1 (zh) 基于spi异步处理事件的方法、装置及存储介质
CN112218339A (zh) 一种中继传输调度方法、装置、存储介质及电子设备
US20200004613A1 (en) Broadcast Queue Adjustment Method, Terminal, and Storage Medium
CN111026697A (zh) 核间通信方法、系统、电子器件以及电子设备
CN110297722A (zh) 线程任务通信方法及相关产品
CN110597643B (zh) 核间通信方法、处理器以及电子设备
CN106954191B (zh) 广播发送方法、装置和终端设备
CN111078619B (zh) 一种转换装置、网络设备及数据传输方法
US20250240341A1 (en) Method for transmitting file, terminal device and storage medium
CN107870921A (zh) 一种日志数据处理方法及装置
CN114885393B (zh) 一种设备入网的控制方法、装置及终端设备
CN116627886A (zh) 核间通信方法及其设备
CN116233977B (zh) 网络设备管理方法、装置及存储介质
CN113038438A (zh) 一种网关的数据传输方法、装置、网关和存储介质
WO2021087909A1 (zh) 信号传输方法、装置、移动终端以及存储介质
CN115004643B (zh) 权限配置方法、装置、节点设备以及数据处理系统
CN115714992B (zh) 数据传输方法及装置
CN113806053B (zh) 一种任务调度的方法、装置、及计算机可读存储介质
CN114567625B (zh) 基于安卓Http服务的无线电监测设备控制处理系统、方法、装置、处理器及其存储介质
CN112433962A (zh) 数据传输电路及方法、核、芯片、电子设备及存储介质
CN109947533B (zh) Windows实时性增强的虚拟无线电实现装置、方法、介质、及终端

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21857277

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2021857277

Country of ref document: EP

Effective date: 20230320