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

By introducing the combination of RpMsg Socket communication method and RPC Binder interface between heterogeneous multi-core processors, the problems of strong closedness and poor versatility of communication mechanisms in the prior art are solved, and common inter-core communication across operating systems is realized, and development efficiency and versatility are improved.

CN119718706AActive Publication Date: 2025-03-28BEIJING XIAOMI MOBILE SOFTWARE CO LTD

Patent Information

Application Number
CN202311270734.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2025-03-28
Estimated Expiration
2043-09-27

AI Technical Summary

Technical Problem

In the prior art, the communication mechanism between heterogeneous multi-core processors is highly closed, has poor versatility, and is difficult to develop, making it difficult to realize a universal communication solution across operating systems.

Method used

A method of inter-core communication is proposed, through RpMsg Socket communication method, and inherits the native Android system RPC Binder interface to realize the transmission of inter-core data and improves universality.

Benefits of technology

It realizes the common service calling capability between heterogeneous multi-core processors, reduces development difficulty, improves universality and development efficiency, and avoids the need to define separate interfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718706A_ABST
    Figure CN119718706A_ABST
Patent Text Reader

Abstract

The invention provides an inter-core communication method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a service calling request sent by second electronic equipment, querying a second processor to which a to-be-called target service belongs in first electronic equipment according to the identification information of the to-be-called target service carried in the service calling request, and sending the to-be-called target service to the second processor, and calling an inter-core communication subclass corresponding to the management service in the first processor, sending the service calling request to a target service in the second processor, calling the inter-core communication subclass, and obtaining a service calling result obtained by the target service based on the service calling request. According to the interface in the inter-core communication subclass, the heterogeneous multi-core standard interface and the interface of the basic communication component RPC of the Android equipment are fused, the capability of the basic communication component RPC of the equipment is enhanced, the service calling capability among the heterogeneous multiple cores is completed based on fusion of existing interfaces, the interface does not need to be customized independently, the development efficiency is improved, and better universality is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the development of electronic technology, heterogeneous multi-core processors CPUs are built into electronic devices. Heterogeneous multi-core processors usually run multiple different operating systems and work together to achieve higher overall performance indicators.

[0003] In the related art, heterogeneous multi-core processors usually develop their own communication mechanisms for communication. Such communication mechanisms are closed, that is, they are only applicable to specific operating systems, are difficult to develop, and have poor versatility. Summary of the invention

[0004] The present application aims to solve one of the technical problems in the related art at least to some extent.

[0005] To this end, the present application proposes an inter-core communication method, device, electronic device and storage medium. The inter-core communication subclass is based on the RpMsg Socket communication method and inherits the RPC Binder interface of the native Android system. When performing inter-core communication, the RPC Binder interface can be directly called to realize the transmission of inter-core data, thereby improving versatility.

[0006] In one aspect, an embodiment of the present application provides an inter-core communication method, which is applied to a first processor in a first electronic device, and the method includes:

[0007] Obtaining a service call request sent by a second electronic device;

[0008] According to the identification information of the target service to be called carried in the service calling request, querying the second processor to which the target service to be called belongs in the first electronic device;

[0009] Call the inter-core communication subclass corresponding to the management service in the first processor, and send the service call request to the target service in the second processor; the inter-core communication subclass inherits the interface of the inter-process communication RPCBinder of the remote procedure call and the interface of the inter-core communication standard RpMsg;

[0010] The inter-core communication subclass is called to obtain a service call result obtained by the target service based on the service call request.

[0011] Another aspect of the present application provides an inter-core communication device, which is provided in a first processor in a first electronic device, and includes:

[0012] A first acquisition module, used to acquire a service call request sent by a second electronic device;

[0013] A query module, configured to query a second processor in the first electronic device to which the target service to be called belongs according to the identification information of the target service to be called carried in the service call request;

[0014] A sending module, used to call the inter-core communication subclass corresponding to the management service in the first processor, and send the service call request to the target service in the second processor; the inter-core communication subclass inherits the interface of the inter-process communication RPC Binder of the remote procedure call and the interface of the inter-core communication standard RpMsg;

[0015] The second acquisition module is used to call the inter-core communication subclass to obtain the service call result obtained by the target service based on the service call request.

