Inter-process communication methods, devices, electronic measuring equipment, media, and program products

By creating shared memory and pipes in electronic measurement equipment, and using pipe negotiation for time slices and time slice allocation for inter-process communication, the problem of low efficiency in front-end and back-end process communication is solved, the efficiency of shared memory utilization is improved, and processor usage is reduced.

CN123068151APending Publication Date: 2026-11-10深圳市万里眼技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611273230.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-20
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

In existing electronic measurement equipment, the communication efficiency between the front-end and back-end processes is low, the resource consumption is high, the network socket processing latency and throughput cannot meet the performance requirements, and the lock synchronization leads to frequent sleep wake-up and processor idling problems.

Method used

By creating shared memory and pipes in electronic measurement equipment, and using pipe negotiation of time slices and time slice allocation methods for inter-process communication, data synchronization is ensured and resource consumption is reduced.

Benefits of technology

It improves the efficiency of shared memory utilization, reduces the number of process sleep wake-ups, avoids processor idling, and reduces processor utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123068151A_ABST
    Figure CN123068151A_ABST
Patent Text Reader

Abstract

This application discloses an inter-process communication method applied to a first process in an electronic measuring device. The electronic measuring device also runs a second process, and shared memory and pipes corresponding to both the first and second processes are created within the device. The method includes: negotiating a communication mode with the second process via the pipe to utilize shared memory for data communication; the communication mode includes a first time slice corresponding to the first process for accessing shared memory, a second time slice corresponding to the second process, and a time slice allocation method; and data communication with the second process based on the communication mode and utilizing shared memory. Therefore, combining a time-slice-based communication mode with shared memory to achieve inter-process communication can improve the efficiency of shared memory utilization, control the number of wake-ups during process sleep, and reduce performance overhead; simultaneously, it can avoid processor idling and reduce processor utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, specifically to an inter-process communication method, apparatus, electronic measuring device, medium, and program product. Background Technology

[0002] Current data analyzers (such as vector network analyzers, spectrum analyzers, oscilloscopes, and other instruments with typical scenarios of data acquisition, measurement, result push, and display) are divided into front-end and back-end processes. The back-end is mainly responsible for data acquisition, measurement, and measurement result push, while the front-end is mainly responsible for displaying the measurement results. Similar to data analyzers, electronic measurement devices, such as industrial measurement and control equipment, medical imaging equipment, and communication analysis instruments that require real-time display of multi-channel high-speed data streams, also internally consist of front-end and back-end processes. The back-end is mainly responsible for data acquisition, measurement, and measurement result push, while the front-end is mainly responsible for displaying the measurement results. Currently, commonly used front-end and back-end process communication methods include process communication using network sockets and process communication using lock synchronization or shared memory with flags. Because vector network analyzers involve concurrent measurement of multiple traces at multiple points, the back-end pushes data to the front-end frequently and in large volumes. The processing latency and throughput of network sockets cannot meet performance requirements, leading to problems where measurement results cannot be displayed on the interface in real time. Lock synchronization may cause frequent process sleep and wake-up, resulting in significant kernel switching time. Flags may cause processor idling.

[0003] Therefore, improving the inter-process communication efficiency and reducing resource consumption of electronic measurement devices such as data analyzers is a problem that needs to be solved in this field. Summary of the Invention

[0004] This application discloses an inter-process communication method, apparatus, electronic measurement device, medium, and program product, which are used to solve the problems of low efficiency and high resource consumption in inter-process communication of electronic measurement devices such as data analyzers.

[0005] Firstly, this application provides a communication method applied to a first process in an electronic measuring device. The electronic measuring device also runs a second process, and the electronic measuring device creates shared memory and a pipe corresponding to both the first and second processes. The method includes: negotiating a communication mode with the second process via the pipe to utilize the shared memory for data communication; the communication mode includes a first time slice corresponding to the first process for accessing the shared memory, a second time slice corresponding to the second process for accessing the shared memory, and a time slice allocation method corresponding to the first and second time slices; and performing data communication with the second process based on the communication mode and utilizing the shared memory. In this application, the first and second processes in the electronic measuring device can negotiate how to utilize shared memory for communication via the pipe, negotiating a communication mode that includes time slices and time slice allocation methods. Then, based on the communication mode, data communication between the first and second processes is achieved using shared memory. This combination of a time-slice-included communication mode to utilize shared memory for inter-process communication improves the efficiency of shared memory usage, ensures controllable wake-up times during process sleep, reduces performance overhead, and avoids processor idling, reducing processor occupancy.

[0006] In one possible implementation, the first process is the data supply side, the second process is the data demand side, and the first process and the second process form a data synchronization relationship. In this implementation, the data supply side pushes data to the data demand side to synchronize the data on both sides; frequent data pushes are required in electronic measuring equipment.

