Communication method and apparatus, chip system, and electronic device
By introducing a communication module into the electronic device, cross-domain standard process communication between the main processor core and the slave processor core is solved, and the problem of difficulty in coordination in the prior art is improved, and communication capabilities and system performance are improved.
Patent Information
- Application Number
- PCT/CN2024/079482
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-31
- Filing Date
- 2024-02-29
- Publication Date
- 2025-03-06
AI Technical Summary
In the prior art, it is difficult to coordinate between the master processor core and the slave processor core, resulting in insufficient cross-domain communication capabilities and difficult to achieve deep collaboration.
By introducing a communication module into the electronic device, the first communication module in the first operating system communicates with the second communication module in the second operating system, and cross-domain standard inter-process communication is realized. The specific method includes receiving a request from the second communication module, post-authentication processing the request, and returning a response.
The communication capabilities between heterogeneous processor cores are enhanced, allowing deep collaboration between the master processor core and the slave processor core, improving the isolation, real-time and security of hardware resources, realizing resource sharing, and expanding functions.
Smart Images

Figure CN2024079482_06032025_PF_FP_ABST
Abstract
Description
Communication method, device, chip system and electronic device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on August 31, 2023, with application number 202311137203.0 and application name “Communication Methods, Devices, Chip Systems and Electronic Devices”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] 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
[0003] With the development of information technology and the increasing demand for it, traditional single-core systems-on-chip (SoCs) are no longer able to meet these demands, leading to the gradual development of homogeneous or heterogeneous multi-core SoCs. SoCs can consist of multiple processors, either identical or different, with varying performance and application needs. Each processor core leverages its own computing strengths to achieve optimal resource allocation, improve overall performance, reduce power consumption, and simplify development. Therefore, inter-core communication mechanisms and software programming models are crucial for achieving optimal multi-core performance. Currently, most homogeneous or heterogeneous multi-core processors utilize a master-slave architecture, and existing technologies struggle with coordination between the master and slave processor cores.
[0004] Summary of the Invention
[0005] 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.
[0006] To achieve the above objectives, the present invention adopts the following technical solutions:
[0007] 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, and the first processor core and the second processor core are located in the same electronic device. The method includes: receiving a first request from the second communication module, 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, processing the first request; and sending a first response obtained by processing the first request to the second communication module.
[0008] 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 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. Furthermore, 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 achieved to achieve richer functions.
[0009] 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, the target memory space being 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.
[0010] In a possible implementation of the first aspect, the method further includes: receiving a second request from the second communication module, the second request being used to indicate the identity of the second communication module, the data length of the first request being different from the data length of the second request; processing the second request when the identity authentication of the second communication module is passed; and sending a second response obtained by processing the second request to the second communication module, the data length of the first response being 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 be sent, so that the first processor core running the first communication module and the second processor core running the second communication module can perform deep collaboration.
[0011] 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 initiated by the second communication module into the third request initiated by 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.
[0012] In one possible implementation of the first aspect, the first request includes identity information of the second communication module; and the second communication module's identity authentication being successful includes: identity information verification being successful. In this 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 a first processor core running the first communication module and a second processor core running the second communication module.
[0013] 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, and shared file access can be achieved between the second communication module and the first communication module, 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 achieved between the first processor core running the first communication module and the second processor core running the second communication module.
[0014] 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, and 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 being used to indicate the identity of the second communication module; and receiving a first response to the first request from the first communication module.
[0015] 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. The first communication module processes the first request and returns a first response, and the second communication module can thereby 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. Furthermore, 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.
[0016] In a possible implementation of the second aspect, sending a first request to the 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 comes 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.
[0017] 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 be sent, so that the first processor core running the first communication module and the second processor core running the second communication module can collaborate deeply.
[0018] 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.
[0019] In a possible implementation of the second aspect, after receiving the first response to the first request from the first communication module, the method further includes: processing the first response and sending the processed first response to the 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.
[0020] 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, and shared file access can be achieved between the second communication module and the first communication module, 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 carried out between the first processor core running the first communication module and the second processor core running the second communication module.
[0021] 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 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 first communication module including a first control information management module and a first processing module; the first control information management module being used to receive a first request from the second communication module, the first request being used to indicate the identity of the second communication module; the first processing module being used to process the first request when the identity authentication of the second communication module is passed; and the first control information management module being used to send a first response obtained by processing the first request to the second communication module.
[0022] 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.
[0023] 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.
[0024] 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.
[0025] In a possible implementation of the third aspect, the first request includes identity identification 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 identification information; the identity authentication of the second communication module is passed, including: the identity identification information verification is passed.
[0026] 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.
[0027] In a fourth aspect, a communication device is provided, which includes a second communication module in a second operating system, the second operating system running on a second processor core, the second communication module being used to communicate with a first communication module in a first operating system, the first operating system running on a first processor core, the first processor core and the second processor core being located in the same electronic device, the second communication module including a second control information management module; the second control information management module being used to send a first request to the first communication module, the first request being used to indicate the identity of the second communication module; and the second control information management module being used to receive a first response to the first request from the first communication module.
[0028] In a possible implementation manner of the fourth aspect, the second control information management module is specifically configured to store the first request in a target memory space, and the target memory space is configured to store request data of the second communication module that has passed identity authentication.
[0029] 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.
[0030] 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 and generate a first request based on the initial request, and the first request includes identity information of the second communication module.
[0031] In a possible implementation of the fourth aspect, 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.
[0032] 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.
[0033] In a fifth aspect, a chip system is provided, comprising a first processor core and a second processor core. The first processor core runs a first operating system, which includes the 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, which includes the second communication module provided in the second aspect or any possible implementation of the second aspect.
[0034] In a sixth aspect, an electronic device is provided, which includes a memory such as the chip system provided in the fifth aspect.
[0035] 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.
[0036] 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 the communication method provided by the first aspect or any possible implementation of the first aspect.
[0037] 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 the communication method provided in the second aspect or any possible implementation of the second aspect.
[0038] In 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 caused to execute the communication method provided in the first aspect or any possible implementation manner of the first aspect.
[0039] In yet 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 caused to execute the communication method provided in the second aspect or any possible implementation manner of the second aspect.
[0040] 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
[0041] FIG1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0042] FIG2 is a schematic diagram of an operating system provided in an embodiment of the present application;
[0043] FIG3 is a schematic diagram of a master processor core and a slave processor core provided in an embodiment of the present application;
[0044] FIG4 is a flow chart of a communication method according to an embodiment of the present application;
[0045] FIG5 is a second flow chart of a communication method provided in an embodiment of the present application;
[0046] FIG6 is a third flow chart of a communication method provided in an embodiment of the present application;
[0047] FIG7 is a schematic diagram of a communication module provided in an embodiment of the present application;
[0048] FIG8 is a fourth flow chart of a communication method provided in an embodiment of the present application;
[0049] FIG9 is a schematic diagram of a communication device provided in an embodiment of the present application;
[0050] FIG10 is a schematic diagram of another communication device provided in an embodiment of the present application;
[0051] FIG11 is a schematic diagram of a chip system provided in an embodiment of the present application;
[0052] FIG12 is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] In the embodiments of the present application, "at least one" refers to one or more, and "more" 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: the existence of A alone, the existence of A and B at the same time, and the existence of B 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 previous and next associated objects are in an "or" relationship. In addition, in the embodiments of the present application, words such as "first" and "second" do not limit the quantity and execution order.
[0054] 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 B only having step A.
[0055] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0056] 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.
[0057] (1) Processor core, single-core processor and multi-core processor
[0058] A processor core refers to the core circuitry of a processor, excluding the packaging and auxiliary circuitry (such as pin interface circuitry, power supply circuitry, and clock circuitry). The processor core circuitry performs control and information processing functions. For example, a processor core reads instructions from the processor's internal memory and executes the control and computing tasks specified by those instructions. The processor core may be referred to as simply a processor core or core.
[0059] A single-core processor is one that integrates a single processor core and associated supporting circuitry. A multi-core processor is one that integrates multiple processor cores and associated supporting circuitry. Multi-core processors typically include more supporting circuitry than single-core processors to facilitate communication and coordination between the multiple processor cores.
[0060] Multi-core processors can process single-threaded tasks just like single-core processors, but they can break down tasks and use multiple cores to run them simultaneously to increase processing speed.
[0061] (2) Homogeneous multi-core processors and heterogeneous multi-core processors
[0062] From a hardware perspective, multi-core designs fall into two categories. If all cores or processors have the same architecture, it's called homogeneous multi-core; if the architectures are different, it's called heterogeneous multi-core. From an application perspective, homogeneous multi-core processors are mostly composed of general-purpose processor cores, each capable of independent operation. Heterogeneous multi-core processors, on the other hand, typically combine general-purpose processors, digital signal processors (DSPs), field-programmable gate arrays (FPGAs), media processors, network processors, and other processor cores. Each processor core is configured to meet specific requirements, thereby improving the application's computing performance or real-time performance.
[0063] (3) Multi-domain collaboration
[0064] An independent execution environment running on independent resources is called a domain. Domains can be homogeneous or heterogeneous. For example, in a 16-core system (which can be integrated into one or more processors), processor cores 0 through 11 can be used to run operating system (OS) A, processor cores 12 through 15 can be used to run OS B, and another processor core different from the 16-core system can be used to run OS C. Each operating system is a domain, and the coordination and interaction between processes within each operating system is called multi-domain coordination.
[0065] (4) Process
[0066] A process is a program's execution activity on a set of data within a computer system. It is the fundamental unit of resource allocation and the foundation of operating system architecture. It is the basic unit of dynamic execution within an operating system. In traditional operating systems, a process serves as both the basic unit of allocation and the basic unit of execution. Different processes have their own dedicated memory space, and by default, data between processes is not shared.
[0067] 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, laptops, 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.
[0068] The specific structure of the electronic device 10 is described below with reference to FIG1 . 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. It may also include a sensor component 103, a multimedia component 104, and an input / output interface 105. The processor 101, the memory 102, the sensor component 103, the multimedia component 104, and the input / output interface 105 may be connected to each other via a bus 106.
[0069] The processor 101 is the control center of the electronic device 10. It connects the various parts of the entire device using various interfaces and lines. By running or executing software programs and / or software modules stored in the memory 102 and calling data stored in the memory 102, it 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, thereby enabling the electronic device 10 to implement the method in the following method embodiment.
[0070] 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. 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, and the like.
[0071] 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 a file opening function, etc.; the data storage area can store data created according to the use of the electronic device 10, such as file data, etc.
[0072] The sensor assembly 103 includes one or more sensors for providing various status assessments for the electronic device 10. For example, the sensor assembly 103 can detect the acceleration / deceleration, orientation, open / close state of the electronic device 10, relative positioning of components, or temperature changes of the electronic device 10.
[0073] 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, etc.
[0074] 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. In one possible implementation, the input / output interface 105 may have only one input / output interface or multiple input / output interfaces.
[0075] 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 embodiment of the present application.
[0076] The operating system of the electronic device 10 is illustrated below with reference to FIG2 . The electronic device 10 is deployed with an operating system 220 running on the main processor core 210 and an operating system 240 running on the slave processor core 230. The main processor core 210 may include homogeneous or heterogeneous processor cores A, B, and C. The operating system 220 may include an application layer 221, a system library 222, and a kernel 223. 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-mode library and may run software such as a network protocol stack (high performance stack, HPS) and forwarding plane services (high performance forward240, 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 HPS and HPF through the network card.
[0077] A possible inter-core communication method between the master processor core 310 and the slave processor core 320 is described below with reference to FIG3 . The master processor core 310 and the slave processor core 320 communicate via 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 from the memory 330 (which can be used as 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 for peripheral and shared memory management. 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 opens a data channel through a control bus.
[0078] 4 , the process of the master processor core 310 sending data A to the slave processor core 320 for processing is described below. The process includes steps S110 to S160.
[0079] 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.
[0080] S120: Receive the processing request from the processor core 320 and record the control information.
[0081] S130: The main processor core 310 writes data A into the shared memory.
[0082] S140 : The master processor core 310 sends an interrupt request to the slave processor core 320 .
[0083] 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.
[0084] S160 : The slave processor core 320 returns the processing result of the data A to the master processor core 310 .
[0085] Through the method shown in Figure 4, simple communication can be carried out 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 have deep collaboration.
[0086] Based on this, in order to improve the problem that it is difficult to deeply collaborate between multiple processor cores belonging to different domains, an embodiment of the present application provides a communication method. The following is an introduction to the possible implementation methods of the communication method provided by the embodiment of the present application in conjunction with Figures 5 and 6. 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, and the method shown in Figure 5 is applied to the first communication module, including steps S220, S230 and S240. The method shown in Figure 6 is applied to the second communication module, including steps S210 and S250.
[0087] 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.
[0088] S220: The first communication module receives a first request from the second communication module.
[0089] S230: When the identity authentication of the second communication module is passed, the first communication module processes the first request.
[0090] S240: The first communication module sends a first response obtained by processing the first request to the second communication module.
[0091] S250: The second communication module receives a first response to the first request from the first communication module.
[0092] The operating system is a set of interrelated system software programs that manage and control computer operations, utilize 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, referring to Figure 7, the 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 provided in the first peripheral / shared memory management module 312 in Figure 3. The second control information management module may be provided in the second peripheral / shared memory management module 322 in Figure 3.
[0093] 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 information indicating 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.
[0094] In addition, the first processor core and the second processor core may be integrated into the same chip or located on different chips. The number of 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, and the embodiments of the present application do not limit this.
[0095] In one example, the first processor core may be a master processor core, and the second processor core may be a slave processor core. In the method shown in FIG4 , because the master processor core and the slave processor core cannot recognize the identities of the processes running on each other, the slave processor core cannot send a request to the master processor core. In this embodiment, because 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.
[0096] In another example, the first processor core may be a slave processor core, and the second processor core may be a master processor core. In the method shown in FIG4 , the master processor core can only send processing requests and interrupt requests to the slave processor core via inter-core communication. In this embodiment, if the master processor core requires assistance from the slave processor core in processing a first request, the first request may indicate the identity of the master processor core, enabling standard inter-process communication between the master and slave processor cores.
[0097] 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.
[0098] In another possible implementation, the first operating system supports processing the first request, but the second operating system does not. For example, when the second processor core is a slave processor core, 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 on the hard disk. If the service executed by the second operating system requires access to file data, the second communication module can send the first request for accessing hard disk data to the first communication module for processing.
[0099] 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. 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 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.
[0100] Next, the identity authentication method of the second communication module is introduced through the following embodiments.
[0101] 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 the request data of the second communication module that has passed authentication.
[0102] 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 the first request is obtained from the target memory space, the identity authentication of the second communication module is passed.
[0103] Among them, requests during cross-domain communication can be transmitted through memory (which 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 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.
[0104] 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. A request forwarding module in the second communication module intercepts the first request and stores the first request in the target memory space via the second control information management module.
[0105] In this embodiment, 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 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 comes 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.
[0106] In a second possible implementation, referring to FIG8 , the second operating system runs a target process. Before S210 (the second communication module sends the first request to the first communication module), the method may further include S201 and S202:
[0107] S201: The target process sends an initial request.
[0108] 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.
[0109] 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.
[0110] Exemplarily, the first processor core is the master processor core, and the second processor core is the slave processor core. The target process sends an initial request, which can be: the target process sends the initial request to the second core. Obtaining the initial request from the target process can be: the request forwarding module intercepts the first request. Generating the first request according to the initial request can be: the request forwarding module adds identity information to the initial request to obtain the first request. Among them, the same as the method shown in Figure 4 is that: when the target process running on the second operating system needs to process the initial request, it sends the initial request to the second core. Different from the method shown in Figure 4 is 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.
[0111] In this embodiment, the target process sends an initial request for the second operating system to process. The second communication module receives the initial request and, based on the initial request, generates a first request including the second communication module's identity information and forwards it to the first communication module for processing. In this way, the target process's request can be forwarded to the first communication module for processing without changing the target process's running code, providing a foundation for deep collaboration between the first processor core running the first communication module and the second processor core running the second communication module.
[0112] Exemplarily, the first request includes identity information of the second communication module. Passing the identity authentication of the second communication module includes: passing the verification of the identity information. Before S230 (the first communication module processes the first request when the identity authentication of the second communication module passes), the method may further include S231: the first communication module verifies the identity information.
[0113] 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.
[0114] 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 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 based on the policy configuration file and the authentication information in the first request, and that the operation of the first request complies with the permissions, and then determines that the identity information verification is passed.
[0115] In the technical solution provided in the embodiments of the present application, the second communication module's identity verification is successful, including: the identity information in the first request is verified successfully. This allows the first communication module to identify 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.
[0116] 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. The following describes the process of processing the first request.
[0117] 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.
[0118] The difference between the first request and the third request is that the two requests are initiated by different parties. The initiator of the first request is the target process of the second communication module, while the initiator of the third request is the first communication module. For example, after the identity proxy module verifies that the authentication information of the first request has been passed, it generates a third request based on the first request. 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, acting as a proxy process for the second communication module, initiates the third request to the first kernel. The first kernel processes the third request in the same manner as it processes a process request of the first operating system.
[0119] 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 initiated by the second communication module into the third request initiated by 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.
[0120] Next, the processing process after the second communication module receives the first response is described. After the second communication module receives the first response, the following implementation methods may be included:
[0121] In a first possible implementation, the first communication module has already 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 and 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 by 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.
[0122] 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 core of the second communication module.
[0123] 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.
[0124] In one possible embodiment, the method further includes: the second communication module sending a second request to the first communication module, the second request being used to indicate the identity of the second communication module, and the data length of the first request being different from the data length of the second request. The first communication module receiving the second request from the second communication module. When the identity authentication of the second communication module is successful, the first communication module processes the second request. The first communication module sending a second response obtained by processing the second request to the second communication module, the data length of the first response being different from the data length of the second response. The second communication module receiving the second response from the first communication module in response to the second request.
[0125] In the method shown in FIG4 , the control information contained in the processing request sent by the master processor core to the slave processor core is fixed-length information, such as a single physical address in memory. In this embodiment, the data length of the first request sent by the second communication module to the first communication module can be variable, such as multiple physical addresses in memory. Similarly, the data length of the first response sent by the first processor core to the second processor core can be variable.
[0126] 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.
[0127] In one possible implementation, both the first processor core and the second processor core are coupled to a memory, and the first processor core is further coupled to a non-volatile memory. Exemplarily, the memory can be used as 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.
[0128] In one example, the first request for accessing the non-volatile memory may include: accessing data in the non-volatile memory. The target process running the second operating system accesses the data in the non-volatile memory, including but not limited to: the target process opening file data in the non-volatile memory, the target process mapping (mmap) the file data in the non-volatile memory to memory, the target process reading the file data in the non-volatile memory, the target process writing the file data in the non-volatile memory, and the target process closing the file data in the non-volatile memory.
[0129] 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.
[0130] (1) The first request may be used for the target process to open the file data in the hard disk. The communication method may include:
[0131] 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.
[0132] 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.
[0133] 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.
[0134] 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.
[0135] The first kernel receives and processes the first request. Specifically, in response to the first request, the first kernel allocates a file descriptor for 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, the first response including the file descriptor of the target file.
[0136] 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.
[0137] The request forwarding module receives the first response and sends the first response to the second core, where the first response is used to record the relationship between the file descriptor and the target file.
[0138] 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. The processed first response can be used to indicate that the target file was successfully opened. The processed first response includes the file descriptor.
[0139] (2) The first request may be used for the target process to read the file data in the hard disk. The communication method may include:
[0140] 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.
[0141] 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.
[0142] After passing through the second control information management module and the first control information management module, the first request is sent to the identity proxy module. The identity proxy module determines that the identity identification information in the first request is correct and sends the first request to the first core.
[0143] The first kernel receives and processes the first request. Specifically, in response to the first request, the first kernel determines the target file based on the file descriptor of the target file and writes the data of the target file from the hard disk to the fourth physical address corresponding to the first virtual address in the memory. The first kernel sends a first response to the identity proxy module, the first response including the data size of the target file stored in the memory according to the first request.
[0144] The 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. The target process can then read the data of the target file from the memory according to the first virtual address of the memory.
[0145] (3) The first request may be used to: the target process writes file data to the hard disk, and the communication method may include:
[0146] A target process running on the second operating system writes target file data to a fifth physical address corresponding to the second virtual address of the memory. The target process calls a write function to send an initial request to the second kernel, the initial request being used to write the target file to the hard disk, the initial request including the second virtual address of the memory and a file descriptor of the target file.
[0147] 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.
[0148] After passing through the second control information management module and the first control information management module, the first request is sent to the identity proxy module. The identity proxy module determines that the identity identification information in the first request is correct and sends the first request to the first core.
[0149] The first kernel receives and processes the first request. Specifically, in response to the first request, the first kernel determines the target file based on the file descriptor of the target file 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, the first response including the data size of the target file written to the hard disk according to the first request.
[0150] 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.
[0151] (4) The first request may be used to: the target process closes the file data in the hard disk. The communication method may include:
[0152] 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.
[0153] 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.
[0154] After passing through the second control information management module and the first control information management module, the first request is sent to the identity proxy module. The identity proxy module determines that the identity identification information in the first request is correct and sends the first request to the first core.
[0155] The first kernel receives and processes the first request. Specifically, in response to the first request, the first kernel determines the target file based on the file descriptor of the target file. The first kernel sends a first response to the identity proxy module, the first response being used to indicate deletion of the correspondence between the target file and the file descriptor.
[0156] 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 that the correspondence between the target file and the file descriptor is deleted. The second kernel receives the first response, deletes the correspondence between the target file and the file descriptor, and sends a processed first response to the target process. The processed first response can be used to indicate that the target file was successfully closed.
[0157] After introducing the relevant content of the first request for non-volatile memory access, the first request for standard inter-process communication or page fault exception processing is described.
[0158] In one example, the first request can be used for standard inter-process communication. Standard inter-process communication refers to communication between processes in the same domain. Standard inter-process communication includes portable operating system interface interprocess communication (POSIX IPC) and system V interprocess communication (SYSV IPC). Because the first communication module can identify the identity of the second communication module, the first request is identified as a request within the first communication module, thereby implementing standard inter-process communication.
[0159] 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, saving memory space.
[0160] 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.
[0161] A target process running on the second operating system accesses a third virtual address of the memory, and the memory responds to the target process that the third virtual address is not associated with a physical address. The target process sends an initial request to the second kernel, the initial request being 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, the initial request including the third virtual address of the memory.
[0162] 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.
[0163] After passing through the second control information management module and the first control information management module, the first request is sent to the identity proxy module. The identity proxy module determines that the identity identification information in the first request is correct and sends the first request to the first core.
[0164] The first kernel receives and processes the first request. Specifically, in response to the first request, the first kernel obtains the first physical address allocated by the memory to the third virtual address. The first kernel sends a first response to the identity proxy module, the first response including the first physical address of the memory.
[0165] 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 the sharing of the page cache address by the first communication module and the second communication module.
[0166] In the method shown in FIG4 , for a service that the master processor core needs to send multiple requests to the slave processor core in order to process, in this embodiment, the first processor core only needs to send a single first request to the second processor core to process the service. For example, in the method shown in FIG4 , the request sent by the master processor to the slave processor includes only one physical address, but in this embodiment, the first request can include multiple physical addresses, so that multiple shared page cache services can be executed at once.
[0167] 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, and shared file access can be achieved between the second communication module and the first communication module, 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 carried out between the first processor core running the first communication module and the second processor core running the second communication module.
[0168] An embodiment of the present application also provides a communication device. Figure 9 is a schematic diagram of a communication device provided by 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, and 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.
[0169] In an optional embodiment, the first control information management module is specifically configured to obtain the first request from a target memory space, and the target memory space is configured to store request data of the second communication module that has passed identity authentication. When the first request is obtained from the target memory space, the identity authentication of the second communication module is passed.
[0170] In an optional embodiment, the first control information management module supports the transmission of information of different data lengths. The first control information management module is further configured to receive a second request from the second communication module, the second request being used to indicate the identity of the second communication module, the data length of the first request being different from the data length of the second request. The first processing module is further configured to process the second request when the identity authentication of the second communication module is successful. The first control information management module is further configured to send a second response obtained by processing the second request to the second communication module, the data length of the first response being different from the data length of the second response.
[0171] In an optional embodiment, the first processing module includes an identity proxy module and a first core. The identity proxy module is configured to generate a third request based on the first request. The first core is configured to process the third request, and the first response is a response to the third request.
[0172] In an optional embodiment, 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 second communication module's identity authentication passing includes: the identity information verification passing.
[0173] 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.
[0174] It can be understood that the various functional modules of the above-mentioned communication device can be used to implement at least one step in the communication method shown in Figure 5 or Figure 8 respectively. Since each step has been described in detail in the above-mentioned communication method embodiment, the effects that can be achieved can be referred to the above-mentioned communication method embodiment and will not be repeated here.
[0175] An embodiment of the present application also provides a communication device. Figure 10 is a schematic diagram of another communication device provided by 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, and 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.
[0176] In an optional implementation, the second control information management module is specifically configured to store the first request in a target memory space, and the target memory space is configured to store request data of the second communication module that has passed identity authentication.
[0177] In an optional embodiment, the second control information management module supports the transmission of information of different data lengths. The second control information management module is further configured to send a second request to the first communication module, the second request being used to indicate the identity of the second communication module, the data length of the first request being different from the data length of the second request. The second control information management module is further configured to receive a second response from the first communication module in response to the second request, the data length of the first response being different from the data length of the second response.
[0178] In an optional embodiment, the second communication module further includes a request forwarding module, the second operating system runs a target process, and the request forwarding module is configured to obtain an initial request from the target process and generate a first request based on the initial request, wherein the first request includes the identity information of the second communication module.
[0179] In an optional embodiment, the second communication module further includes a second kernel, wherein the second kernel is configured to process the first response and send the processed first response to the target process.
[0180] 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.
[0181] It can be understood that the various functional modules of the above-mentioned communication device can be used to implement at least one step in the communication method shown in Figure 6 or Figure 8 respectively. Since each step has been described in detail in the above-mentioned communication method embodiment, the effects that can be achieved can be referred to the above-mentioned communication method embodiment and will not be repeated here.
[0182] An embodiment of the present application also provides a chip system. The structure of the electronic device can be referred to Figure 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 at least one step in 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 perform at least one step in the corresponding method embodiment above, such as at least one step in Figure 6 and Figure 8.
[0183] It can be understood that the chip system can be used to implement at least one step in the communication method shown in Figure 5, Figure 6 or Figure 8. Since each step has been described in detail in the aforementioned communication method embodiment, the effect that can be achieved can be referred to the aforementioned communication method embodiment and will not be repeated here.
[0184] An embodiment of the present application also provides an electronic device. The structure of the electronic device can be referred to Figure 12. The electronic device includes the above-mentioned chip system and a memory. Instructions are stored in the memory, and when the chip system runs the instructions in the memory, the electronic device performs at least one step in the communication method shown in Figure 5 or Figure 6 or Figure 8. 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 be referred 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.
[0185] The present application also provides a computer-readable storage medium. The computer-readable storage medium stores program code that can be invoked by a processor to execute at least one step of the communication method shown in FIG5, FIG6, or FIG8. It is understood that since each step has been described in detail in the aforementioned communication method embodiments, the effects achieved can be referred to in the aforementioned communication method embodiments and will not be further described here.
[0186] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A communication method, characterized in that: The method 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, and the method includes: receiving a first request from the second communication module, where the first request is used to indicate an identity of the second communication module; When the identity authentication of the second communication module is passed, processing the first request; A first response obtained by processing the first request is sent to the second communication module.
2. The method according to claim 1, characterized in that The receiving a first request from the second communication module comprises: Acquire 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; When the first request is obtained from the target memory space, the identity authentication of the second communication module is passed.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: receiving 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; When the identity authentication of the second communication module is passed, processing the second request; A second response obtained by processing the second request is sent to the second communication module, wherein a data length of the first response is different from a data length of the second response.
4. The method according to any one of claims 1 to 3, characterized in that: The processing of the first request comprises: generating a third request according to the first request; The third request is processed, and the first response is a response to the third request.
5. The method according to claim 1, 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.
6. The method according to any one of claims 1 to 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 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 method includes: Sending a first request to the first communication module, where the first request is used to indicate an identity of the second communication module; A first response to the first request is received from the first communication module.
8. The method according to claim 7, characterized in that The sending a first request to the first communication module includes: The first request is stored in 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.
9. The method according to claim 7 or 8, characterized in that: The method further comprises: Sending 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; A second response to the second request is received from the first communication module, wherein 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 second operating system runs a target process; Before sending the first request to the first communication module, the method further includes: An initial request from the target process is obtained, and the first request is generated according to the initial request, wherein the first request includes identity information of the second communication module.
11. The method according to claim 10, characterized in that After receiving the first response to the first request from the first communication module, the method further includes: The first response is processed, and the processed first response is sent to the target process.
12. The method according to any one of claims 7 to 11, 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.
13. A communication device, characterized in that: 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, where 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 passes; The first control information management module is used to send a first response obtained by processing the first request to the second communication module.
14. The device according to claim 13, characterized in that The first control information management 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; When the first request is obtained from the target memory space, the identity authentication of the second communication module is passed.
15. The device according to claim 13 or 14, characterized in that The first control information management module supports the transmission of information of different data lengths; The first control information management module is further 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 processing module is further configured to process the second request when the identity authentication of the second communication module passes; The first control information management module is further 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.
16. The device according to any one of claims 13 to 15, characterized in that 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.
17. The device according to claim 13, characterized in that 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 identification information; The identity authentication of the second communication module passes, including: the identity identification information verification passes.
18. The device according to any one of claims 13 to 17, 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.
19. A communication device, characterized in that: 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, where 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.
20. The device according to claim 19, characterized in that 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 the request data of the second communication module that has passed the identity authentication.
21. The device according to claim 19 or 20, characterized in that 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, 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 control information management module is further 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.
22. The device according to claim 19, characterized in that The second communication module further 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, and generate the first request according to the initial request, wherein the first request includes identity information of the second communication module.
23. The device according to claim 22, characterized in that The second communication module also includes a second core; The second kernel is used to process the first response and send the processed first response to the target process.
24. The device according to any one of claims 19 to 23, 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.
25. 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 1 to 6; 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 7 to 12.
26. An electronic device, characterized in that: The electronic device comprises a memory and a chip system as claimed in claim 25.
27. The electronic device according to claim 26, characterized in that: The electronic device includes at least one of the following: a receiver, a switch, a router or a car.
28. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, which can be called by a processor to execute the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Communication method and device, chip system and electronic equipment
CN117370262A
File sharing method and device, electronic equipment and readable storage medium
CN114567871A
Data and file interaction method
CN114780505A
Method and system for sharing GPU (Graphics Processing Unit) by multiple systems based on multi-core chip
CN115601222A
Inter-nuclear communication system
CN115878549A