[0016] Another aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the above aspect is implemented.

[0017] Another aspect of the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method described in the aforementioned aspect is implemented.

[0018] Another aspect of the present application provides a computer program product on which a computer program is stored. When the program is executed by a processor, the method described in the above aspect is implemented.

[0019] The inter-core communication method, device, electronic device and storage medium proposed in the present application obtain a service call request sent by the second electronic device, query the second processor to which the target service to be called belongs in the first electronic device according to the identification information of the target service to be called carried in the service call request, call the inter-core communication subclass corresponding to the management service in the first processor, send the service call request to the target service in the second processor, call the inter-core communication subclass, and obtain the service call result obtained by the target service based on the service call request. The relevant interface in the inter-core communication subclass RpMsgsockeadress corresponding to the management service integrates the heterogeneous multi-core RpMsg standard interface and the interface of the basic communication component RPCBinder of Android electronic devices, enhances the capability of the basic communication component RPC of electronic devices, and completes the service call capability between heterogeneous multi-cores based on the integration of existing interfaces, without the need for separate customized interfaces, improves development efficiency, and has better versatility.

[0020] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0022] Figure 1 A schematic diagram of a flow chart of an inter-core communication method provided in an embodiment of the present application;

[0023] Figure 2 A flowchart of another inter-core communication method provided in an embodiment of the present application;

[0024] Figure 3 A schematic diagram of a communication scenario provided in an embodiment of the present application

[0025] Figure 4A A schematic diagram of an architecture of inter-core communication provided in an embodiment of the present application;

[0026] Figure 4B That is, a schematic diagram of the architecture of the underlying implementation of inter-core communication in an embodiment of the present application;

[0027] Figure 5 A schematic diagram of a scenario interaction of inter-core communication provided in an embodiment of the present application;

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

[0029] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0031] The following describes the inter-core communication method, device, electronic device and storage medium of the embodiments of the present application with reference to the accompanying drawings.

[0032] Figure 1 A flowchart of an inter-core communication method provided in an embodiment of the present application.

[0033] The executor of the inter-core communication method of the embodiment of the present application is an inter-core communication device, which can be set in a processor of a first electronic device including a multi-core processor, referred to as a first processor. The electronic device can be a smart phone, a smart wearable device, a PDA, a desktop computer, etc., which is not limited in this embodiment.

[0034] like Figure 1 As shown, the method may include the following steps:

[0035] Step 101: Obtain a service call request sent by a second electronic device.

[0036] In one implementation of the embodiment of the present application, the multi-core processor provided in the first electronic device includes at least two processors, each of which has a processor core. Each processor can execute different tasks simultaneously.

[0037] The second electronic device is an electronic device different from the first electronic device. An application of the second electronic device needs to call a service in an application of the first electronic device. For example, the first electronic device is a computer, and the second electronic device is a mobile phone. The service to be called is a function in the application. The service call request is a request to call a service on a processor other than the first processor in the first electronic device, carrying the identification information of the service to be called. The identification information of the service is, for example, the port number Port A of the service, and the data to be processed or the operation to be performed by the service. As an implementation method, based on the RPC Inet Socket method of Android, the remote second electronic device sends the service call request to the first processor of the first electronic device to realize communication between remote devices. Among them, the RPCInetSocket method, that is, locates the electronic device to which the service to be called belongs through the IP address of the electronic device and the port number of the service. Among them, RPC (Remote Procedure Call) refers to the mechanism for communication between the operating systems of the processors running on different devices to complete the process call. Inet Socket is an IP socket, which locates the target service on the target device through the IP address of the device plus the port number of the service.

[0038] Step 102: query the second processor in the first electronic device to which the target service to be called belongs according to the identification information of the target service to be called carried in the service calling request.

[0039] In an embodiment of the present application, a multi-core processor system of the first device includes multiple services, and different services are deployed in different processors. For ease of management, a main processor is set among the multiple processors, and a management service is set in the main processor. The management service is used to manage all services in the first device. As an implementation method, the management service maintains the correspondence between the identification information of each service and the processor to which each service belongs. Therefore, when the identification information of the target service to be called is obtained, the processor to which the target service belongs can be queried. Since it is possible to determine which processors are included in the first device, it is possible to determine whether the target service belongs to a processor other than the first processor, thereby determining whether it is a service call between different processors in the first electronic device, that is, whether it is inter-core communication.