[0007] In one possible implementation, the shared memory creation process includes: determining a memory space for creating the shared memory; establishing a memory address mapping relationship between the memory space and the addresses of the first process and the second process, thereby obtaining shared memory corresponding to both the first process and the second process. In this implementation, the shared memory is created by allocating a portion of memory and then establishing an address mapping relationship, so as to achieve inter-process communication through the created shared memory.

[0008] In one possible implementation, the communication method for negotiating data communication using the shared memory with the second process via the pipe includes: generating a current negotiation request and sending the current negotiation request to the second process via the pipe; if no negotiation result is received from the second process via the pipe within a preset time, then the current negotiation request is regenerated; if a negotiation result is received from the second process via the pipe within the preset time, then a communication method for data communication using the shared memory is determined based on the negotiation result. In this implementation, the negotiation request initiated by the first process may include detailed information about the communication method and can be repeatedly sent periodically. After receiving the negotiation request, the second process will return a negotiation result indicating whether it accepts the communication method; this ensures the reliability of the negotiation process.

[0009] In one possible implementation, the negotiation result is a representation of whether the second process accepts the current negotiation request, based on preset communication conditions. In this implementation, judging the data negotiation content corresponding to the negotiation request initiated by the first process using communication conditions ensures that the negotiation communication method is acceptable to both processes, guaranteeing the reliability of subsequent inter-process communication using shared memory.

[0010] In one possible implementation, determining the communication method for data communication using the shared memory based on the negotiation result includes: if the negotiation result indicates acceptance of the current negotiation request, then sending a confirmation message indicating successful negotiation to the second process through the pipe, and determining the data negotiation content corresponding to the current negotiation request as the communication method for data communication using the shared memory. In this implementation, the negotiation process involves multiple interactive confirmations to finally obtain the communication method for data communication using shared memory, ensuring the orderly transmission of information during the negotiation process and guaranteeing reliable communication during the negotiation process.

[0011] In one possible implementation, the data communication between the first process and the second process based on the communication method and utilizing the shared memory includes: the first process performing data read / write operations on the shared memory based on the time slice allocation method and the first time slice, and the second process performing data read / write operations on the shared memory based on the time slice allocation method and the second time slice, thereby realizing data communication between the first process and the second process. In this implementation, the two processes performing data read / write operations on the shared memory separately using time slices can improve memory utilization efficiency, control the number of wake-ups during process sleep, avoid processor idling, and reduce processor occupancy.

[0012] In one possible implementation, the communication method further includes a data format determined by the first process and the second process through negotiation via the pipe; correspondingly, the step of communicating with the second process using the shared memory based on the communication method includes: communicating with the second process using the shared memory based on the data format, the time slice allocation method, and the first time slice. In this implementation, combining the data format, the time slice allocation method, and the corresponding first and second time slices for inter-process data communication ensures secure and reliable communication.

[0013] Secondly, this application provides a communication device applied to a first process in an electronic measuring device, wherein the electronic measuring device also runs a second process, and the electronic measuring device creates shared memory and a pipe corresponding to both the first process and the second process, comprising: a communication mode negotiation module, used to negotiate with the second process through the pipe a communication mode for data communication using the shared memory; the communication mode includes a first time slice corresponding to the first process for accessing the shared memory, a second time slice corresponding to the second process for accessing the shared memory, and a time slice allocation method corresponding to the first time slice and the second time slice; and a data communication module, used to perform data communication with the second process based on the communication mode and using the shared memory.

[0014] Thirdly, this application provides an electronic measuring device, including a processor and a memory, wherein the memory is used to store a computer program, the processor is used to read the computer program to implement a first process and a second process, and shared memory and pipes corresponding to both the first process and the second process, for implementing the inter-process communication method as described above.

[0015] Fourthly, this application provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the inter-process communication method described above.

[0016] Fifthly, this application provides a computer program product, including a computer program / instructions, which, when executed by a processor, implements the inter-process communication method as described above.

[0017] This application's technical solution is applied to a first process in an electronic measuring device. The electronic measuring device also runs a second process, and it creates shared memory and pipes corresponding to both the first and second processes. First, it negotiates a communication method with the second process through the pipe to utilize the shared memory for data communication. This communication method includes a first time slice corresponding to the first process for accessing the shared memory, a second time slice corresponding to the second process for accessing the shared memory, and a time slice allocation method corresponding to the first and second time slices. Then, based on this communication method and utilizing the shared memory, it performs data communication with the second process. It can be seen that the first and second processes in the electronic measuring device can negotiate through the pipe how to utilize shared memory for communication, negotiating a communication method that includes time slices and time slice allocation methods. Then, based on this communication method, it utilizes shared memory to achieve data communication between the first and second processes. This combination of a time-slice-included communication method to utilize shared memory for inter-process communication improves the efficiency of shared memory usage, ensures controllable wake-up times during process sleep, and reduces performance overhead. Simultaneously, it avoids processor idling and reduces processor occupancy. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of an electronic measurement device architecture disclosed in an embodiment of this application; Figure 2 This is a flowchart of a communication method disclosed in an embodiment of this application; Figure 3 This is a flowchart illustrating a communication method negotiation process disclosed in an embodiment of this application; Figure 4 This is a flowchart illustrating a specific communication method negotiation process disclosed in an embodiment of this application; Figure 5 This is a schematic diagram of a communication device structure disclosed in an embodiment of this application; Figure 6 This is a software architecture diagram for internal data communication of a vector network analyzer disclosed in an embodiment of this application; Figure 7 This is a schematic diagram of a specific inter-process communication device structure disclosed in an embodiment of this application; Figure 8This is a schematic diagram of another specific inter-process communication device structure disclosed in the embodiments of this application.

