Process two-way communication method and system and readable storage medium
By generating readable and writeable device nodes and linked list management methods in the kernel driver, the problems of unidirectionality of process communication and shared memory complexity in the prior art are solved, and efficient inter-process bidirectional communication is achieved.
Patent Information
- Application Number
- CN202411966200.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-05-02
AI Technical Summary
In the prior art, the process communication method is mainly one-way communication, which cannot meet the processing capabilities of large-scale high-efficiency communication data, and the shared memory method is complex and difficult to manage.
By automatically generating readable and writeable device nodes in the kernel driver, processes can directly realize two-way communication through file reading and writing, and use linked lists to manage data storage and distribution between processes.
It realizes efficient two-way communication between processes, improves communication efficiency, and reduces the difficulty of process communication development.
Smart Images

Figure CN119917315A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of process communication, and in particular to a process two-way communication method, system and readable storage medium. Background Art
[0002] In existing systems that require process communication, such as operating systems, process communication technologies, except for sockets, other process communication methods based on input / output (I / O) are highly efficient, but can only communicate in one direction, including message queues. The shared memory method is complex to use and data is difficult to manage. It is not suitable for message type communication, resulting in an inability to meet the processing capabilities for large quantities of efficient communication data. Summary of the invention
[0003] The present application provides a process bidirectional communication method, system and readable storage medium, which can solve the technical problem that processes cannot bidirectionally communicate in the prior art.
[0004] In a first aspect, an embodiment of the present application provides a process bidirectional communication method, including: a first process and a second process, applied to the first process, the method including: obtaining an operation instruction, determining a target linked list according to the operation instruction, the target linked list including a first linked list corresponding to the first process and a second linked list corresponding to the second process; when the operation instruction is a write instruction, adjusting the first linked list; when the operation instruction is a read instruction, adjusting the second linked list.
[0005] Preferably, the method also includes: initializing the first linked list and the second linked list, setting the number of messages in the first linked list and the second linked list to 0; initializing the first resource pointer of the first linked list and the second resource pointer of the second linked list to empty; and creating a device node according to the first linked list and the second linked list.
[0006] Further preferably, the method also includes: determining whether the first process is allowed to use the device node; when the first process is allowed to use the device node, setting the first linked list as the write linked list of the first process, and setting the second linked list as the read linked list of the first process.
[0007] Preferably, the write instruction includes write information and write length; when the operation instruction is a write instruction, adjusting the first linked list includes: when the write length is greater than 0, applying for memory for the write length and locking the first linked list; when the number of messages in the first linked list is greater than the maximum limit, deleting the head node of the first linked list; adding the write information to the tail of the first linked list.
[0008] Preferably, the read instruction includes a read length; when the operation instruction is a read instruction, adjusting the second linked list includes: when the number of messages in the second linked list is greater than 0, locking the second linked list, and reading the head node of the second linked list and the data length of the head node of the second linked list; when the read length is greater than the data length of the head node of the second linked list, setting the read length to the data length of the head node of the second linked list; copying the data corresponding to the data length of the head node of the second linked list to the buffer of the first process, and deleting the head node of the second linked list.
[0009] Preferably, the method further includes: when a release instruction is triggered, releasing the memory corresponding to the first linked list.
[0010] Preferably, the method also includes: when the uninstall instruction is triggered, looping to determine whether the number of messages in the first linked list is 0; when it is not 0, reading and releasing the head node of the first linked list; when it is 0, releasing the memory corresponding to the first process.
[0011] In the second aspect, an embodiment of the present application also provides a process bidirectional communication method, including a first process and a second process, applied to the second process, the method including: obtaining an operation instruction, determining a target linked list according to the operation instruction, the target linked list including a first linked list corresponding to the first process and a second linked list corresponding to the second process; when the operation instruction is a write instruction, adjusting the second linked list; when the operation instruction is a read instruction, adjusting the first linked list.
[0012] In the third aspect, an embodiment of the present application also provides a process bidirectional communication system, including a first process and a second process; the first process includes a first linked list corresponding to the first process, and the second process includes a second linked list corresponding to the second process; the first process adjusts the first linked list according to the write instruction, and adjusts the second linked list according to the read instruction; the second process adjusts the second linked list according to the write instruction, and adjusts the first linked list according to the read instruction.
[0013] In a fourth aspect, an embodiment of the present application further provides a readable storage medium, on which a process two-way communication program is stored, wherein when the process two-way communication program is executed by a processor, the steps of the process two-way communication method described above are implemented.
[0014] In the present application, by allocating the first linked list and the second linked list corresponding to the first process and the second process, and utilizing data storage and distribution, the two processes can achieve inter-process communication by operating file reading and writing, which greatly improves the efficiency of inter-process communication and significantly reduces the difficulty of process communication development. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 This is a flow chart of a process bidirectional communication method applied to a first process in an embodiment of the present application;
[0016] Figure 2 This is a schematic diagram of the process message writing processA in an embodiment of the present application;
[0017] Figure 3 This is a schematic diagram of the process message reading processA in an embodiment of the present application;
[0018] Figure 4 This is a schematic diagram of the driver initialization process in an embodiment of the present application;
[0019] Figure 5 This is a schematic diagram of the process flow of opening a device node by processA in an embodiment of the present application;
[0020] Figure 6 This is a schematic diagram of the process triggering driving release function flow in an embodiment of the present application;
[0021] Figure 7 This is a schematic diagram of the process triggering uninstall instruction flow in an embodiment of the present application;
[0022] Figure 8 This is a flow chart of a process bidirectional communication method applied to a second process in an embodiment of the present application;
[0023] Fig. 9 This is a schematic diagram of the hardware structure of a process two-way communication device involved in the embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0025] As the communication requirements of the system architecture increase, the communication efficiency requirements of each level of the system are greatly increased. For example, as cars become more and more intelligent, the camera pixels of the car body are getting higher and higher, the sensor data accuracy is getting higher and higher, and the traditional transmission copper wires are gradually converted to optical fibers. After the optical fiber connects the camera and radar sensor, the communication rate is greatly improved. After the communication rate is increased, the requirements for data processing capabilities of the vehicle system are also greatly increased. Improving data processing capabilities requires improving the internal communication efficiency of the system, and the communication efficiency requirements of each level of the system are also greatly increased.
[0026] However, except for socket, the other process communication methods based on I / O and message queues in the current body system process communication technology can only communicate in one direction. The shared memory communication method is complicated to use and the data is difficult to manage. It is not suitable for message-type communication, resulting in the inability to meet the data processing capabilities after the introduction of optical fiber.
[0027] In order to solve the above problems, the present invention provides a process two-way communication method, system and readable storage medium. By adopting the kernel driver mode, a readable and writable device node is automatically generated, and the process can directly open the device node for reading and writing, and the driver manages the data needed to be read and written by each process, so that the data needed to be read and written by each process do not interfere with each other, and realize the function of efficient inter-process communication. The driver used in the present invention can independently realize various functions such as open function (open), write function (write), read function (read) and other mechanisms, and cleverly use data storage and distribution, so that two processes can directly realize inter-process communication by operating file read and write mode, and the efficiency is greatly improved, and the difficulty of process communication development is also greatly reduced.
[0028] In one embodiment of the present invention, the present invention provides a process bidirectional communication system, including a first process and a second process; the first process includes a first linked list corresponding to the first process, and the second process includes a second linked list corresponding to the second process; the first process adjusts the first linked list according to a write instruction, and adjusts the second linked list according to a read instruction; the second process adjusts the second linked list according to the write instruction, and adjusts the first linked list according to the read instruction.
[0029] In a specific embodiment of the present invention, the first process may be process A, i.e., processA, and the second process may be process B, i.e., processB; the first linked list corresponding to the first process, i.e., the linked list corresponding to processA, may be list_processA, and the second linked list corresponding to the second process, i.e., the linked list corresponding to processB, may be list_processB. In addition, the number of messages in the linked list may be represented by datalen, the number of messages of processA may be represented by datalenA, and the number of messages of processB may be represented by datalenB; the resource pointer opened by the process may be represented by ptr_source, the resource pointer opened by processA may be represented by ptr_sourceA, and the resource pointer opened by processB may be represented by ptr_sourceB; the read-write lock may be represented by mutex; the function of opening a device node may be represented by open, the function of reading a device node may be represented by read, the function of writing a device node may be represented by write, and the kernel function of opening memory space may be represented by kmalloc.
[0030] In another embodiment, if Figure 1 As shown, the present invention provides a process bidirectional communication method, including a first process and a second process, and is applied to the first process. The method includes:
[0031] S100, obtaining an operation instruction, and determining a target linked list according to the operation instruction, where the target linked list includes a first linked list corresponding to the first process and a second linked list corresponding to the second process;
[0032] The operation instructions may include write instructions and read instructions.
[0033] S200, when the operation instruction is a write instruction, adjusting the first linked list;
[0034] In one embodiment, a write instruction includes write information and a write length; when the operation instruction is a write instruction, adjusting the first linked list includes: when the write length is greater than 0, applying for memory for the write length and locking the first linked list; when the number of messages in the first linked list is greater than the maximum limit, deleting the head node of the first linked list; and adding the write information to the tail of the first linked list.
[0035] In a specific embodiment, if Figure 2 As shown, taking processA as an example, process message writing may include the following steps:
[0036] S201, processA calls write to write a message;
[0037] S202, determine whether the write length len of processA is less than or equal to 0, if yes, end directly, otherwise execute S203; after the driver triggers the write function, determine whether the length of the process write message data is less than or equal to 0, if yes, end directly and return -1.
[0038] S203, kmalloc applies for a piece of memory including a data pointer data_ptr and a uint type length variable node_len;
[0039] S204, kmalloc applies for a memory data with a write length of len;
[0040] S205, mutex lock;
[0041] S206, copy_from_user is used to copy the written data to the data memory, and the data_ptr pointer points to the data address, and node_len is assigned the value of len;
[0042] S207, determine whether the number of messages written into the buffer list_processA by the current process is greater than the upper limit, if yes, execute S208, otherwise execute S209;
[0043] S208, delete the first message written to the head of the linked list, release the corresponding memory area, and reduce the number of linked list messages by one;
[0044] S209, adding the latest written message to the process write linked list, and the total number of messages written to the linked list is increased by one;
[0045] S210, mutex unlocked.
[0046] S300: When the operation instruction is a read instruction, adjust the second linked list.
[0047] In one embodiment, the read instruction includes a read length; when the operation instruction is a read instruction, adjusting the second linked list includes: when the number of messages in the second linked list is greater than 0, locking the second linked list, and reading the head node of the second linked list and the data length of the head node of the second linked list; when the read length is greater than the data length of the head node of the second linked list, setting the read length to the data length of the head node of the second linked list; copying the data corresponding to the data length of the head node of the second linked list to the buffer of the first process, and deleting the head node of the second linked list.
[0048] In a specific embodiment, Figure 3 As shown, still taking processA as an example, process message reading may include the following steps:
[0049] S301, processA calls the read function to read the message;
[0050] S302, determine whether the length of the read list of processA is 0; if so, return to S301, otherwise execute S303; after the driver triggers the read function, determine whether the number of messages in the process read list (here list_processB) is 0, if it is 0, directly return -1 to the process.
[0051] S303, mutex locking; the read-write lock mutex locks the current operation.
[0052] S304, obtain the message data at the first position of the head from the read list list_processB;
[0053] S305, determine whether the length of the acquired message data node_len is greater than the length len requested to be read this time; if not, execute S306; if yes, execute S307;
[0054] S306, the requested length len is assigned to the current message length node_len;
[0055] S307, using copy_to_user to copy the kernel-driven message data to the process's data receiving buffer, the length of which is len;
[0056] S308, the total number of messages in the read linked list is reduced by one;
[0057] S309, mutex unlock;
[0058] S310, release the memory occupied by the data message taken out by the current kernel driver, delete the message from the list_processB linked list, and return the length of the data successfully read by the copy.
[0059] In another embodiment, before obtaining the operation instruction, the method also includes driver initialization, which may include: initializing the first linked list and the second linked list, setting the number of messages in the first linked list and the second linked list to 0; initializing the first resource pointer of the first linked list and the second resource pointer of the second linked list to empty; creating a device node according to the first linked list and the second linked list.
[0060] In a specific embodiment, the driver initialization can be performed as follows Figure 4 The method shown comprises the following steps:
[0061] S401. Create a drive device number.
[0062] S402, initialize the write linked list of the process, and initialize the number of messages written to the linked list to 0, initialize the resource pointer of the process to null, and initialize the read-write lock of the linked list. In a specific embodiment, assuming that processA and processB interact, two message linked lists list_processA and list_processB of the two processes processA and processB can be initialized, and the number of messages datalen can be initialized to 0, respectively used to save the message data written by the corresponding process, and the resource pointer ptr_source of processA and processB is initialized to null, that is, NULL, and the read-write lock mutex used to control processA and processB to the two linked lists is initialized;
[0063] S403, create a device node and mount it as / dev / XXX. Automatically mount the driver device node, the device node path is / dev / by default, and the name is XXX.
[0064] In another embodiment, when a process needs to communicate with another process, the process first needs to open a device node. The process may include: determining whether the first process is allowed to use the device node; when the first process is allowed to use the device node, setting the first linked list as the write linked list of the first process and setting the second linked list as the read linked list of the first process.
[0065] In a specific embodiment, Figure 5 As shown, taking processA as an example, the process opening the device node can specifically include the following steps
[0066] S501, open the device node through the open function; any process such as processA or processB can use the open function to open the driver device node / dev / XXX.
[0067] S502, determine whether the process name is allowed to use the device node; if not, terminate directly; if yes, execute S503.
[0068] After the driver triggers the open function, it determines whether the current driven process can use the driver for communication. If the process is not allowed to use the driver, the driver ends directly and returns an error code.
[0069] S503, apply for a block of memory to store process information, for example, the write address of processA is list_processA, and the read address of processA is list_processB.
[0070] Apply for a piece of memory as ptr_source, ptr_source saves the write list of the process as list_processA, and the read list as list_processB.
[0071] S504. Save the memory address opened by the process to ptr_source to facilitate release when the driver is uninstalled.
[0072] In another embodiment, when the release instruction is triggered, the memory corresponding to the first linked list is released.
[0073] In a specific embodiment, Figure 6 As shown, when the release instruction is triggered, that is, the process triggers the driver release function, if processA and processB interact, the following steps may be included:
[0074] S601, determine whether the current name is processA; if yes, execute step S602; otherwise, execute step S603;
[0075] S602. Release the ptr_source memory pointed to by processA and set it to NULL, and then end.
[0076] S603, determine whether the current name is processB; if not, directly end; if yes, execute step S604;
[0077] S604. Release the ptr_source memory pointed to by processB and set it to NULL, and then end.
[0078] In another embodiment, when the uninstall instruction is triggered, it is determined in a loop whether the number of messages in the first linked list is 0; when it is not 0, the head node of the first linked list is read and released; when it is 0, the memory corresponding to the first process is released.
[0079] In a specific embodiment, Figure 7 As shown, if processA and processB interact, when the uninstall instruction is triggered, the following steps can be performed:
[0080] S701, uninstall the device node and release the device number, that is, cancel the registration of the device number;
[0081] S702, determine whether the number of messages in list_processA is 0; if not, execute S703; if yes, execute S704;
[0082] S703, take out the first message at the head of list_processA, release its memory, and return to S702;
[0083] S704, determine whether the number of messages in list_processB is 0; if not, execute S705; if yes, execute S706;
[0084] S705, take out the first message at the head of list_processB, release its memory, and return to S704;
[0085] S706, determine whether the ptr_source pointer pointed to by processA is NULL; if not, execute S707; if yes, execute S708;
[0086] S707, release the ptr_source pointer memory pointed to by processA;
[0087] S708, determine whether the ptr_source pointer pointed to by processB is NULL; otherwise, execute S709, and end if yes;
[0088] S709. Release the ptr_source pointer memory pointed to by process, and end.
[0089] That is, the loop determines whether the number of messages in the list_processA and list_processB linked lists is 0. If not, the data is taken out from the head of the linked list and its memory is released in turn, and then the message is deleted from the linked list until the data of the two linked lists are completely deleted and released; determine whether the ptr_source pointer pointed to by processA and processB is NULL. If not, the memory allocated by its ptr_source is released.
[0090] The above method is mainly described based on processA, and in the second aspect of the present invention, the embodiment of the present application also provides a process two-way communication method, such as Figure 8 As shown, the method includes a first process and a second process, and is applied to the second process, which may be processB, for example. The method includes:
[0091] S801, obtaining an operation instruction, and determining a target linked list according to the operation instruction, where the target linked list includes a first linked list corresponding to the first process and a second linked list corresponding to the second process;
[0092] S802: When the operation instruction is a write instruction, adjust the second linked list;
[0093] S803: When the operation instruction is a read instruction, adjust the first linked list.
[0094] The other contents correspond to the steps in the above method embodiment, and their implementation process will not be repeated here one by one.
[0095] In a third aspect, an embodiment of the present application provides a process two-way communication device, which may be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.
[0096] Fig. 9 A schematic diagram of the hardware structure of a process two-way communication device involved in an embodiment of the present application is shown.
[0097] Reference Fig. 9 In an embodiment of the present application, a process bidirectional communication device may include a processor, a memory, a communication interface, and a communication bus.
[0098] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.
[0099] Communication interfaces include input / output (I / O) interfaces, physical interfaces, and logical interfaces, which are used to interconnect devices within a process two-way communication device, and interfaces used to interconnect a process two-way communication device with other devices (such as other computing devices or user devices). Physical interfaces can be Ethernet interfaces, optical fiber interfaces, ATM interfaces, etc.; user devices can be display screens (Display), keyboards (Keyboard), etc.
[0100] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0101] The processor may be a general-purpose processor, and the general-purpose processor may call the process two-way communication program stored in the memory and execute the process two-way communication method provided by the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the process two-way communication program is called may refer to the various embodiments of the process two-way communication method of the present application, and will not be repeated here.
[0102] Those skilled in the art will understand that Fig. 9The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0103] The embodiment of the present application also provides a readable storage medium.
[0104] The readable storage medium of the present application stores a process two-way communication program, wherein when the process two-way communication program is executed by a processor, the steps of the process two-way communication method as described above are implemented.
[0105] Among them, the method implemented when the process two-way communication program is executed can refer to the various embodiments of the process two-way communication method of the present application, and will not be repeated here.
[0106] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
[0107] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.
[0108] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.
[0109] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.
[0110] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0111] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.
[0112] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A process two-way communication method, characterized in that: The method comprises a first process and a second process, and is applied to the first process, comprising: Obtain an operation instruction, and determine a target linked list according to the operation instruction, wherein the target linked list includes a first linked list corresponding to the first process and a second linked list corresponding to the second process; When the operation instruction is a write instruction, adjusting the first linked list; When the operation instruction is a read instruction, the second linked list is adjusted.
2. The process two-way communication method according to claim 1, characterized in that: The method further comprises: Initialize the first linked list and the second linked list, and set the number of messages in the first linked list and the second linked list to 0; Initialize the first resource pointer of the first linked list and the second resource pointer of the second linked list to be empty; A device node is created according to the first linked list and the second linked list.
3. The process two-way communication method according to claim 2, characterized in that: The method further comprises: Determining whether the first process is allowed to use the device node; When the first process is allowed to use the device node, the first linked list is set as a write linked list of the first process, and the second linked list is set as a read linked list of the first process.
4. The process two-way communication method according to claim 1, characterized in that: The write instruction includes write information and write length; when the operation instruction is a write instruction, adjusting the first linked list includes: When the write length is greater than 0, apply for a memory of the write length, and lock the first linked list; When the number of messages in the first linked list is greater than the upper limit, deleting the head node of the first linked list; The write information is added to the tail of the first linked list.
5. The process two-way communication method according to claim 1, characterized in that: The read instruction includes a read length; when the operation instruction is a read instruction, adjusting the second linked list includes: When the number of messages in the second linked list is greater than 0, locking the second linked list, and reading the head node of the second linked list and the data length of the head node of the second linked list; When the read length is greater than the data length of the head node of the second linked list, setting the read length to the data length of the head node of the second linked list; The data corresponding to the data length of the head node of the second linked list is copied to the buffer of the first process, and the head node of the second linked list is deleted.
6. The process two-way communication method according to claim 1, characterized in that: The method further comprises: When the release instruction is triggered, the memory corresponding to the first linked list is released.
7. The process two-way communication method according to claim 1, characterized in that: The method further comprises: When the uninstall instruction is triggered, loop to determine whether the number of messages in the first linked list is 0; When it is not 0, read and release the head node of the first linked list; When it is 0, the memory corresponding to the first process is released.
8. A process two-way communication method, characterized in that: The method comprises a first process and a second process, and is applied to the second process, comprising: Obtain an operation instruction, and determine a target linked list according to the operation instruction, wherein the target linked list includes a first linked list corresponding to the first process and a second linked list corresponding to the second process; When the operation instruction is a write instruction, adjusting the second linked list; When the operation instruction is a read instruction, the first linked list is adjusted.
9. A process two-way communication system, characterized in that: The method comprises a first process and a second process; the first process comprises a first linked list corresponding to the first process, and the second process comprises a second linked list corresponding to the second process; the first process adjusts the first linked list according to a write instruction, and adjusts the second linked list according to the read instruction; The second process adjusts the second linked list according to the write instruction and adjusts the first linked list according to the read instruction.
10. A readable storage medium, characterized in that: The readable storage medium stores a process two-way communication program, wherein when the process two-way communication program is executed by a processor, the steps of the process two-way communication method according to any one of claims 1 to 8 are implemented.