[0040] Step 103: call the inter-core communication subclass corresponding to the management service in the first processor, and send the service call request to the target service in the second processor.

[0041] In the embodiment of the present application, when it is determined that the target service to be called belongs to the second processor among the multiple processors of the first electronic device, and it is determined that the current service call belongs to a call between different processors in the same electronic device, that is, it belongs to inter-core communication, then the relevant interface in the inter-core communication subclass RpMsg Socke Adress corresponding to the management service is called, and the service call request is sent to the target service in the second processor, so that the target service in the second processor generates a service call result according to the action or task carried in the service call request and requested to execute by the target service. As an implementation method, the connection interface in the inter-core communication subclass corresponding to the management service is called to establish an RpMsg connection between the management service and the target service, and then the data sending interface in the inter-core communication subclass corresponding to the management service is called to send the service call request to the target service in the second processor.

[0042] Among them, the inter-core communication subclass, RpMsg Socket Adress, complies with the inter-core communication standard RpMsg, which stands for Remote Processor Messaging. It defines the standard binary interface used for communication between cores in heterogeneous multi-core processing systems (AMP, Asymmetric Multiprocessing). The inter-core communication subclass is based on the inter-core communication standard socket RpMsg Socket communication method and inherits the interface of the inter-process communication RPC Binder of the remote procedure call. That is to say, the relevant interfaces in the inter-core communication subclass RpMsg SockeAdress corresponding to the management service integrate the heterogeneous multi-core RpMsg standard interface and the interface of the Android Android device basic communication component RPC to complete the service calling capability between heterogeneous multi-cores, enhancing the capability of the Android device basic communication component RPC. Based on the integration of existing interfaces, there is no need to customize the interface separately, which improves the versatility of the used interface, improves development efficiency, and has better versatility. In addition, it provides a new idea for the use of the native heterogeneous multi-core RpMsg standard interface in the Android AndroidBinder.

[0043] Step 104, calling the inter-core communication subclass to obtain the service call result obtained by the target service based on the service call request.

[0044] In an embodiment of the present application, a data receiving interface in the inter-core communication subclass is called to receive a service call result sent by a target service, thereby realizing inter-core communication among different processors inside a first electronic device. This inter-core communication method is also called CPC (Cross-PE Communication), which refers to a mechanism for communicating between different processors on a single device to complete a process call.

[0045] In the inter-core communication method of the embodiment of the present application, a service call request sent by the second electronic device is obtained, and according to the identification information of the target service to be called carried in the service call request, the second processor to which the target service to be called belongs in the first electronic device is queried, and the inter-core communication subclass corresponding to the management service in the first processor is called, and the service call request is sent to the target service in the second processor, and the inter-core communication subclass is called to obtain the service call result obtained by the target service based on the service call request. The relevant interface in the inter-core communication subclass RpMsg Socke Adress corresponding to the management service integrates the heterogeneous multi-core RpMsg standard interface and the interface of the Android device basic communication component RPC Binder, which enhances the capability of the Android device basic communication component RPC, and completes the service call capability between heterogeneous multi-cores based on the integration of existing interfaces, without the need for a separate custom interface, thereby improving development efficiency and having better versatility.

[0046] Based on the above embodiments, Figure 2 A flowchart of another inter-core communication method provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the method comprises the following steps:

[0047] Step 201: Obtain a service call request sent by a second electronic device.

[0048] Among them, step 201 can refer to the explanation in the above-mentioned embodiment, and the principle is the same, which will not be repeated here.