[0020] Explanation of reference numerals in the attached figures: 10-Communication device; 101-Processor; 102-Memory; 103-Transceiver; 11-Communication mode negotiation module; 12-Data communication module. Detailed Implementation

[0021] The technical solution of this application is applied to electronic measurement equipment, and is not limited to instruments and meters such as vector network analyzers, spectrum analyzers, and oscilloscopes that have typical scenarios of data acquisition, measurement, result push and display. It is also applicable to any industrial measurement and control equipment, medical imaging equipment and communication analysis instruments that have the requirement of real-time display of multi-channel high-speed data streams. Furthermore, the technical solution of this application involves two processes that constitute a data synchronization relationship, in which one process continuously provides data to the other process. Examples include log collection and audio / video encoding scenarios. In log collection scenarios, electronic measurement equipment includes a backend acquisition process and a frontend storage process. The backend acquisition process is mainly responsible for acquiring, measuring, and pushing measurement results of physical signals and other data, while the frontend storage process is mainly responsible for recording and storing measurement results. In audio / video encoding scenarios, electronic measurement equipment includes a backend acquisition process and a frontend push process. The backend acquisition process can capture data from a camera or microphone and parse network streams or serial signals containing audio / video encoded data. It then synchronizes the network streams or serial signals to the frontend push process, which then pushes the network streams or serial signals to a streaming media server. This achieves the goal of pushing data acquired by a camera or microphone to a streaming media server. Alternatively, for a vector network analyzer, its backend acquisition process can acquire and calculate the scattering parameters (S-parameters) corresponding to the device under test. The backend acquisition process then pushes the calculated scattering parameters to the frontend display process, which then displays the data.

[0022] like Figure 1 The diagram shows an electronic measurement device architecture disclosed in this application. The first process and the second process can negotiate via a pipe how to communicate using shared memory, obtaining a communication method that includes time slices and time slice allocation. Based on this communication method, data communication between the first and second processes can be achieved using shared memory. The first and second processes communicate by reading and writing data to the shared memory. This combination of time-slice-based communication and shared memory-based inter-process communication improves the efficiency of shared memory usage, allows for controllable wake-up times during process sleep, and reduces performance overhead. Simultaneously, it avoids processor idling and reduces processor utilization.

[0023] Example 1

[0024] like Figure 2As shown, this embodiment discloses a communication method applied to a first process in an electronic measuring device. The electronic measuring device is also configured with a second process, and shared memory and pipes corresponding to both the first and second processes are created in the electronic measuring device. Specifically, it includes: Step S11: Negotiate with the second process through a pipe the communication method for data communication using shared memory; the communication method includes a first time slice corresponding to the first process for accessing shared memory, a second time slice corresponding to the second process for accessing shared memory, and a time slice allocation method corresponding to the first time slice and the second time slice.

[0025] In this embodiment, the first process and the second process first negotiate through a pipe, specifically the communication method used when they communicate using shared memory. Here, the pipe refers to a temporary "data channel" located in memory, managed by the operating system kernel. Through this channel, one process writes data, and the other reads data, thus exchanging information. Specifically, the process notifies the kernel through a system call, and the kernel then allocates a buffer in memory, i.e., the temporary "data channel." The communication method specifically involves the first and second time slices for the first and second processes to access shared memory, respectively, and the time slice allocation method. A time slice refers to a specific time period, such as X milliseconds. The time slice allocation method allows each process to sequentially obtain a time slice of processor execution time. It should be noted that the length of the time slice can be dynamically adjusted according to the process load. For example, if a process frequently releases control prematurely, its next time slice can be shortened; if it frequently times out, its time slice can be extended.

