Inter-core communication method and device, chip and electronic equipment

By using device communication structures and response message mechanisms in multi-core heterogeneous systems, the problems of low data access efficiency and timeout of device processing function return results in inter-core communication are solved, and efficient inter-core communication and hardware domain access are achieved.

CN118796752APending Publication Date: 2024-10-18BEIJING SEMIDRIVE TECHNOLOGY LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410769047.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Existing inter-core communication methods in multi-core heterogeneous systems have problems such as low data access efficiency, busy status and inconsistency between upper and lower layers caused by device processing function return result timeout, which affects the access efficiency of the hardware domain.

Method used

By introducing a device communication structure into a multi-core heterogeneous system, including device identification, device-related functions and tasks, the second processor core determines the task based on the device identification in the first command and sends a response message before the execution of the device-related functions ends. , ensuring the synchronization and efficiency of inter-core communication.

Benefits of technology

It improves the performance of cross-hardware domain data access, keeps the inter-core communication interface in a non-busy state, ensures the parallel execution and response consistency of device processing functions, and improves the efficiency of multi-device cross-hardware domain access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796752A_ABST
    Figure CN118796752A_ABST
Patent Text Reader

Abstract

The invention provides an inter-core communication method, the method is applied to a multi-core heterogeneous system at least comprising a first processor core and a second processor core, and the method comprises the following steps: the second processor core receives a first command sent by the first processor core; the second processor core determines a task based on a device identifier carried in the first command; the second processor core awakens the task and executes an equipment related function corresponding to the task based on the task; the second processor core sends a first response message before the execution of the device-related function is ended; the first response message is used for indicating that the second processor core is in a state capable of responding to a second command.
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 inter-core communication methods, devices, chips and electronic devices. Background Art

[0002] System on Chip (SoC) can be composed of multiple single-core processors or multi-core processors. SoC can include multiple hardware domains, each of which runs an operating system. There is a need for data interaction between hardware domains (operating systems), such as one hardware domain (operating system) of SoC needs to access the data of another hardware domain (operating system) of SoC. Therefore, improving the data access performance across hardware domains is an urgent problem to be solved. Summary of the invention

[0003] The embodiments of the present application provide an inter-core communication method, device, chip and electronic device, which can.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] In a first aspect, an embodiment of the present application provides an inter-core communication method, the method being applied to a multi-core heterogeneous system including at least a first processor core and a second processor core, the method comprising:

[0006] The second processor core receives a first command sent by the first processor core;

[0007] The second processor core determines a task based on the device identifier carried in the first command;

[0008] Waking up the task, and executing a device-related function corresponding to the task based on the task;

[0009] Before the execution of the device-related function ends, a first response message is sent; the first response message is used to indicate that the second processor core is in a state capable of responding to a second command.

[0010] In some optional embodiments, the method further includes: the second processor core registering a device communication structure, the device communication structure including a device identifier, device-related functions and tasks; each of the tasks is used to execute a device-related function uniquely corresponding to the task.

[0011] In some optional embodiments, the second processor core determines the task based on the device identifier carried in the first command, including: the second processor core determines the task corresponding to the device identifier based on the device communication structure.

[0012] In some optional embodiments, the method further includes: the second processor core receiving a second command sent by the first processor core.

[0013] In some optional embodiments, the method further includes: the second processor core sending a second response message to the first processor core, where the second response message is used to indicate that the execution of the device-related function is completed.

[0014] In some optional embodiments, the method further includes: the second processor core receiving a first counter command, the first counter command being sent by the first processor core when the first processor core does not receive a second response message corresponding to the first command within a preset time;

[0015] The second processor core determines, based on the first anti-command, a return value of a device-related function corresponding to the first command;

[0016] If the return value indicates that the device-related function returns successfully, controlling the device-related function to return to a state of waiting for command execution;

[0017] If the return value indicates that the device-related function returns failure, the device-related function is controlled to execute resource recycling.

[0018] In a second aspect, an embodiment of the present application provides an inter-core communication method, the method being applied to a multi-core heterogeneous system including at least a first processor core and a second processor core, the method comprising:

[0019] The first processor core sends the first command in the command queue to the second processor core;

[0020] The first processor core receives a first response message, where the first response message is used to indicate that the second processor core is in a state capable of responding to a second command.

[0021] In some optional embodiments, the method further includes: the first processor core receiving a second command sending request sent by a second application;

[0022] The first processor core sends a second command to the second processor core based on the second command sending request.

[0023] In some optional embodiments, the method further includes: if the first processor core does not receive a second response message corresponding to the first command within a preset time, the second response message being used to indicate that the execution of the device-related function corresponding to the first command is finished, the first processor core sending a first counter command to the second processor core;

[0024] The first anti-command is used by the second processor core to determine a return value of a device-related function corresponding to the first command.

