Communication method, device, chip system and electronic device
Through the introduction of cross -domain communication methods in multi -nuclear systems, the problem of collaborative difficulties between the main processor core and the processor nucleus are solved, and the in -depth synergy and resource sharing of the heterogeneous processor nucleus have been realized, and the system performance and system performance and system performance and system performance and resource sharing are improved. Safety.
Patent Information
- Application Number
- CN202311137203.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2043-08-31
AI Technical Summary
In the prior art, it is difficult to coordinate between the master processor core and the slave processor core, resulting in limitations in resource configuration and performance improvement of multi-core systems.
By introducing a communication method in a multi -core system, the first communication module in the first operating system and the second communication module in the second operating system for cross -domain communication to achieve authentication and request processing Coordination between the nucleus.
This method realizes inter -diameter communication between standard process, enhances the communication capabilities of the heterogeneous processor nuclear, enables the main processor nucleus to coordinate with the processor core, and improve the isolation, real -time and safety of hardware resources And realize resource sharing and expand system functions.
Smart Images

Figure CN117370262B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of electronic technology, and in particular, to a communication method, device, chip system and electronic device. Background Art
[0002] With the development of information technology and the increase in demand, traditional single-core systems on chip are difficult to meet the demand, and homogeneous multi-core or heterogeneous multi-core systems on chip have gradually developed. The system on chip can be composed of multiple identical or different processors, multiple processor cores with different performance and uses. Each processor core plays its own computing advantages to achieve the best allocation of resources, improve overall performance, reduce power consumption, and simplify the development model. Therefore, the communication mechanism between multi-cores and the software programming model are particularly important for the performance of multi-core. At present, homogeneous multi-core processors or heterogeneous multi-core processors mostly adopt a master-slave structure. The existing technology has the problem that it is difficult for the master processor core and the slave processor core to cooperate. Summary of the invention
[0003] The embodiments of the present application provide a communication method, device, chip system and electronic device, which solve the problem in the prior art that it is difficult for a master processor core and a slave processor core to collaborate.
[0004] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:
[0005] In a first aspect, a communication method is provided, which is applied to a first communication module in a first operating system, the first operating system runs on a first processor core, the first communication module is used to communicate with a second communication module in a second operating system, the second operating system runs on a second processor core, the first processor core and the second processor core are located in the same electronic device, the method comprising: receiving a first request from the second communication module, the first request being used to indicate the identity of the second communication module; processing the first request when the identity authentication of the second communication module passes; and sending a first response obtained by processing the first request to the second communication module.
[0006] In the above technical solution, in an electronic device including multiple operating systems, for the first communication module and the second communication module in different operating systems, the second communication module requires the first communication module to process the request of the second communication module, and the second communication module sends a first request that can indicate the identity of the second communication module to the first communication module. The first communication module verifies the identity of the second communication module and processes the first request, and returns the processed first response to the second communication module. In this way, for the first communication module and the second communication module belonging to different domains (different operating systems), since the first communication module can identify the identity of the second communication module through the first request, cross-domain standard inter-process communication (standard inter-process communication refers to: communication between processes in the same domain) can be realized, and the communication capability of the heterogeneous processor core in the communication module is enhanced, so that the first processor core running the first communication module and the second processor core running the second communication module can be deeply coordinated. Further, the hardware resources between different domains can be isolated, the real-time performance of hardware processing and the security of some hardware can be improved, and resource sharing between the first communication module and the second communication module can be realized to achieve richer functions.
[0007] In a possible implementation of the first aspect, receiving a first request from a second communication module includes: obtaining the first request from a target memory space, and the target memory space is used to store request data of the second communication module that has passed identity authentication. Wherein, when the first request is obtained from the target memory space, the identity authentication of the second communication module is passed. In the above possible implementation, the target memory space is pre-configured to store request data of the second communication module that has passed identity authentication. When the first communication module obtains the first request from the target memory space, it can be known that the first request is from the second communication module that has passed identity authentication. On the one hand, the first communication module can identify the identity of the second communication module, providing a basis for deep collaboration between the first processor core running the first communication module and the second processor core running the second communication module. On the other hand, it is only necessary to pre-configure the first communication module and the second communication module to transmit request data through the target memory space, without adding an identity authentication step each time a request is sent, and the request sending speed is faster and more convenient.
[0008] In a possible implementation of the first aspect, the method further includes: receiving a second request from a second communication module, the second request is used to indicate the identity of the second communication module, and the data length of the first request is different from the data length of the second request; when the identity authentication of the second communication module is passed, the second request is processed; and the second response obtained by processing the second request is sent to the second communication module, and the data length of the first response is different from the data length of the second response. In the above possible implementation, the second communication module can send the first request and the second request to the first communication module for processing, and the data length of the first request is different from the data length of the second request, and the data length of the first response to the first request is different from the data length of the second response to the second request. In this way, when the first communication module and the second communication module communicate, the data length and request type that can be sent are more diverse, and the original multiple requests can also be merged into one request to send, so that the first processor core running the first communication module and the second processor core running the second communication module can be deeply coordinated.
[0009] In a possible implementation of the first aspect, processing a first request includes: generating a third request based on the first request; processing the third request, wherein the first response is a response to the third request. In the above possible implementation, the first request is a request from the second communication module, the first communication module receives the first request, generates the third request based on the first request, and converts the first request whose initiator is the second communication module into the third request whose initiator is the first communication module, so that the first communication module processes the third request as a request of the first operating system, providing a basis for deep collaboration between the first processor core running the first communication module and the second processor core running the second communication module.
[0010] In a possible implementation of the first aspect, the first request includes identity information of the second communication module; the identity authentication of the second communication module is passed, including: the identity information is verified. In the above possible implementation, by setting the identity information of the second communication module in the first request, the first communication module can identify the identity of the second communication module, providing a basis for deep collaboration between the first processor core running the first communication module and the second processor core running the second communication module.
[0011] In a possible implementation of the first aspect, the first request is used to request the execution of at least one of the following functions: non-volatile memory access, standard inter-process communication, or page fault exception handling. In the above possible implementation, the first request is used to execute at least one of the following: non-volatile memory access, standard inter-process communication, or page fault exception handling. In this way, on the one hand, the second communication module does not have to rely on the file system to access files, the second communication module can access the files of the first communication module, the second communication module and the first communication module can achieve shared file access, and the first communication module can offload core services to the second communication module for processing. On the other hand, the first communication module and the second communication module can achieve collaboration on page fault exceptions, so that the first communication module and the second communication module can share page cache and save memory space. On the other hand, the first communication module and the second communication module can achieve cross-domain standard inter-process communication. Therefore, deep collaboration can be performed between the first processor core running the first communication module and the second processor core running the second communication module.
[0012] In a second aspect, a communication method is provided, which is applied to a second communication module in a second operating system, the second operating system runs on a second processor core, the second communication module is used to communicate with a first communication module in a first operating system, the first operating system runs on a first processor core, the first processor core and the second processor core are located in the same electronic device, the method comprising: sending a first request to the first communication module, the first request is used to indicate the identity of the second communication module; receiving a first response to the first request from the first communication module.
[0013] In the above possible implementation, in an electronic device including multiple operating systems, for the first communication module and the second communication module in different operating systems, the second communication module requires the first communication module to process the request of the second communication module, and the second communication module sends a first request that can indicate the identity of the second communication module to the first communication module, and the first communication module processes the first request and returns a first response, so that the second communication module can obtain the first response obtained by processing the first request. In this way, for the first communication module and the second communication module belonging to different domains (different operating systems), since the first communication module can identify the identity of the second communication module through the first request, cross-domain standard inter-process communication (standard inter-process communication refers to: communication between processes in the same domain) can be achieved, and the communication capability of the heterogeneous processor cores in the communication module is enhanced, so that the first processor core running the first communication module and the second processor core running the second communication module can be deeply coordinated. Further, the hardware resources between different domains can be isolated, the real-time performance of hardware processing, and the security of some hardware can be improved. Resource sharing between the first communication module and the second communication module can also be achieved to achieve richer functions.
[0014] In a possible implementation of the second aspect, sending a first request to a first communication module includes: storing the first request in a target memory space, and the target memory space is used to store the request data of the second communication module that has passed the identity authentication. In the above possible implementation, the target memory space is pre-configured to store the request data of the second communication module that has passed the identity authentication. The second communication module stores the first request in the target memory space, so that when the first communication module obtains the first request from the target memory space, it can be known that the first request is from the second communication module that has passed the identity authentication. On the one hand, the first communication module can identify the identity of the second communication module, providing a basis for deep collaboration between the first processor core running the first communication module and the second processor core running the second communication module. On the other hand, it is only necessary to pre-configure the first communication module and the second communication module to transmit the request data through the target memory space, without adding the identity authentication step each time a request is sent, and the request sending speed is faster and more convenient.
[0015] In a possible implementation of the second aspect, the method further includes: sending a second request to the first communication module, the second request is used to indicate the identity of the second communication module, and the data length of the first request is different from the data length of the second request; receiving a second response to the second request from the first communication module, and the data length of the first response is different from the data length of the second response. In the above possible implementation, the second communication module can send the first request and the second request to the first communication module for processing, and the data length of the first request is different from the data length of the second request, and the data length of the first response to the first request is different from the data length of the second response to the second request. In this way, when the first communication module and the second communication module communicate, the data length and request type that can be sent are more diverse, and the original multiple requests can be merged into one request to send, so that the first processor core running the first communication module and the second processor core running the second communication module can be deeply coordinated.
[0016] In a possible implementation of the second aspect, the second operating system runs a target process. Before sending the first request to the first communication module, it also includes: obtaining an initial request from the target process, generating a first request based on the initial request, and the first request includes the identity information of the second communication module. In the above possible implementation, the second communication module obtains the initial request of the target process, generates a first request including the identity information of the second communication module based on the initial request, and forwards it to the first communication module for processing. In this way, the request of the target process can be forwarded to the first communication module for processing without changing the running code of the target process, providing a basis for deep collaboration between the first processor core running the first communication module and the second processor core running the second communication module.
[0017] In a possible implementation of the second aspect, after receiving a first response to a first request from a first communication module, the method further includes: processing the first response and sending the processed first response to a target process. In the above possible implementation, the second kernel only needs to perform simple subsequent processing on the first response after receiving the first response. When the second operating system does not support the complete processing of the first request or the computing power of the second processor core is insufficient, the first request can be processed by the first communication module to obtain the first response, thereby providing a basis for deep collaboration between the first processor core running the first communication module and the second processor core running the second communication module.
[0018] In a possible implementation of the second aspect, the first request is used to request the execution of at least one of the following functions: non-volatile memory access, standard inter-process communication, or page fault exception handling. In the above possible implementation, the first request is used to execute at least one of the following: non-volatile memory access, standard inter-process communication, or page fault exception handling. In this way, on the one hand, the second communication module does not have to rely on the file system to access files, the second communication module can access the files of the first communication module, the second communication module and the first communication module can achieve shared file access, and the first communication module can offload core services to the second communication module for processing. On the other hand, the first communication module and the second communication module can achieve collaboration on page fault exceptions, so that the first communication module and the second communication module can share page cache and save memory space. On the other hand, the first communication module and the second communication module can achieve cross-domain standard inter-process communication. Therefore, deep collaboration can be performed between the first processor core running the first communication module and the second processor core running the second communication module.
[0019] According to a third aspect, a communication device is provided, which includes a first communication module in a first operating system, the first operating system runs on a first processor core, the first communication module is used to communicate with a second communication module in a second operating system, the second operating system runs on a second processor core, the first processor core and the second processor core are located in the same electronic device, the first communication module includes a first control information management module and a first processing module; the first control information management module is used to receive a first request from the second communication module, the first request is used to indicate the identity of the second communication module; the first processing module is used to process the first request when the identity authentication of the second communication module is passed; the first control information management module is used to send a first response obtained by processing the first request to the second communication module.
[0020] In a possible implementation of the third aspect, the first control information management module is specifically used to obtain a first request from a target memory space, and the target memory space is used to store request data of a second communication module that has passed identity authentication; wherein, when the first request is obtained from the target memory space, the identity authentication of the second communication module is passed.
[0021] In a possible implementation of the third aspect, the first control information management module supports the transmission of information of different data lengths; the first control information management module is also used to receive a second request from the second communication module, the second request is used to indicate the identity of the second communication module, and the data length of the first request is different from the data length of the second request; the first processing module is also used to process the second request when the identity authentication of the second communication module is passed; the first control information management module is also used to send a second response obtained by processing the second request to the second communication module, and the data length of the first response is different from the data length of the second response.
[0022] In a possible implementation of the third aspect, the first processing module includes an identity proxy module and a first kernel; the identity proxy module is used to generate a third request based on the first request; the first kernel is used to process the third request, and the first response is a response to the third request.
[0023] In a possible implementation of the third aspect, the first request includes identity information of the second communication module, and the first processing module includes an identity proxy module; the identity proxy module is used to verify the identity information; the identity authentication of the second communication module is passed, including: the identity information verification is passed.
[0024] In a possible implementation manner of the third aspect, the first request is used to request execution of at least one of the following functions: non-volatile memory access, standard inter-process communication, or page fault exception handling.
[0025] In a fourth aspect, a communication device is provided, which includes a second communication module in a second operating system, the second operating system runs on a second processor core, the second communication module is used to communicate with a first communication module in a first operating system, the first operating system runs on a first processor core, the first processor core and the second processor core are located in the same electronic device, the second communication module includes a second control information management module; the second control information management module is used to send a first request to the first communication module, the first request is used to indicate the identity of the second communication module; the second control information management module is used to receive a first response to the first request from the first communication module.
[0026] In a possible implementation manner of the fourth aspect, the second control information management module is specifically used to store the first request in a target memory space, and the target memory space is used to store request data of the second communication module that has passed identity authentication.
[0027] In a possible implementation of the fourth aspect, the second control information management module supports the transmission of information of different data lengths; the second control information management module is also used to send a second request to the first communication module, the second request is used to indicate the identity of the second communication module, and the data length of the first request is different from the data length of the second request; the second control information management module is also used to receive a second response to the second request from the first communication module, and the data length of the first response is different from the data length of the second response.
[0028] In a possible implementation of the fourth aspect, the second communication module also includes a request forwarding module, and the second operating system runs a target process; the request forwarding module is used to obtain an initial request from the target process, generate a first request based on the initial request, and the first request includes identity information of the second communication module.
[0029] In a possible implementation manner of the fourth aspect, the second communication module also includes a second kernel; the second kernel is used to process the first response and send the processed first response to the target process.
[0030] In a possible implementation manner of the fourth aspect, the first request is used to request execution of at least one of the following functions: non-volatile memory access, standard inter-process communication, or page fault exception handling.
[0031] In a fifth aspect, a chip system is provided, the chip system comprising a first processor core and a second processor core. The first processor core runs a first operating system, the first operating system comprises a first communication module provided in the first aspect or any possible implementation of the first aspect. The second processor core runs a second operating system, the second operating system comprises a second communication module provided in the second aspect or any possible implementation of the second aspect.
[0032] In a sixth aspect, an electronic device is provided, which includes a memory chip system such as the one provided in the fifth aspect.
[0033] In a possible implementation manner of the sixth aspect, the electronic device includes at least one of the following: a receiver, a switch, a router, or a car.
[0034] In a seventh aspect, a computer-readable storage medium is provided, in which a program code is stored. The program code can be called by a processor to execute a communication method provided by the first aspect or any possible implementation of the first aspect.
[0035] In an eighth aspect, a computer-readable storage medium is provided, in which a program code is stored. The program code can be called by a processor to execute a communication method provided by the second aspect or any possible implementation of the second aspect.
[0036] According to another aspect of the present application, a computer program product is provided. When the computer program product is run on a computer, the computer is enabled to execute the communication method provided in the first aspect or any possible implementation manner of the first aspect.
[0037] According to another aspect of the present application, a computer program product is provided. When the computer program product is run on a computer, the computer is enabled to execute the communication method provided in the second aspect or any possible implementation manner of the second aspect.
[0038] It can be understood that any of the communication devices, electronic devices, computer storage media or computer program products provided above are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0040] Figure 2 A schematic diagram of an operating system provided in an embodiment of the present application;
[0041] Figure 3 A schematic diagram of a master processor core and a slave processor core provided in an embodiment of the present application;
[0042] Figure 4 A communication method according to an embodiment of the present invention is provided. Figure 1 ;
[0043] Figure 5 A communication method according to an embodiment of the present invention is provided. Figure 2 ;
[0044] Figure 6 A communication method according to an embodiment of the present invention is provided. Figure 3 ;
[0045] Figure 7A schematic diagram of a communication module provided in an embodiment of the present application;
[0046] Figure 8 A communication method according to an embodiment of the present invention is provided. Figure 4 ;
[0047] Fig. 9 A schematic diagram of a communication device provided in an embodiment of the present application;
[0048] Fig.10 A schematic diagram of another communication device provided in an embodiment of the present application;
[0049] Fig.11 A schematic diagram of a chip system provided in an embodiment of the present application;
[0050] Fig.12 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: a, b, c, ab, ac, bc or abc, where a, b and c can be single or multiple. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, in the embodiments of the present application, the words "first", "second" and the like do not limit the quantity and execution order.
[0052] In the embodiments of the present application, the description of "step B is also included before / after step A" is only for introducing step B or for ease of reading, and is not limited to step B being placed before / after step A, nor is it limited to step A being required before step B.
[0053] In the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0054] Before introducing the embodiments of the present application, the relevant technical terms involved in the embodiments of the present application are first introduced and explained.
[0055] (1) Processor core, single-core processor, and multi-core processor
[0056] The processor core refers to the core circuit of the processor except for the packaging and auxiliary circuits (such as the interface circuit of the pin, the power circuit, the clock circuit, etc.). The processor core circuit is used to complete the control and information processing functions. For example, the processor core can read instructions from the internal memory of the processor and execute the control and computing tasks specified by the instructions. The processor core may be referred to as the processor core or core in the following text.
[0057] A single-core processor is a processor that integrates one processor core and related auxiliary circuits. A multi-core processor is a processor that integrates multiple processor cores and related auxiliary circuits. Generally, multi-core processors contain more auxiliary circuits than single-core processors to solve the communication and coordination problems between multiple processor cores.
[0058] A multi-core processor can handle single-threaded tasks just like a single-core processor, but a multi-core processor can break down tasks and use multiple cores to run simultaneously to increase processing speed.
[0059] (2) Homogeneous multi-core processors and heterogeneous multi-core processors
[0060] From a hardware perspective, multi-core designs are divided into two categories. If all cores or processors have the same architecture, it is defined as homogeneous multi-core; if the architecture is different, it is called heterogeneous multi-core. From the application perspective, most homogeneous multi-core processors are composed of general-purpose processor cores, and each processor core can run independently. Heterogeneous multi-core processors usually inherit processor cores such as general-purpose processors, digital signal processors (DSP), field-programmable gate arrays (FPGA) processors, media processors, and network processors. Each processor core is set according to different requirements, thereby improving the computing performance or real-time performance of the application.
[0061] (3) Multi-domain collaboration
[0062] An independent execution environment running on independent resources is called a domain, and domains can be isomorphic or heterogeneous. For example, in a 16-core system (the 16-core system can be integrated on one or more processors), processor cores 0 to 11 can be used to run operating system (OS) A, processor cores 12 to 15 can be used to run operating system B, and another processor core different from the 16-core system can be used to run operating system C. Each operating system is a domain, and the coordination and interaction between the processes of each operating system is multi-domain coordination.
[0063] (4) Process
[0064] A process is a program in a computer system running on a certain data set. It is the basic unit for resource allocation in a computer system and the foundation of the operating system structure. A process is the basic unit of dynamic execution of an operating system. In a traditional operating system, a process is both a basic allocation unit and a basic execution unit. Different processes will have independent spaces in memory, and data between processes is not shared by default.
[0065] After introducing the relevant technical terms of the embodiments of the present application, the application scenarios of the embodiments of the present application are introduced. The embodiments of the present application provide a communication method, which can be applied to electronic devices. The electronic devices include but are not limited to: mobile phones, computers, tablet computers, laptop computers, PDAs, wearable devices (such as smart watches, smart bracelets, pedometers, etc.), vehicle-mounted devices (such as cars, bicycles, electric vehicles, airplanes, ships, trains, high-speed railways, etc.), virtual reality (VR) devices, augmented reality (AR) devices, communication devices (such as connectors, switches, routers, etc.), etc.
[0066] Combine the following Figure 1 The specific structure of the electronic device 10 is described by way of example. The electronic device 10 or a chip system built into the electronic device 10 may include: a processor 101, a memory 102, and instructions stored in the memory 102, and may also include a sensor component 103, a multimedia component 104, and an input / output interface 105. Furthermore, the processor 101, the memory 102, the sensor component 103, the multimedia component 104, and the input / output interface 105 may be connected respectively via a bus 106.
[0067] The processor 101 is the control center of the electronic device 10, and uses various interfaces and lines to connect various parts of the entire device. By running or executing software programs and / or software modules stored in the memory 102, and calling data stored in the memory 102, the processor 101 performs various functions of the electronic device 10 and processes data, thereby monitoring the electronic device 10 as a whole. In the embodiment of the present application, the processor 101 can be used to execute one or more steps in the method embodiment of the present application. For example, when the processor 101 runs the instructions stored in the memory 102, the processor 101 can be used to execute one or more steps in the following method embodiment, so that the electronic device 10 implements the method in the following method embodiment.
[0068] In some embodiments, the processor 101 may be a single processor structure, a multi-processor structure, a single-threaded processor, a multi-threaded processor, etc. In some embodiments, the processor 101 may include at least one of a central processing unit (CPU), a general-purpose processor, a digital signal processor, a neural network processor, a graphics processing unit (GPU), an image signal processor, a microcontroller or a microprocessor, etc. In some embodiments, the processor 101 may further include other hardware circuits or accelerators, such as application-specific integrated circuits, field programmable gate arrays or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The processor 101 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, etc.
[0069] The memory 102 can be used to store data, software programs and modules; it mainly includes a program storage area and a data storage area, wherein the program storage area can store software programs, including instructions formed in code, including but not limited to an operating system, and applications required for at least one function, such as an open file function, etc.; the data storage area can store data created according to the use of the electronic device 10, such as file data, etc.
[0070] The sensor component 103 includes one or more sensors for providing various aspects of status evaluation for the electronic device 10. For example, the acceleration / deceleration, orientation, open / closed state of the electronic device 10, the relative positioning of components, or the temperature change of the electronic device 10 can be detected.
[0071] The multimedia component 104 may provide a screen as an output interface between the electronic device 10 and the user, and the screen may be a touch screen to receive input signals from the user. The multimedia component 104 may also include at least one camera and the like.
[0072] The input / output interface 105 provides an interface between the processor 101 and a peripheral interface module. For example, the peripheral interface module may include a keyboard, a mouse, or a USB (Universal Serial Bus) device, etc. In a possible implementation, the input / output interface 105 may have only one input / output interface or may have multiple input / output interfaces.
[0073] Although not shown, the electronic device 10 may further include an audio component and a communication component, for example, the audio component includes a microphone, and the communication component includes a wireless fidelity (WiFi) module, a Bluetooth module, etc., which will not be described in detail in the present embodiment.
[0074] Combine the following Figure 2 The operating system of the electronic device 10 is illustrated. An operating system 220 running on the main processor core 210 and an operating system 240 running on the slave processor core 230 are deployed in the electronic device 10. The main processor core 210 may include a homogeneous or heterogeneous processor core A, a processor core B, and a processor core C. The operating system 220 may include an application layer 221, a system library 222, and a kernel 223, and the operating system 220 may run most of the business and system services of the electronic device 20. The slave processor core 230 may include a processor core D. The operating system 240 may include an application layer 241, a system library 242, and a kernel 243. Exemplarily, the operating system 240 may include a user state library, and may run software such as a network protocol stack (high performance stack, HPS) and a forwarding plane service (high performance forwar240, HPF) with high performance requirements. Optionally, the operating system 240 may also run software for partial data storage and transmission. The network service can be on the operating system 220 side. When the operating system 220 sends a packet to the outside, the network service request is sent to the operating system 240, and then sent to the outside through the network card via the HPS and HPF.
[0075] Combine the following Figure 3A possible inter-core communication method of the master processor core 310 and the slave processor core 320 is introduced. The master processor core 310 and the slave processor core 320 communicate through transmission buses such as a data bus and a control bus. The master processor core 310 is deployed with software modules such as a first shared data module 311, a first peripheral / shared memory management module 312 and a first system control module 313. The slave processor core 320 is deployed with software modules such as a second shared data module 321, a second peripheral / shared memory management module 322 and a second system control module 323. The first shared data module 311 and the second shared data module 312 are used to transmit data of a memory 330 (the memory 330 can be used as a shared memory), a message queue, a frame queue or a ring queue, the first peripheral / shared memory management module 312 and the second peripheral / shared memory management module 322 are used to transmit control information of peripheral management and shared internal management, and the first system control module 313 and the second system control module 323 are used to transmit interrupt control information. The master processor core 310 sends a request to the slave processor core 320 through an interrupt, uses the memory 330 to implement data transmission, and each processor core implements peripheral access and data channel opening through the control bus.
[0076] Combine the following Figure 4 The process of the master processor core 310 sending data A to the slave processor core 320 for processing is introduced. The process includes steps S110 to S160.
[0077] S110: The main processor core 310 sends a processing request, which includes control information such as the data length of data A and memory access rights.
[0078] S120: Receive the processing request from the processor core 320 and record the control information.
[0079] S130: The main processor core 310 writes data A into the shared memory.
[0080] S140 : The master processor core 310 sends an interrupt request to the slave processor core 320 .
[0081] S150: The slave processor core 320 receives the interrupt request, and reads and processes data A from the shared memory according to the control information.
[0082] S160 : The slave processor core 320 returns the processing result of the data A to the master processor core 310 .
[0083] pass Figure 4The method shown in the figure can perform simple communication between the main processor core 310 and the slave processor core 320 belonging to different domains. For example, the main processor core 310 can send a processing request to the slave processor core 320, and the main processor core 310 can send data to the slave processor core 320. The main processor core 310 can offload some functions to the slave processor core 320, but the slave processor core 320 needs to rely on the file system to access the file, and the communication between the cross-domain processor cores cannot support standard inter-process communication. The main processor core 310 and the slave processor core 320 each consume page cache, and the memory overhead is large. Therefore, it is difficult for the main processor core 310 and the slave processor core 320 to perform deep collaboration.
[0084] Based on this, in order to improve the problem that multiple processor cores belonging to different domains are difficult to deeply collaborate, the embodiment of the present application provides a communication method. Figure 5 and Figure 6 The possible implementation methods of the communication method provided in the embodiment of the present application are introduced. The electronic device includes a first processor core and a second processor core, a first operating system runs on the first processor core, the first operating system includes a first communication module, the second operating system runs on the second processor core, the second operating system includes a second communication module, the first communication module is used to communicate with the second communication module, Figure 5 The method shown is applied to the first communication module, and includes steps S220, S230 and S240. Figure 6 The method shown is applied to the second communication module, and includes steps S210 and S250.
[0085] S210: The second communication module sends a first request to the first communication module, where the first request is used to indicate the identity of the second communication module.
[0086] S220: The first communication module receives a first request from the second communication module.
[0087] S230: When the identity authentication of the second communication module passes, the first communication module processes the first request.
[0088] S240: The first communication module sends a first response obtained by processing the first request to the second communication module.
[0089] S250: The second communication module receives a first response to the first request from the first communication module.
[0090] The operating system is a set of interrelated system software programs that manage and control computer operations, use and run hardware and software resources, and provide public services to organize user interactions. The communication module is a software module in the operating system. For example, please refer to Figure 7The first communication module may include a first control information management module, an identity proxy module, and a first kernel, and the second communication module may include a second control information management module, a request forwarding module, and a second kernel. Steps S210 and S250 may be performed by the second control information management module, steps S220 and S240 may be performed by the first control information management module, and step S230 may be performed by the identity proxy module and the first kernel. The first control information management module may be set in Figure 3 The second control information management module can be set in the first peripheral / shared memory management module 312. Figure 3 In the second peripheral / shared memory management module 322.
[0091] Furthermore, the first request may be a service request initiated by a process running the second operating system. If the first request is a data access type request, the first request may include indication information of the data to be accessed, and may also include control information such as the size of the data to be accessed, access rights (such as read-only, write-only), etc.
[0092] In addition, the first processor core and the second processor core may be integrated in the same chip or located on different chips. The number of the second processor cores may be one or more. The first processor core and the second processor core may be homogeneous processor cores or heterogeneous processor cores. The first processor core and the second processor core may be CPU processor cores, GPU processor cores, or other types of processor cores, which are not limited in the embodiments of the present application.
[0093] In one example, the first processor core may be a master processor core and the second processor core may be a slave processor core. Figure 4 In the method shown, since the master processor core and the slave processor core cannot recognize the identity of the process running by each other, the slave processor core cannot send a request to the master processor core. In this embodiment, since the master processor core can recognize the identity of the slave processor core, the slave processor core can send the first request to the master processor core.
[0094] In another example, the first processor core may be a slave processor core and the second processor core may be a master processor core. Figure 4 In the method shown, the master processor core can only send processing requests and interrupt requests to the slave processor core through inter-core communication. In this embodiment, if the master processor core needs the slave processor core to assist in processing a first request, the first request can indicate the identity of the master processor core, and standard inter-process communication between the master processor core and the slave processor core can be implemented.
[0095] In a possible implementation, both the first operating system and the second operating system support processing the first request, but the computing power of the second processor core is insufficient, so the first request that should be processed by the second processor core is sent to the first processor core for processing.
[0096] In another possible implementation, the first operating system supports processing the first request, but the second operating system does not support processing the first request. For example, when the second processor core is a slave processor core, in order to maintain a high-performance operating environment and reduce system complexity, the second operating system does not include a file system, and the second communication module cannot access data in the hard disk. If the service executed by the second operating system has a need to access file data, the second communication module can send the first request for accessing hard disk data to the first communication module for processing.
[0097] In the technical solution provided in the embodiment of the present application, in an electronic device including multiple operating systems, for the first communication module and the second communication module in different operating systems, the second communication module requires the first communication module to process the request of the second communication module, and the second communication module sends a first request that can indicate the identity of the second communication module to the first communication module, and the first communication module verifies the identity of the second communication module and processes the first request, and returns the processed first response to the second communication module. In this way, for the first communication module and the second communication module belonging to different domains (different operating systems), since the first communication module can identify the identity of the second communication module through the first request, cross-domain standard inter-process communication (standard inter-process communication refers to: communication between processes in the same domain) can be achieved, and the communication capability of the heterogeneous processor core in the communication module is enhanced, so that the first processor core running the first communication module and the second processor core running the second communication module can be deeply coordinated. Further, the hardware resources between different domains can be isolated, the real-time performance of hardware processing can be improved, and the security of some hardware can be improved. Resource sharing between the first communication module and the second communication module can also be achieved to achieve richer functions.
[0098] Next, the identity authentication method of the second communication module is introduced through the following embodiments.
[0099] In a first possible implementation, before S210 (the second communication module sends a first request to the first communication module), the method includes: the second communication module stores the first request in a target memory space, and the target memory space is used to store request data of the second communication module that has passed identity authentication.
[0100] S220 (the first communication module receives the first request from the second communication module) includes: the first communication module obtains the first request from the target memory space. When obtaining the first request from the target memory space, the identity authentication of the second communication module passes.
[0101] Among them, requests during cross-domain communication can be transmitted through memory (the memory is used as shared memory). Requests between two different communication modules can be passed through different memory spaces. Shared memory may include multiple memory spaces, and the electronic device is pre-configured through the system: requests between the first communication module and the second communication module are transmitted through the target memory space in the multiple memory spaces. When the first communication module receives the first request from the target memory space, it can be known that the first request is sent by the second communication module that has passed the identity authentication, and the first communication module can directly trust the relevant data of the first request written by the second communication module in the shared memory.
[0102] Exemplarily, the first processor core is a master processor core, the second processor core is a slave processor core, and the second operating system runs a target process. Before S210 (the second communication module sends a first request to the first communication module), the method further includes: the target process sends the first request to the second core. The request forwarding module in the second communication module intercepts the first request and stores the first request in the target memory space through the second control information management module.
[0103] In this embodiment, the target memory space is preconfigured to store the request data of the second communication module that has passed the identity authentication. The second communication module stores the first request to the target memory space, and the first communication module obtains the first request from the target memory space. In this way, when the first communication module obtains the first request from the target memory space, it can be known that the first request is from the second communication module that has passed the identity authentication. On the one hand, the first communication module can identify the identity of the second communication module, providing a basis for deep collaboration between the first processor core running the first communication module and the second processor core running the second communication module. On the other hand, it is only necessary to preconfigure the first communication module and the second communication module to transmit the request data through the target memory space, without adding the identity authentication step each time a request is sent, and the request sending speed is faster and more convenient.
[0104] In the second possible implementation, please refer to Figure 8 , the second operating system runs a target process, before S210 (the second communication module sends a first request to the first communication module), the method may further include S201 and S202:
[0105] S201: The target process sends an initial request.
[0106] S202: The second communication module obtains an initial request from the target process, and generates a first request according to the initial request, where the first request includes identity information of the second communication module.
[0107] The difference between the initial request and the first request may be that the initial request does not include the identity information of the second communication module, while the first request includes the identity information of the second communication module.
[0108] Exemplarily, the first processor core is a master processor core, and the second processor core is a slave processor core. The target process sends an initial request, which may be: the target process sends an initial request to the second core. Obtaining the initial request from the target process may be: the request forwarding module intercepts the first request. Generating the first request according to the initial request may be: the request forwarding module adds identity information to the initial request to obtain the first request. Figure 4 The method shown is the same as follows: when the target process running on the second operating system needs to process the initial request, it sends the initial request to the second kernel. Figure 4 The method shown is different in that the request forwarding module intercepts the initial request. The interception object of the request forwarding module can be determined according to the request type, such as a data access type request.
[0109] In this embodiment, the target process sends an initial request so that the second operating system processes the initial request. The second communication module obtains the initial request, generates a first request including the identity information of the second communication module according to the initial request, and forwards it to the first communication module for processing. In this way, the request of the target process can be forwarded to the first communication module for processing without changing the target process running code, providing a basis for deep collaboration between the first processor core running the first communication module and the second processor core running the second communication module.
[0110] Exemplarily, the first request includes the identity information of the second communication module. The identity authentication of the second communication module is passed, including: the identity information is authenticated. Before S230 (the first communication module processes the first request when the identity authentication of the second communication module is passed), the method may also include S231: the first communication module authenticates the identity information.
[0111] The identity information in the first request can be used to enable the first communication module to identify the identity of the second communication module. Optionally, the first communication module can receive first requests from multiple second communication modules, and the identity information in the first requests from different second communication modules is different, and each identity information uniquely corresponds to a second communication module.
[0112] Exemplarily, the identity proxy module can execute S231. The identity proxy module can verify the identity information by: verifying through a policy configuration file, mandatory access control (MAC), discretionary access control (DAC) or system configuration. For example, the first communication module includes a policy configuration file. The policy configuration file includes security settings related to identity authentication, password policy, network security and access control of other communication modules, as well as user settings related to configuration files, permissions and restrictions of other communication modules. When the identity proxy module receives the first request, it verifies that the first request comes from the second communication module according to the policy configuration file and the identity authentication information in the first request, and the operation of the first request complies with the permissions, and then determines that the identity information verification is passed.
[0113] In the technical solution provided in the embodiment of the present application, the identity authentication of the second communication module is passed, including: the identity identification information in the first request is verified. In this way, the first communication module can identify the identity of the second communication module, providing a basis for deep collaboration between the first processor core running the first communication module and the second processor core running the second communication module.
[0114] The above describes the process of the second communication module sending the first request and the first communication module verifying the identity of the second communication module. Next, the process of processing the first request will be described.
[0115] In a possible implementation, S230 (the first communication module processes the first request when the identity authentication of the second communication module is passed) includes S232: generating a third request according to the first request, processing the third request, and the first response is a response to the third request.
[0116] Among them, the difference between the first request and the third request is that the initiators of the two requests are different. The initiator of the first request is the target process of the second communication module, and the initiator of the third request is the first communication module. Exemplarily, after the identity proxy module verifies that the identity authentication information of the first request is passed, the third request is generated according to the first request, and the initiator of the third request is the identity proxy module of the first communication module. The identity proxy module of the first communication module, as the proxy process of the second communication module, initiates the third request to the first kernel, and the first kernel will process the third request in the same way as the process request of the first operating system.
[0117] In the technical solution provided in the embodiment of the present application, the first request is a request from the second communication module. The first communication module receives the first request, generates a third request based on the first request, and converts the first request whose initiator is the second communication module into the third request whose initiator is the first communication module, so that the first communication module processes the third request as a request of the first operating system, thereby providing a basis for deep collaboration between the first processor core running the first communication module and the second processor core running the second communication module.
[0118] Next, the processing process after the second communication module receives the first response is introduced. After the second communication module receives the first response, the following implementation methods may be included:
[0119] In the first possible implementation, the first communication module has processed the first request and obtained the first response required by the target process. After receiving the first response obtained by processing the first request, the second communication module sends the first response to the target process. In this way, the second communication module does not need to process the first request, but only performs the function of forwarding the first response. When the second operating system does not support processing the first request or the computing power of the second processor core is insufficient, the first request can be processed through the first communication module, providing a basis for deep collaboration between the first processor core running the first communication module and the second processor core running the second communication module.
[0120] In a second possible implementation, after the first communication module processes the first request, the second communication module is required to perform subsequent processing on the first request. After S250 (receiving a first response to the first request from the first communication module), the method may further include S260: processing the first response and sending the processed first response to the target process. S260 may be executed by the second kernel of the second communication module.
[0121] In the technical solution provided in the embodiment of the present application, after receiving the first response, the second communication module also processes the first response and sends the processed first response to the target process. In this way, the second core only needs to perform simple subsequent processing on the first response. When the second operating system does not support the complete processing of the first request or the computing power of the second processor core is insufficient, the first request can be processed by the first communication module to obtain the first response, providing a basis for deep collaboration between the first processor core running the first communication module and the second processor core running the second communication module.
[0122] In a possible implementation, the method further includes: the second communication module sends a second request to the first communication module, the second request is used to indicate the identity of the second communication module, and the data length of the first request is different from the data length of the second request. The first communication module receives the second request from the second communication module. When the identity authentication of the second communication module is passed, the first communication module processes the second request. The first communication module sends a second response obtained by processing the second request to the second communication module, and the data length of the first response is different from the data length of the second response. The second communication module receives a second response to the second request from the first communication module.
[0123] in, Figure 4 In the method shown, the control information contained in the processing request sent by the master processor core to the slave processor core is information of fixed length, such as a single physical address of a memory. In this embodiment, the data length of the first request sent by the second communication module to the first communication module can be an unfixed length, such as multiple physical addresses of a memory. Similarly, the data length of the first response sent by the first processor core to the second processor core can be an unfixed length.
[0124] In the technical solution provided in the embodiment of the present application, the second communication module can send the first request and the second request to the first communication module for processing, and the data length of the first request is different from the data length of the second request, and the data length of the first response to the first request is different from the data length of the second response to the second request. In this way, when the first communication module and the second communication module communicate, the data length and request type that can be sent are more diverse, and the original multiple requests can be merged into one request to be sent, so that the first processor core running the first communication module and the second processor core running the second communication module can be deeply coordinated.
[0125] In a possible implementation, the first processor core and the second processor core are both coupled to a memory, and the first processor core is also coupled to a non-volatile memory, and illustratively, the memory can be used as a shared memory. The first request is used to request execution of at least one of the following functions: non-volatile memory access, standard inter-process communication, or page fault exception handling.
[0126] In one example, the first request for non-volatile memory access may include: accessing data in the non-volatile memory. The target process run by the second operating system accesses the data in the non-volatile memory, including but not limited to: the target process opens file data in the non-volatile memory, the target process maps (mmap) the file data in the non-volatile memory to the memory, the target process reads the file data in the non-volatile memory, the target process writes the file data in the non-volatile memory, and the target process closes the file data in the non-volatile memory.
[0127] Next, an application scenario of the first request is described by taking the first processor core as a master processor core, the second processor core as a slave processor core, and the non-volatile memory as a hard disk as an example.
[0128] (I) The first request may be used for: the target process to open the file data in the hard disk, and the communication method may include:
[0129] The target process running in the second operating system calls the open function in the function library libc and sends an initial request to the second kernel. The initial request is used to open the target file in the hard disk. The initial request includes the first directory path of the target file in the hard disk.
[0130] The request forwarding module intercepts the initial request, adds the identity information of the second communication module to the initial request to obtain a first request, and sends the first request to the second control information management module.
[0131] The second control information management module receives the first request and sends the first request to the first control information management module. The first control information management module receives the first request and sends the first request to the identity proxy module.
[0132] The identity proxy module determines that the identity identification information in the first request is correct, and sends the first request to the first kernel.
[0133] The first kernel receives and processes the first request. Specifically, the first kernel responds to the first request and allocates a file descriptor to the target file according to the first directory path in the hard disk. The first kernel sends a first response to the identity proxy module, and the first response includes the file descriptor of the target file.
[0134] The identity proxy module receives the first response and sends the first response to the first control information management module. The first control information management module receives the first response and sends the first response to the second control information management module. The second control information management module receives the first response and sends the first response to the request forwarding module.
[0135] The request forwarding module receives the first response and sends the first response to the second kernel, where the first response is used to record the relationship between the file descriptor and the target file.
[0136] The second kernel receives and subsequently processes the first response. Specifically, the second kernel records the relationship between the file descriptor and the target file. The second kernel sends the processed first response to the target process, and the processed first response can be used to indicate that the target file is successfully opened, and the processed first response includes the file descriptor.
[0137] (ii) The first request may be used for: the target process to read the file data in the hard disk, and the communication method may include:
[0138] The target process running in the second operating system calls the read function and sends an initial request to the second kernel. The initial request is used to read the target file in the hard disk. The initial request includes a first virtual address of the memory used to read the target file data and a file descriptor of the target file.
[0139] The request forwarding module intercepts the initial request, adds the identity information of the second communication module to the initial request to obtain a first request, and sends the first request to the second control information management module.
[0140] The first request is sent to the identity proxy module through the second control information management module and the first control information management module. The identity proxy module determines that the identity information in the first request is correct and sends the first request to the first core.
[0141] The first kernel receives and processes the first request. Specifically, the first kernel determines the target file according to the file descriptor of the target file in response to the first request, and writes the data of the target file from the hard disk to the fourth physical address corresponding to the first virtual address of the memory. The first kernel sends a first response to the identity proxy module, and the first response includes the data size of the target file stored in the memory according to the first request.
[0142] After the identity proxy module, the first control information management module, the second control information management module and the request forwarding module, a first response is sent to the second kernel, the second kernel receives the first response, and sends the first response to the target process. Then, the target process can read the data of the target file from the memory according to the first virtual address of the memory.
[0143] (III) The first request may be used for: the target process to write file data in the hard disk, and the communication method may include:
[0144] The target process running in the second operating system writes the target file data to the fifth physical address corresponding to the second virtual address of the memory. The target process calls the write function to send an initial request to the second kernel, the initial request is used to write the target file in the hard disk, and the initial request includes the second virtual address of the memory and the file descriptor of the target file.
[0145] The request forwarding module intercepts the initial request, adds the identity information of the second communication module to the initial request to obtain a first request, and sends the first request to the second control information management module.
[0146] The first request is sent to the identity proxy module through the second control information management module and the first control information management module. The identity proxy module determines that the identity information in the first request is correct and sends the first request to the first core.
[0147] The first kernel receives and processes the first request. Specifically, the first kernel determines the target file according to the file descriptor of the target file in response to the first request, and writes the data of the target file stored at the fifth physical address corresponding to the second virtual address of the memory to the hard disk. The first kernel sends a first response to the identity proxy module, and the first response includes the data size of the target file written to the hard disk according to the first request.
[0148] A first response is sent to the second kernel through the identity proxy module, the first control information management module, the second control information management module and the request forwarding module. The second kernel receives the first response and sends the first response to the target process.
[0149] (iv) The first request may be used to: the target process closes the file data in the hard disk. The communication method may include:
[0150] The target process running in the second operating system calls the close function and sends an initial request to the second kernel. The initial request is used to close the target file and includes a file descriptor of the target file.
[0151] The request forwarding module intercepts the initial request, adds the identity information of the second communication module to the initial request to obtain a first request, and sends the first request to the second control information management module.
[0152] The first request is sent to the identity proxy module through the second control information management module and the first control information management module. The identity proxy module determines that the identity information in the first request is correct and sends the first request to the first core.
[0153] The first kernel receives and processes the first request. Specifically, the first kernel determines the target file according to the file descriptor of the target file in response to the first request. The first kernel sends a first response to the identity proxy module, and the first response is used to indicate the deletion of the corresponding relationship between the target file and the file descriptor.
[0154] A first response is sent to the second kernel through the identity proxy module, the first control information management module, the second control information management module and the request forwarding module, and the first response is used to indicate that the corresponding relationship between the target file and the file descriptor is deleted. The second kernel receives the first response, deletes the corresponding relationship between the target file and the file descriptor, and sends a processed first response to the target process, and the processed first response can be used to indicate that the target file is closed successfully.
[0155] After introducing the relevant contents of the first request for non-volatile memory access, the first request for standard inter-process communication or page fault exception processing is described.
[0156] In one example, the first request can be used for standard inter-process communication. Wherein, standard inter-process communication refers to: communication between processes located in the same domain. Standard inter-process communication includes portable operating system interface inter-process communication (POSIX IPC) and system V inter-process communication (SYSV IPC). Since the first communication module can identify the identity of the second communication module, the first request is identified as a request inside the first communication module, thereby realizing standard inter-process communication.
[0157] In another example, the first request for page fault exception processing may include: obtaining the first physical address corresponding to the third virtual address of the memory when the page fault exception occurs, and establishing a mapping relationship between the first physical address and the third virtual address. Wherein, the page fault exception means that when the process accesses the virtual address of the memory, it is found that the virtual address is not associated with the physical address. At this time, the process sends a page fault exception request to the kernel, and the page fault exception request is used to establish an association between the virtual address and the physical address. After the second communication module sends the page fault exception, the page fault exception request is forwarded to the first communication module. After processing, the first communication module finds the corresponding first physical address (page cache address) and returns it to the second communication module. The second communication module uses the first physical address returned by the first communication module to establish a mapping relationship, thereby enabling the first communication module and the second communication module to share the page cache address and save memory space.
[0158] Next, an application scenario of the first request is described by taking the first processor core as a master processor core, the second processor core as a slave processor core, and the non-volatile memory as a hard disk as an example.
[0159] The target process running in the second operating system accesses the third virtual address of the memory, and the memory feeds back to the target process that the third virtual address is not associated with the physical address. The target process sends an initial request to the second kernel, the initial request is used to obtain the first physical address of the memory and establish a mapping relationship between the first physical address and the third virtual address, and the initial request includes the third virtual address of the memory.
[0160] The request forwarding module intercepts the initial request, adds the identity information of the second communication module to the initial request to obtain a first request, and sends the first request to the second control information management module.
[0161] The first request is sent to the identity proxy module through the second control information management module and the first control information management module. The identity proxy module determines that the identity information in the first request is correct and sends the first request to the first core.
[0162] The first kernel receives and processes the first request. Specifically, the first kernel obtains the first physical address allocated by the memory to the third virtual address in response to the first request. The first kernel sends a first response to the identity proxy module, and the first response includes the first physical address of the memory.
[0163] A first response is sent to the second kernel through the identity proxy module, the first control information management module, the second control information management module and the request forwarding module. The first response is used to indicate the establishment of a mapping relationship between the third virtual address and the first physical address of the memory. The second kernel receives the first response and writes the mapping relationship between the third virtual address and the first physical address into the page table of the memory. The second kernel sends the processed first response to the target process, and the processed first response can be used to indicate that the mapping relationship between the first physical address and the third virtual address is successfully established. As a result, both the first communication module and the second communication module can use the mapping relationship between the first physical address and the third virtual address to realize that the first communication module and the second communication module share the page cache address.
[0164] Among them, Figure 4 In the method shown, for a service that the master processor core needs to send multiple requests to the slave processor core to process, in this embodiment, the first processor core only needs to send one first request to the second processor core to process it. Figure 4 In the method shown, the request sent by the master processor to the slave processor includes only one physical address. In this embodiment, the first request may include multiple physical addresses, so multiple shared page cache services can be executed at one time.
[0165] In the technical solution provided in the embodiment of the present application, the first request is used to perform at least one of the following: non-volatile memory access, standard inter-process communication, or page fault exception handling. In this way, on the one hand, the second communication module does not have to rely on the file system to access files, the second communication module can access the files of the first communication module, the second communication module and the first communication module can achieve shared file access, and the first communication module can offload core services to the second communication module for processing. On the other hand, the first communication module and the second communication module can achieve collaboration on page fault exceptions, so that the first communication module and the second communication module can share page cache and save memory space. On the other hand, the first communication module and the second communication module can achieve cross-domain standard inter-process communication. Therefore, deep collaboration can be performed between the first processor core running the first communication module and the second processor core running the second communication module.
[0166] An embodiment of the present application also provides a communication device. Fig. 9 A schematic diagram of a communication device provided for an embodiment of the present application. The device includes a first communication module in a first operating system, the first operating system runs on a first processor core, the first communication module is used to communicate with a second communication module in a second operating system, the second operating system runs on a second processor core, the first processor core and the second processor core are located in the same electronic device, and the first communication module includes a first control information management module and a first processing module. The first control information management module is used to receive a first request from the second communication module, the first request is used to indicate the identity of the second communication module. The first processing module is used to process the first request when the identity authentication of the second communication module is passed. The first control information management module is used to send a first response obtained by processing the first request to the second communication module.
[0167] In an optional implementation, the first control information management module is specifically used to obtain the first request from the target memory space, and the target memory space is used to store the request data of the second communication module that has passed the identity authentication. When the first request is obtained from the target memory space, the identity authentication of the second communication module is passed.
[0168] In an optional implementation, the first control information management module supports the transmission of information of different data lengths. The first control information management module is also used to receive a second request from the second communication module, the second request is used to indicate the identity of the second communication module, and the data length of the first request is different from the data length of the second request. The first processing module is also used to process the second request when the identity authentication of the second communication module is passed. The first control information management module is also used to send a second response obtained by processing the second request to the second communication module, and the data length of the first response is different from the data length of the second response.
[0169] In an optional implementation, the first processing module includes an identity proxy module and a first kernel. The identity proxy module is used to generate a third request according to the first request. The first kernel is used to process the third request, and the first response is a response to the third request.
[0170] In an optional implementation, the first request includes identity information of the second communication module, and the first processing module includes an identity proxy module. The identity proxy module is used to verify the identity information. The identity authentication of the second communication module passes, including: the identity information verification passes.
[0171] In an optional implementation, the first request is used to request execution of at least one of the following functions: non-volatile memory access, standard inter-process communication, or page fault exception handling.
[0172] It is understandable that the functional modules of the above communication device can be used to implement Figure 5 or Figure 8 At least one step in the communication method shown is described in detail in the aforementioned communication method embodiment, and the effect that can be achieved can be referred to the aforementioned communication method embodiment, which will not be repeated here.
[0173] An embodiment of the present application also provides a communication device. Fig.10 A schematic diagram of another communication device provided for an embodiment of the present application. The device includes a second communication module in a second operating system, the second operating system runs on a second processor core, the second communication module is used to communicate with a first communication module in a first operating system, the first operating system runs on a first processor core, the first processor core and the second processor core are located in the same electronic device, and the second communication module includes a second control information management module. The second control information management module is used to send a first request to the first communication module, the first request is used to indicate the identity of the second communication module. The second control information management module is used to receive a first response to the first request from the first communication module.
[0174] In an optional implementation, the second control information management module is specifically used to store the first request in a target memory space, and the target memory space is used to store request data of the second communication module that has passed identity authentication.
[0175] In an optional implementation, the second control information management module supports the transmission of information of different data lengths. The second control information management module is further used to send a second request to the first communication module, the second request is used to indicate the identity of the second communication module, and the data length of the first request is different from the data length of the second request. The second control information management module is also used to receive a second response to the second request from the first communication module, and the data length of the first response is different from the data length of the second response.
[0176] In an optional implementation, the second communication module further includes a request forwarding module, the second operating system runs a target process, and the request forwarding module is used to obtain an initial request from the target process and generate a first request according to the initial request, wherein the first request includes the identity information of the second communication module.
[0177] In an optional implementation, the second communication module further includes a second kernel. The second kernel is configured to process the first response and send the processed first response to the target process.
[0178] In an optional implementation, the first request is used to request execution of at least one of the following functions: non-volatile memory access, standard inter-process communication, or page fault exception handling.
[0179] It is understandable that the functional modules of the above communication device can be used to implement Figure 6 or Figure 8 At least one step in the communication method shown is described in detail in the aforementioned communication method embodiment, and the effect that can be achieved can be referred to the aforementioned communication method embodiment, which will not be repeated here.
[0180] The present application also provides a chip system. The structure of the electronic device can refer to Fig.11 The chip system includes a first processor core and a second processor core. The first processor core runs a first operating system including a first communication module, and the first communication module is used to perform at least one step in the corresponding method embodiment above, such as Figure 5 and Figure 8 The second processor core runs a second operating system including a second communication module, and the second communication module is used to execute at least one step in the above corresponding method embodiment, such as Figure 6 and Figure 8 at least one step in .
[0181] It is understandable that the chip system can be used to implement Figure 5 or Figure 6 or Figure 8At least one step in the communication method shown is described in detail in the aforementioned communication method embodiment, and the effect that can be achieved can be referred to the aforementioned communication method embodiment, which will not be repeated here.
[0182] The present application also provides an electronic device. The structure of the electronic device can refer to Fig.12 The electronic device comprises the chip system and a memory. The memory stores instructions. When the chip system runs the instructions in the memory, the electronic device executes Figure 5 or Figure 6 or Figure 8 At least one step in the communication method shown. It can be understood that, since each step has been described in detail in the aforementioned communication method embodiment, the effect that can be achieved can refer to the aforementioned communication method embodiment, and will not be repeated here. Exemplarily, the electronic device includes at least one of the following: a receiver, a switch, a router or a car.
[0183] The present application also provides a computer-readable storage medium. The computer-readable storage medium stores program code, which can be called and executed by a processor. Figure 5 or Figure 6 or Figure 8 It is understandable that, since each step has been described in detail in the aforementioned communication method embodiment, the effects that can be achieved can refer to the aforementioned communication method embodiment, and will not be repeated here.
[0184] Finally, it should be noted that the above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A communication method, characterized in that: The method is applied to a request forwarding module in a second communication module in a second operating system, the second communication module further includes a second kernel and a target process, the second operating system runs on a second processor core, the second communication module is used to communicate with a first communication module in a first operating system, the first operating system runs on a first processor core, the first processor core and the second processor core are located in the same electronic device, and the method includes: The request forwarding module receives an initial request from the target process, where the initial request is a request sent by the target process to the second kernel; The request forwarding module generates a first request according to the initial request, where the first request is used to indicate the identity of the second communication module; The request forwarding module sends the first request to the first communication module; The request forwarding module receives a first response to the first request from the first communication module.
2. The method according to claim 1, characterized in that The sending a first request to the first communication module includes: The request forwarding module stores the first request in a target memory space, and the target memory space is used to store request data of the second communication module that has passed identity authentication.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: The second communication module sends a second request to the first communication module, where the second request is used to indicate the identity of the second communication module, and a data length of the first request is different from a data length of the second request; The second communication module receives a second response to the second request from the first communication module, and a data length of the first response is different from a data length of the second response.
4. The method according to claim 1, characterized in that: The first request includes identity information of the second communication module, where the identity information is used to identify the identity of the second communication module.
5. The method according to claim 4, characterized in that After receiving the first response to the first request from the first communication module, the method further includes: The request forwarding module sends the first response to the second core; The second kernel receives the first response, processes the first response, and sends the processed first response to the target process.
6. The method according to claim 1, 2, 4 or 5, characterized in that: The first request is used to request execution of at least one of the following functions: non-volatile memory access, standard inter-process communication, or page fault exception processing.
7. A communication method, characterized in that: The method is applied to an identity proxy module in a first communication module in a first operating system, the first communication module further comprising a first kernel, the first operating system running on a first processor core, the first communication module being used to communicate with a second communication module in a second operating system, the second operating system running on a second processor core, the first processor core and the second processor core being located in the same electronic device, the method comprising: The identity proxy module receives a first request from the second communication module, where the first request is used to indicate the identity of the second communication module; When the identity authentication of the second communication module is passed, the identity proxy module generates a third request according to the first request, wherein the third request is used to indicate that the initiator of the third request is the identity proxy module; The identity proxy module sends the third request to the first kernel; The identity proxy module receives a first response sent by the first kernel and obtained by processing the third request; The identity proxy module sends the first response to the second communication module.
8. The method according to claim 7, characterized in that The identity proxy module receives a first request from the second communication module, including: The identity proxy module obtains the first request from a target memory space, where the target memory space is used to store request data of the second communication module that has passed identity authentication; Wherein, when the identity proxy module obtains the first request from the target memory space, the identity authentication of the second communication module is passed.
9. The method according to claim 7 or 8, characterized in that: The method further comprises: The first communication module receives a second request from the second communication module, where the second request is used to indicate the identity of the second communication module, and a data length of the first request is different from a data length of the second request; The first communication module processes the second request when the identity authentication of the second communication module passes; The first communication module sends a second response obtained by processing the second request to the second communication module, and a data length of the first response is different from a data length of the second response.
10. The method according to claim 7, characterized in that The first request includes identity information of the second communication module; The identity authentication of the second communication module passes, including: the identity identification information verification passes.
11. The method according to claim 7, 8 or 10, characterized in that The first request is used to request execution of at least one of the following functions: non-volatile memory access, standard inter-process communication, or page fault exception processing.
12. A communication device, characterized in that: The device includes a request forwarding module in a second communication module in a second operating system, the second communication module also includes a second kernel and a target process, the second operating system runs on a second processor core, the second communication module is used to communicate with a first communication module in a first operating system, the first operating system runs on a first processor core, and the first processor core and the second processor core are located in the same electronic device; The request forwarding module is used to receive an initial request from the target process, where the initial request is a request sent by the target process to the second kernel; The request forwarding module is further used to generate a first request according to the initial request, wherein the first request is used to indicate the identity of the second communication module; The request forwarding module is further used to send the first request to the first communication module; The request forwarding module is further configured to receive a first response to the first request from the first communication module.
13. The device according to claim 12, characterized in that The request forwarding module is specifically used to store the first request in a target memory space, and the target memory space is used to store the request data of the second communication module that has passed the identity authentication.
14. The device according to claim 12 or 13, characterized in that The second communication module supports the transmission of information of different data lengths; The second communication module is used to send a second request to the first communication module, where the second request is used to indicate the identity of the second communication module, and the data length of the first request is different from the data length of the second request; The second communication module is further configured to receive a second response to the second request from the first communication module, wherein a data length of the first response is different from a data length of the second response.
15. The device according to claim 12, characterized in that The first request includes identity information of the second communication module, where the identity information is used to identify the identity of the second communication module.
16. The device according to claim 15, characterized in that The request forwarding module is further configured to send the first response to the second core; The second kernel is used to receive the first response, process the first response, and send the processed first response to the target process.
17. The device according to claim 12, 13, 15 or 16, characterized in that The first request is used to request execution of at least one of the following functions: non-volatile memory access, standard inter-process communication, or page fault exception processing.
18. A communication device, characterized in that: The device includes an identity proxy module in a first communication module in a first operating system, the first communication module also includes a first kernel, the first operating system runs on a first processor core, the first communication module is used to communicate with a second communication module in a second operating system, the second operating system runs on a second processor core, and the first processor core and the second processor core are located in the same electronic device; The identity proxy module is used to receive a first request from the second communication module, where the first request is used to indicate the identity of the second communication module; The identity proxy module is further configured to generate a third request according to the first request when the identity authentication of the second communication module is passed, wherein the third request is configured to indicate that the initiator of the third request is the identity proxy module; The identity proxy module is further used to send the third request to the first kernel; The identity proxy module is further configured to receive a first response sent by the first kernel and obtained by processing the third request; The identity proxy module is further used to send the first response to the second communication module.
19. The device according to claim 18, characterized in that The identity proxy module is specifically used to obtain the first request from a target memory space, and the target memory space is used to store the request data of the second communication module that has passed the identity authentication; Wherein, when the identity proxy module obtains the first request from the target memory space, the identity authentication of the second communication module is passed.
20. The device according to claim 18 or 19, characterized in that The first communication module is used to receive a second request from the second communication module, where the second request is used to indicate the identity of the second communication module, and the data length of the first request is different from the data length of the second request; The first communication module is further configured to process the second request when the identity authentication of the second communication module passes; The first communication module is further configured to send a second response obtained by processing the second request to the second communication module, wherein a data length of the first response is different from a data length of the second response.
21. The device according to claim 18, characterized in that The first request includes identity information of the second communication module; The identity proxy module is used to verify the identity identification information; The identity authentication of the second communication module passes, including: the identity identification information verification passes.
22. The device according to claim 18, 19 or 21, characterized in that The first request is used to request execution of at least one of the following functions: non-volatile memory access, standard inter-process communication, or page fault exception processing.
23. A chip system, characterized in that: The chip system includes a first processor core and a second processor core; The first processor core runs a first operating system, the first operating system includes a first communication module, and the first communication module is used to execute the communication method according to any one of claims 7 to 11; The second processor core runs a second operating system, the second operating system includes a second communication module, and the second communication module is used to execute the communication method according to any one of claims 1 to 6.
24. An electronic device, characterized in that: The electronic device comprises a memory and a chip system as claimed in claim 23.
25. The electronic device according to claim 24, characterized in that: The electronic device includes at least one of the following: a receiver, a switch, a router or a car.
26. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Method and device for communication between user process and system service
CN104216862A
Data processing method and device, equipment and machine readable medium
CN111400726A
Inter-core data processing method and system, system on chip and electronic equipment
CN112732628A