[0026] In specific implementations, the communication method may include negotiation event numbers (integers used to record different negotiation processes), time slice length, time slice allocation method, guard interval, number of trace points, number of traces, trace format, number of communication attempts, etc. The time slice allocation method can be fixed-time-slice round-robin, load-based dynamic allocation, or a time-slice round-robin scheduling algorithm that allocates a time slice of processor execution time to each process sequentially. The guard interval specifically refers to the time interval of the inter-process synchronization mechanism, used to prevent data inconsistency caused by multiple processes simultaneously accessing shared memory areas. The number of trace points specifically refers to the number of key nodes involved in the data communication process, including key operation nodes such as memory mapping points, data writing points, and data reading points, clearly defining the dependencies and execution order between each node. For example, data writing must be performed after memory mapping is complete, and memory visibility must be guaranteed through a barrier (a synchronization mechanism that enforces the order and visibility of memory operations); the number of traces is used to limit the number of processes accessing the shared memory region simultaneously, such as setting the maximum concurrency to N, and blocking or queuing if the number is exceeded to prevent resource contention from causing performance degradation or data corruption; the trace format can refer to the structured representation of data in shared memory, including the arrangement of data fields, the format definition of data packets, etc.; the number of communication operations specifically refers to the total number of times data is exchanged between processes through shared memory, which is achieved through read and write operations of shared memory.

[0027] In a possible implementation, the first process is the data supply side, and the second process is the data demand side, with a data synchronization relationship between them. Especially in data analyzers, it's necessary to frequently push collected data to the display window, with the process controlling data collection pushing the collected data to the process controlling the display data. Furthermore, other common scenarios also involve the data supply side pushing data to the data demand side; such as timed push, event-driven (data volume reaches a threshold or collection is complete), or continuous streaming push. Different push strategies are suitable for scenarios with different performance requirements and need to be dynamically selected based on the buffer state. To adapt to push strategies in different scenarios, dynamic adjustment capabilities are also required; when the data demand side's processing capacity is insufficient (e.g., slow display refresh), the data supply side can also sense this and slow down the push rate; reverse control can be achieved through semaphores to avoid data backlog or loss and ensure system stability. Specifically, reverse control through semaphores refers to quantifying data backlog using a counter and the length of the waiting queue, with the data supply side sensing the quantification result and slowing down the push rate.

[0028] In one possible implementation, the shared memory creation process first involves determining the memory space used to create the shared memory; then, establishing a mapping relationship between the memory addresses of the memory space and the addresses of the first and second processes, resulting in shared memory corresponding to both processes. It can be understood that the memory space refers to a portion of memory that is partitioned off, and then an address mapping relationship is established between this memory space and the first and second processes, thus completing the shared memory creation operation. Afterwards, either the first or second process can access the shared memory and perform data reading or writing, thereby enabling data interaction between the first and second processes through this shared memory.

[0029] Step S12: Based on the communication method, data communication is performed with the second process using shared memory.

[0030] The communication method is obtained through step S11 above. This communication method includes the specific operation method for the first process and the second process to communicate using shared memory. It can be understood that both the first process and the second process can interact with the shared memory based on this communication method, thus achieving data communication between them. Specifically, during data communication based on this method, the first process can perform data read and write operations on the shared memory based on the time slice allocation method and the first time slice, and the second process can perform data read and write operations on the shared memory based on the time slice allocation method and the second time slice. This allows data communication between the first process and the second process through shared memory. It should be noted that the first process and the second process only access the shared memory within their respective time slices. At the end of each time slice, control of the shared memory must be forcibly released so that the other process can safely access it in the next time slice. In other words, the first process can trigger access operations to the shared memory based on the time slice allocation method and the first time slice, specifically performing data write operations. The second process can trigger data read operations to the shared memory based on the time slice allocation method and the second time slice, obtaining the data written by the first process, thus achieving data communication with the first process. In this way, the two processes can read and write data to the shared memory separately using time slices, which can improve memory utilization efficiency. Furthermore, accessing the shared memory according to time slices can control the number of wake-ups when the process is in sleep mode, avoid processor idling, and reduce processor utilization.

[0031] Furthermore, in a specific embodiment, if the first process has no data to write to the shared memory within its own time slice (i.e., no suitable data has been collected), it can notify the second process through a pipe or a status flag in the shared memory, and release control of the shared memory in advance, reducing resource consumption. Specifically, this can be done by sending specific control instructions through a pipe; or by setting a status flag in the shared memory (e.g., using a one-byte integer to represent the "no data" state). Regardless of the method used, resources can be released in a timely manner, reducing unnecessary waiting. Correspondingly, to avoid data overwriting, the shared memory can be divided into multiple fixed-size slots or a circular queue can be used. The first process writes data 1 in time slice 1, and the second process reads data 1 in time slice 2; by using the read pointer and write pointer in the shared memory in conjunction with the index notification in the pipe, direct overwriting of unread data is avoided. Here, the index notification is a message indicating a change in the buffer state, such as a byte or an integer, used to trigger the other process to process data.

[0032] In one possible implementation, the communication method negotiated between the first and second processes through a pipe may further include a data format, i.e., the format of the interactive data when the first and second processes communicate via shared memory. Furthermore, the first process may access the shared memory based on a time-slice allocation method and time-slice triggering, and write relevant data to the shared memory based on the data format in the communication method. In specific embodiments, the communication method may involve negotiating time numbers, time slices, time-slice allocation methods, and communication-related data formats (such as frame formats and communication protocol formats) to ensure secure and reliable data communication. Furthermore, the frame format defines the structured storage method of data in shared memory, such as field order and data length; the communication protocol format specifies the rules for data interaction, such as verification methods and error handling mechanisms. When writing data, the first process must strictly encapsulate it according to the negotiated format to ensure that the second process can correctly parse the data.