[0025] In a third aspect, an embodiment of the present application provides an inter-core communication device, on which a multi-core heterogeneous system runs, and the device includes a first processor core and a second processor core;

[0026] The second processor core is configured to receive a first command sent by the first processor core; and determine a task based on a device identifier carried in the first command;

[0027] Waking up the task, and executing a device-related function corresponding to the task based on the task;

[0028] Before the execution of the device-related function ends, a first response message is sent; the first response message is used to indicate that the second processor core is in a state capable of responding to a second command.

[0029] In a fourth aspect, an embodiment of the present application provides a chip, the chip comprising: a processor, a memory, and a bus;

[0030] The memory stores executable instructions;

[0031] The processor communicates with the memory via the bus, and the above-mentioned inter-core communication method is implemented when the processor executes the executable instructions stored in the memory.

[0032] In a fifth aspect, an embodiment of the present application provides a component on a transportation device, wherein the component includes a chip, and the chip can implement the above-mentioned inter-core communication method.

[0033] In a sixth aspect, an embodiment of the present application provides an electronic device, wherein the electronic device includes a chip, and the chip can implement the above-mentioned inter-core communication method.

[0034] The inter-core communication method provided by the embodiment of the present application includes: the method is applied to a multi-core heterogeneous system including at least a first processor core and a second processor core, and the method includes: the second processor core receives a first command sent by the first processor core; the second processor core determines a task based on a device identifier carried in the first command; wakes up the task, and executes a device-related function corresponding to the task based on the task; before the execution of the device-related function is completed, sends a first response message; the first response message is used to indicate that the second processor core is in a state capable of responding to a second command. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is a schematic diagram of an optional processing flow of a method for executing inter-core communication by a second processor core provided in an embodiment of the present application;

[0036] Figure 2 It is another optional processing flow diagram of the second processor core executing the inter-core communication method provided in the embodiment of the present application;

[0037] Figure 3 It is a schematic diagram of another optional processing flow of the second processor core executing the inter-core communication method provided in the embodiment of the present application;

[0038] Figure 4 This is a schematic diagram of an optional processing flow of a method for performing inter-core communication by a first processor core provided in an embodiment of the present application;

[0039] Figure 5 It is another optional processing flow diagram of the first processor core executing the inter-core communication method provided in the embodiment of the present application;

[0040] Figure 6 This is another optional processing flow diagram of the first processor core executing the inter-core communication method provided in the embodiment of the present application;

[0041] Figure 7 is a schematic diagram of a model for implementing an inter-core communication method provided in an embodiment of the present application;

[0042] Figure 8 It is a schematic diagram of a model of an inter-core communication method in the related art;

[0043] Fig. 9 It is a schematic diagram of the architecture of the inter-core communication method provided in the embodiment of the present application;

[0044] Fig.10 It is a detailed processing flow diagram of the inter-core communication method provided in an embodiment of the present application;

[0045] Fig.11 This is a schematic diagram of the structure of an inter-core communication device provided in an embodiment of the present application;

[0046] Fig.12 It is a schematic diagram of the structure of the chip provided in the embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0048] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0049] In the following description, the terms "first\second" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0051] It should be understood that in the various embodiments of the present application, the size of the serial number of each implementation process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0052] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0053] 1) In the embodiment of the present application, the SoC chip can be a multi-core heterogeneous chip. A multi-core heterogeneous chip refers to a chip with two or more processor cores integrated in a single chip. Each processor core can act as an independent processor and independently run the instructions stored in the memory corresponding to the processor core. Multi-core heterogeneous chips can bring more combined advantages such as performance, cost, power consumption, and size. Different architectures perform their respective duties and each plays the unique advantages of the original architecture.

[0054] The multi-core heterogeneous chip in the embodiment of the present application can be applied to transportation equipment, including but not limited to balancing vehicles, cars, buses, subways, trains, and airplanes.

[0055] 2) Hardware domain, which is a set of hardware collections, which may include hardware resources such as processor cores, interrupt controllers, clock controllers and memories; the number of processor cores in the hardware collection can be one or more; one hardware domain runs one operating system, and different hardware domains can run different operating systems.

[0056] The IP cores in each hardware domain are divided into large cores and small cores. The large cores are suitable for running operating systems with high performance, while the small cores are suitable for running operating systems with low performance, high speed and greater security. Information is transmitted between different hardware domains through inter-core communication channels.

[0057] 3) Inter-core communication: There is a need for information communication between different hardware domains. The communication method between hardware domains is called inter-core communication. Inter-core communication has more advantages than communication between chips. For example, it does not need to transmit data outside the chip, which greatly improves the security and speed of data transmission. There are many forms of inter-core communication, such as the Mailbox mechanism suitable for transmitting instructions and the shared memory mechanism suitable for sharing data.