[0049] As an example, Figure 3A schematic diagram of a communication scenario provided for an embodiment of the present application, wherein an Android tablet is the second device, an Android phone is the first device, CPU0 in the phone is the first processor, and CPU1 in the phone is the second processor. In a remote device such as a tablet, the tablet discovers the IP information of the other device phone through interconnection, and the phone notifies the other tablet of its own IP address. After the tablet obtains the IP of the phone and the port number provided by the service APP1 to the outside, it directly calls the native Android RPC Binder interface and requests the service APP1 capability on the phone side through the InetSocket communication method of Android RPC. That is, the application in the CPU1 core of the mobile phone provides service 1, and the main CPU on the mobile phone that provides direct network service access is CPU0. Inside the mobile phone, the management service corresponding to the main CPU0 records service 1 and the processor to which service 1 belongs is CPU1, which realizes the proxy mapping of service capability 1 on the heterogeneous CPU1 in the main CUP0. The purpose is that when service 2 of the application in the remote second electronic device needs to request service 1 in CPU1 on the first electronic device, service 2 in application 1 in the second electronic device accesses the service on the main CPU0 on the first electronic device. Through the CPC method of inter-core call inside the mobile phone, the main CPU0 can access the CPU1 that actually provides service 1 capability, and CPU1 processes the service call request and returns the result of the service call request. In other words, the relay to service 1 on the CPU1 core that actually provides the capability is completed by the CPC service between CPU0 and CPU1 inside the mobile phone. It is not perceived by the external tablet. From the perspective of the external tablet, it can directly access the services inside the multi-core of the mobile phone side remotely, and the user is not aware of it.