[0033] Therefore, in the above embodiments, the first process and the second process of the electronic measuring device can negotiate through a pipe how to use shared memory to communicate, negotiate a communication method that includes time slices and time slice allocation, and then use shared memory to realize data communication between the first process and the second process based on the communication method. In this way, using shared memory to realize inter-process communication in combination with a communication method that includes time slices can improve the utilization efficiency of shared memory, make the number of wake-ups controllable when the process is in sleep mode, and reduce performance overhead; at the same time, it can avoid processor idling and reduce processor utilization.

[0034] Example 2

[0035] The above embodiments describe a communication method where the first process and the second process negotiate data communication using shared memory via a pipe, and implement the data communication process between the first process and the second process based on this communication method. The time slice feature in the communication method improves the efficiency of shared memory utilization, allows for controllable wake-up times during process sleep, and reduces performance overhead; it also avoids processor idling and reduces processor utilization. Based on the above embodiments, as... Figure 3 As shown, this embodiment will focus on the negotiation process of the communication method between the first process and the second process. The action executor in this embodiment is the first process, which specifically includes: Step S21: Generate a current negotiation request and send it to the second process via a pipe.

[0036] In this embodiment, the first process first generates a negotiation request, which includes data negotiation content. The data negotiation content can be a specific communication method (including negotiation time number, time slice, time slice allocation method, number of communication times, etc.), which is recorded as the current negotiation request. Then, the current negotiation request is sent to the second process through the pipes corresponding to the first process and the second process.

[0037] Understandably, upon receiving the current negotiation request, the second process will return a result indicating whether it accepts the corresponding communication method, i.e., the negotiation result. In one possible implementation, the negotiation result can be a result indicating whether the second process accepts the current negotiation request based on preset communication conditions. Furthermore, the communication conditions can be conditions constructed considering factors such as system load performance, communication security, and communication format. For example, if the system load exceeds a certain percentage, high-frequency communication requests are rejected, and a zero-copy format that reduces memory copying is preferred; data can be transferred directly from the file descriptor to the socket, completed entirely in kernel space without passing through the user buffer; this is suitable for static file servers (such as Nginx). Specifically, system load performance can consider the number of memory copies involved in communication and the system overhead of system calls, data exchange frequency and real-time performance, etc.; communication security can consider mutual exclusion and synchronization of inter-process access, protection against unauthorized access, and the integrity and consistency of data in shared memory, etc.; the communication format can be the format definition of data packets, agreed-upon data structures, etc. The second process can use this communication condition to determine the data negotiation content corresponding to the negotiation request initiated by the first process; this ensures that the negotiation communication method is acceptable to both processes, guaranteeing the reliability of subsequent inter-process communication using shared memory.

[0038] In one possible implementation, security verification can be introduced during the negotiation process. During the initial negotiation, the two processes can exchange digital certificates or shared key fingerprints to prevent malicious processes from impersonating each other. Furthermore, the first process can calculate the HMAC-SHA256 digest of the negotiation request, which the second process can then verify before making further conditional checks to prevent tampering. Further, after successful negotiation, the first process can call `mprotect()` to set write-only permissions for the shared memory, while the second process sets read-only permissions, with the kernel enforcing an unauthorized access interception.

[0039] Step S22: If the negotiation result is not received from the second process through the pipeline within the preset time, the current negotiation request is regenerated.

[0040] To ensure the reliability of the negotiation process, the first process can periodically resend the request. That is, after sending the current negotiation request to the second process, if no negotiation result is received from the second process via the pipe within a preset time, it indicates a possible anomaly in the transmission of the current negotiation request. A new negotiation request with a new negotiation time number can be generated. Of course, other information in the regenerated negotiation request (such as time slice, time slice allocation method, number of communications, etc.) can also be regenerated. The preset time is dynamically adjusted by relevant personnel based on historical response delays and current network load; it can be 100 milliseconds, meaning the first process can regenerate the negotiation request every 100 milliseconds. In addition to fixed-period renegotiation, an exponential backoff renegotiation method can also be used to avoid exacerbating system pressure during periods of high conflict. Alternatively, a negotiation retry counter (e.g., 3 times by default) can be introduced, automatically degrading to the default communication method (pre-set communication method) after exceeding the limit to ensure system availability.

[0041] Furthermore, in a specific embodiment, when the first process receives a negotiation result but the negotiation result indicates failure, it can readjust the time slice length, time slice allocation method, and other information corresponding to the negotiation request, i.e., regenerate a new negotiation request. Moreover, the second process can add modification suggestions for the communication method to the negotiation result indicating negotiation failure. After confirmation by the first process, a corresponding new negotiation request can be generated based on the modification suggestions. Furthermore, to ensure the security of the negotiation process, the first process can verify the negotiation result returned by the second process. If the verification fails, a new negotiation request is also regenerated. Only if the verification succeeds can the success of the negotiation be determined.