[0058] Mailbox is a mechanism or data structure used for communication between different processing cores. It can be used to pass messages and trigger events between different processors, cores or hardware modules.

[0059] Mailbox can be viewed as a shared, bidirectional communication interface that contains one or more registers for storing messages or control information. The sender can write messages into the registers of the Mailbox, and the receiver can read these messages and process them accordingly. That is, the sender can control the receiver or instruct the receiver to perform corresponding operations by writing messages or control information into the registers of the Mailbox.

[0060] In semiconductor chips, Mailbox is often used for communication between processors, such as between multi-core processors, SoCs, or multiple independent functional modules. Through the Mailbox mechanism, different processing units can work together, share data, synchronize operations, and trigger events, thereby achieving more efficient system collaboration and resource sharing.

[0061] It should be noted that the implementation of Mailbox may vary depending on the chip architecture, communication protocol or design requirements, but in general, it exists to achieve reliable and efficient communication and data exchange between processing units.

[0062] 4) The RPMsg (Remote Processor Messaging) protocol defines a standardized binary interface for communication between multiple hardware domains in a heterogeneous multi-core system; RPMsg is a message passing bus that allows kernel drivers to communicate with remote processors available on the system.

[0063] In the related art, when cross-hardware domain access is implemented based on Rpmsg, the handler of the Rpmsg model device is implemented through the serial port, and the Rpmsg model device is in a busy state most of the time, which makes the access efficiency of the hardware domain low. When the processing function of a device does not return the processing result, the processing functions of other devices cannot be executed and an exception occurs, which reduces the access efficiency of the hardware domain. In addition, when implementing cross-hardware domain access based on Rpmsg, there is also the problem of inconsistency between the upper and lower layers of Rpmsg communication; for example, when turning on a device, if the Rpmsg client does not receive a timeout message from the Rpmsg server within N1 time, the upper layer of the Rpmsg client believes that the device has failed to be turned on. However, the lower layer of the Rpmsg client may successfully turn on the device after exceeding N1 time.

[0064] The inter-core communication method provided in the embodiment of the present application can at least solve the above problems.

[0065] The inter-core communication method provided in the embodiment of the present application is applied to a multi-core heterogeneous system including at least a first processor core and a second processor core, and the second processor core executes an optional processing flow diagram of the inter-core communication method, such as Figure 1 As shown, at least the following steps are included:

[0066] Step S101: The second processor core receives a first command sent by the first processor core.

[0067] In some embodiments, the Rpmsg service in the second processor core receives a first command sent by the Rpmsg client in the first processor core.

[0068] In some embodiments, before sending the first command, the Rpmsg client may store the first command in a command queue.

[0069] Step S102: The second processor core determines a task based on the device identifier carried in the first command.

[0070] In some embodiments, the first command carries a device ID, and different device IDs correspond to different devices. The specific implementation process of the second processor core determining the task based on the device ID carried in the first command includes: the Rpmsg service in the second processor core determines the task corresponding to the device ID based on the device communication structure (Device-Rpmsg structure).

[0071] In some embodiments, the device communication structure is registered by the second processor core, and the device communication structure includes the correspondence between the device identification, the device-related function (Device process) and the task. The task has a unique correspondence with the device-related function, and each task is used to execute the device-related function that uniquely corresponds to the task. Compared with the device communication structure in the related art, the device communication structure in the embodiment of the present application adds a "task" item, wherein the task can be called a task of a device-related function (Device process task), and the device communication structure is shown in Table 1 below. The device identification can be configured by the device client and the device server, and the device-related function can be a device handler, such as a device-related function used to obtain one or some attributes of the device. In the embodiment of the present application, a "task" item is added to the device communication structure, and the device-related function is executed based on the task or in the task, so that multiple commands are executed in parallel, and the communication efficiency across hardware domains is improved.

[0072] Table 1

[0073] Equipment identification Device related functions Task Device ID1 Device process1 Device process task1 Device ID2 Device process2 Device process task2 … … … Device IDN Device process Device process taskN

[0074] Step S103: the second processor core wakes up the task and executes a device-related function corresponding to the task based on the task.

[0075] In some embodiments, the Rpmsg service in the second processor core wakes up the task.

[0076] In the embodiment of the present application, multiple device-related functions can be executed synchronously by running multiple tasks in parallel, so that the interface of Rpmsg is in a non-busy (NoBusy) state, thereby improving the performance of Rpmsg multi-device cross-hardware domain access.

[0077] Step S104: before the execution of the device-related function ends, the second processor core sends a first response message; the first response message is used to indicate that the second processor core is in a state capable of responding to a second command.

[0078] In some embodiments, the second processor core may send the first response message to the first processor core while executing the device-related function; or may send the first response message to the first processor core after starting to execute the device-related function and before the execution of the device-related function ends. Specifically, the Rpmsg service in the second processor core sends the first response message to the Rpmsg client in the first processor core.