[0050] As an implementation method, after obtaining the service capabilities deployed on the opposite Android device, that is, the different cores on the tablet, the interface provided by RPC can be directly called. That is: the tablet directly calls the RPC Binder interface, session->setupInetClient (Internet Protocol (IP) address of the remote service provider, the port number bound to the remote service provider's service), and sends the service call request to CPU0 of the mobile phone.

[0051] Step 202, obtaining a service list.

[0052] The service list includes the corresponding relationship between the processor to which each service belongs and the identification information.

[0053] The service list generation method includes the following implementation methods:

[0054] In one implementation of an embodiment of the present application, before the device leaves the factory, since the number of processors included in the device and the services in the applications included in each processor can be determined, a service list can be generated at the time of leaving the factory to implement management of all services in the first electronic device.

[0055] In another implementation method of the embodiment of the present application, when there is a new application or a new service in the application that needs to be registered, the new service includes a target service. Taking the target service as an example, the inter-core communication method of the embodiment of the present application is used, that is, the management service in the first processor calls the data receiving interface in the inter-core communication subclass to receive the identification information of the target service and the processor to which it belongs. According to the identification information of the target service and the second processor to which it belongs, a correspondence between the identification information of the target service and the second processor to which it belongs is established in the service list. Similarly, a correspondence between the identification information of each service and the second processor to which it belongs can be established in the service list.

[0056] Step 203: query the service list according to the identification information of the target service to be called in the service calling request, and determine that the target service to be called belongs to the second processor in the first electronic device.

[0057] In an embodiment of the present application, the service list includes information about services in all processors in the first electronic device, so that according to the identification information of the target service to be called in the service call request, for example, the identification information is port information, the service list is queried to determine the second processor to which the target service to be called belongs among the multiple processors in the first electronic device, thereby achieving positioning of the processor that actually provides the service.

[0058] Step 204 , according to the identifier of the management service and the identifier of the first processor to which it belongs, and the socket communication type corresponding to the management service, a new inter-core communication subclass corresponding to the management service is added in the Android RPC Binder.

[0059] As an example, Figure 4A As shown, in the related art, the Socket classes in Android's RPC Binder include three types, namely Inet Socket, VM Socket and Domain Socket. These three types of Socket classes cannot implement calls between different processors in a device, that is, they cannot implement inter-core calls. Therefore, this application extends RPCBinder to obtain RpMsg Socket, and implements communication between processors, that is, inter-core communication, based on the RpMsg Socket class. Among them, the different Socket class methods of Android Binder adopt different implementation methods when implementing the Socket transport layer interface.

[0060] Specifically, to integrate RpMsg and Android Binder, it is necessary to expand the original RPC interface of Android Binder. RpMsg Socket also has the specific implementation process of these interfaces. We only need to replace each specific Class XX Socket Address constructor corresponding to the original Socket Address class of Android Binder with the Socket Address type corresponding to RpMsg Socket. For example, add the RpMsg Socket Class type and construct a constructor for this new class based on the structure type of RpMsg Socket Address. Among them, the core of RpMsgSocket communication is the service identifier and the identifier of the processor to which it belongs, as well as the socket communication type corresponding to the service. Among them, the identifier of the processor to which it belongs, Rp_cpu, is used to distinguish which processor core it belongs to, and the identifier of the service, Rp_name, is used to define which service on the core of this processor. The socket communication type Rp_family corresponding to the service: the type used to define socket communication is the PF_RpMsg type, among which the PF_RpMsg type is equivalent to other types such as PF_INET in related technologies.

[0061] Among them, class RpMsg Socket Address: public RPC Socket Address inherits the parent class RPC SocketAddress. Some API interfaces of RPC Binder itself can be directly called in the new RpMsg Socket, realizing the use of common interfaces. Among them, the interface calls required for the AIDL communication process are all common interfaces inherited from the parent class RPCSocket Address.

[0062] Optionally, the RpMsg communication channel can also be established. After the RpMsg communication channel is established, the Socket is expanded. Specifically, Figure 4A The process will not be described in detail here. Figure 4A The Binder obtained by expanding in the underlying layer relies on the multi-core processor communication framework technology of OpenAMP, that is, Figure 4B That is, it is a schematic diagram of the underlying architecture of the inter-core communication implementation of the embodiment of the present application. In the AMP (asymmetric multi-processing) configuration, different software environments will be run on different processing cores and their own code programs will be executed. The cores work together to improve the processor performance. The OpenAMP software framework provides the necessary API functions for developing the AMP system.

[0063] Thus, the communication method of Android CPC encapsulated by RpMsg Socket is integrated, and inter-core calls can be realized.

[0064] Step 205: call the inter-core communication subclass corresponding to the management service in the first processor, and send the service call request to the target service in the second processor.

[0065] Among them, the inter-core communication subclass inherits the interface of the remote procedure call inter-process communication RPC Binder and the interface of the inter-core communication standard RpMsg, that is, it is based on the inter-core communication standard socket RpMsg Socket communication method, and inherits the interface of the remote procedure call inter-process communication RPC Binder.

[0066] Step 206, calling the inter-core communication subclass to obtain the service call result obtained by the target service based on the service call request.

[0067] Among them, step 205 and step 206 can refer to the explanation in the above-mentioned embodiment, and the principles are the same, so they will not be repeated here.

[0068] Step 207: Send the service call result to the second electronic device through the RPC Binder interface.

[0069] In the embodiment of the present application, since the service call request is issued by the service in the processor on the second electronic device, when the first processor obtains the service call result from the second processor that actually provides the service, it is necessary to send the result of the service call to the service that issued the request on the second electronic device, wherein, since the first electronic device and the second electronic device are different electronic devices, communication between remote devices is implemented based on RPC communication in the relevant technology, specifically, by calling the interface of the RPC Binder to send the service call result to the second electronic device.

[0070] The inter-core communication method implemented in the present application expands a new RpMsg Socket underlying communication method, which is shared with other RPC communication method interfaces for the upper layer, that is, it has been integrated under the RPC interface, and there is no need to pay attention to whether it is the RPC Inet Socket or the RpMsg Socket capability. In the RPC Binder module, it is not perceived by the upper-layer application, which reduces the difficulty of development. When performing inter-core communication, the RPC Binder interface can be directly called to realize the transmission of inter-core data, thereby improving versatility.

[0071] Based on the above embodiments, the embodiment of the present application is integrated under the RPC interface, so that the service capability of the device can directly use the AIDL mechanism of Binder to directly call the native Binder interface: that is, the BBinder Class of the service side (the service in the processor that initiates the call) and the BpBinder Class of the user client side (the service in the called processor) are automatically generated through the interface definition language (Android Interface Definition Language, AIDL). By expanding the Binder capability, the native android Ipc communication capability is enhanced, and the relevant code can be automatically generated, reducing the development difficulty. At the same time, on distributed multi-core devices, the inter-core communication mechanism of the present application is used to facilitate the development of later applications, and at the same time provide a new inter-core communication capability.

[0072] Based on the above embodiments, the present application embodiment provides a schematic diagram of scene interaction of inter-core communication, such as Figure 5 As shown,

[0073] In the first device, for example, a mobile phone, there are two processors, namely, CPU1 and CPU0. Service B on CPU1 is registered on the main core CPU0 through CPC Binder. As the main core, CPU0 manages all Binder services through Service Manage. At the same time, corresponding services on CPU1 other than CPU0 use CPC Binder to communicate between multiple cores.

[0074] The second device, that is, the service Server_C on the remote device C wants to request access to the service Server_B. The remote device C uses the RPC Inet Binder method, and the main processor presents the network IP address AAAA and the port PortA corresponding to the service B to remotely connect to CPU0, and calls the RPC Binder interface to send the service access request to the main core CPU0.

[0075] The Service Manage process of CPU0 queries the requested service Server_B and determines that service Server_B is the proxy service mapped in CPU0, that is, it finds that service Server_B is service Server_B in processor CPU1, then calls the local inter-core communication method CPC Binder to transfer the remote service call request to service Server_B on the real service provider CPU1.

[0076] CPU1 calls service B to obtain the service call result, and returns the result to CPU0, realizing inter-core communication. Then, CPU0 returns the service call result to remote device C based on the RPC Binder interface.

[0077] In order to implement the above embodiment, the embodiment of the present application also proposes an inter-core communication device, which is arranged in a first processor in a first electronic device.

[0078] Figure 6 A schematic diagram of the structure of an inter-core communication device provided in an embodiment of the present application.

[0079] like Figure 6 As shown, the device may include:

[0080] A first acquisition module 61 is used to acquire a service call request sent by a second electronic device;

[0081] A query module 62, configured to query the second processor to which the target service to be called belongs in the first electronic device according to the identification information of the target service to be called carried in the service calling request;

[0082] The sending module 63 is used to call the inter-core communication subclass corresponding to the management service in the first processor, and send the service call request to the target service in the second processor; wherein the inter-core communication subclass inherits the interface of the inter-process communication RPC Binder of the remote procedure call and the interface of the inter-core communication standard RpMsg;

[0083] The second acquisition module 64 is used to call the inter-core communication subclass to obtain the service call result obtained by the target service based on the service call request.

[0084] Furthermore, in an implementation of the embodiment of the present application, the device further includes:

[0085] A new module is added, which is used to add an inter-core communication subclass corresponding to the management service in the Android RPC Binder according to the identifier of the management service and the identifier of the first processor to which it belongs, and the socket communication type corresponding to the management service.

[0086] In one implementation of the embodiment of the present application, the query module 62 is specifically configured to:

[0087] Obtaining a service list; wherein the service list includes a correspondence between a processor to which each service belongs and identification information;

[0088] According to the identification information of the target service to be called in the service calling request, a service list is queried to determine that the target service to be called belongs to the second processor in the first electronic device.

[0089] In one implementation of the embodiment of the present application, the query module 62 is specifically configured to:

[0090] Calling the data receiving interface in the inter-core communication subclass to receive the registration request sent by the target service; wherein the registration request carries the identification information of the target service and the second processor to which it belongs;

[0091] According to the identification information of the target service and the second processor to which it belongs, a corresponding relationship between the identification information of the target service and the second processor to which it belongs is established in the service list.

[0092] In one implementation of the embodiment of the present application, the sending module 63 is further configured to:

[0093] The service call result is sent to the second electronic device through the RPC Binder interface.

[0094] It should be noted that the above explanation of the method embodiment is also applicable to the device of this embodiment, and will not be repeated here.

[0095] The inter-core communication device proposed in the present application obtains a service call request sent by the second electronic device, queries the second processor to which the target service to be called belongs in the first electronic device according to the identification information of the target service to be called carried in the service call request, calls the inter-core communication subclass corresponding to the management service in the first processor, sends the service call request to the target service in the second processor, calls the inter-core communication subclass, and obtains the service call result obtained by the target service based on the service call request. The relevant interface in the inter-core communication subclass RpMsg SockeAdress corresponding to the management service integrates the heterogeneous multi-core RpMsg standard interface and the interface of the basic communication component RPC Binder of the electronic device, enhances the capability of the basic communication component RPC of the electronic device, and completes the service call capability between heterogeneous multi-cores based on the integration of existing interfaces, does not require a separate customized interface, improves development efficiency, and has better versatility.

[0096] In order to implement the above embodiments, the present application also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the above method embodiments is implemented.

[0097] In order to implement the above embodiments, the present application also proposes a non-temporary computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method described in the above method embodiments is implemented.

[0098] In order to implement the above embodiments, the present application also proposes a computer program product on which a computer program is stored. When the computer program is executed by a processor, the method described in the above method embodiments is implemented.

[0099] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a message transceiver device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0100] Reference Figure 7 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0101] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0102] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0103] The power component 806 provides power to the various components of the electronic device 800. The power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.