[0042] Step S23: If the negotiation result is received from the second process through the pipe within a preset time, the communication method of using shared memory for data communication is determined based on the negotiation result.

[0043] Furthermore, if the first process receives the negotiation result returned by the second process via the pipe within a preset time, it needs to determine the specific communication method based on the negotiation result. In one possible implementation, if the negotiation result indicates acceptance of the current negotiation request, the data negotiation content corresponding to the current negotiation request (i.e., the specific communication method) can be directly determined as the communication method used for subsequent data communication. Furthermore, when the negotiation result indicates acceptance of the current negotiation request, the first process can send a confirmation message indicating successful negotiation to the second process via the pipe, so that the second process will also determine the data negotiation content corresponding to the current negotiation request as the communication method for subsequent data communication using shared memory. It is understandable that the negotiation process between the first and second processes regarding the communication method involves multiple interactive confirmations, ultimately resulting in a communication method accepted by both parties. These multiple interactive confirmations ensure the orderly transmission of information during the negotiation process and guarantee the security and reliability of the negotiated communication method.

[0044] In one possible implementation, after the first process and the second process determine the communication method, they can persistently store it in the local cache and add a timestamp or version number to facilitate subsequent backtracking and troubleshooting in case of communication anomalies, and also support context tracking of multi-round negotiation.

[0045] like Figure 4 The diagram illustrates the communication process between the first and second processes. The first process initiates a negotiation request to the second process and waits for a response. The first process can periodically repeat the negotiation request. In other words, if the first process does not receive a response from the second process within a certain time after initiating the request, or if the response indicates failure, it can initiate a new negotiation request. Understandably, the time slices and time allocation methods in the new negotiation request can be adjusted according to pre-set rules; for example, adjusting the time slice allocation method or increasing the length of a single time slice. Correspondingly, if the first process receives a successful negotiation result from the second process, it determines the communication method including the time slice and time slice allocation method and sends an acknowledgment to the second process so that the second process can also determine its corresponding communication method. Furthermore, the first and second processes can use shared memory according to the negotiated communication method, accessing shared memory for data read and write according to their respective time slices, thus achieving data communication between the first and second processes through shared memory.

[0046] Therefore, during the communication negotiation between the first and second processes via the pipe, the first process can periodically initiate repeated negotiation requests. These requests can include detailed information about the communication method. Upon receiving the request, the second process will assess the negotiated data content based on the communication conditions to ensure that the negotiated communication method is acceptable to both processes. Furthermore, after receiving a confirmation of acceptance from the second process, the first process will send a confirmation message indicating successful negotiation. This multiple interactive confirmation ensures the orderly transmission of information during the negotiation process, guarantees reliable communication, and improves the reliability of subsequent inter-process communication using shared memory.

[0047] Example 3

[0048] Based on the above embodiments, such as Figure 5 As shown, this embodiment provides a communication device applied to a first process in an electronic measuring device. The electronic measuring device also runs a second process, and the electronic measuring device creates shared memory and pipes corresponding to both the first and second processes, including: The communication mode negotiation module 11 is used to negotiate with the second process through a pipe the communication mode for data communication using shared memory; the communication mode includes a first time slice corresponding to the first process for accessing shared memory, a second time slice corresponding to the second process for accessing shared memory, and a time slice allocation method corresponding to the first time slice and the second time slice; The data communication module 12 is used to communicate with the second process based on a communication method and by utilizing shared memory.

[0049] Therefore, the communication mode negotiation module 11 can negotiate the communication mode between the first process and the second process regarding how to use shared memory for communication, and finally negotiate a communication mode that includes time slices and time slice allocation methods; the data communication module 12 can use shared memory to realize data communication between the first process and the second process based on the communication mode; thus, combining the communication mode including time slices to use shared memory to realize inter-process communication can improve the utilization efficiency of shared memory, make the number of wake-ups controllable when the process is in sleep mode, and reduce performance overhead; at the same time, it can avoid processor idling and reduce processor utilization.

[0050] Example 4

[0051] Based on the above embodiments, such as Figure 6 As shown in the figure, this embodiment discloses a software architecture diagram for internal data communication of a vector network analyzer, including a backend process A and a frontend process B, specifically including: In this embodiment, the backend process A includes a data acquisition module, a data analysis module, and a data communication module; the frontend process B includes a data communication module and a data display module. Each of these modules can be a software module, such as a method, function, or other software module capable of implementing a corresponding function. Each of these software modules can be implemented by a computer processor executing corresponding program instructions.