[0079] In a preferred embodiment, the second processor core may send a first response message to the first processor core before executing the device-related function. For example, the second processor core immediately sends the first response message to the first processor core after receiving the first command; or the second processor core sends the first response message to the first processor core after determining the task based on the device identification carried in the first command (i.e., step S102) and before executing the device-related function (i.e., step S103).

[0080] In an embodiment of the present application, after the second processor core sends a first response message to the first processor core, the first processor core can continue to send new commands to the second processor core, so that the second processor core can execute multiple device-related functions corresponding to multiple commands in parallel, thereby improving data access efficiency across hardware domains.

[0081] In the embodiment of the present application, since the first response message is used to indicate that the second processor core is in a state capable of responding to the second command, the first processor core can continue to send the second command to the second processor core, so that the second processor core synchronously executes the tasks corresponding to the first command and the second command, respectively, thereby improving the performance of Rpmsg multi-device cross-hardware domain access. Since each task is executed by its corresponding task-related function, when an exception occurs in a task-related function or a device corresponding to a task, the execution progress of another task is not affected.

[0082] The inter-core communication method provided in the embodiment of the present application is applied to a multi-core heterogeneous system including at least a first processor core and a second processor core, and another optional processing flow diagram of the second processor core executing the inter-core communication method, such as Figure 2 As shown, at least the following steps are included:

[0083] Step S201: The second processor core receives a first command sent by the first processor core.

[0084] Step S202: The second processor core determines a task based on the device identifier carried in the first command.

[0085] Step S203: the second processor core wakes up the task and executes a device-related function corresponding to the task based on the task.

[0086] Step S204: before the execution of the device-related function ends, the second processor core sends a first response message; the first response message is used to indicate that the second processor core is in a state capable of responding to a second command.

[0087] In the embodiment of the present application, the specific implementation process of steps S201 to S204 is the same as that of the above-mentioned steps S101 to S104, and will not be repeated here.

[0088] Step S205: The second processor core sends a second response message to the first processor core, where the second response message is used to indicate that the execution of the device-related function has ended.

[0089] In some embodiments, the Rpmsg service in the second processor core sends a second response message to the Rpmsgclient in the first processor core; when the Rpmsg client in the first processor core receives the second response message, it indicates that the first command has been executed by the second processor core.

[0090] The inter-core communication method provided in the embodiment of the present application is applied to a multi-core heterogeneous system including at least a first processor core and a second processor core, and the second processor core performs another optional processing flow diagram of the inter-core communication method, such as Figure 3 As shown, at least the following steps are included:

[0091] Step S301: The second processor core receives a first command sent by the first processor core.

[0092] Step S302: The second processor core determines a task based on the device identifier carried in the first command.

[0093] Step S303: the second processor core wakes up the task and executes a device-related function corresponding to the task based on the task.

[0094] Step S304: before the execution of the device-related function ends, the second processor core sends a first response message; the first response message is used to indicate that the second processor core is in a state capable of responding to a second command.

[0095] In the embodiment of the present application, the specific implementation process of steps S301 to S304 is the same as that of the above-mentioned steps S101 to S104, and will not be repeated here.

[0096] Step S305: The second processor core receives a first counter command, where the first counter command is sent by the first processor core when the first processor core does not receive a second response message corresponding to the first command within a preset time.

[0097] In some embodiments, if the first processing core does not receive the second response message within a preset time, the first processor core determines the device identification and sends a first counter command to the second processor core based on the device identification; wherein the first counter command may be the inverse operation of the first command.

[0098] The specific process of the first processor core determining the device identification may be: the first processor core prints the device identification of timeout.

[0099] Step S306: The second processor core determines a return value of a device-related function corresponding to the first command based on the first anti-command.

[0100] In some embodiments, after receiving the first counter command, the task corresponding to the first command in the second processor core searches for the return value of the device-related function.

[0101] Step S307: If the return value indicates that the device-related function returns successfully, control the device-related function to return to a state of waiting for command execution.

[0102] In some embodiments, if the return value indicates that the device-related function returns successfully, the task corresponding to the first command performs the inverse operation of the execution command to control the device-related function to return to the state before sending the command. The state before sending the command can also be called the waiting command execution state.

[0103] Step S308: If the return value indicates that the device-related function returns failed, control the device-related function to execute resource recycling.

[0104] In some embodiments, the device-dependent function in the second processor core performs internal resource reclamation.

[0105] Above Figures 1 to 3 In the illustrated embodiment, after sending the first response message, the second processor core can receive the second command sent by the first processor core; in the embodiment of the present application, the Rpmsg service in the second processor core has a response mutex lock to solve the problem of conflicting response messages for different devices.

