CN-119718706-B - Inter-core communication method, device, electronic equipment and storage medium
Abstract
The application provides an inter-core communication method, an inter-core communication device, electronic equipment and a storage medium, wherein the method comprises the steps of obtaining a service calling request sent by second electronic equipment, inquiring a second processor to which a target service to be called belongs in first electronic equipment according to identification information of the target service to be called carried in the service calling request, calling an inter-core communication subclass corresponding to management service in the first processor, sending the service calling request to the 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. Interfaces in the inter-core communication subclass are fused with heterogeneous multi-core standard interfaces and interfaces of an android device basic communication component RPC, the capability of the device basic communication component RPC is enhanced, the service calling capability among heterogeneous multi-cores is completed based on the fusion of the existing interfaces, independent custom interfaces are not needed, the development efficiency is improved, and the device has better universality.
Inventors
- HUANG HANQING
Assignees
- 北京小米移动软件有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20230927
Claims (10)
- 1. An inter-core communication method, applied to a first processor in a first electronic device, comprising: Acquiring a service call request sent by second electronic equipment; inquiring a second processor to which the target service to be called belongs in the first electronic equipment according to the identification information of the target service to be called, which is carried in the service calling request; If the second processor is different from the first processor, calling an 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 an interface of an inter-process communication RPC Binder and an interface of an inter-core communication standard RpMsg of remote procedure call; and calling the inter-core communication subclass to acquire a service calling result obtained by the target service based on the service calling request.
- 2. The method of claim 1, wherein the invoking the inter-core communication subclass corresponding to the management service in the first processor, before sending the service invocation request to the target service in the second processor, comprises: And according to the identifier of the management service, the identifier of the first processor to which the management service belongs and the socket communication type corresponding to the management service, adding the inter-core communication subclass corresponding to the management service in the RPC Binder of the android.
- 3. The method of claim 1, wherein the querying the second processor to which the target service to be invoked belongs in the first electronic device according to the identification information of the target service to be invoked carried in the service invocation request includes: Obtaining a service list, wherein the service list comprises corresponding relations between processors and identification information to which each service belongs; And inquiring a service list according to the identification information of the target service to be called in the service calling request, and determining that the target service to be called belongs to a second processor in the first electronic equipment.
- 4. The method of claim 3, wherein prior to the obtaining the service list, further comprising: Invoking a data receiving interface in the inter-core communication subclass to receive a registration request sent by the target service, wherein the registration request carries identification information of the target service and a second processor to which the registration request belongs; and establishing a corresponding relation between the identification information of the target service and the second processor in the service list according to the identification information of the target service and the second processor.
- 5. The method according to any one of claims 1-4, wherein after the obtaining the service call result obtained by the target service based on the service call request, further comprises: and sending the service calling result to the second electronic equipment through an RPC Binder interface.
- 6. An inter-core communication apparatus, characterized by a first processor disposed in a first electronic device, comprising: the first acquisition module is used for acquiring a service call request sent by the second electronic equipment; The query module is used for querying a second processor to which the target service to be invoked belongs in the first electronic equipment according to the identification information of the target service to be invoked, which is carried in the service invocation request; The sending module is used for calling the inter-core communication subclass corresponding to the management service in the first processor and sending the service calling request to the target service in the second processor if the second processor is different from the first processor, wherein the inter-core communication subclass inherits the interface of the inter-process communication RPC Binder and the interface of the inter-core communication standard RpMsg of remote procedure call; And the second acquisition module is used for calling the inter-core communication subclass and acquiring a service calling result obtained by the target service based on the service calling request.
- 7. The apparatus of claim 6, wherein the apparatus further comprises: and the new adding module is used for adding the inter-core communication subclass corresponding to the management service in the RPC Binder of the android according to the identification of the management service, the identification of the first processor to which the management service belongs and the socket communication type corresponding to the management service.
- 8. The apparatus of claim 6, wherein the query module is specifically configured to: Obtaining a service list, wherein the service list comprises corresponding relations between processors and identification information to which each service belongs; And inquiring a service list according to the identification information of the target service to be called in the service calling request, and determining that the target service to be called belongs to a second processor in the first electronic equipment.
- 9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any of claims 1-5 when the program is executed.
- 10. A non-transitory computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements the method according to any of claims 1-5.
Description
Inter-core communication method, device, electronic equipment and storage medium Technical Field The present application relates to the field of wireless communications technologies, and in particular, to an inter-core communication method, an inter-core communication device, an electronic device, and a storage medium. Background With the development of electronic technology, a heterogeneous multi-core processor CPU is built in an electronic device, and the heterogeneous multi-core processor generally runs a plurality of different operating systems, so that a higher overall performance index is achieved by cooperative work among the heterogeneous multi-core processors. In the related art, communication is performed among heterogeneous multi-core processors, and usually, a communication mechanism of the heterogeneous multi-core processors is developed, and the communication mechanism has a sealing property, namely, the heterogeneous multi-core processors are only applicable to specific operating systems, and the heterogeneous multi-core processors are high in development difficulty and poor in universality. Disclosure of Invention The present application aims to solve at least one of the technical problems in the related art to some extent. Therefore, the application provides an inter-core communication method, an inter-core communication device, electronic equipment and a storage medium, wherein the inter-core communication subclass is based on RpMsg Socket communication modes, inherits an RPC Binder interface of a native android system, can directly call the RPC Binder interface to realize transmission of inter-core data when inter-core communication is carried out, and improves universality. 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: Acquiring a service call request sent by second electronic equipment; inquiring a second processor to which the target service to be called belongs in the first electronic equipment according to the identification information of the target service to be called, which is carried in the service calling request; 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, wherein the inter-core communication subclass inherits the interface of the inter-process communication RPCBinder and the interface of the inter-core communication standard RpMsg of remote procedure call; and calling the inter-core communication subclass to acquire a service calling result obtained by the target service based on the service calling request. Another embodiment of the present application provides an inter-core communication apparatus, which is provided in a first processor in a first electronic device, including: the first acquisition module is used for acquiring a service call request sent by the second electronic equipment; The query module is used for querying a second processor to which the target service to be invoked belongs in the first electronic equipment according to the identification information of the target service to be invoked, which is carried in the service invocation request; The sending module is used for calling an inter-core communication subclass corresponding to the management service in the first processor and sending the service calling request to the target service in the second processor, wherein the inter-core communication subclass inherits an interface of an inter-process communication RPC Binder and an interface of an inter-core communication standard RpMsg of remote procedure call; And the second acquisition module is used for calling the inter-core communication subclass and acquiring a service calling result obtained by the target service based on the service calling request. Another embodiment of the application proposes an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, said processor implementing the method according to the previous aspect when executing said program. Another aspect of the application provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method as described in the previous aspect. Another aspect of the application provides a computer program product having a computer program stored thereon, which when executed by a processor implements a method according to the previous aspect. According to the inter-core communication method, the inter-core communication device, the electronic equipment and the storage medium, a service call request sent by the second electronic equipment is obtained, a second processor to which a target service to be called belongs in the first electronic equipment is qu