[0052] In this embodiment, shared memory is pre-mapped with the address of backend process A and frontend process B. Furthermore, the data communication modules of backend process A and frontend process B can negotiate communication data through a pre-set data negotiation pipe, negotiating a communication method that includes the communication data format, time slice allocation, and specific time slices. The time slice allocation can be: AAB..., and the specific time slice can be X milliseconds, meaning process A accesses shared memory in two X milliseconds, process B accesses shared memory in one X millisecond, and so on. During the process of backend process A and frontend process B communicating using the negotiated communication method, each process reads and writes to shared memory according to the data format within its own time slice; that is, data communication between backend process A and frontend process B is achieved using shared memory. Specifically, the data acquisition module of backend process A collects the scattering parameters of the RF microwave device, processes the data through the data analysis module, and then writes the processed data to shared memory according to the data format corresponding to the communication method within its own time slice through the data communication module of backend process A. Correspondingly, the data communication module of frontend process B can read the data written by backend process A from shared memory within its own time slice and send the read data to the data display module. In this way, accessing shared memory according to time slices realizes data communication from backend process A to frontend process B.

[0053] Therefore, it can be seen that the backend process A and the frontend process B in the vector network analyzer can negotiate how to communicate using shared memory through a pre-set data negotiation pipe. The negotiated communication method includes time slices and time slice allocation. Then, based on the communication method, data communication between the backend process A and the frontend process B is realized using shared memory. This combination of time-slice-based communication method to realize inter-process communication using shared memory can improve the efficiency of shared memory utilization. Even when the process is in sleep mode, the number of wake-ups can be controlled, reducing performance overhead. At the same time, it can avoid processor idling and reduce processor utilization.

[0054] Figure 7This is a schematic structural diagram of the inter-process communication device 10 provided in this application. The communication device 10 includes a processor 101, which is coupled to a memory 102. The memory 102 is used to store computer programs or instructions and / or data. The processor 101 is used to execute the computer programs or instructions stored in the memory 102, or to read the data stored in the memory 102, so as to execute the methods in the above method embodiments.

[0055] Optionally, there may be one or more processors 101.

[0056] Optionally, the memory 102 may be one or more.

[0057] Alternatively, the memory 102 can be integrated with the processor 101, or it can be set separately.

[0058] Optionally, such as Figure 8 As shown, the communication device 10 also includes a transceiver 103, which is used for receiving and / or transmitting signals. For example, the processor 101 is used to control the transceiver 103 to receive and / or transmit signals.

[0059] In addition, this application also provides an electronic measuring device, including a processor and a memory, the memory being used to store a computer program, the processor being used to read the computer program to implement a first process and a second process, and shared memory and pipes corresponding to both the first process and the second process, for executing the methods in the various method embodiments of this application.

[0060] In addition, this application also provides a computer-readable storage medium storing computer instructions, which, when executed on a computer, cause the methods in the various method embodiments of this application to be performed.

[0061] This application also provides a computer program product, which includes computer program code or instructions, such that when the computer program code or instructions are run on a computer, the methods in the various method embodiments of this application are executed.

[0062] Furthermore, this application also provides a chip including a processor. A memory for storing a computer program is provided independently of the chip, and the processor is used to execute the computer program stored in the memory to perform the methods in the various method embodiments of this application.

[0063] Furthermore, the chip may also include a communication interface. The communication interface can be an input / output interface or an interface circuit, etc. Furthermore, the chip may also include memory.

[0064] It should be understood that the processor in the embodiments of this application can be an integrated circuit chip with the ability to process signals. In implementation, each step of the above method embodiments can be completed by the integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware encoding processor, or implemented by a combination of hardware and software modules in the encoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.

[0065] The memory in this application embodiment can be volatile memory or non-volatile memory, or it can include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), and synchronous link dynamic memory (SLDRAM).

[0066] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA, or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, the memory can be integrated into the processor.

[0067] It should also be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0068] Each of the above modules or units can be implemented through software, hardware, or a combination of both. For example, in audio and video encoding scenarios, the communication method negotiation module 11 and the data communication module 12 can both be implemented based on software.

[0069] In this application, "implemented through software" means that the processor reads and executes program instructions stored in memory to implement the functions corresponding to the aforementioned modules or units. Here, the processor refers to a processing circuit capable of executing program instructions, including but not limited to at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller unit (MCU), or an artificial intelligence processor, etc., and other processing circuits capable of running program instructions. In other embodiments, the processor may also include circuits with other processing functions (such as hardware circuits for hardware acceleration, bus and interface circuits, etc.). The processor can be presented as an integrated chip, for example, as an integrated chip whose processing function only includes executing software instructions, or it can also be presented as a SoC (system on a chip), that is, on a single chip, in addition to the processing circuit capable of running program instructions (usually referred to as the "core"), it also includes other hardware circuits for implementing specific functions (of course, these hardware circuits can also be implemented separately based on ASIC or FPGA). Correspondingly, the processing functions, in addition to executing software instructions, may also include various hardware acceleration functions (such as AI calculation, encoding / decoding, compression / decompression, etc.).