[0106] Because the second processor core sends the first response message to the first processor core before the execution of the device-related function is completed, the Rpmsg client in the first processor core is in a non-busy (NoBusy) state, and the Rpmsg client can respond to the command sending request of the application. If the Rpmsg client does not receive the first response message, the Rpmsgclient cannot send a command to the second processor core, and the task corresponding to the command to be sent in the Rpmsg client is suspended.

[0107] Above Figures 1 to 3 The illustrated embodiment is a processing flow of a second processor core in a multi-core heterogeneous system implementing an inter-core communication method. The following describes a processing flow of a first processor core in a multi-core heterogeneous system implementing an inter-core communication method.

[0108] The inter-core communication method provided in the embodiment of the present application is applied to a multi-core heterogeneous system including at least a first processor core and a second processor core. The first processor core executes an optional processing flow diagram of the inter-core communication method, such as Figure 4 As shown, at least the following steps are included:

[0109] Step S401: The first processor core sends the first command in the command queue to the second processor core.

[0110] In some embodiments, the Rpmsg client in the first processor core receives a first command sending request sent by the first application, the first processor core stores the first command in a command queue, and sends the first command to the Rpmsg client in the second processor core. In some embodiments, the first command can be used to represent a request by the first application to obtain an attribute of the first device.

[0111] Step S402: The first processor core receives a first response message, where the first response message is used to indicate that the second processor core is capable of responding to a second command.

[0112] In some embodiments, the Rpmsg client in the first processor core receives a first response message sent by the Rpmsg service in the second processor core, and the first response message is used to indicate that the second processor core is in a state capable of responding to a second command. The Rpmsg client in the first processor core is in a non-busy (NoBusy) state, and the Rpmsg client can respond to a command sending request of an application.

[0113] In the embodiment of the present application, since the first response message is used to indicate that the second processor core is in a state capable of responding to the second command, the first processor core can continue to send the second command to the second processor core, so that the second processor core synchronously executes the tasks corresponding to the first command and the second command, respectively, thereby improving the performance of Rpmsg multi-device cross-hardware domain access. Since each task is executed by its corresponding task-related function, when an exception occurs in a task-related function or a device corresponding to a task, the execution progress of another task is not affected.

[0114] The inter-core communication method provided in the embodiment of the present application is applied to a multi-core heterogeneous system including at least a first processor core and a second processor core. The first processor core performs another optional processing flow diagram of the inter-core communication method, such as Figure 5 As shown, at least the following steps are included:

[0115] Step S501: The first processor core sends the first command in the command queue to the second processor core.

[0116] Step S502: The first processor core receives a first response message, where the first response message is used to indicate that the second processor core is capable of responding to a second command.

[0117] In some embodiments, the specific implementation process of step S501 to step S502 is the same as the specific implementation process of step S401 to step S402 described above, and will not be repeated here.

[0118] Step S503: The first processor core receives a second command sending request sent by the second application, and the first processor core sends a second command to the second processor core based on the second command sending request.

[0119] In some embodiments, the second command may be sent before the task corresponding to the first command is completed, so that the task corresponding to the first command and the task corresponding to the second command can be executed synchronously. In the embodiments of the present application, the synchronous execution of the first command and the second command is used as an example for explanation. In some scenarios, more than two commands can be executed synchronously, such as: before the first command of the second processor core is executed, the second command and the third command are executed simultaneously.

[0120] In the embodiment of the present application, the second processor core can execute multiple commands synchronously, thereby improving the communication efficiency across hardware domains.

[0121] The inter-core communication method provided in the embodiment of the present application is applied to a multi-core heterogeneous system including at least a first processor core and a second processor core. The first processor core performs another optional processing flow diagram of the inter-core communication method, such as Figure 6 As shown, at least the following steps are included:

[0122] Step S601: The first processor core sends the first command in the command queue to the second processor core.

[0123] Step S602: The first processor core receives a first response message, where the first response message is used to indicate that the second processor core is capable of responding to a second command.

[0124] In some embodiments, the specific implementation process of step S601 to step S602 is the same as the specific implementation process of step S401 to step S402 described above, and will not be repeated here.

[0125] Step S603, if the first processor core does not receive a second response message corresponding to the first command within a preset time, and the second response message is used to indicate that the execution of the device-related function corresponding to the first command is completed, the first processor core sends a first counter command to the second processor core.

[0126] The first anti-command is used by the second processor core to determine a return value of a device-related function corresponding to the first command.

[0127] In some embodiments, if the first processing core does not receive the second response message within a preset time, the first processor core determines the device identification and sends a first counter command to the second processor core based on the device identification; wherein the first counter command may be the inverse operation of the first command.

[0128] The second response message may further include the execution result of the first command; if the first command requests to obtain a certain attribute of the first device, the second response message may include the attribute value of the first device.