[0104] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0105] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0106] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0107] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0108] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0109] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0110] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0111] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0112] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0113] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0114] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0115] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0116] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0117] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0118] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A method for inter-core communication, characterized in that: A first processor applied to a first electronic device includes: Obtaining a service call request sent by a second electronic device; According to the identification information of the target service to be called carried in the service calling request, querying the second processor to which the target service to be called belongs in the first electronic device; Calling the inter-core communication subclass corresponding to the management service in the first processor, and sending the service call request to the target service in the second processor; wherein the inter-core communication subclass inherits the interface of the inter-process communication RPC Binder of the remote procedure call and the interface of the inter-core communication standard RpMsg; The inter-core communication subclass is called to obtain a service call result obtained by the target service based on the service call request.

2. The method according to claim 1, characterized in that The calling of the inter-core communication subclass corresponding to the management service in the first processor, before sending the service call request to the target service in the second processor, includes: According to the identifier of the management service and the identifier of the first processor to which it belongs, and the socket communication type corresponding to the management service, an inter-core communication subclass corresponding to the management service is added in the Android RPC Binder.

3. The method according to claim 1, characterized in that The querying, according to the identification information of the target service to be called carried in the service calling request, the second processor to which the target service to be called belongs in the first electronic device includes: Obtaining a service list; wherein the service list includes a correspondence between the processor and identification information to which each service belongs; According to the identification information of the target service to be called in the service calling request, a service list is queried to determine that the target service to be called belongs to the second processor in the first electronic device.