[0070] In this application, "implemented in hardware" means that the functions of the above-mentioned modules or units are implemented through hardware processing circuits that do not have program instruction processing capabilities. These hardware processing circuits can be composed of discrete hardware components or integrated circuits. To reduce power consumption and size, integrated circuits are typically used. Hardware processing circuits can include ASICs (application-specific integrated circuits) or PLDs (programmable logic devices); PLDs can include FPGAs (field-programmable gate arrays), CPLDs (complex programmable logic devices), and so on. These hardware processing circuits can be a single packaged semiconductor chip (e.g., packaged as an ASIC); or they can be integrated with other circuits (e.g., CPUs, DSPs) and packaged into a single semiconductor chip. For example, multiple hardware circuits and a CPU can be formed on a silicon substrate and packaged into a single chip; this type of chip is also called a SoC. Alternatively, circuits for implementing FPGA functions and a CPU can be formed on a silicon substrate and encapsulated into a single chip; this type of chip is also called a SoPC (system on a programmable chip).

[0071] It should be noted that when this application is implemented through software, hardware, or a combination of both, different software or hardware can be used, and it is not limited to using only one type of software or hardware. For example, one module or unit can be implemented using a CPU, while another module or unit can be implemented using a DSP. Similarly, when implemented using hardware, one module or unit can be implemented using an ASIC, while another module or unit can be implemented using an FPGA. Of course, it is not limited to using the same software (e.g., all through a CPU) or the same hardware (e.g., all through an ASIC) to implement some or all modules or units. Furthermore, those skilled in the art will understand that software is generally more flexible but less performant than hardware, while hardware is the opposite. Therefore, those skilled in the art can choose software, hardware, or a combination of both based on actual needs.

[0072] It should be understood that the above description is merely an embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.

Claims

1. An inter-process communication method, characterized in that, A first process is applied in an electronic measuring device, wherein the electronic measuring device also runs a second process, and the electronic measuring device creates shared memory and pipes corresponding to both the first process and the second process, including: The communication method involves negotiating with the second process through the pipeline to utilize the shared memory for data communication; the communication method includes a first time slice corresponding to the first process for accessing the shared memory, a second time slice corresponding to the second process for accessing the shared memory, and a time slice allocation method corresponding to the first time slice and the second time slice; Based on the aforementioned communication method, data communication is conducted with the second process using the shared memory.

2. The inter-process communication method according to claim 1, characterized in that, The first process is the data supply side, the second process is the data demand side, and the first process and the second process form a data synchronization relationship.

3. The inter-process communication method according to claim 1, characterized in that, The process of creating the shared memory includes: Determine the memory space to be used to create the shared memory; Establish a mapping relationship between the memory addresses of the memory space and the addresses of the first process and the second process to obtain shared memory corresponding to both the first process and the second process.

4. The inter-process communication method according to any one of claims 1 to 3, characterized in that, The communication method of negotiating with the second process to use the shared memory for data communication through the pipe includes: Generate a current negotiation request and send the current negotiation request to the second process through the pipeline; If the negotiation result is not received from the second process through the pipeline within the preset time, the current negotiation request will be regenerated. If the negotiation result is received from the second process through the pipe within a preset time, the communication method for data communication using the shared memory is determined based on the negotiation result.

5. The inter-process communication method according to claim 4, characterized in that, The negotiation result is a result obtained by the second process based on preset communication conditions, indicating whether or not to accept the current negotiation request.

6. The inter-process communication method according to claim 4 or 5, characterized in that, The step of determining the communication method for data communication using the shared memory based on the negotiation result includes: If the negotiation result indicates acceptance of the current negotiation request, then a confirmation message indicating successful negotiation is sent to the second process through the pipeline, and the data negotiation content corresponding to the current negotiation request is determined as the communication method for data communication using the shared memory.

7. The inter-process communication method according to any one of claims 1 to 6, characterized in that, The process of communicating data with the second process based on the communication method and utilizing the shared memory includes: The first process performs data read and write operations on the shared memory based on the time slice allocation method and the first time slice, and the second process performs data read and write operations on the shared memory based on the time slice allocation method and the second time slice, so as to realize data communication between the first process and the second process.

8. The inter-process communication method according to any one of claims 1 to 7, characterized in that, The communication method further includes: a data format determined by the first process and the second process through the pipe; Accordingly, the step of communicating data with the second process based on the communication method and utilizing the shared memory includes: Based on the data format, the time slice allocation method, and the first time slice, the shared memory is used to communicate with the second process.

9. An electronic measuring device, characterized in that, The system includes a processor and a memory, the memory being used to store a computer program, the processor being used to read the computer program to implement a first process and a second process, and shared memory and pipes corresponding to both the first process and the second process, for implementing the inter-process communication method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, Used to store computer programs, which, when executed by a processor, implement the inter-process communication method as described in any one of claims 1 to 8.

11. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the inter-process communication method as described in any one of claims 1 to 8.