[0129] In some embodiments, if the first processor core does not receive the second response message corresponding to the first command within a preset time, the Rpmsg client in the first processor core sends a failure message to the upper layer of the Rpmsg client in the first processor core. In this way, the consistency between the upper layer and the lower layer of the Rpmsg client can be guaranteed.

[0130] In some embodiments, if the first processor core receives the second response message, the Rpmsg client in the first processor core searches for a task corresponding to the command in the queue and wakes up an application corresponding to the task.

[0131] The embodiments of the present application provide a method for implementing the ( Figures 1 to 6 Schematic diagram of the model of the inter-core communication method, as shown in Figure 7 As shown, the Rpmsg client in the first processor core sends a command to the Rpmsg server in the second processor core; the Rpmsg server determines the task based on the received command, and executes the corresponding device-related function based on the task. Before the execution of the device-related function is completed, the Rpmsg server sends a first response message to the Rpmsg client, and the first response message is used to indicate that the second processor core is in a state capable of responding to new commands. After the execution of the device-related function is completed, the Rpmsg server sends a second response message to the Rpmsg client, and the second response message may include the execution result of the command.

[0132] In the related art, a schematic diagram of a model of an inter-core communication method is shown in FIG. Figure 8As shown, the Rpmsg client in the first processor core sends a command to the Rpmsg server in the second processor core; the Rpmsg server executes the command and sends a response message to the Rpmsg client after the command execution is completed. Before the Rpmsg client receives the response message sent by the Rpmsg server, the Rpmsg channel is in the Busy state. In this scenario, when the Rpmsg client receives a new command request, the new command request will be suspended until the Rpmsg client receives the response message sent by the Rpmsg server, and then the Rpmsg client sends a new command to the Rpmsg server.

[0133] Therefore, the embodiments of the present application Figure 7 The model shown is similar to the related art Figure 8 Compared with the model shown in the figure, an operation is added in which the Rpmsg service sends a first response message to the Rpmsg client before the execution of the device-related function is completed. In this way, the Rpmsg client can continue to send new commands to the Rpmsg service, so that the Rpmsgservice synchronously executes the tasks corresponding to the two commands, thereby improving the performance of Rpmsg multi-device cross-hardware domain access.

[0134] The schematic diagram of the architecture of the inter-core communication method provided in the embodiment of the present application is as follows: Fig. 9 As shown, the first processor core is installed with a first application, a second application, ... an Nth application, each application corresponds to a device client, and the application only communicates with its corresponding device client; the first application corresponds to the first device client, the second application corresponds to the second device client, ... the Nth application corresponds to the Nth device client. Each device client communicates with the Rpmsg client.

[0135] Fig. 9 The second processor core shown includes multiple devices, such as a first device, a second device, ... an Nth device, each device corresponds to a device service, and the device only communicates with its corresponding device service; the first device corresponds to the first device service, the second device corresponds to the second device service, ... the Nth device program corresponds to the Nth device service. Each device service communicates with the Rpmsg service.

[0136] It should be noted that the device described in the embodiment of the present application is a hardware module on a processor core; Rpmsgservice and Rpmsg client are software modules located on different processor cores, and the software modules are used to implement communication between two hardware domains. Rpmsg service and Rpmsg client communicate through Mailbox. The device server and the device client are software modules located on different processor cores.

[0137] The inter-core communication method provided in the embodiment of the present application can be applied to smart cars. The SoC corresponding to the cockpit of the smart car includes at least two hardware domains, namely the hardware domain corresponding to the central control (IVI) of the smart car and the hardware domain corresponding to the instrument cluster of the smart car. The first application can be a navigation application running on the hardware domain corresponding to the central control, and the navigation application needs to obtain the attribute value of the first device in the hardware domain corresponding to the instrument cluster. In this scenario, the detailed processing flow diagram of the inter-core communication method provided in the embodiment of the present application is as follows: Fig.10 As shown, at least the following steps are included:

[0138] Step S701: The navigation application calls the interface of the device client on the hardware domain corresponding to the central control.

[0139] Step S702: the device client constructs a command according to the interface and the device identifier, and sends the command to the Rpmsg client.

[0140] Step S703: the Rpmsg client stores the command in a queue and sends the command to the Rpmsg server in the hardware domain corresponding to the meter.

[0141] Among them, steps S701 to S703 are all implemented by hardware or software on the hardware domain corresponding to the central control.

[0142] Step S704, after receiving the command, the Rpmsg server in the hardware domain corresponding to the instrument searches for the corresponding task in the device communication structure according to the device identifier, wakes up the task, and executes the corresponding device-related function in the task.

[0143] Step S705: The Rpmsg server sends a first response message to the Rpmsg client.

[0144] In some embodiments, the Rpmsg client receives the first response message, indicating that the Rpmsg client is in a non-busy state and can respond to a new command sending request.

[0145] If the Rpmsg client does not receive the first response message, after the Rpmsg client receives the command sending request from the application, the task corresponding to the command sending request will be suspended.

[0146] Step S706: The Rpmsg server sends a second response message to the Rpmsg client.

[0147] In some embodiments, the second response message carries the attribute value of the first device in the hardware domain corresponding to the meter, and the second response message is used to indicate the completion of the execution of the command in step S702.

[0148] Steps S704 to S706 are all implemented by hardware or software on the hardware domain corresponding to the instrument.

[0149] Step S707, the Rpmsg client searches for the command in the queue, wakes up the application of the task corresponding to the command, and feeds back the command execution result carried in the Jier response message to the application.

[0150] In the embodiment of the present application, the command that the Rpmsg client searches for in the queue is the command described in step S702.

[0151] The embodiment of the present application further provides an inter-core communication device, on which a multi-core heterogeneous system runs. A schematic diagram of a composition structure of the inter-core communication device is shown as follows: Fig.11 As shown, it includes: a first processor core 801 and a second processor core 802;

[0152] The second processor core 802 is configured to receive a first command sent by the first processor core 801; and determine a task based on a device identifier carried in the first command;

[0153] The second processor core 802 wakes up the task and executes a device-related function corresponding to the task based on the task;

[0154] The second processor core 802 is used to send a first response message before the execution of the device-related function ends; the first response message is used to indicate that the second processor core 801 is in a state capable of responding to the second command

[0155] In some embodiments, the second processor core 802 is further used to register a device communication structure, wherein the device communication structure includes a device identifier, device-related functions, and tasks;

[0156] Each of the tasks is used to execute a device-related function uniquely corresponding to the task.

[0157] In some embodiments, the second processor core 802 is specifically configured to determine a task corresponding to the device identifier based on the device communication structure.

[0158] In some embodiments, the second processor core 802 is further configured to receive a second command sent by the first processor core 801 .

[0159] In some embodiments, the second processor core 802 is further used to send a second response message to the first processor core, where the second response message is used to indicate that the execution of the device-related function has ended.

[0160] In some embodiments, the second processor core 802 is further configured to receive a first counter command, the first counter command being sent by the first processor core when the first processor core does not receive a second response message corresponding to the first command within a preset time;

[0161] Determine, based on the first counter command, a return value of a device-related function corresponding to the first command;

[0162] If the return value indicates that the device-related function returns successfully, controlling the device-related function to return to a state of waiting for command execution;

[0163] If the return value indicates that the device-related function returns failure, the device-related function is controlled to execute resource recycling.

[0164] In some other embodiments, the first processor core 801 is used to send the first command in the command queue to the second processor core 802;

[0165] The first processor core 801 is used to receive a first response message, where the first response message is used to indicate that the second processor core 802 is in a state capable of responding to a second command.

[0166] The first processor core 801 is further configured to receive a second command sending request sent by a second application;

[0167] The first processor core 801 is configured to send a second command to the second processor core 802 based on the second command sending request.

[0168] If the first processor core does not receive a second response message corresponding to the first command within a preset time, the second response message being used to indicate that the execution of the device-related function corresponding to the first command has ended, the first processor core 801 is further used to send a first counter command to the second processor core;

[0169] The first anti-command is used by the second processor core to determine a return value of a device-related function corresponding to the first command.

[0170] The present application also provides a chip, a schematic diagram of the structure of the chip, such as Fig.12As shown, the chip includes: a processor 410, a memory 450 and a bus 440; the various modules in the chip are coupled together through the bus 440. It can be understood that the bus 440 is used to realize the connection and communication between these modules. In addition to the data bus, the bus 440 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Fig.12 Various buses are labeled as bus 440.

[0171] The processor 410 has signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware models, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0172] The memory 450 stores executable instructions for implementing the inter-core communication method provided in the embodiment of the present application. The inter-core communication method can be implemented by Fig.11 The first processor core 801 and the second processor core 802 in the inter-core communication device shown are implemented; the memory 450 can be removable, non-removable or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 450 optionally includes one or more storage devices that are physically far away from the processor 410.

