Process communication method and device based on vehicle-mounted shared memory, medium and product
By selecting an appropriate mode to access shared memory based on the mounting status of the server process in the intelligent vehicle's in-vehicle software architecture, and using message middleware to implement request-response communication, the problem of high communication costs for in-vehicle shared memory processes is solved, and communication efficiency and reliability are improved.
Patent Information
- Application Number
- CN202611610293.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-16
- Publication Date
- 2026-11-24
AI Technical Summary
In the in-vehicle software architecture of intelligent vehicles, process communication based on in-vehicle shared memory is costly and suffers from issues such as redundant construction of the transport layer and non-standardized client/server semantics, resulting in redundant communication architecture and high integration costs.
By determining the mounting status of the server process, selecting either independent process mode or frame-embedded mode, the server process is connected to shared memory. The message middleware of shared memory is used to implement request-response communication, avoiding the need to build an additional independent RPC protocol stack. Public service channels and private response channels are used to achieve CS semantic reuse.
It reduces communication architecture redundancy and deployment costs, improves communication efficiency and resource utilization, ensures request-response isolation and communication reliability under multi-client concurrency, and adapts to different deployment models.
Smart Images

Figure CN123157484A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent vehicle in-vehicle software architecture technology, and in particular to a process communication method, device, medium and product based on in-vehicle shared memory. Background Technology
[0002] In the intelligent vehicle in-vehicle software architecture, as intelligent driving functions evolve to higher levels, communication needs to be completed in a publish / subscribe message middleware on shared memory in the in-vehicle multi-process environment to meet the data transmission requirements of sensor streams, status broadcasts, etc. At the same time, services such as parameter query and calibration distribution require clear request-response semantics.
[0003] In related technologies, a Remote Procedure Call (RPC) protocol stack is typically introduced to implement request-response communication. That is, in addition to the existing publish / subscribe middleware based on shared memory, an independent protocol stack is built to complete remote procedure calls between the client and the server.
[0004] However, in the above process, it is necessary to repeatedly build the communication protocol stack on the basis of the existing transmission link, which can easily cause redundancy in the vehicle communication architecture and result in high cost of process communication based on vehicle shared memory. Summary of the Invention
[0005] This application provides a process communication method, device, medium, and product based on in-vehicle shared memory to solve the problem of high cost of process communication based on in-vehicle shared memory.
[0006] Firstly, this application provides a process communication method based on in-vehicle shared memory, comprising:
[0007] Determine the mounting status of the server process for shared memory, and based on the mounting status, determine the mounting mode of the server process, which is either independent process mode or frame-embedded mode.
[0008] Based on the mounting mode, the server process is connected to shared memory so that the server process can receive messages in the public service channel through a message middleware based on shared memory;
[0009] Receive request messages sent by the client process and determine the response message based on the request message;
[0010] Determine the response channel corresponding to the client process and send a response message to the response channel so that the client process can receive the response message from the response channel.
[0011] In one possible implementation, the mounting mode of the server process is determined based on the mounting state, including:
[0012] When the mount status is unmounted, the mount mode is determined to be independent process mode;
[0013] When the mounting status is "mounted", the mounting mode is determined to be the frame-embedded mode.
[0014] In one possible implementation, depending on the mounting mode, the server process is accessed through shared memory, including:
[0015] When the mounting mode is independent process mode, create or mount shared memory and configure the node identifier and module identifier of the server process to connect the server process to the shared memory.
[0016] In one possible implementation, depending on the mounting mode, the server process is accessed through shared memory, including:
[0017] When the mounting mode is frame-embedded mode, the shared memory already mounted by the module frame is reused, and the module identifier of the module frame is verified to be consistent with the initialization parameters in order to access the shared memory.
[0018] In one possible implementation, the public service channel is a public request channel registered at the transport layer based on message middleware, used to carry request messages sent by client processes.
[0019] In one possible implementation, determining the response message based on the request message includes:
[0020] Invoke the business processing callback corresponding to the public service channel;
[0021] The response message is obtained by filling in the response content according to the business logic corresponding to the request message through the business processing callback.
[0022] In one possible implementation, determining the response channel corresponding to the client process includes:
[0023] Parse the request message to obtain the client process identification information, which includes the source module identifier and the source node identifier;
[0024] The response channel corresponding to the client process is determined based on the source module identifier and the source node identifier.
[0025] In one possible implementation, determining the response channel corresponding to the client process includes:
[0026] Determine the service name corresponding to the request message;
[0027] According to the preset constraints, the source module identifier, source node identifier and service name are concatenated to obtain the channel name, and the response channel is determined based on the channel name.
[0028] Secondly, this application provides a process communication device based on in-vehicle shared memory, wherein:
[0029] The determination module is used to determine the mounting status of the server process for shared memory, and based on the mounting status, to determine the mounting mode of the server process, which is either independent process mode or frame-embedded mode.
[0030] The access module is used to connect the server process to shared memory according to the mounting mode, so that the server process can receive messages in the public service channel through the shared memory-based message middleware;
[0031] The receiving module is used to receive request messages sent by the client process and determine the response message based on the request message;
[0032] The sending module is used to determine the response channel corresponding to the client process and send a response message to the response channel so that the client process can receive the response message from the response channel.
[0033] Thirdly, embodiments of this application provide a process communication device based on in-vehicle shared memory, comprising: at least one processor and a memory; the memory stores computer execution instructions; at least one processor executes the computer execution instructions stored in the memory, causing at least one processor to execute the process communication method based on in-vehicle shared memory as described in the first aspect above and any one of the first aspects.
[0034] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the process communication method based on vehicle-mounted shared memory as described in the first aspect and any one of the first aspects.
[0035] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the process communication method based on in-vehicle shared memory as described in the first aspect and any one of the first aspects.
[0036] The process communication method, device, medium, and product based on in-vehicle shared memory provided in this application determine the mounting state of the server process to the shared memory, and determines the mounting mode of the server process as either an independent process mode or a frame-embedded mode based on the mounting state. The server process is then connected to the shared memory according to the mounting mode, enabling it to receive request messages sent by client processes through a shared memory-based message middleware on a public service channel, determine the response message, identify the corresponding response channel for the client process, and send the response message to the response channel. In this method, the server process can adaptively select between independent process mode and frame-embedded mode based on the mounting state, and reuse the existing shared memory publish / subscribe message middleware to implement request-response communication. This eliminates the need to build an independent RPC protocol stack, avoiding redundant construction of the transport layer and effectively avoiding the problem of redundancy in the in-vehicle communication architecture. It also eliminates the need for additional protocol stack deployment, improving the integration efficiency of the communication architecture. It accurately achieves request-response isolation under multi-client concurrency. Furthermore, this method is applicable to in-vehicle multi-process environments with different deployment forms, reducing the deployment cost of the communication system and improving communication efficiency and resource utilization while enhancing the reliability of in-vehicle communication. Attached Figure Description
[0037] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0038] Figure 1 A schematic diagram illustrating the application scenarios provided in the embodiments of this application;
[0039] Figure 2 A flowchart illustrating a process communication method based on in-vehicle shared memory provided in an embodiment of this application;
[0040] Figure 3 A schematic diagram illustrating the shared memory access process provided in an embodiment of this application;
[0041] Figure 4 A schematic diagram illustrating the process of determining the response channel provided in an embodiment of this application;
[0042] Figure 5 A schematic diagram illustrating the dual-mode process of the CS initialization interface provided in this application embodiment;
[0043] Figure 6 A schematic diagram illustrating the transmission link startup process of the CS communication encapsulation module provided in this application embodiment;
[0044] Figure 7 A schematic diagram of the timing diagram for sending client synchronization requests provided in an embodiment of this application;
[0045] Figure 8A schematic diagram illustrating the process of sending a synchronization request as provided in an embodiment of this application;
[0046] Figure 9 A schematic diagram of server-side service channel registration and timing diagram provided for embodiments of this application;
[0047] Figure 10 A schematic diagram illustrating the logical process of the CS communication encapsulation module and message middleware provided in the embodiments of this application;
[0048] Figure 11 A schematic diagram of the structure of a process communication device based on in-vehicle shared memory provided in an embodiment of this application;
[0049] Figure 12 This is a schematic diagram of the structure of a process communication device based on vehicle-mounted shared memory provided in an embodiment of this application.
[0050] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0051] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0052] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.
[0053] In the intelligent vehicle in-vehicle software architecture, as intelligent driving functions evolve to higher levels, communication needs to be completed in a publish / subscribe message middleware on shared memory in the multi-process environment of the vehicle to meet the data transmission requirements of sensor streams, status broadcasts, etc., which can be sent to multiple recipients without needing to respond. At the same time, services such as parameter query and calibration distribution require explicit request-response semantics.
[0054] In related technologies, request-response communication typically employs an independent Remote Procedure Call (RPC) protocol stack. This approach completes remote procedure calls between the client and server through an independent protocol stack, service discovery, and serialization mechanism. However, it requires building an independent protocol stack on top of the existing shared memory-based publish / subscribe middleware, resulting in redundant construction of the transport layer and high integration costs.
[0055] Another approach is for each module to construct channels and write timeout and polling logic independently on top of the publish / subscribe middleware. This solution does not require an independent protocol stack, but channel naming, timeouts, and response routing are inconsistent, response crosstalk can easily occur when multiple clients are concurrent, the interfaces are inconsistent, and there is a lack of standardized encapsulation.
[0056] Furthermore, existing solutions do not unify the initialization paths of embedded modules and independent / external access processes within the framework, and misuse can easily lead to shared memory mounting failures or failure to receive packets; at the same time, synchronous requests and asynchronous publish / subscribe are difficult to unify, and the lack of a thin encapsulation layer leads to redundant business development.
[0057] In summary, existing technologies face a core contradiction in in-vehicle request-response communication: redundant construction of the transport layer and lack of standardization in client / service (CS) semantics. Independent RPC protocol stack solutions suffer from architectural redundancy and high integration costs due to redundant construction, while self-assembled channel solutions lack unified encapsulation, leading to inconsistent interfaces and crosstalk between multiple clients. Furthermore, existing solutions generally lack dual-mode initialization and runtime verification, further exacerbating the technical problems of inconsistent deployment models and insufficient communication reliability.
[0058] Therefore, this application provides a process communication method based on vehicle-mounted shared memory. By determining the mounting status of the server process for the shared memory, and determining the mounting mode of the server process as either an independent process mode or a frame-embedded mode based on the mounting status, the server process is connected to the shared memory according to the mounting mode. This allows the server process to receive request messages sent by the client process through a message middleware based on shared memory in a public service channel, determine the response message, determine the response channel corresponding to the client process, and send the response message to the response channel. This method implements client-server semantics on top of publish / subscribe using public request channels and private response channels, reusing the existing shared memory message bus without requiring the construction of a separate RPC protocol stack. This achieves zero new physical bus construction, avoids redundant transport layer construction, and reduces architectural redundancy and integration costs. Furthermore, through dual-mode initialization and shared memory mount status verification, it unifies the access paths of independent processes and framework-embedded modules, adapting to different deployment models and avoiding mount failures or packet reception failures. When multiple clients are concurrent, each client receives responses from the private response channel, effectively avoiding crosstalk. In addition, by providing service registration, synchronous request sending, timeout, and polling packet reception capabilities through thin encapsulation, it reduces redundant business development, facilitates third-party module expansion, and improves the integration efficiency and scenario adaptability of vehicle request-response communication while enhancing communication reliability and resource utilization.
[0059] To facilitate understanding, the following will be combined with... Figure 1 The application scenarios applicable to the embodiments of this application will be described.
[0060] Figure 1 This is a schematic diagram illustrating an application scenario provided in an embodiment of this application. Please refer to [link / reference]. Figure 1 This includes process communication devices based on in-vehicle shared memory deployed in vehicles, and multiple business processes (e.g., client processes, server processes) running on such devices.
[0061] During vehicle operation, multiple business processes within the in-vehicle shared memory-based inter-process communication device need to communicate data. For example, a client process may need to initiate a service request to a server process. In this embodiment, multiple business processes can be mounted on the same shared memory segment and communicate based on a message middleware. The client process sends requests via a public service channel, and the server process returns responses via a response channel, realizing request-response interaction in a multi-process in-vehicle environment and improving the efficiency and reliability of in-vehicle communication.
[0062] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0063] Figure 2 This is a flowchart illustrating a process communication method based on in-vehicle shared memory, provided as an embodiment of this application. Please refer to... Figure 2 As shown, the method may include the following steps:
[0064] S201. Determine the mount status of the server process for shared memory, and determine the mount mode of the server process based on the mount status.
[0065] The execution subject of this application embodiment can be an electronic device or a process communication device based on vehicle-mounted shared memory installed in the electronic device. The process communication device based on vehicle-mounted shared memory can be implemented by software or by a combination of software and hardware.
[0066] The mounting mode can be either independent process mode or frame-embedded mode.
[0067] A server-side process can refer to a process in a multi-process in-vehicle environment that provides specific services (such as parameter querying, calibration distribution, etc.), receives client requests, and returns responses. For example, the vehicle parameter service process.
[0068] Shared memory can refer to a communication medium provided by the operating system that allows multiple processes to share the same physical memory region in order to achieve efficient data exchange.
[0069] Mount status can refer to whether the runtime environment in which the current server process resides has mapped the shared memory segment into the address space of this process.
[0070] Mounting mode can refer to the way a server process accesses shared memory.
[0071] Independent process mode refers to a deployment model where the server process does not belong to any module framework, needs to create or mount a shared memory segment, and starts the communication link independently. For example, an independent parameter service program.
[0072] The framework-embedded mode refers to a server process running as a functional module within a module framework, directly reusing the shared memory and message client deployment methods already mounted on the module framework. For example, a service module integrated within an intelligent driving domain controller framework.
[0073] In some embodiments, since the in-vehicle multi-process environment has two deployment forms—independent processes and embedded frameworks—if the mounting status is not determined in advance, it is very easy to cause duplicate mounting (the shared memory has already been mounted by the framework, but the process tries to mount it again) or mounting failure (the framework has not mounted it, but the process uses it directly), resulting in the inability to establish a communication link. Specifically, after the server process starts, it calls the CS initialization interface, which can be used to query whether the current process address space already has a shared memory mapping to determine the mounting status.
[0074] In some embodiments, to ensure that the server process selects the correct communication link initialization path based on the actual operating environment and guarantees normal subsequent communication, specifically, if the mounting status is "unmounted," it means that there is no readily available shared memory in the current environment, so the mounting mode is determined to be the independent process mode; if the mounting status is "mounted," it means that the current environment already has shared memory, so the mounting mode is determined to be the frame-embedded mode to avoid redundant construction.
[0075] S202. According to the mounting mode, the server process is connected to the shared memory so that the server process can receive messages in the public service channel through the shared memory-based message middleware.
[0076] Message middleware can refer to a software layer deployed on shared memory that provides publish / subscribe (Pub / Sub) communication capabilities. Understandably, the message middleware in this solution uses shared memory as the underlying transmission medium and provides capabilities such as topic registration, message publishing and subscription, and routing distribution. It is the basis for this solution to reuse the existing message bus and eliminate the need to build a separate RPC protocol stack.
[0077] In some embodiments, the public service channel is a public request channel registered with the transport layer based on message middleware, used to carry request messages sent by client processes.
[0078] Specifically, this solution implements client / server (CS) semantics above the publish / subscribe transport layer of the message middleware. The common service channel is a pre-registered public request channel on this transport layer, allowing all client processes to send requests to the server process uniformly. The message middleware itself runs on shared memory and is responsible for efficiently transmitting request messages published to the common service channel to the server process via shared memory. This solution requires no additional physical transmission medium or a separate RPC protocol stack; instead, it directly reuses the transport layer capabilities of the message middleware, receiving requests on the common service channel and sending responses on the private response channel, thus achieving CS semantics reuse of the existing message bus.
[0079] By defining the public service channel as a public request channel registered based on the message middleware transport layer, the request messages are uniformly carried by this public channel. This enables the reuse of the existing shared memory publish / subscribe bus for CS request-response semantics, eliminating the need to build a separate protocol stack and reducing architectural redundancy.
[0080] S203. Receive the request message sent by the client process and determine the response message based on the request message.
[0081] In a multi-process in-vehicle environment, a client process can refer to a process that actively initiates service requests and waits for a response. Examples include the control process and the instrument cluster process.
[0082] A request message can refer to structured data sent by a client process to a server process, containing information such as the service name, request parameters, and message routing headers. For example, a request to query vehicle speed.
[0083] A response message can refer to the structured data that the server process returns to the client process after processing the request message.
[0084] In some embodiments, after the server process accesses shared memory and starts the transmission link, it registers a public service channel and the corresponding business processing callback. It then enters the main loop, periodically calling the single-message polling interface to drive the notification mechanism for packet reception. When the client process publishes a request message to the public service channel, the server process receives the request message on the public service channel through this main loop polling mechanism and triggers the corresponding business processing callback.
[0085] In some embodiments, the response message can be determined based on the request message in the following manner: invoking the business processing callback corresponding to the public service channel; and filling the response content according to the business logic corresponding to the request message through the business processing callback to obtain the response message.
[0086] In some embodiments, the server process registers a public service channel and its corresponding business processing callback during the initialization phase. When the main loop receives a request message on the public service channel, the message middleware automatically triggers and invokes the pre-registered business processing callback based on the public service channel pointed to by the request message.
[0087] After the business processing callback is triggered, the corresponding business logic (e.g., querying vehicle speed, issuing calibration parameters) is executed by parsing the service name and request parameters in the request message, and the execution result is filled into the response content according to the structured format of the response message to obtain the response message.
[0088] By invoking the business processing callback corresponding to the public service channel and filling the response content according to the business logic corresponding to the request message, the standardized processing of requests and response generation on the server side are realized. The business logic and communication link are decoupled, reducing redundant business development.
[0089] S204. Determine the response channel corresponding to the client process and send a response message to the response channel so that the client process can receive the response message from the response channel.
[0090] A response channel can refer to a private response channel in a message middleware that is uniquely associated with a specific client process, and is used to accurately send response messages back to that client.
[0091] In some embodiments, in multi-client concurrent scenarios, such as client A and client B, if all responses are sent to a common channel or the same channel, client A may receive a response from client B (i.e., response crosstalk). Therefore, it is necessary to determine a dedicated response channel for each client. The server process reads the source node identifier and source module identifier from the routing header of the request message, concatenates them according to preset rules to generate a private response channel name corresponding to that client, and determines the response channel.
[0092] In this way, the server process can publish the generated response message to the client's corresponding private response channel. When the client process initiates a synchronization request, it has already subscribed to its own private response channel, so it can accurately receive its own response message from that channel, completing a client-server interaction.
[0093] Understandably, taking two clients as an example, when client A and client B concurrently initiate requests, the server process reads the source node identifier and source module identifier from their respective request message routing headers, concatenates them to form the response channels for client A and client B respectively, and sends response messages back to their corresponding response channels. Client A only receives responses from its own response channel, and client B only receives responses from its own response channel; the two do not mix up. In the example runtime environment, the round-trip latency is approximately 1 millisecond.
[0094] By using the above method, multiple clients can receive responses from their respective response channels when they are concurrent, which means that there is no crosstalk between concurrent responses from multiple clients. The three-process independent example can verify the CS link independently of the whole vehicle module, which is convenient for third-party module expansion and effectively improves the reliability and concurrent processing efficiency of request-response communication in the vehicle multi-process environment.
[0095] In this embodiment, CS request-response is implemented through a public request channel and a derived private response channel, replacing the independent RPC protocol stack. This allows CS semantics to reuse the existing message bus without the need to build a separate protocol stack, thus improving the integration efficiency of the communication architecture. Furthermore, through dual-mode initialization and shared memory mount status verification, it can adapt to different deployment forms, avoiding mount failure or packet loss. This reduces the redundancy of the communication architecture and improves the communication reliability and resource utilization under multiple client concurrency.
[0096] Based on any of the above embodiments, the following, in conjunction with Figure 3 The process of connecting the server process to shared memory according to the mounting mode is explained in detail.
[0097] Figure 3 This is a schematic diagram illustrating the shared memory access process provided in an embodiment of this application. Please refer to... Figure 3 The method may include:
[0098] S301. Determine the mounting mode of the server process based on the mounting status.
[0099] In some embodiments, the mounting mode of the server process can be determined based on the mounting state as follows: when the mounting state is not mounted, the mounting mode is determined to be independent process mode; when the mounting state is mounted, the mounting mode is determined to be frame-embedded mode.
[0100] A modular framework can refer to a software framework that carries multiple functional modules and provides a unified operating environment and basic communication capabilities.
[0101] Initialization parameters can refer to the configuration information passed by the server process when calling the CS initialization interface.
[0102] A module identifier can refer to a unique identity that a server process registers within a module framework.
[0103] Specifically, after the server process starts, it calls the CS initialization interface to query whether a shared memory mapping already exists in the current process's address space. If the query result is "not mounted," it means that there is no readily available shared memory available for reuse in the current environment, and the process must run independently. Therefore, the mounting mode is determined to be the independent process mode. If the query result is "mounted," it means that the current process is running within a module framework, and the shared memory has been prepared in advance by the framework. Therefore, the mounting mode is determined to be the framework embedded mode.
[0104] After determining the mounting mode, the CS initialization interface further verifies the legality of the mode and state. That is, if the mode does not match the actual state (for example, the independent process mode is selected when the mode is mounted), the initialization interface will return a precondition error and prompt the user to use the frame embedded mode to ensure the legality of the mode selection.
[0105] Specifically, if the shared memory has not yet been mounted by the module framework, but the server process selects the frame-embedded mode, initialization will return an initialization error. If the shared memory has been mounted by the module framework, but the server process still selects the independent process mode, a precondition error will be returned, prompting that the frame-embedded mode should be used instead. In frame-embedded mode, it is also necessary to verify whether the module identifier of the module framework is consistent with the initialization parameters. If they are inconsistent, a parameter error will be returned. In addition, in frame-embedded mode, packet reception is driven by the message reading task in the host module's main event loop, eliminating the need for the infinite loop of polling in the independent process. This ensures the legality of the mode selection while achieving efficient collaboration with the module framework.
[0106] By using the above method, the independent process mode or the frame-embedded mode is automatically determined according to the shared memory mounting status, realizing dual-mode adaptive initialization. This effectively avoids mounting failure or failure to receive packets due to mode misuse, and improves the reliability of shared memory access.
[0107] S302. When the mounting mode is independent process mode, create or mount shared memory and configure the node identifier and module identifier of the server process to connect the server process to the shared memory.
[0108] Specifically, after determining the mounting mode to be independent process mode, the server process, lacking a ready-made shared memory environment provided by the module framework, needs to manually create or mount shared memory segments by calling system interfaces. Simultaneously, the server process needs to configure its own node and module identifiers to identify itself in the message middleware, serving as the basis for routing and response feedback. Upon transmission link startup, due to the independent process mode, the encapsulation module will create a new message hub, message client, and shared memory transport layer, and initiate monitoring of shared memory, completing the server process's independent access to shared memory.
[0109] By creating or mounting shared memory and configuring an identifier in independent process mode, server processes without framework dependencies can also access the same shared memory, enhancing deployment flexibility and expanding the scope of application.
[0110] S303. When the mounting mode is the frame embedded mode, reuse the shared memory that the module frame has mounted, and verify that the module identifier of the module frame is consistent with the initialization parameters in order to access the shared memory.
[0111] Specifically, after determining the mounting mode to be the frame-embedded mode, the server process no longer recreates the message hub and shared memory. Instead, it directly reuses the shared memory and message client already mounted by the module framework. The server process needs to bind to the host functional module created by the module framework at runtime and verify whether the module identifier of the module framework is consistent with the initialization parameters. If the shared memory has not yet been mounted by the module framework, the initialization returns an error; if the module identifier is inconsistent with the initialization parameters, a parameter error is returned. After the verification passes, the transmission link directly reuses the host message client and notification index, marking that the transmission is ready. In the frame-embedded mode, packet reception is driven by the message reading task in the host module's main event loop, eliminating the need for an infinite polling loop in an independent process, thus completing the server process's embedded access to the shared memory.
[0112] By reusing the mounted shared memory and verifying the module identifier in the frame-embedded mode, the redundant construction of shared memory is avoided, resource consumption is reduced, and at the same time, runtime verification ensures access security and the correctness of the communication link.
[0113] In this embodiment, based on the server-side process's mounting status for shared memory, the method determines whether to use an independent process mode when the shared memory is not mounted, and creates or mounts the shared memory, configuring node and module identifiers. When the shared memory is mounted, the method determines whether to use an embedded framework mode, reusing the mounted shared memory and verifying the module identifier and initialization parameters of the module framework. This method adaptively selects the mounting mode based on the mounting status, avoiding mounting failures or packet loss due to misuse in a single deployment model. It achieves dual-mode access and runtime verification, improving the reliability and deployment flexibility of shared memory access and reducing integration costs.
[0114] Figure 4 This is a schematic diagram illustrating the process of determining the response channel provided in an embodiment of this application. Please refer to... Figure 4 The method may include:
[0115] S401. Parse the request message to obtain the identification information of the client process.
[0116] The identification information includes the source module identifier and the source node identifier.
[0117] Identification information can refer to information carried in the request message that identifies the client process that initiated the request.
[0118] The source module identifier can refer to the unique identifier of the functional module that specifically executes the request within the client process that initiates the request.
[0119] The source node identifier can refer to the node name or unique identifier of the client process that initiated the request in the vehicular multi-process communication network.
[0120] In some embodiments, after receiving a request message on the public service channel, the server process parses the routing header of the request message. The routing header pre-encapsulates the identity information of the client process initiating the request. By parsing this routing header, the source node identifier and source module identifier are extracted, thus obtaining the client process's identification information. In this scheme, when constructing a request message, the client writes its own source node identifier and source module identifier into the message routing header, allowing the server to determine the request source by parsing the routing header without direct interaction with the client.
[0121] S402. Determine the response channel corresponding to the client process based on the source module identifier and the source node identifier.
[0122] In some embodiments, the response channel corresponding to the client process can be determined as follows: determine the service name corresponding to the request message; concatenate the source module identifier, source node identifier, and service name according to preset constraints to obtain the channel name, and determine the response channel based on the channel name.
[0123] The service name can refer to the specific service name requested by the request message, which is used to distinguish different services called by the same client process.
[0124] Constraints can refer to pre-agreed naming or concatenation rules used to generate response channel names, such as @source node @source module @service name.
[0125] The channel name can refer to a string that uniquely points to the response channel of the client process, obtained by concatenating the source module identifier, source node identifier, and service name according to the constraints.
[0126] In some embodiments, when determining the service name of a client process, the service name corresponding to the request can be extracted from the message body or routing header of the request message. The service name is used to identify the specific service requested by the client, such as GetSpeed, SetCalibration, etc.
[0127] In some embodiments, a preset constraint condition is obtained, such as @source node@source module@service name. The parsed source node identifier, source module identifier, and the service name corresponding to the determined request message are substituted into the constraint condition as concatenation parameters to generate a globally unique channel name, which is then used as the response channel corresponding to the client process.
[0128] By using the above method, a dedicated response channel can be accurately determined for each client, avoiding crosstalk problems caused by unclear response channels in multi-client concurrent scenarios, and improving the routing accuracy and reliability of vehicle request-response communication.
[0129] In this embodiment, the source module identifier and source node identifier of the client process are obtained by parsing the request message. The corresponding response channel for the client process is then determined based on these identifiers. Furthermore, the source module identifier, source node identifier, and service name are concatenated according to preset constraints, combining the service name corresponding to the request message, to obtain the channel name. The response channel is then determined based on this channel name. This method can accurately determine a dedicated response channel for each client, avoiding crosstalk problems caused by ambiguous response channels in multi-client concurrent scenarios, and improving the routing accuracy and reliability of in-vehicle request-response communication.
[0130] The process of inter-process communication based on in-vehicle shared memory will be explained in detail below.
[0131] This application provides a shared memory-based in-vehicle middleware client / server communication system. The system includes at least one client process, at least one server process, a shared memory segment, and a CS communication encapsulation module deployed within each process.
[0132] Each process attaches to the same shared memory segment through the CS initialization interface, and the transmission of requests and responses is completed through the publish / subscribe transport layer of the message middleware. The client process sends requests through the public service channel, and the server process sends back responses to the corresponding private response channel according to the source node identifier and source module identifier in the request message routing header, thus avoiding response crosstalk in multi-client concurrent scenarios.
[0133] For example, consider three independent executable processes: a server process S and two client processes A and B. All three are mounted on the same shared memory segment in independent process mode to verify the correctness of the CS communication encapsulation layer in the message middleware. This example confirms that when client A and client B concurrently initiate requests, server S can accurately send the response back to the corresponding private response channel based on the source node identifier and source module identifier in their respective request message routing headers. Clients A and B each receive their responses from their own private response channels without interference.
[0134] In some embodiments, after the server process S starts, it calls the CS initialization interface, selects the independent process mode, creates or mounts a shared memory segment, and sets the node name and module identifier of the process. Then, it calls the transmission link startup interface of the CS communication encapsulation module. Since it is in independent process mode, the encapsulation module creates a message hub, message client, and shared memory transmission layer, and starts shared memory monitoring. After that, it registers the public service channel and the corresponding business processing callback. When a request message is received through the public service channel, the callback function fills in the response content according to the business logic. Finally, it enters the main loop, periodically calls the single message polling and receiving interface, drives the notification mechanism to receive packets and triggers callbacks, and completes the initialization of the server process and service registration.
[0135] Below, in conjunction with Figure 5 This paper provides a detailed explanation of the dual-mode process of the CS initialization interface.
[0136] Figure 5 This is a schematic diagram illustrating the dual-mode process of the CS initialization interface provided in this application embodiment. Please refer to... Figure 5 This method may include: after the client process or server process starts, calling the CS initialization interface, which determines whether the shared memory is currently mounted; if the shared memory is not mounted, then the independent process mode is adopted, and the current process creates or mounts the shared memory itself, and sets the node identifier and module identifier of the current process to complete the access of the shared memory; if the shared memory is mounted, then the frame embedded mode is adopted, and the current process binds to the host function module, reuses the mounted shared memory, and verifies whether the module identifier and the initialization parameters are consistent to complete the access of the shared memory; if the mounting mode selected by the current process does not match the actual mounting state of the shared memory, then the initialization interface returns a precondition error, prompting that the mounting mode corresponding to the mounting state should be changed. Through dual-mode initialization and runtime verification, it is ensured that processes under different deployment forms can correctly access the same shared memory segment.
[0137] Below, in conjunction with Figure 6 The startup process of the transmission link of the CS communication encapsulation module is explained in detail.
[0138] Figure 6 This is a schematic diagram illustrating the transmission link startup process of the CS communication encapsulation module provided in an embodiment of this application. Please refer to... Figure 6The method may include: a CS communication encapsulation module deployed within each client and server process, used to encapsulate request and response communication based on a shared memory message middleware. When the transmission link starts, the CS communication encapsulation module determines whether the current process is in frame-embedded mode; if in frame-embedded mode, it reuses the host message client and notification index, and marks the transmission as ready; if not in frame-embedded mode, i.e., the current process is in independent process mode, it creates a new message hub, message client, and shared memory transmission layer, and starts shared memory monitoring to complete the transmission link startup.
[0139] Specifically, when the transmission link starts, the CS communication encapsulation module first determines whether the current process is in frame-embedded mode. If it is in frame-embedded mode, it means that the current process is running within the module framework, and shared memory, message clients, and event notification mechanisms have all been pre-created and mounted by the module framework. Therefore, the CS communication encapsulation module does not recreate the message hub, but directly reuses the host message client and notification index. The host message client can refer to an existing client instance in the module framework used for sending and receiving messages; the notification index can refer to the index of the event notification mechanism registered in the module framework, used to wake up the host module's main event loop when a message arrives. After reuse is complete, the CS communication encapsulation module marks the transmission as ready, indicating that the current process's transmission link can now send and receive messages normally.
[0140] If the current process is not in embedded framework mode, meaning it is in independent process mode, it means that the current process does not have a module framework to provide ready-made communication facilities. Therefore, the CS communication encapsulation module creates a message hub, message client, and shared memory transport layer, and starts shared memory monitoring. Here, the message hub can refer to the communication hub used to access the message middleware in independent process mode, responsible for managing the message client and transport layer; the message client can refer to the client instance used to publish and subscribe to messages; the shared memory transport layer can refer to the message transport layer implemented based on shared memory, responsible for the actual data transfer; starting shared memory monitoring means enabling the monitoring of new messages in shared memory to receive requests or responses in a timely manner.
[0141] In some embodiments, after client process A or B starts, it completes CS initialization in independent process mode and mounts the same shared memory segment as the server. Then, it starts the transmission link and pre-subscribes to the private response channel corresponding to this client. The name of this private response channel is generated by the rule "@source node@source module@service name", where the source node and source module are taken from the identifiers configured during the initialization of this client. Then, it constructs a request message and calls the synchronization request sending interface to publish the request to the public service channel. Finally, it calls the single message polling receiving interface repeatedly within the set timeout period. If a matching response message is received, the response content is copied and success is returned. If no response is received after the timeout, a timeout error is returned, completing the initialization and synchronization request process of the client process.
[0142] Below, in conjunction with Figure 7 The timing diagram for sending synchronous requests to the client is explained in detail.
[0143] Figure 7 This is a schematic diagram illustrating the timing of client synchronization request transmission as provided in an embodiment of this application. Please refer to... Figure 7 The method may include: when a client process initiates a synchronization request, it first subscribes to a private response channel corresponding to the client to pre-establish a channel for receiving responses; then, the client process constructs a request message and publishes the request message to the public service channel; after publication, the client process enters a waiting phase, repeatedly attempting to receive the next message within a set timeout period, and checking whether a response has arrived by receiving packets through a driver notification mechanism; if a matching response message is received within the timeout period, the response result is copied and a success is returned; if no response message is received after the set timeout period, a timeout error is returned, completing one client synchronization request sending and response receiving process.
[0144] Below, in conjunction with Figure 8 The process of sending a synchronization request is explained in detail.
[0145] Figure 8 This is a schematic diagram illustrating the process of sending a synchronization request as provided in an embodiment of this application. Please refer to... Figure 8The method may include: after the client process initiates a synchronization request sending process, it first ensures that it has subscribed to the private response channel corresponding to its own client to pre-establish a channel for receiving responses; subsequently, the client process constructs a request message and publishes the request message to the public service channel. After publication, the client process enters a waiting state to determine whether a matching response message has been received or whether the set timeout period has been reached. If a matching response message is received or the timeout period has been reached, the waiting ends, the response result is copied and a success is returned, or a timeout error is returned in the case of a timeout; if neither a response message is received nor the timeout period has been reached, the client process responds to the notification trigger event of the underlying message middleware, performs a single packet capture and context matching verification, attempts to receive packets, and retryes after a short sleep, repeatedly executing the above judgment steps until a response is received or a timeout occurs.
[0146] In this way, the client process can wait for a response in a polling manner within the set timeout period, avoiding the decrease in communication efficiency caused by long-term blocking, while ensuring the reliability and timeliness of the synchronous request sending process.
[0147] In some embodiments, taking client process A and server process S as examples, when client A initiates a synchronization request, the interaction process is as follows: Client A publishes a request message carrying a message routing header to the public service channel. The routing header contains the node name and module identifier of client A. Server process S receives the request in its main loop, executes the business logic, and constructs a response message. The server reads the source node identifier and source module identifier from the request message routing header, concatenates the response channel name, and publishes the response message to the channel. Client A receives the response within the synchronization request sending process, completing one CS interaction. When client B concurrently initiates a request, the server sends a response back to the private response channel corresponding to client B, which will not be confused with the response from client A.
[0148] It should be noted that the public service channel name can be configured according to business needs; the default timeout for synchronization requests can be set to 1000 milliseconds; the default capacity of the subscription buffer can be set to 32 messages; and the minimum recommended capacity of the shared memory segment in independent process mode is 64 megabytes. Request and response messages use separate message type definitions, and the message body is in a structured serialization format. The message routing header must include at least the source node name, source module identifier, and timestamp, so that the server can construct a private response channel and route response messages.
[0149] Below, in conjunction with Figure 9 The service channel registration and sequence diagram of the server are explained in detail.
[0150] Figure 9 This is a schematic diagram illustrating the server-side service channel registration and timing diagram provided in an embodiment of this application. Please refer to [link / reference]. Figure 9The method may include: after the server process starts, it first registers a public service channel and the corresponding business processing callback to declare that it will receive request messages sent by the client process on the public service channel; then, the server process enters a polling or main loop to receive request messages by periodically calling the single message polling receiving interface; when a request message is received, the server process executes the business processing callback, fills in the response content according to the business logic corresponding to the request message, and obtains the response message; then, the server process reads the source node identifier and source module identifier from the routing header of the request message to determine the source of the request message; finally, the server process concatenates the read source node identifier and source module identifier to generate a private response channel name corresponding to the client process, and publishes the response message to the private response channel so that the client process can receive the response message from the private response channel, thus completing the server's service channel registration and request-response process.
[0151] Below, in conjunction with Figure 10 This paper provides a detailed explanation of the logical processes of the CS communication encapsulation module and message middleware.
[0152] Figure 10 This is a schematic diagram illustrating the logical process of the CS communication encapsulation module and message middleware provided in the embodiments of this application. Please refer to... Figure 10 The CS communication encapsulation module is located above the publish / subscribe transport layer of the message middleware. It is used to implement client / server request-response semantics on the basis of reusing the underlying publish / subscribe capabilities, without replacing the underlying publish / subscribe mechanism.
[0153] This encapsulation module provides client / server initialization interfaces, transport link startup interfaces, and capabilities such as service registration, synchronous request sending, and message polling. The client / server initialization interface supports both independent process mode and framework-embedded mode, and selects to create or reuse message clients based on the mounting mode. The transport link startup interface is used to establish or reuse the message hub and transport layer. Service registration, synchronous request sending, and message polling interact with the underlying shared memory and message middleware through a shared memory manager to complete the sending and receiving of requests and responses. Through these methods, the CS communication encapsulation module provides unified CS communication capabilities for upper-layer services without altering the underlying publish / subscribe transport layer.
[0154] In some embodiments, the method for determining the response channel can be flexible. For example, instead of using a fixed naming rule, a session identifier or request sequence number can be used to generate or identify a private response channel. The waiting method for synchronous requests can also be replaced by an asynchronous callback plus completion notification method, that is, the client does not block and wait after sending a request, but triggers subsequent processing through a callback or notification after receiving a response. In addition, both the server and the client can adopt independent process mode or framework embedded mode respectively or simultaneously according to actual deployment requirements. The CS communication encapsulation module can also adopt a templated design to support any request message and response message type. All of the above alternative methods can adapt to different communication scenarios and deployment requirements without departing from the core concept of this application.
[0155] In this embodiment, CS semantics are implemented on top of publish / subscribe using a public request channel and a derived private response channel. This allows CS communication to reuse existing message middleware without adding a physical bus or building a separate RPC protocol stack. Simultaneously, by using dual-mode CS initialization and shared memory mount state guard verification, the access paths for independent processes and embedded modules within the framework are unified, avoiding mount failures or packet reception issues caused by mode misuse. Furthermore, synchronous requests are polled for packets at deadlines under a notification mechanism. When multiple clients are concurrent, each client receives responses from the private response channel, effectively avoiding response crosstalk. The three-process independent example can verify the CS link independently of the vehicle module and is consistent with the approach of lightweight external access frameworks, facilitating third-party module expansion.
[0156] Figure 11 This is a schematic diagram of a process communication device based on in-vehicle shared memory, provided as an embodiment of this application. Please refer to... Figure 11 The process communication device 1100 based on vehicle-mounted shared memory includes: a determining module 1101, an access module 1102, a receiving module 1103, and a sending module 1104, wherein:
[0157] The determination module 1101 is used to determine the mounting status of the server process for shared memory, and based on the mounting status, determine the mounting mode of the server process, which is either independent process mode or frame embedded mode.
[0158] The access module 1102 is used to connect the server process to the shared memory according to the mounting mode, so that the server process can receive messages in the public service channel through the shared memory-based message middleware;
[0159] The receiving module 1103 is used to receive request messages sent by the client process and determine response messages based on the request messages;
[0160] The sending module 1104 is used to determine the response channel corresponding to the client process and send a response message to the response channel so that the client process can receive the response message from the response channel.
[0161] In one possible implementation, the determining module 1101 is specifically used for:
[0162] When the mount status is unmounted, the mount mode is determined to be independent process mode;
[0163] When the mounting status is "mounted", the mounting mode is determined to be the frame-embedded mode.
[0164] In one possible implementation, the access module 1102 is specifically used for:
[0165] When the mounting mode is independent process mode, create or mount shared memory and configure the node identifier and module identifier of the server process to connect the server process to the shared memory.
[0166] In one possible implementation, the access module 1102 is specifically used for:
[0167] When the mounting mode is frame-embedded mode, the shared memory already mounted by the module frame is reused, and the module identifier of the module frame is verified to be consistent with the initialization parameters in order to access the shared memory.
[0168] In one possible implementation, the public service channel is a public request channel registered at the transport layer based on message middleware, used to carry request messages sent by client processes.
[0169] In one possible implementation, the receiving module 1103 is specifically used for:
[0170] Invoke the business processing callback corresponding to the public service channel;
[0171] The response message is obtained by filling in the response content according to the business logic corresponding to the request message through the business processing callback.
[0172] In one possible implementation, the sending module 1104 is specifically used for:
[0173] Parse the request message to obtain the client process identification information, which includes the source module identifier and the source node identifier;
[0174] The response channel corresponding to the client process is determined based on the source module identifier and the source node identifier.
[0175] In one possible implementation, the sending module 1104 is specifically used for:
[0176] Determine the service name corresponding to the request message;
[0177] According to the preset constraints, the source module identifier, source node identifier and service name are concatenated to obtain the channel name, and the response channel is determined based on the channel name.
[0178] The process communication device based on vehicle-mounted shared memory provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0179] Figure 12 This is a schematic diagram of the structure of a process communication device based on in-vehicle shared memory, provided as an embodiment of this application. Figure 12 As shown, the process communication device 1200 based on vehicle-mounted shared memory may include: transceiver 1201, processor 1202, and memory 1203.
[0180] Processor 1202 executes computer execution instructions stored in memory, causing processor 1202 to perform the scheme in the above embodiments. Processor 1202 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0181] The memory 1203 is connected to the processor 1202 via the system bus and completes communication between them. The memory 1203 is used to store computer program instructions.
[0182] Transceiver 1201 can be used to obtain the task to be run and its configuration information.
[0183] The system bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.
[0184] This application also provides a chip for executing instructions, which is used to execute the technical solution of the process communication method based on vehicle shared memory in the above embodiments.
[0185] This application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on a computer, the computer performs the technical solution of the process communication method based on vehicle-mounted shared memory described in the above embodiments.
[0186] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, it can implement the technical solution of the process communication method based on vehicle-mounted shared memory in the above embodiments.
[0187] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0188] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.
[0189] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.
[0190] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.
[0191] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.
[0192] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.
[0193] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0194] The aforementioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0195] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. The processor and storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic control unit or main control device.
[0196] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0197] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A process communication method based on a vehicle-mounted shared memory, characterized in that, The method includes: Determine the mounting status of the server process for shared memory, and based on the mounting status, determine the mounting mode of the server process, wherein the mounting mode is either independent process mode or frame embedded mode. According to the mounting mode, the server process is connected to the shared memory so that the server process can receive messages in the public service channel through the message middleware based on the shared memory; Receive a request message sent by the client process, and determine a response message based on the request message; The response channel corresponding to the client process is determined, and the response message is sent to the response channel so that the client process receives the response message from the response channel.
2. The method of claim 1, wherein, Based on the mounting status, the mounting mode of the server process is determined, including: When the mounting state is unmounted, the mounting mode is determined to be independent process mode; When the mounting status is "mounted", the mounting mode is determined to be the frame-embedded mode.
3. The method of claim 1, wherein, According to the mounting mode, connecting the server process to the shared memory includes: When the mounting mode is independent process mode, the shared memory is created or mounted, and the node identifier and module identifier of the server process are configured to connect the server process to the shared memory.
4. The method according to claim 1, characterized in that, According to the mounting mode, connecting the server process to the shared memory includes: When the mounting mode is the frame-embedded mode, the shared memory already mounted by the module frame is reused, and the module identifier of the module frame is verified to be consistent with the initialization parameters in order to access the shared memory.
5. The method according to claim 1, characterized in that, The public service channel is a public request channel registered at the transport layer based on the message middleware, used to carry request messages sent by the client process.
6. The method according to claim 1, characterized in that, Based on the request message, a response message is determined, including: Invoke the business processing callback corresponding to the public service channel; The response message is obtained by filling the response content according to the business logic corresponding to the request message through the business processing callback.
7. The method according to claim 1, characterized in that, Determining the response channel corresponding to the client process includes: Parse the request message to obtain the identification information of the client process, which includes the source module identifier and the source node identifier; The response channel corresponding to the client process is determined based on the source module identifier and the source node identifier.
8. The method according to claim 7, characterized in that, Determining the response channel corresponding to the client process includes: Determine the service name corresponding to the request message; According to preset constraints, the source module identifier, the source node identifier, and the service name are concatenated to obtain the channel name, and the response channel is determined based on the channel name.
9. A process communication device based on vehicle-mounted shared memory, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-8.
11. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the method described in any one of claims 1-8.