4. The method according to claim 3, characterized in that Before obtaining the service list, the method further includes: Calling the data receiving interface in the inter-core communication subclass to receive the registration request sent by the target service; wherein the registration request carries the identification information of the target service and the second processor to which it belongs; According to the identification information of the target service and the second processor to which it belongs, a corresponding relationship between the identification information of the target service and the second processor to which it belongs is established in the service list.

5. The method according to any one of claims 1 to 4, characterized in that: After obtaining the service call result obtained by the target service based on the service call request, the method further includes: The service call result is sent to the second electronic device through the RPC Binder interface.

6. An inter-core communication device, characterized in that: A first processor disposed in a first electronic device includes: A first acquisition module, used to acquire a service call request sent by a second electronic device; A query module, configured to query a second processor in the first electronic device to which the target service to be called belongs according to the identification information of the target service to be called carried in the service call request; A sending module, used to call the inter-core communication subclass corresponding to the management service in the first processor, and send the service call request to the target service in the second processor; wherein the inter-core communication subclass inherits the interface of the inter-process communication RPC Binder of the remote procedure call and the interface of the inter-core communication standard RpMsg; The second acquisition module is used to call the inter-core communication subclass to obtain the service call result obtained by the target service based on the service call request.

7. The device according to claim 6, characterized in that The device further comprises: A new module is added, which is used to add an inter-core communication subclass corresponding to the management service in the Android RPC Binder according to the identifier of the management service and the identifier of the first processor to which it belongs, and the socket communication type corresponding to the management service.

8. The device according to claim 6, characterized in that The query module is specifically used for: Obtaining a service list; wherein the service list includes a correspondence between the processor and identification information to which each service belongs; According to the identification information of the target service to be called in the service calling request, a service list is queried to determine that the target service to be called belongs to the second processor in the first electronic device.

9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 5 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Inter-core communication method, processor and multi-processor communication system

    CN108780437A

  • Communication method and device between vehicle terminal subsystems, electronic equipment and medium

    CN113973126A

  • Interface processing method and device

    CN115145699A

Cited By

  • SOMEIP communication method, vehicle and medium

    CN121478515A