[0173] In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof.

[0174] In some embodiments, the chip may further include:

[0175] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0176] The network communication module 452 is used to reach other computing devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, Wireless Authentication (WiFi), and Universal Serial Bus (USB).

[0177] An embodiment of the present application also provides a component on a transportation device, wherein the component includes a chip, and the chip is capable of executing the above-mentioned inter-core communication method.

[0178] In some optional embodiments, the components may be components at the circuit board level, components at the automotive electrical system level, or components of an automotive assembly. As an example, the components may be the engine, chassis, body, and electrical and electronic equipment of the vehicle. The electrical and electronic equipment of the vehicle may include headlights for lighting, management equipment for controlling the engine, central control equipment for receiving broadcasts, navigation, listening to music, entertainment, etc.

[0179] The embodiment of the present application also provides an electronic device, the electronic device includes a chip, and the chip can execute the above-mentioned inter-core communication method. The chip can be a multi-core heterogeneous chip, and the electronic device can be a transportation device, including but not limited to a balance car, a car, a bus, a train or an airplane.

[0180] The embodiment of the present application provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will be triggered to execute the inter-core communication method provided by the embodiment of the present application, for example, Figures 1 to 6 The inter-core communication method shown.

[0181] In some embodiments, the computer-readable storage medium may be a ferroelectric random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disk, or a CD-ROM; it may also be various devices including one or any combination of the above memories.

