Non-POD data cross-process sharing method and device, equipment and medium
By dividing the memory reserved area of the same address for the publishing process and the subscription process in the autonomous driving operating system, and constructing non-POD data objects in the shared memory block, directly transmitting a list of smart pointers, the result of serialization and deserialization is solved. The problems of waste of resources and low real-time performance enable efficient cross-process sharing of non-POD data.
Patent Information
- Application Number
- CN202411177064.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-12-17
AI Technical Summary
The prior art causes the problems of wasting resources and low system real-time when non-POD data is transmitted across processes through serialization and deserialization in an autonomous driving operating system.
Divide a reserved area in the memory space of the publishing process and the subscription process, and construct non-POD data object instances in this area through shared memory blocks, store the memory locations of the object instances, and send a list of smart pointers to the subscription process. The subscription process will use the following steps: The received smart pointer list restores object instances to avoid serialization and deserialization operations.
It improves data transmission efficiency, reduces computing resource consumption, and improves the real-timeness of the system.
Smart Images

Figure CN119149266A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computers and relates to a data cross-process sharing technology, and specifically relates to a non-POD data cross-process sharing method, device, equipment and medium. Background Art
[0002] With the rapid development of science and technology in recent years, autonomous driving technology has become a major innovation in the automotive industry. With its open source, stability and strong ecosystem support, the operating system provides a solid underlying support for the design and implementation of the autonomous driving framework, and has gradually become the core of many autonomous driving platforms. However, when building an autonomous driving platform, a key challenge is how to efficiently and safely transmit large amounts of data between different modules of the framework. Timely and accurate transmission of data between modules is the basis for ensuring that the vehicle can respond to environmental changes in real time and improve driving safety.
[0003] The current operating system architecture in the field of autonomous driving is mostly built on the Linux platform. Its core framework includes multiple independent modules, which logically cooperate with each other to complete tasks such as perception, decision-making, planning and control. Usually, in order to ensure the high reliability of the system and the low coupling between modules, each module is often deployed in a separate process with an independent virtual address space. Although this design improves the stability and maintainability of the system, it also brings difficulties in data interaction, especially when it comes to the efficient transmission of large blocks of data.
[0004] At present, cross-process communication is usually carried out through shared memory, which allows different processes to access the same physical memory area, realizes fast data exchange, and avoids the extra overhead brought by traditional communication methods such as pipes and sockets. However, the use of shared memory is not without obstacles. For example, when processing non-POD (Plain Old Data) type data, that is, data types containing pointers or complex constructors, due to the inconsistent virtual address space mapping of different processes, directly passing non-POD type objects will lead to unpredictable behavior and even system crashes.
[0005] In order to avoid the above problems when sharing non-POD type data through shared memory, the traditional method is to adopt the strategy of data serialization and deserialization. Specifically, the sender converts the complex non-POD type data structure into a series of byte streams (serialization), and then writes these byte streams into the shared memory; the receiver then reads these byte streams from the shared memory and restores them to the original data structure (deserialization). However, sharing non-POD type data through serialization and deserialization greatly increases the computing burden, especially for frequent and large-scale data communication, which will undoubtedly consume precious computing resources and affect the real-time performance of the system.
[0006] Another way is to stipulate that the data interface only uses POD type data transmission. The application scenarios of this method are limited, which limits the flexibility and richness of data between modules and makes the direct transmission of complex data structures and objects impossible. Summary of the invention
[0007] In order to solve the technical problems of resource waste and low system real-time performance caused by the existing non-POD data cross-process transmission through serialization and deserialization, the present invention discloses a non-POD data cross-process sharing method, which is used for sharing non-POD data between a data publishing process and a data receiving process in a Linux kernel. Specifically, the method includes the following steps:
[0008] A reserved area is divided out in the memory space of the publishing process and the subscription process respectively, and the same starting address and ending address are assigned to the reserved areas of the publishing process and the subscription process;
[0009] The publishing process applies for a shared memory block mapped to the reserved area, constructs an object instance of non-POD data in the shared memory block, stores the memory location of the object instance, fills the smart pointers of all the object instances into a smart pointer list, and sends the smart pointer list to the subscribing process;
[0010] The subscription process obtains the corresponding object instance through the memory location, and restores the object instance to non-POD data according to the received smart pointer list.
[0011] In an improved embodiment, constructing an object instance of non-POD data in the shared memory block, storing the memory location of the object instance, and filling the smart pointers of all the object instances into a smart pointer list includes:
[0012] The publishing process uses its own constructor to construct an object instance of non-POD data in the object area of the shared memory block;
[0013] Storing the memory location of each of the object instances in the information area of the shared memory block;
[0014] Fill the extracted smart pointer of each object instance into the smart pointer list.
[0015] In an improved embodiment, the publishing process uses its own constructor to construct an object instance of non-POD data in the object area of the shared memory block, including:
[0016] Using the constructor of the publishing process itself, applying for construction space for each main object in the non-POD data in the object area and constructing a main object instance;
[0017] In the object area, a construction space is applied for each sub-object under the main object and a sub-object instance is constructed, and a smart pointer between the main object and each of the sub-objects under it is extracted.
[0018] In an improved embodiment, the publishing process applies for a shared memory block mapped to the reserved area, including:
[0019] Establishing a communication link between the publishing process and the subscribing process;
[0020] Applying for a shared memory block mapped to the reserved area from a shared memory space list according to the amount of shared data of the publishing process;
[0021] The space of the shared memory block is divided into an object area and an information area, wherein the object area is used to construct an object instance through a constructor, and the information area is used to store attribute information of the object instance.
[0022] In an improved embodiment, the space of the shared memory block is smaller than the space of the reserved area.
[0023] In an improved embodiment, the method further comprises:
[0024] After the publishing process completes the construction operation on the object instance, the reference count of the object instance is stored;
[0025] When the subscription process receives the smart pointer list, it performs a +1 operation on the reference count to obtain a new reference count; and performs a recovery operation on the object instance through the memory location and the smart pointer list according to the destructor of the subscription process itself;
[0026] When the publishing process receives feedback that the subscribing process has finished using the object instance, the smart pointer of the object instance is destroyed and a -1 operation is performed on the new reference count.
[0027] In an improved embodiment, the method further comprises:
[0028] If the publishing process does not receive the smart pointer list reception message sent by the subscribing process within a set time, the smart pointer list is resent to the subscribing process;
[0029] If the sending of the smart pointer list fails, the publishing process destroys the smart pointers filled in the smart pointer list.
[0030] The embodiment of the present invention also provides a non-POD data cross-process sharing device, including a process memory arrangement module, a shared memory block application module, an object construction module, a data sending module and an object destruction module.
[0031] The process memory arrangement module is used to divide a reserved area in the memory space of the publishing process and the subscription process respectively, and allocate the same starting address and ending address to the reserved areas of the publishing process and the subscription process;
[0032] The shared memory block application module is used by the publishing process to apply for a shared memory block mapped to the reserved area;
[0033] The object construction module is used for the publishing process to construct an object instance of non-POD data in the shared memory block, store the memory location of the object instance, and fill the smart pointers of all the object instances into the smart pointer list;
[0034] The data generation module is used to send the smart pointer list to the subscription process;
[0035] The object destructor module is used by the subscription process to obtain the corresponding object instance through the memory location, and restore the object instance to non-POD data according to the received smart pointer list.
[0036] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any of the above-mentioned non-POD data cross-process sharing methods to solve the existing technical problems of resource waste and low system real-time performance caused by cross-process transmission of non-POD data through serialization and deserialization.
[0037] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program for executing any of the above-mentioned non-POD data cross-process sharing methods, so as to solve the technical problems of resource waste and low system real-time performance caused by the existing cross-process transmission of non-POD data through serialization and deserialization.
[0038] Compared with the prior art, the beneficial effects that can be achieved by at least one of the above technical solutions adopted in the embodiments of this specification include at least: the non-POD data cross-process sharing method of the present invention, first, by arranging the memory space of each process in the system, a reserved area with the same address is divided; secondly, the publishing process constructs the object of non-POD data in the applied shared memory block through the constructor, stores the location information of the object, and fills the smart pointer of the object into the smart pointer list; finally, the smart pointer list can be sent to the subscribing process through existing channels such as DDS. After receiving the message, the subscribing process can use the destructor to restore the non-POD data object according to the location information of the object because all processes have a reserved area with the same address, thereby realizing the sharing of non-POD data between two processes. The method of the present invention does not require serialization and deserialization of data, which greatly improves the data transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 A flowchart of a non-POD data cross-process sharing method disclosed in an embodiment of the present invention;
[0041] Figure 2 A schematic diagram of rearranging the memory space of a process in an embodiment of the present invention;
[0042] Figure 3 A schematic diagram of a shared memory block between a publishing process and a subscribing process in an embodiment of the present invention;
[0043] Figure 4 Schematic diagram of construction and destruction of a certain object instance in non-POD data in an embodiment of the present invention;
[0044] Figure 5 It is an architectural diagram of a non-POD data cross-process sharing device disclosed in an embodiment of the present invention;
[0045] Figure 6 A schematic diagram of a computer device disclosed in an embodiment of the present invention;
[0046] Among them, 501, process memory arrangement module; 502, shared memory block application module; 503, object construction module; 504, data sending module; 505, object destruction module; 601, memory; 602, processor. DETAILED DESCRIPTION
[0047] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0048] The following describes the implementation methods of the present application through specific specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and the features of the embodiments can be combined with each other in the absence of conflict. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work belong to the scope of protection of the present application.
[0049] POD data (Plain Old Data) is used to describe data types that have no complex structure and no significant custom behavior, while the non-POD data involved in this application refers to data types with pointers or complex constructors. It can also be understood that the data structure of non-POD data is relatively complex and has user-defined constructors, destructors, assignment operators or copy constructors.
[0050] The embodiment of the present invention discloses a non-POD data cross-process sharing method, see Figure 1 As shown, the method comprises the following steps:
[0051] S11, a reserved area is divided in the memory space of the publishing process and the subscription process respectively, and the same starting address and ending address are assigned to the reserved areas of the publishing process and the subscription process;
[0052] S12, the publishing process applies for a shared memory block mapped to the reserved area, constructs an object instance of non-POD data in the shared memory block, stores the memory location of the object instance, fills the smart pointers of all the object instances into a smart pointer list, and sends the smart pointer list to the subscribing process;
[0053] S13. The subscription process obtains the corresponding object instance through the memory location, and restores the object instance to non-POD data according to the received smart pointer list.
[0054] In the embodiment of the present invention, the non-POD data sharing between processes mainly involves the process memory space arrangement to obtain the reserved area, the shared memory block application, the object instance construction, the smart pointer output of the object instance, the object instance destruction analysis, etc. By dividing a reserved area in the process memory space, the object can have the same address information in the publishing process and the subscribing process, which is convenient for the subscribing process to directly use the non-POD data object, thereby avoiding the need to serialize and deserialize the non-POD data.
[0055] The core framework of an existing Linux or Unix system is usually composed of multiple independent modules. These modules cooperate with each other logically. To ensure the reliability of the system and the low coupling between modules, each module is usually deployed in a separate process. Each process has an independent virtual address space, and each process has a shared library SO, heap, stack and other areas. In this application, Figure 2 As shown, the shared memory of the process is rearranged to divide a reserved area through step S11. Specifically, a process memory configuration table can be set according to user needs, and the process space can be rearranged according to the process memory configuration table, so that there is a reserved area in the memory space of all processes, and the starting address and the ending address of the reserved area of all processes are the same. The reserved area is used to construct and destroy non-POD data to realize data sharing.
[0056] In an improved embodiment of the present invention, the publishing process applies for a shared memory block mapped to the reserved area, and the non-POD data is shared between the publishing process and the subscribing process through the shared memory block. Specifically, applying for a shared memory block in the shared memory includes the following steps:
[0057] S121, establishing a communication link between the publishing process and the subscribing process;
[0058] S122, applying for a shared memory block mapped to the reserved area from the shared memory space list according to the amount of shared data of the publishing process, wherein the space of the applied shared memory block is smaller than the space of the reserved area; as shown in Figure 3 As shown, with the camera process as the publishing process and the algorithm process as the subscribing process, a shared memory block that satisfies the amount of non-POD data and has a space smaller than the reserved area can be selected from the existing shared memory space list according to the amount of non-POD data that needs to be shared with the algorithm process in the camera process.
[0059] S123. Divide the space of the shared memory block into an object area and an information area, wherein the object area is used to construct an object instance through a constructor, and the information area is used to store attribute information of the object instance.
[0060] In specific implementation, the publishing process constructs an object instance of non-POD data in the shared memory block, stores the memory location of the object instance, and fills the smart pointers of all the object instances into a smart pointer list, specifically including the following steps:
[0061] S124, the publishing process uses its own constructor to construct an object instance of non-POD data in the object area of the shared memory block;
[0062] S125, storing the memory location of each of the object instances in the information area of the shared memory block;
[0063] S126. Fill the extracted smart pointer of each object instance into the smart pointer list.
[0064] Optionally, the publishing process uses its own constructor to construct an object instance of non-POD data in the object area of the shared memory block, including:
[0065] S1241, using the constructor of the publishing process itself, applying for construction space for each main object in the non-POD data in the object area and constructing a main object instance;
[0066] S1242: Apply for construction space and construct sub-object instances for each sub-object under the main object in the object area, and extract smart pointers between the main object and each of the sub-objects under it.
[0067] In specific implementation, Figure 4 The figure shows the construction and destruction process of a main object (here defined as object 1) in non-POD data. During construction, the constructor a of the publishing process (here defined as process a) applies for the construction space of object 1 in the shared memory block, and then applies for the construction space of its subordinate sub-objects. After completing the construction of the sub-object instance, the smart pointer of the sub-object is filled into the smart pointer list. By applying for the construction space of object 1 and its subordinate sub-objects, the content of the object can be written in the construction space, and the memory location information of the construction space, such as the start address, end address, space size, reference count, etc., is stored in the information area.
[0068] In an improved embodiment of the present invention, after constructing an object instance of non-POD data, it also includes: S127, recording the reference count of each object instance, and changing the value of the reference count before and after data sharing. The reference count can also be called a holding count, and the reference count is designed to manage the life cycle of the object. Specifically, the formation and change process of the reference count includes the following steps:
[0069] S1271, after the publishing process completes the construction operation on the object instance, the reference count of the object instance is stored;
[0070] S1272, when the subscription process receives the smart pointer list, it performs a +1 operation on the reference count to obtain a new reference count; and restores the object instance through the memory location and the smart pointer list according to the destructor of the subscription process itself;
[0071] S1273. When the publishing process receives feedback that the subscribing process has finished using the object instance, the smart pointer of the object instance is destroyed and a -1 operation is performed on the new reference count.
[0072] In an improved embodiment, the method further comprises:
[0073] S1274. If the publishing process does not receive the smart pointer list reception message sent by the subscribing process within the set time, resend the smart pointer list to the subscribing process;
[0074] S1275: If the sending of the smart pointer list fails, the publishing process destroys the smart pointers filled in the smart pointer list.
[0075] When the above step S13 is implemented, since the subscribing process and the publishing process have a reserved area with the same address, after the subscribing process receives the smart pointer list sent by the publishing process, the object can be restored through the memory location of the stored object instance to realize the sharing of non-POD data. When the subscribing process has finished using the data, the smart pointer in the smart pointer list can be destroyed and released.
[0076] Based on the same inventive concept, a non-POD data cross-process sharing device is also provided in an embodiment of the present invention, as described in the following embodiment. Since the principle of solving the problem by the non-POD data cross-process sharing device is similar to the non-POD data cross-process sharing method disclosed in the above embodiment, the implementation of the non-POD data cross-process sharing device can refer to the implementation of the above-mentioned non-POD data cross-process sharing method, and the repeated parts will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements predetermined functions. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0077] Figure 3 is a structural block diagram of a non-POD data cross-process sharing device disclosed in an embodiment of the present invention, such as Figure 3 As shown, the non-POD data cross-process sharing device includes a process memory arrangement module 501, a shared memory block application module 502, an object construction module 503, a data sending module 504 and an object destruction module 505. The structure is described below.
[0078] The process memory arrangement module 501 is used to divide a reserved area in the memory space of the publishing process and the subscription process respectively, and assign the same starting address and ending address to the reserved areas of the publishing process and the subscription process;
[0079] The shared memory block application module 502 is used by the publishing process to apply for a shared memory block mapped to the reserved area;
[0080] The object construction module 503 is used for the publishing process to construct an object instance of non-POD data in the shared memory block, store the memory location of the object instance, and fill the smart pointers of all the object instances into the smart pointer list;
[0081] The data generation module 504 is used to send the smart pointer list to the subscription process;
[0082] The object destructor module 505 is used by the subscription process to obtain the corresponding object instance through the memory location, and restore the object instance to non-POD data according to the received smart pointer list.
[0083] In an optional embodiment, the object construction module 503 is also used for the publishing process to use its own constructor to construct an object instance of non-POD data in the object area of the shared memory block; store the memory location of each of the object instances in the information area of the shared memory block; and fill the extracted smart pointer of each of the object instances into the smart pointer list.
[0084] In an optional embodiment, the system further includes a communication link establishing module, and the communication link establishing module is used to establish a communication link between the publishing process and the subscribing process.
[0085] The shared memory block application module 502 is also used to apply for a shared memory block mapped to the reserved area from the shared memory space list according to the amount of shared data of the publishing process, and the space of the shared memory block is smaller than the space of the reserved area; the space of the shared memory block is divided into an object area and an information area, the object area is used to construct an object instance through a constructor, and the information area is used to store attribute information of the object instance.
[0086] The non-POD data cross-process sharing method of the present invention first arranges the memory space of each process in the system to divide a reserved area with the same address; secondly, the publishing process constructs an object of non-POD data in the applied shared memory block through a constructor, stores the location information of the object, and fills the smart pointer of the object into a smart pointer list; finally, the smart pointer list can be sent to the subscribing process through existing channels such as DDS. After the subscribing process receives the message, since all processes have a reserved area with the same address, the subscribing process can use a destructor to restore the object of non-POD data according to the location information of the object, thereby realizing the sharing of non-POD data between two processes. The method of the present invention does not need to serialize and deserialize data, which greatly improves the transmission efficiency of data.
[0087] In this embodiment, a computer device is provided, such as Figure 6 As shown, it includes a memory 601, a processor 602, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any of the above-mentioned non-POD data cross-process sharing methods is implemented.
[0088] Specifically, the computer device may be a computer terminal, a server or a similar computing device.
[0089] In this embodiment, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program for executing any of the above-mentioned non-POD data cross-process sharing methods.
[0090] Specifically, computer-readable storage media include permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable storage media does not include transitory media such as modulated data signals and carrier waves.
[0091] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present invention are not limited to any specific combination of hardware and software.
[0092] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for sharing non-POD data across processes, characterized in that: The method comprises: A reserved area is divided out in the memory space of the publishing process and the subscription process respectively, and the same starting address and ending address are assigned to the reserved areas of the publishing process and the subscription process; The publishing process applies for a shared memory block mapped to the reserved area, constructs an object instance of non-POD data in the shared memory block, stores the memory location of the object instance, fills the smart pointers of all the object instances into a smart pointer list, and sends the smart pointer list to the subscribing process; The subscription process obtains the corresponding object instance through the memory location, and restores the object instance to non-POD data according to the received smart pointer list.
2. The non-POD data cross-process sharing method according to claim 1, characterized in that: The step of constructing an object instance of non-POD data in the shared memory block, storing the memory location of the object instance, and filling the smart pointers of all the object instances into a smart pointer list includes: The publishing process uses its own constructor to construct an object instance of non-POD data in the object area of the shared memory block; Storing the memory location of each of the object instances in the information area of the shared memory block; Fill the extracted smart pointer of each object instance into the smart pointer list.
3. The non-POD data cross-process sharing method according to claim 2, characterized in that: The publishing process uses its own constructor to construct an object instance of non-POD data in the object area of the shared memory block, including: Using the constructor of the publishing process itself, applying for construction space for each main object in the non-POD data in the object area and constructing a main object instance; In the object area, a construction space is applied for each sub-object under the main object and a sub-object instance is constructed, and a smart pointer between the main object and each of the sub-objects under it is extracted.
4. The non-POD data cross-process sharing method according to any one of claims 1 to 3, characterized in that: The publishing process applies for a shared memory block mapped to the reserved area, including: Establishing a communication link between the publishing process and the subscribing process; Applying for a shared memory block mapped to the reserved area from a shared memory space list according to the amount of shared data of the publishing process; The space of the shared memory block is divided into an object area and an information area, wherein the object area is used to construct an object instance through a constructor, and the information area is used to store attribute information of the object instance.
5. The non-POD data cross-process sharing method according to claim 4, characterized in that: The space of the shared memory block is smaller than the space of the reserved area.
6. The non-POD data cross-process sharing method according to claim 1, characterized in that: The method further comprises: After the publishing process completes the construction operation on the object instance, the reference count of the object instance is stored; When the subscription process receives the smart pointer list, it performs a +1 operation on the reference count to obtain a new reference count; and performs a recovery operation on the object instance through the memory location and the smart pointer list according to the destructor of the subscription process itself; When the publishing process receives feedback that the subscribing process has finished using the object instance, the smart pointer of the object instance is destroyed and a -1 operation is performed on the new reference count.
7. The non-POD data cross-process sharing method according to claim 1, characterized in that: The method further comprises: If the publishing process does not receive the smart pointer list reception message sent by the subscribing process within a set time, the smart pointer list is resent to the subscribing process; If the sending of the smart pointer list fails, the publishing process destroys the smart pointers filled in the smart pointer list.
8. A non-POD data cross-process sharing device, characterized in that: include: A process memory arrangement module, the process memory arrangement module is used to divide a reserved area in the memory space of the publishing process and the subscription process respectively, and assign the same starting address and ending address to the reserved areas of the publishing process and the subscription process; A shared memory block application module, wherein the shared memory block application module is used by the publishing process to apply for a shared memory block mapped to the reserved area; An object construction module, wherein the object construction module is used by the publishing process to construct an object instance of non-POD data in the shared memory block, store the memory location of the object instance, and fill in the smart pointers of all the object instances into a smart pointer list; A data sending module, the data generating module is used to send the smart pointer list to the subscription process; An object destructor module is used by the subscription process to obtain the corresponding object instance through the memory location, and restore the object instance to non-POD data according to the received smart pointer list.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the non-POD data cross-process sharing method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing the non-POD data cross-process sharing method according to any one of claims 1 to 7.