[0182] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, model, subroutine or other unit suitable for use in a computing environment.

[0183] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0184] An embodiment of the present application provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the inter-core communication method described in the present application is implemented.

[0185] The above are only embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A method for inter-core communication, characterized in that: The method is applied to a multi-core heterogeneous system including at least a first processor core and a second processor core, and the method includes: The second processor core receives a first command sent by the first processor core; The second processor core determines a task based on the device identifier carried in the first command; The second processor core wakes up the task and executes a device-related function corresponding to the task based on the task; Before the execution of the device-related function ends, the second processor core sends a first response message; the first response message is used to indicate that the second processor core is in a state capable of responding to a second command.

2. The method according to claim 1, characterized in that The method further comprises: The second processor core registers a device communication structure, wherein the device communication structure includes a device identifier, device-related functions, and tasks; Each of the tasks is used to execute a device-related function uniquely corresponding to the task.

3. The method according to claim 2, characterized in that The second processor core determines a task based on the device identifier carried in the first command, including: The second processor core determines a task corresponding to the device identifier based on the device communication structure.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: The second processor core receives a second command sent by the first processor core.

5. The method according to claim 1, characterized in that The method further comprises: The second processor core sends a second response message to the first processor core, where the second response message is used to indicate that the execution of the device-related function has ended.

6. The method according to claim 1, characterized in that The method further comprises: The second processor core receives a first counter command, wherein the first counter command is sent by the first processor core when the first processor core does not receive a second response message corresponding to the first command within a preset time; The second processor core determines, based on the first anti-command, a return value of a device-related function corresponding to the first command; If the return value indicates that the device-related function returns successfully, controlling the device-related function to return to a state of waiting for command execution; If the return value indicates that the device-related function returns failure, the device-related function is controlled to execute resource recycling.

7. An inter-core communication method, characterized in that: The method is applied to a multi-core heterogeneous system including at least a first processor core and a second processor core, and the method includes: The first processor core sends the first command in the command queue to the second processor core; The first processor core receives a first response message, where the first response message is used to indicate that the second processor core is in a state capable of responding to a second command.

8. The method according to claim 7, characterized in that The method further comprises: The first processor core receives a second command sending request sent by a second application; The first processor core sends a second command to the second processor core based on the second command sending request.

9. The method according to claim 7 or 8, characterized in that: The method further comprises: If the first processor core does not receive a second response message corresponding to the first command within a preset time, the second response message being used to indicate that the execution of the device-related function corresponding to the first command has ended, the first processor core sends a first counter command to the second processor core; The first anti-command is used by the second processor core to determine a return value of a device-related function corresponding to the first command.

10. An inter-core communication device, characterized in that: A multi-core heterogeneous system is running on the device, and the device includes a first processor core and a second processor core; The second processor core is used to receive a first command sent by the first processor core; Determine a task based on the device identifier carried in the first command; Waking up the task, and executing a device-related function corresponding to the task based on the task; Before the execution of the device-related function ends, sending a first response message; The first response message is used to indicate that the second processor core is in a state capable of responding to a second command.

11. An inter-core communication device, characterized in that: A multi-core heterogeneous system is running on the device, and the device includes a first processor core and a second processor core; The first processor core is used to send the first command in the command queue to the second processor core; The first processor core receives a first response message, where the first response message is used to indicate that the second processor core is in a state capable of responding to a second command.

12. A chip, characterized in that: The chip includes: a processor, a memory and a bus; The memory stores executable instructions; The processor communicates with the memory via the bus, and when the processor executes the executable instructions stored in the memory, the inter-core communication method described in any one of claims 1 to 6 is implemented, or the inter-core communication method described in any one of claims 7 to 9 is implemented.

13. A component of a traffic device, characterized in that: The component includes a chip, and the chip can implement the inter-core communication method described in any one of claims 1 to 6, or the chip can implement the inter-core communication method described in any one of claims 7 to 9.

14. An electronic device, characterized in that: The electronic device includes a chip, and the chip can implement the inter-core communication method described in any one of claims 1 to 6, or the chip can implement the inter-core communication method described in any one of claims 7 to 9.