Data processing method and computer equipment
By monitoring the workload of IPC requests and adjusting IPC policies in real time, the problem of the inability to dynamically optimize inter-process communication in existing technologies is solved, reducing IPC latency and overhead and improving system throughput.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2024-10-30
- Publication Date
- 2026-05-05
AI Technical Summary
Existing inter-process communication (IPC) schemes cannot dynamically adjust the optimal strategy according to the operating characteristics of the application, resulting in high overhead and high latency, and existing technologies cannot effectively reduce data transmission overhead.
By monitoring the workload of IPC requests, IPC strategies can be dynamically adjusted in real time, including parallel execution, physical page mapping, and data copying strategies, to optimize inter-process data transfer.
It enables dynamic adjustment of IPC strategies based on actual application operation, reducing IPC latency and overhead, and improving system throughput.
Smart Images

Figure CN121979696A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of inter-process communication (IPC), and more particularly to a data processing method and a computer device. Background Technology
[0002] In an operating system, resources are represented by processes, with each process typically representing an application, and data between processes is isolated. Inter-process communication (IPC) breaks down this isolation to enable collaboration between applications. IPC has a wide range of applications, including but not limited to: databases, Network Functions Virtualization (NFV), High-Performance Computing (HPC), cloud-native computing, and other high-value scenarios.
[0003] Existing IPC solutions have high overhead. Two sets of experiments illustrate this: a) IPC overhead accounts for over 32% within the Remote Dictionary Server (Redis), indicating that IPC is a key performance bottleneck for Redis. b) Data transfer overhead accounts for 6% to 67% of IPC overhead, and this overhead increases with the amount of message data, demonstrating that data transfer is the main overhead of IPC.
[0004] There are many existing IPC strategies, such as: 1. Data is transmitted using a copy method; 2. Data is transmitted using a zero-copy method; 3. IPC is in synchronous mode; 4. IPC is in asynchronous mode; 5. IPC is in batch processing mode, etc. Different applications may require different IPC strategies, and existing technical solutions use one or more of these strategies in combination. However, once a strategy is selected, it cannot be modified. It cannot dynamically adjust and select the optimal strategy based on the application's operating characteristics. Summary of the Invention
[0005] This application provides a data processing method and a computer device, which selects the most suitable IPC policy for each IPC request transmitted by the application through policy selection, and determines whether the current IPC policy is suitable for the current situation (i.e. whether the first preset condition is met) by monitoring the workload of the IPC requests, thereby realizing the function of real-time and dynamic adjustment of the IPC policy.
[0006] Based on this, the embodiments of this application provide the following technical solutions:
[0007] Firstly, this application provides a data processing method, which specifically includes: First, obtaining a first IPC request transmitted by a first application. The first IPC request can be for sending data or receiving data, and this application does not limit this. The first IPC request can be one or multiple, and this application does not limit this. The first IPC request can be any one of multiple applications in user mode. Next, determining a first IPC strategy, and transmitting m first data to be transmitted corresponding to m first IPC requests based on the first IPC strategy (one first IPC request corresponds to one first data to be transmitted). The IPC strategy is used to characterize the transmission method adopted by the data to be transmitted corresponding to the IPC request. If the m first IPC requests do not meet a first preset condition, the first IPC strategy is adjusted to a second IPC strategy, and n second data to be transmitted corresponding to n second IPC requests are transmitted based on the second IPC strategy. The n second IPC requests are new IPC requests generated by the first application after determining that the first preset condition is not met, and one second IPC request corresponds to one second data to be transmitted, where n ≥ 1.
[0008] In the above embodiments of this application, for each IPC request transmitted by the application, the most suitable IPC policy is obtained through policy selection, and the workload of IPC requests is monitored to determine whether the current IPC policy is suitable for the current situation (i.e., whether the first preset condition is met), thereby realizing the function of real-time and dynamic adjustment of IPC policy.
[0009] In one possible implementation of the first aspect, the first IPC strategy can be a single IPC strategy or a combination of multiple IPC strategies (in which case, these multiple IPC strategies can be referred to as sub-strategies), and this application does not limit this. Specifically, the first IPC strategy includes at least a first sub-strategy. In this case, one implementation of determining the first IPC strategy can be: first, determine whether the m first IPC requests can be executed in parallel with the computation on the first application (in addition to IPC work, there are other tasks within the application, generally referred to as computation work). If so, the first sub-strategy can be determined to be a parallel execution strategy (i.e., Pipeline mode). This parallel execution strategy is used to characterize the first IPC requests and computation as a parallel execution mode, that is, the first application completes IPC while performing computation work, thereby hiding the overhead of IPC.
[0010] In the above embodiments of this application, since the prior art solution executes IPC and computation serially, that is, the application needs to complete the IPC work first and then perform the computation, it ignores the situation where IPC and computation work are not dependent on each other in many cases. Some applications do not need to wait for IPC to complete before they can perform computation work. However, the embodiments of this application, by parallelizing IPC work and computation work, hide the overhead of IPC, improve the system throughput, and reduce IPC latency.
[0011] In one possible implementation of the first aspect, determining that the m first IPC requests can be executed in parallel with the computation on the first application can be done as follows: First, determine whether there is a custom target attribute in the page table of the m data to be transmitted corresponding to each of the m first IPC requests (i.e., whether special protection is set, and the data to be transmitted with the target attribute set cannot be accessed by the application in advance and will fall into the page fault process). If so (i.e. at least one first IPC request has a target attribute), then further determine whether the number of times the page fault process triggered by it is executed reaches a first preset frequency. If the number of times the page fault process is executed is lower than the first preset frequency, then determine that the m first IPC requests can be executed in parallel with the computation on the first application.
[0012] In the above embodiments of this application, if the number of times the page fault procedure is executed is lower than the first preset frequency, it means that the page fault procedure is not frequently triggered, indicating that the time window for IPC and computation parallelism is large, which is suitable for parallel execution. This judgment method is simple and easy to implement.
[0013] In one possible implementation of the first aspect, when the first IPC strategy includes a first sub-strategy, the manifestation of m first IPC requests not meeting the first preset condition can be: the number of times the page missing process is executed reaches the first preset frequency mentioned above.
[0014] In the above embodiments of this application, when the number of times the page fault process is executed reaches the first preset frequency, it indicates that the page fault process is frequently triggered, which means that the time window for IPC and computation to run in parallel is small and not suitable for parallel execution.
[0015] In one possible implementation of the first aspect, the second IPC strategy includes at least a second sub-strategy, which may be a serial execution strategy, characterized in that the computation of n second IPC requests on the first application is performed in a serial execution mode.
[0016] In the above embodiments of this application, it is specifically explained that when the current situation is no longer suitable for executing the parallel execution strategy, it can be promptly adjusted to the serial execution strategy, thereby realizing the function of dynamically adjusting the IPC strategy according to the actual operation of the application.
[0017] In one possible implementation of the first aspect, the first IPC strategy may further include a third sub-strategy. In this case, one implementation of determining the first IPC strategy is as follows: First, register m first IPC requests in a preset event table to obtain m registration events, with one first IPC request corresponding to one registration event; if it is determined that the target registration event can perform page owner transfer, determine that the third sub-strategy is a physical page mapping strategy, the target registration event is one of the m registration events, the owner transfer is the transfer of physical pages belonging to the first process to the second process, and the physical page mapping strategy is used to represent mapping physical pages belonging to the first process to the virtual address space of the second process, where the first process is the process that needs to send data and the second process is the process that needs to receive data.
[0018] In the embodiments described above in this application, the prior art requires copying the data to be transmitted from a first process in user space to kernel space, and then from kernel space to a second process in user space to complete inter-process data communication. In other words, a single data transmission in the prior art's IPC process requires two copies, which incurs significant overhead and leads to high IPC latency. The embodiments described above in this application eliminate the need for two copies of the data to be transmitted between processes, thus avoiding the overhead of two data copy operations.
[0019] In one possible implementation of the first aspect, one way to determine that the target registration event can be used for page owner transfer is to determine whether the address of the target first data to be transferred (i.e., one of the m first data to be transferred) corresponding to the current target registration event is page-aligned (e.g., whether it is aligned to a 4KB address). If so, then the target registration event can be used for owner transfer.
[0020] In the above embodiments of this application, it is specifically explained that it is feasible to determine whether page master transfer can be performed by determining whether the data to be transferred is aligned with a 4KB address.
[0021] In one possible implementation of the first aspect, the method may further include: when the target first IPC request corresponding to the target registration event is completed, it is also necessary to delete the completed target registration event from the event table (i.e. delete the registration event that has been completed in the event table), wherein the target first IPC request is one of the m first IPC requests.
[0022] In the above embodiments of this application, when the target registered event in the event table is completed, the corresponding registered event needs to be deleted in a timely manner to facilitate real-time monitoring and statistics by the background thread.
[0023] In one possible implementation of the first aspect, after deleting the target registration event that has been completed from the event table, the method further includes: deleting the target attribute from the page table of the first target data to be transmitted if the target attribute exists.
[0024] In the above embodiments of this application, if the target attribute (i.e., it has been specially protected) still exists in the page table of the corresponding data to be transmitted, it is necessary to delete the target attribute from the page table. After that, the application can access the data normally without getting caught in the page missing process.
[0025] In one possible implementation of the first aspect, the fact that m first IPC requests do not satisfy the first preset condition further includes:
[0026] The number of times a copy-on-write (COW) exception occurs due to the first process performing a preset operation (e.g., sending a Buf Overwrite) on the first process of the data to be sent is called the second preset frequency.
[0027] In the above embodiments of this application, several manifestations of m first IPC requests not meeting the first preset conditions are specifically described, which have flexibility and wide applicability.
[0028] In one possible implementation of the first aspect, the second IPC strategy further includes a fourth sub-strategy, which may include a data copy strategy, which represents that n second data to be transmitted are first copied from the first application to the kernel mode, and then copied from the kernel mode to the second application in the user mode, wherein the second application is another of at least two applications on the computer device.
[0029] In the above embodiments of this application, it is specifically explained that when the current situation is no longer suitable for the physical page mapping strategy, it can be promptly adjusted to the data copy strategy, thereby realizing the function of dynamically adjusting the IPC strategy according to the actual operation of the application.
[0030] A second aspect of this application provides a computer device having the function of implementing the method of the first aspect or any possible implementation thereof. This function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described function.
[0031] A third aspect of this application provides a computer device that may include a memory, a processor, and a bus system. The memory is used to store a computer program (also referred to as a program or computer-readable instructions), and the processor is used to invoke the program stored in the memory to execute the method of the first aspect of the embodiments of this application or any possible implementation of the first aspect.
[0032] A fourth aspect of this application provides a computer-readable storage medium storing instructions that, when executed on a computer, enable the computer to perform the methods described in the first aspect or any possible implementation thereof.
[0033] The fifth aspect of this application provides a computer program or a computer program product containing instructions that, when the computer program or computer program product is run on a computer, causes the computer to perform the method described in the first aspect or any possible implementation of the first aspect.
[0034] A sixth aspect of this application provides a chip including at least one processor and at least one interface circuit coupled to the processor. The interface circuit performs transceiver functions and sends instructions to the at least one processor. The at least one processor runs a computer program or instructions, having the functionality to implement the methods described in the first aspect or any possible implementation of the first aspect. This functionality can be implemented in hardware, software, or a combination of hardware and software, including one or more modules corresponding to the described functions. Furthermore, the interface circuit is used to communicate with other modules outside the chip.
[0035] In some implementations of this application, some of the one or more processors may implement some steps of the above method through dedicated hardware. For example, the processing involving neural network models may be implemented by a dedicated neural network processor or graphics processor.
[0036] The method provided in this application embodiment can be implemented by a single chip or by multiple chips working together. Attached Figure Description
[0037] Figure 1 A schematic diagram of the system architecture provided in the embodiments of this application;
[0038] Figure 2 A flowchart illustrating the data processing method provided in this application embodiment;
[0039] Figure 3 A flowchart illustrating the selection of IPC strategies based on registration events provided in this application embodiment;
[0040] Figure 4 A core flowchart provided for embodiments of this application;
[0041] Figure 5 A schematic diagram of a system for policy selection and adjustment using an adaptive policy state machine provided in an embodiment of this application;
[0042] Figure 6 A schematic diagram of the component structure of a specific example provided in this application embodiment;
[0043] Figure 7 A schematic diagram of a computer device provided in an embodiment of this application;
[0044] Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0045] This application provides a data processing method for obtaining the most suitable IPC policy for each IPC request transmitted by the application through policy selection, and determining whether the current IPC policy is suitable for the current situation (i.e., whether the first preset condition is met) by monitoring the workload of the IPC requests, thereby realizing the function of real-time and dynamic adjustment of the IPC policy.
[0046] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0047] To better understand the solutions of the embodiments of this application, the relevant terms and concepts that may be involved in the embodiments of this application will be introduced below. It should be understood that the explanation of the relevant concepts may be limited due to the specific circumstances of the embodiments of this application, but it does not mean that this application can only be limited to that specific situation. The specific circumstances of different embodiments may also differ, and no specific limitation is made here.
[0048] (1) Calculation
[0049] When a program (also known as an application) is running, in addition to IPC (Internet Protocol) operations, it also has other functions, collectively referred to as computation, or simply computation.
[0050] (2) Owner transfer
[0051] Physical page X originally belonged to process A, but now it has been transferred to process B, and process B can access the physical page.
[0052] (3) COW
[0053] Two processes initially share a block of data in read-only mode. When one of them attempts to modify this data, the system allocates a new physical memory address, copies the shared data to the new address, and then the modification is applied to the new address. At this point, the data sharing between the processes is terminated.
[0054] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0055] First, the system architecture and overall process applied in the methods of the embodiments of this application will be described. For details, please refer to [link / reference needed]. Figure 1 , Figure 1 This is a schematic diagram of the system architecture provided in an embodiment of this application. The system architecture includes user mode and kernel mode. The user mode provides an Application Programming Interface (API), which can be a socket API or other inter-process communication (IPC) APIs; this application does not limit this. In the kernel mode, this application increases the types of selectable IPC strategies during the IPC process and adds the functionality of IPC strategy selection.
[0056] Specifically, firstly, after each IPC request is passed to kernel mode, the optimal IPC strategy can be selected based on the target code segment running in kernel mode. As an example, the functionality of this target code segment can be implemented using a state machine (such as...). Figure 1This functionality is implemented using an adaptive strategy state machine (as shown), which can include adaptive selection of IPC strategies and monitoring and adjustment of IPC load. Multiple IPC strategies are dynamically selected and adjusted based on the actual application operation to achieve optimal overall communication efficiency. For each IPC request, the most suitable IPC strategy is obtained after passing through the adaptive strategy state machine. This application dynamically adjusts the IPC strategy by monitoring the IPC workload, including but not limited to the time IPC requests remain in the event table, the frequency of page faults triggered by applications accessing data prematurely, and the frequency of COW faults caused by applications performing preset operations (e.g., sending Buf Overwrite). This optimization process is completely transparent and unknown to the application.
[0057] It should be noted that in the embodiments of this application, the optimal IPC strategy can be a combination of one or more sub-strategies, meaning that multiple IPC strategies can be supported for the same application. For example, IPC requests that can be executed in parallel with the computational work on the application can be optimized using a parallel execution strategy (i.e., the first sub-strategy, also known as Pipeline mode); otherwise, a serial execution strategy (i.e., the second sub-strategy, also known as Unpipiline mode) is executed. Furthermore, for the data to be transmitted (i.e., the application's data to be sent or received), the choice between a physical page mapping strategy (i.e., the third sub-strategy, also known as Page Attach mode) and a data copy strategy (i.e., the fourth sub-strategy, also known as Page Copy mode) can be further selected based on whether the address of the data to be transmitted is page-aligned and / or the size of the message.
[0058] It should also be noted that the IPC strategies described above in the embodiments of this application are merely illustrative. In other embodiments of this application, the system architecture may include more IPC strategies. For example, whether multiple IPC requests can be processed in batches is not limited in this application.
[0059] It should be noted that, in the embodiments of this application, Figure 1 The system architecture shown is for illustrative purposes only, and there are no restrictions on the deployment methods of each unit.
[0060] Based on the above system architecture, the data processing method provided in the embodiments of this application will be described below. Please refer to the following for details. Figure 2 , Figure 2 This is a flowchart illustrating a data processing method provided in an embodiment of this application. The method is applied to a computer device, which includes at least two applications in user mode (e.g., a first application and a second application) and a target code segment in kernel mode. By running the target code segment, the following steps are performed:
[0061] 201. Obtain m first IPC requests transmitted by the first application, where the first application is one of multiple applications in user mode, and m≥1.
[0062] First, the first IPC request transmitted by the first application is obtained. This first IPC request can be for sending or receiving data, and this application does not limit it in this regard. There can be one or more first IPC requests, and this application does not limit it in this regard. The first IPC request can be any one of the multiple applications in user mode.
[0063] It should be noted that, in some embodiments of this application, the first IPC request can be registered as an event (e.g., Figure 3 As shown, the first-order application maintains synchronization semantics, enabling parallel execution of IPC and computation. Specifically, the received first IPC request is encapsulated into an event and registered in a pre-set global event table. This pre-set event table can be initialized before step 201, and a background thread can be started. The task of this background thread is to periodically check the event table to see if there are any registered events (one IPC request corresponds to one registered event), and if so, execute the corresponding registered event.
[0064] It's important to note that the background thread can be one or multiple. The specific number can be set by the user or dynamically adjusted based on the number of registered events in the event table. This application does not impose any limitations on this. As an example, when the number of registered events in the event table reaches a preset threshold, it means that the time each registered event stays in the event table will be longer. At this time, the number of background threads can be dynamically adjusted. For example, the number of background threads to be started can be determined based on the number of registered events in the event table for concurrent processing. If the number of registered events in the event table does not reach the preset threshold, one background thread can handle the process. In this case, there can be only one background thread. Specifically, this application does not impose any limitations on the number of background threads and can dynamically adjust them based on the number of registered events in the event table.
[0065] It should be noted that in some embodiments of this application, after registering each first IPC request for an event, if preset requirements are met (e.g., IPC cannot be executed in parallel with application computations), a custom target attribute (also known as special protection) is set in the page table of the first data to be transmitted (i.e., data to be sent or received) corresponding to each first IPC request. This target attribute is used to indicate that if the user accesses the first data to be transmitted before it is ready, the execution of the IPC Page Fault process will be triggered due to the setting of this target attribute. This IPC Page Fault process is a code flow that is automatically executed when the second application accesses the specially protected data. In this process, the registered event to which the accessed data belongs is searched, and then subsequent operations are performed based on the relevant information of the registered event. For details, please refer to [link to relevant documentation]. Figure 3 When an application (referred to as a second application) accesses the first data to be transmitted, it first determines whether the first data is ready (e.g., whether it has already been transmitted to the second application). If it is ready, the second application can directly access the data; if it is not ready, it will enter the IPC Page Fault process. It is important to note that this target attribute is a custom attribute, and it will only be set in the page table of the first data to be transmitted if the requirements are met. If the requirements are not met, this target attribute does not need to be set.
[0066] 202. Determine the first IPC strategy, and transmit the m first data to be transmitted corresponding to the m first IPC requests based on the first IPC strategy, wherein the IPC strategy is used to characterize the transmission method adopted by the data to be transmitted corresponding to the IPC request.
[0067] Then, a first IPC strategy is determined, and based on the first IPC strategy, the m first data to be transmitted corresponding to the m first IPC requests are transmitted (one first IPC request corresponds to one first data to be transmitted), wherein the IPC strategy is used to characterize the transmission method adopted by the data to be transmitted corresponding to the IPC request.
[0068] It should be noted that in some embodiments of this application, the first IPC policy can be a single IPC policy or a combination of multiple IPC policies (in which case, these multiple IPC policies can be referred to as sub-policies), and this application does not limit this. For ease of understanding, the process of determining the first IPC policy is illustrated below with an example:
[0069] (1) The first IPC strategy includes the first sub-strategy.
[0070] As an example, if the first IPC policy includes at least a first sub-policy, the implementation of the first IPC policy can be determined as follows:
[0071] First, determine whether these m first IPC requests can be executed in parallel with the computation on the first application. If so, then the first sub-strategy can be determined as a parallel execution strategy (i.e., Figure 1 The Pipeline mode shown is used to characterize the first IPC request and computation as a parallel execution mode, that is, the first application completes IPC while performing computational work, thereby hiding the overhead of IPC.
[0072] It should be noted that in some embodiments of this application, there are multiple ways to determine whether an IPC request can be executed in parallel with the computation on the application. For example, it can be determined whether the page table of the m data to be transmitted corresponding to each of the m first IPC requests contains the aforementioned custom target attribute (i.e., whether special protection is set, and the data to be transmitted with the target attribute set cannot be accessed by the application in advance and will fall into the page fault process). If so (i.e. at least one first IPC request contains the target attribute), it is further determined whether the number of times the page fault process triggered by it is executed reaches a preset frequency (which can be called the first preset frequency). If the number of times the page fault process is executed is lower than the first preset frequency, it means that the page fault process is not frequently triggered, indicating that the time window for parallel execution of IPC and computation is large and suitable for parallel execution. Therefore, it can be confirmed that the first IPC request and the computation on the first application can be executed in parallel.
[0073] (2) The first IPC strategy includes the third sub-strategy
[0074] As an example, if the first IPC policy includes at least a third sub-policy, the implementation of the first IPC policy can be determined as follows:
[0075] If the first IPC request has been registered in the preset event table as an event based on the description in step 201 above, then for m first IPC requests, there will be m corresponding registration events, with one first IPC request corresponding to one registration event. Then, it will be further determined whether there is a registration event among these m registration events that can be transferred to the owner (each registration event currently being judged can be called the target registration event). If the owner can be transferred, then the third sub-policy is determined to be a physical page mapping policy and read-only protection is set for the physical page. Here, the owner transfer means that the physical page belonging to the first process is transferred to the second process so that the second process can access the physical page. The physical page mapping policy is used to represent mapping the physical page belonging to the first process to the virtual address space of the second process. Here, the first process is the process that needs to send data, and the second process is the process that needs to receive data.
[0076] As can be seen from the above, data to be transmitted using the physical mapping strategy does not need to be copied twice between the two applications. The data transmission is directly transformed into a transfer between page owners, eliminating the overhead of two copies and making IPC more efficient.
[0077] It should be noted that in some embodiments of this application, there are multiple ways to determine whether a registration event can be transferred to an owner. For example, it can be determined whether the address of the target first data to be transmitted (i.e., one of the m first data to be transmitted) corresponding to the current target registration event is page-aligned (e.g., whether it is aligned to a 4KB address). If so, it indicates that the target registration event can be transferred to an owner.
[0078] It should also be noted that in some embodiments of this application, once the IPC request corresponding to the registration event is completed, the registration event will be deleted from the event table (i.e., the registration event that has been completed will be deleted from the event table), such as... Figure 3 As shown.
[0079] It should also be noted that in some other embodiments of this application, when deleting the corresponding registration event, if the target attribute (i.e., it has been specially protected) still exists in the page table of the corresponding data to be transmitted, the target attribute also needs to be deleted from the page table. After that, the application can access the data normally without getting caught in the page missing process.
[0080] It should be noted that the first and third sub-strategies described above are merely illustrative of the first IPC strategy. This first IPC strategy may include the first sub-strategy and / or the third sub-strategy; that is, it may include only the first sub-strategy, only the third sub-strategy, or a combination of the first and third sub-strategies. This application does not limit this. Furthermore, in some other embodiments of this application, the first IPC strategy may include other sub-strategies besides the first and / or third sub-strategies, such as a batch strategy. This application does not limit this as well.
[0081] 203. If m first IPC requests do not meet the first preset condition, the first IPC strategy is adjusted to the second IPC strategy, and n second data to be transmitted corresponding to n second IPC requests are transmitted based on the second IPC strategy, wherein n second IPC requests are new IPC requests generated by the first application after it is determined that the first preset condition is not met, and n≥1.
[0082] If the m first IPC requests do not meet the first preset condition, the first IPC strategy is adjusted to the second IPC strategy, and the n second data to be transmitted corresponding to the n second IPC requests are transmitted based on the second IPC strategy. The n second IPC requests are new IPC requests generated by the first application after it is determined that the first preset condition is not met. One second IPC request corresponds to one second data to be transmitted, and n≥1.
[0083] It should be noted that, in the embodiments of this application, the first IPC policy may include a first sub-policy and / or a third sub-policy. Similarly, the second IPC policy may include one IPC policy or a combination of multiple IPC policies (in which case, these multiple IPC policies may be called sub-policies), and this application does not limit this. For ease of understanding, the process of determining the second IPC policy is illustrated below with an example:
[0084] (1) The second IPC strategy includes the second sub-strategy
[0085] As an example, if the first IPC strategy includes a first sub-strategy, the second IPC strategy can include a second sub-strategy. In this case, the manifestation of m first IPC requests not meeting the first preset condition can be: the number of times the page fault process is executed reaches the aforementioned first preset frequency. Because when the number of times the page fault process is executed reaches this first preset frequency, it indicates that the IPC Page Fault process is frequently triggered, meaning that the time window for parallel IPC and computation is small, making parallel execution unsuitable. In this case, the second sub-strategy can be a serial execution strategy (i.e.,... Figure 1 The Unpipeline mode shown here is used to characterize the n second IPC requests and the computation on the first application as being executed in a serial manner.
[0086] (2) The second IPC strategy includes the fourth sub-strategy
[0087] As an example, if the first IPC strategy includes a third sub-strategy, the second IPC strategy may include a fourth sub-strategy. In this case, the manifestation of m first IPC requests not meeting the first preset condition can be: the registration event corresponding to the first IPC request (i.e., the target registration event) cannot be transferred to the owner; or, the number of COW exceptions caused by the first process sending data performing a preset operation (e.g., sending a Buf Overwrite) is obtained at a preset frequency, which can be called the second preset frequency. In this case, the fourth sub-strategy can be a data copy strategy, which represents copying the n second data to be transmitted first from the first application (i.e., the process that generates the data to be transmitted) to the kernel state, and then from the kernel state to the second application in user mode (i.e., the process receiving the data to be transmitted), where the second application is another of the at least two applications mentioned above.
[0088] It should also be noted that the aforementioned second and fourth sub-strategies are merely illustrative of the second IPC strategy. This second IPC strategy may include the second sub-strategy and / or the fourth sub-strategy; that is, it may include only the second sub-strategy, only the fourth sub-strategy, or a combination of the second and fourth sub-strategies. This application does not limit this. Furthermore, in some other embodiments of this application, the second IPC strategy may include other sub-strategies besides the second and / or fourth sub-strategies; this application does not limit this as well.
[0089] In summary, in the above embodiments of this application, the first and second sub-strategies are IPC strategies that determine whether the data to be transmitted can be executed in parallel with computation before the actual transmission of the data to be transmitted begins. The third and fourth sub-strategies are IPC strategies that determine the specific transmission method of the data to be transmitted. For details, please refer to [reference needed]. Figure 4 The core flowchart shown includes the following steps:
[0090] 401. Obtain IPC Request.
[0091] First, the preset event table and IPC system are initialized (see the above description for details, which will not be repeated here), and IPC requests transmitted by user-mode applications are received and registered in the event table. One IPC request corresponds to one registration event.
[0092] 402. Determine whether IPC and computation can be executed in parallel. If yes, proceed to step 403; otherwise, proceed to step 404.
[0093] After obtaining and registering an IPC request, policy selection and adjustment can be performed based on the state machine. First, it is determined whether the IPC and computation corresponding to the current IPC request can be executed in parallel. If yes, step 403 is executed; otherwise, step 404 is executed.
[0094] 403. Execute the parallel execution strategy.
[0095] Execute the parallel execution strategy and proceed to step 405.
[0096] 404. Execute the serial execution strategy.
[0097] The serial execution strategy is executed, and the process proceeds to step 405.
[0098] 405. Determine whether the page owner can be transferred. If yes, proceed to step 406; otherwise, proceed to step 407.
[0099] Next, determine whether the page owner can be transferred. If yes, proceed to step 406; otherwise, proceed to step 407.
[0100] 406. Execute the physical page mapping strategy.
[0101] 407. Execute the data copy strategy.
[0102] As described above, the parallel execution strategy proposed in this application's embodiments allows IPC requests to be registered as events and maintain synchronization semantics with the application, enabling IPC and computation to execute in parallel. Simultaneously, nesting IPC within the page miss process avoids security issues caused by the application accessing data prematurely. Furthermore, the physical page mapping strategy proposed in this application's embodiments transforms data copying during IPC into a page owner transfer, eliminating the overhead of two data copy operations.
[0103] To facilitate understanding of the data processing method described in the embodiments of this application, the following uses an adaptive policy state machine as an example to provide a detailed explanation of the policy selection and adjustment process described in the embodiments of this application. Please refer to [link / reference needed] for details. Figure 5 , Figure 5 A schematic diagram of a system for policy selection and adjustment using the adaptive policy state machine provided in the embodiments of this application, which may specifically include the following four parts:
[0104] (I) Initializing the Adaptive Strategy State Machine
[0105] This step initializes the weights of each IPC policy within the adaptive policy state machine. This adaptive policy state machine can contain one or more types of IPC policies. As an example, specific policies may include, but are not limited to, the following:
[0106] 1. A strategy that uses data copying to transfer data, i.e., a data copying strategy;
[0107] 2. The strategy of transmitting data by using physical page mapping (i.e., inter-process transfer of page owner, where the sender maps the data to be sent to the receiver, and the receiver obtains the right to access this data) is called physical page mapping strategy.
[0108] 3. Serial execution strategy, i.e., IPC is in synchronous mode;
[0109] 4. Parallel execution strategy, i.e., IPC is in asynchronous mode (processing IPC requests and other work within the application can be executed in parallel);
[0110] 5. Batch strategy, that is, IPC is in batch processing mode (multiple IPC requests are merged into one request).
[0111] To facilitate understanding of the process of initializing the weights of each IPC policy, the following examples illustrate the process:
[0112] Example 1: The weight of the physical page mapping strategy is set to 100, and the weight of the data copy strategy is set to 0. Therefore, during IPC communication, the physical page mapping strategy, which is more efficient, will be preferred for data transmission.
[0113] Example 2: The weight of the parallel execution strategy is set to 100, and the weight of the serial execution strategy is set to 0. Therefore, IPC requests will be executed in parallel execution mode by default.
[0114] (II) Strategy Selection
[0115] This step selects an appropriate IPC strategy based on information received from the IPC request, such as whether the address of the data to be transmitted is page-aligned, and based on the set parallel weights and batch weights.
[0116] Similarly, to facilitate understanding of the strategy selection process, several specific examples are provided below:
[0117] Example 1: If the data address is page-aligned, then the physical page mapping strategy will be chosen to transmit the data. Since this method has a performance improvement of several times compared to the data copying method, and the improvement is more obvious when the data is larger, this strategy is better in the scenario where the data address is page-aligned.
[0118] Example 2: It selects between parallel and serial execution modes to execute IPC requests based on the weight of parallelism. This weight can be a default value during system initialization, set based on user input (developers best understand the operating characteristics of their applications), or updated according to the strategy adjustment mechanism to be introduced later (which collects application operating characteristics to set and update weights).
[0119] (III) Strategy Combination
[0120] This step combines the IPC strategies selected in the previous step to output the final IPC strategy. For example, if the physical page mapping strategy and the parallel execution strategy were selected above, the specific combination would be as follows: First, the parallel execution mode would be used to process IPC requests. Since IPC requests involve data transfer when processed by the background thread, the background thread would use the physical page mapping strategy to transfer the data.
[0121] (iv) Strategy Adjustment
[0122] This step dynamically adjusts the IPC strategy based on monitoring data of the IPC workload, such as: 1. the duration of the registration event corresponding to the IPC request remaining in the event table; 2. the frequency of the page missing process being triggered due to the application accessing data in advance; 3. the frequency of COW exceptions caused by the application sending Buf Overwrite, etc.
[0123] Let's take the example of "the frequency of page misses triggered by applications accessing data prematurely": When registering an IPC event, special protection is set for the data requested by the IPC (i.e., a custom target attribute is defined in the data's page table). Then, a background thread processes the IPC requests in parallel. Next, the application needs to access the data requested by the IPC. If the data is not yet ready, it will fall into a page miss process due to the special protection set for the data. The system will count the number of times the application falls into this process. Assuming it exceeds 1000 times per second (this number can be set according to requirements and is not limited), frequent page miss triggering behavior indicates that the time window for IPC and computation parallelism is small. Therefore, it is determined that this application is not suitable for a parallel execution strategy, and the system will reduce the weight of "parallelism," or even set it to 0. Thus, when the adaptive strategy state machine selects a strategy, it will prioritize the serial execution strategy.
[0124] Furthermore, to further understand the data processing method provided in the embodiments of this application, the process of the above data processing method is described below with a specific example. Please refer to [link / reference needed] for details. Figure 6 , Figure 6This is a schematic diagram of the component structure of a specific example provided in this application. This example focuses on IPC communication latency and throughput. This example adapts the Socket API interface and provides it upwards, hijacking the following interfaces: send(), recv(), connect(), accept(), bind(), socket(), select(), and epoll(), to wh_socket_XXX. The hijacking is transparent to the application. When the application calls the corresponding Socket interface, it enters the logic of this example.
[0125] Referring to the process described in the above embodiments of this application, the main flow of IPC communication is as follows:
[0126] 1. Load the wormhole module into the kernel.
[0127] 2. Register the / dev / wormhole device and initialize the hashtable used to store worm holes.
[0128] 3. Create and initialize the event table in the kernel, create and start a background thread. The background thread's job is to periodically scan the event table.
[0129] 4. Next, hijack the application's internal Socket API interface and redirect to the interface corresponding to this application.
[0130] 5. Whenever a process creates a socket, a corresponding warm hole is created in the kernel to store IPC request information.
[0131] 6. If the application initiates a send or recv IPC request, this application will execute the parallel execution strategy by default. The IPC request will be registered as an event in the previously created event table. The registered event can include the address information of the data, the type of request, whether it is send or recv, the time of request registration, etc., and triggers a system call to set special protection for the address of the data.
[0132] 7. A background thread periodically scans the event table, traversing and executing the registered events. Based on the relevant information of the registered events, it actually triggers the corresponding IPC requests.
[0133] 8. Execute the IPC request. If the IPC request is a send request, and the data address is page-aligned and the message size is ≥4KB, then the address information of the sending data is first written into the wormhole of the receiving process; otherwise, the sending data is copied to the wormhole of the receiving process. Simultaneously, the IPC strategy is marked as either a physical page mapping strategy or a data copy strategy. If the IPC request is a recv request, the receiving process queries its own wormhole. If the IPC strategy is a data copy strategy, and the wormhole stores data, then the data is copied to the receiving address. If the IPC strategy is a physical page mapping strategy, and the wormhole stores the address information of the data, then the physical page containing the data is directly mapped to the receiving address.
[0134] 9. If the application accesses data that has not yet been transmitted before the background thread executes the IPC request, the application will automatically enter a page fault process due to the special protection set for the data address, forcing the execution of the IPC request corresponding to that data (i.e., step 8 above). Simultaneously, the weight of the parallel execution strategy will be reduced. When the weight decreases to a certain threshold, step 6 will no longer execute the IPC request asynchronously by default, but will instead execute the IPC request synchronously.
[0135] Based on the above embodiments, in order to better implement the above solutions of this application, related equipment for implementing the above solutions is also provided below. See details. Figure 7 , Figure 7 This is a schematic diagram of a computer device provided in an embodiment of this application. The computer device 700 may specifically include: an acquisition module 701, a determination module 702, and an adjustment module 703. The acquisition module 701 is used to acquire m first inter-process communication (IPC) requests transmitted by a first application, where the first application is one of the applications, and m ≥ 1. The determination module 702 is used to determine a first IPC strategy and transmit m first data to be transmitted corresponding to the m first IPC requests based on the first IPC strategy. The IPC strategy is used to characterize the transmission method adopted by the data to be transmitted corresponding to the IPC request, and one first IPC request corresponds to one first data to be transmitted. The adjustment module 703 is used to adjust the first IPC strategy to a second IPC strategy when the m first IPC requests do not meet a first preset condition, and transmit n second data to be transmitted corresponding to n second IPC requests based on the second IPC strategy. The n second IPC requests are new IPC requests generated by the first application after it is determined that the first preset condition is not met, and one second IPC request corresponds to one second data to be transmitted, and n ≥ 1.
[0136] In one possible design, the first IPC strategy includes at least a first sub-strategy. The determining module 702 is specifically used to: determine the first sub-strategy as a parallel execution strategy when it is determined that the m first IPC requests can be executed in parallel with the computation on the first application. The parallel execution strategy is used to characterize the m first IPC requests and the computation as being executed in parallel.
[0137] In one possible design, the determining module 702 is further configured to: determine whether a target attribute exists in the page table of the m first data to be transmitted, the target attribute being used to characterize that accessing the first data to be transmitted before it is ready will trigger the execution of a page miss procedure. If so, and if it is determined that the number of times the page miss procedure is executed is less than a first preset frequency, determine that the m first IPC requests can be executed in parallel with the computation on the first application.
[0138] In one possible design, the first IPC request not meeting the first preset condition includes: the number of times the missing process of the page is executed reaches the first preset frequency.
[0139] In one possible design, the second IPC strategy includes at least a second sub-strategy, which includes a serial execution strategy for characterizing the n second IPC requests and the computation on the first application as a serial execution mode.
[0140] In one possible design, the first IPC strategy further includes a third sub-strategy. The determining module 702 is specifically used to: register the m first IPC requests in a preset event table to obtain m registration events, with one first IPC request corresponding to one registration event; if it is determined that the target registration event can perform page owner transfer, determine that the third sub-strategy is a physical page mapping strategy, the target registration event is one of the m registration events, the owner transfer is the transfer of physical pages belonging to the first process to the second process, and the physical page mapping strategy is used to represent mapping physical pages belonging to the first process to the virtual address space of the second process.
[0141] In one possible design, the determining module 702 is further used to: determine whether the address of the target first data to be transmitted corresponding to the target registration event is page-aligned, and the target first data to be transmitted is one of the m first data to be transmitted; if so, determine that the target registration event can be transferred to the owner.
[0142] In one possible design, the adjustment module 703 is further configured to: delete the target registration event from the event table when the target first IPC request corresponding to the target registration event is completed, wherein the target first IPC request is one of the m first IPC requests.
[0143] In one possible design, the adjustment module 703 is further configured to: after deleting the target registration event from the event table, if the target attribute exists in the page table of the first data to be transmitted of the target, delete the target attribute from the page table of the first data to be transmitted of the target.
[0144] In one possible design, the m first IPC requests not meeting the first preset condition also include: the target registration event cannot be transferred to an owner; or, the number of times the first process performs a preset operation causing a copy-on-write (COW) exception reaches a second preset frequency.
[0145] In one possible design, the second IPC strategy also includes a fourth sub-strategy, which includes a data copy strategy. This data copy strategy is used to characterize that the n second data to be transmitted are first copied from the first application to the kernel mode, and then copied from the kernel mode to the second application in the user mode, where the second application is another application.
[0146] It should be noted that the information interaction and execution process between the modules / units in the computer device 700 are based on the same concept as the method embodiments described above in this application. For details, please refer to the description in the method embodiments shown above in this application, which will not be repeated here.
[0147] Next, we will introduce another computer device provided in the embodiments of this application. Please refer to [link / reference]. Figure 8 , Figure 8 This is a schematic diagram of a computer device provided in an embodiment of this application. The computer device 800 may be equipped with... Figure 7 The computer device 700 described in the corresponding embodiment is used to implement Figure 7 Corresponding to the functionality of the computer device 700 in the embodiment, specifically, the computer device 800 is implemented by one or more servers. The computer device 800 can vary significantly due to differences in configuration or performance, and may include one or more central processing units (CPUs) 822 and memory 832, and one or more storage media 830 (e.g., one or more mass storage devices) for storing application programs 842 or data 844. The memory 832 and storage media 830 can be temporary or persistent storage. The program stored in the storage media 830 may include one or more modules (not shown in the figure), each module including a series of instruction operations on the computer device 800. Furthermore, the CPU 822 may be configured to communicate with the storage media 830 and execute the series of instruction operations in the storage media 830 on the computer device 800.
[0148] The computer device 800 may also include one or more power supplies 826, one or more wired or wireless network interfaces 850, one or more input / output interfaces 858, and / or one or more operating systems 841, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0149] In this embodiment, the central processing unit 822 is used to execute... Figure 5 or Figure 6 The steps performed by the computer device in the corresponding embodiment are as follows. For example, the central processing unit 822 can be used to: First, obtain a first IPC request transmitted by a first application. The first IPC request can be for sending data or receiving data, and this application does not limit this. The first IPC request can be one or more, and this application does not limit this. The first IPC request can be any one of multiple applications in user mode. Then, determine a first IPC strategy, and transmit m first data to be transmitted corresponding to m first IPC requests based on the first IPC strategy (one first IPC request corresponds to one first data to be transmitted). The IPC strategy is used to characterize the transmission method used for the data to be transmitted corresponding to the IPC request. If the m first IPC requests do not meet the first preset condition, the first IPC strategy is adjusted to the second IPC strategy, and the n second data to be transmitted corresponding to the n second IPC requests are transmitted based on the second IPC strategy. The n second IPC requests are new IPC requests generated by the first application after it is determined that the first preset condition is not met. One second IPC request corresponds to one second data to be transmitted, and n≥1.
[0150] It should be noted that the specific manner in which the central processing unit 822 executes the above steps is based on the same concept as the method embodiment described above in this application, and the resulting technical effects are also the same as those in the above embodiment of this application. For details, please refer to the description in the method embodiment shown above in this application, which will not be repeated here.
[0151] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0152] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0153] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0154] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. A data processing method, characterized in that, Applied to a computer device, the computer device including at least two applications in user mode and a target code segment in kernel mode, the method includes: By running the target code segment, the following operations are performed: Obtain m first inter-process communication (IPC) requests transmitted by the first application, where the first application is one of the applications, and m ≥ 1; A first IPC strategy is determined, and m first data to be transmitted corresponding to the m first IPC requests are transmitted based on the first IPC strategy. The IPC strategy is used to characterize the transmission method adopted by the data to be transmitted corresponding to the IPC request, and one first IPC request corresponds to one first data to be transmitted. If the m first IPC requests do not meet the first preset condition, the first IPC policy is adjusted to the second IPC policy, and the n second data to be transmitted corresponding to the n second IPC requests are transmitted based on the second IPC policy. The n second IPC requests are new IPC requests generated by the first application after it is determined that the first preset condition is not met. One second IPC request corresponds to one second data to be transmitted, and n≥1.
2. The method according to claim 1, characterized in that, The first IPC policy includes at least a first sub-policy, and determining the first IPC policy includes: If it is determined that the m first IPC requests can be executed in parallel with the computation on the first application, the first sub-strategy is determined to be a parallel execution strategy, and the parallel execution strategy is used to characterize the m first IPC requests and the computation as being executed in parallel.
3. The method according to claim 2, characterized in that, Determining that the m first IPC requests can be executed in parallel with computation on the first application includes: Determine whether a target attribute exists in the page table of the m first data to be transmitted. The target attribute is used to characterize that accessing the data before it is ready will trigger the execution of a page miss process. If so, and if it is determined that the number of times the page missing process is executed is less than the first preset frequency, then it is determined that the m first IPC requests can be executed in parallel with the computation on the first application.
4. The method according to claim 3, characterized in that, The m first IPC requests that do not meet the first preset condition include: The number of times the page missing process is executed reaches the first preset frequency.
5. The method according to any one of claims 1-4, characterized in that, The second IPC policy includes at least a second sub-policy, which includes: A serial execution strategy, wherein the serial execution strategy is used to characterize the n second IPC requests and the computation on the first application as a serial execution mode.
6. The method according to any one of claims 1-5, characterized in that, The first IPC policy further includes a third sub-policy, and determining the first IPC policy includes: The m first IPC requests are registered in a preset event table to obtain m registration events, with one first IPC request corresponding to one registration event; If it is determined that the target registration event can be used for page owner transfer, the third sub-policy is determined to be a physical page mapping policy. The target registration event is one of the m registration events. The owner transfer is the transfer of physical pages belonging to the first process to the second process. The physical page mapping policy is used to represent mapping physical pages belonging to the first process to the virtual address space of the second process.
7. The method according to claim 6, wherein determining the target registration event for page owner transfer includes: Determine whether the address of the target first data to be transmitted corresponding to the target registration event is page-aligned, wherein the target first data to be transmitted is one of the m first data to be transmitted; If so, it is determined that the target registration event can be used for owner transfer.
8. The method according to any one of claims 6-7, characterized in that, The method further includes: If the target first IPC request corresponding to the target registration event is completed, the target registration event is deleted from the event table. The target first IPC request is one of the m first IPC requests.
9. The method according to claim 8, characterized in that, After deleting the target registered event from the event table, the method further includes: If the target attribute exists in the page table of the first target data to be transmitted, the target attribute is deleted from the page table of the first target data to be transmitted.
10. The method according to any one of claims 6-9, characterized in that, The fact that the m first IPC requests do not meet the first preset condition also includes: The target registration event cannot be transferred to a new owner; or, The number of times the first process causes a copy-on-write (COW) exception during a preset operation reaches a second preset frequency.
11. The method according to any one of claims 6-10, characterized in that, The second IPC policy also includes a fourth sub-policy, which includes: A data copying strategy is used to characterize the process of first copying the n second data to be transmitted from the first application to the kernel state, and then copying them from the kernel state to a second application in the user state, wherein the second application is another application.
12. A computer device, characterized in that, include: The acquisition module is used to acquire m first inter-process communication (IPC) requests transmitted by the first application, where the first application is one of the applications, and m ≥ 1; The determining module is used to determine a first IPC strategy and transmit m first data to be transmitted corresponding to the m first IPC requests based on the first IPC strategy. The IPC strategy is used to characterize the transmission method adopted by the data to be transmitted corresponding to the IPC request, and one first IPC request corresponds to one first data to be transmitted. The adjustment module is used to adjust the first IPC policy to a second IPC policy when the m first IPC requests do not meet the first preset condition, and to transmit n second data to be transmitted corresponding to the n second IPC requests based on the second IPC policy. The n second IPC requests are new IPC requests generated by the first application after it is determined that the first preset condition is not met, and one second IPC request corresponds to one second data to be transmitted, and n≥1.
13. The device according to claim 12, characterized in that, The first IPC policy includes at least a first sub-policy, and the determining module is specifically used for: If it is determined that the m first IPC requests can be executed in parallel with the computation on the first application, the first sub-strategy is determined to be a parallel execution strategy, and the parallel execution strategy is used to characterize the m first IPC requests and the computation as being executed in parallel.
14. The device according to claim 13, characterized in that, The determining module is further configured to: Determine whether a target attribute exists in the page table of the m first data to be transmitted. The target attribute is used to characterize that accessing the data before it is ready will trigger the execution of a page miss process. If so, and if it is determined that the number of times the page missing process is executed is less than the first preset frequency, then it is determined that the m first IPC requests can be executed in parallel with the computation on the first application.
15. The device according to claim 14, characterized in that, The m first IPC requests that do not meet the first preset condition include: The number of times the page missing process is executed reaches the first preset frequency.
16. The device according to any one of claims 12-15, characterized in that, The second IPC policy includes at least a second sub-policy, which includes: A serial execution strategy, wherein the serial execution strategy is used to characterize the n second IPC requests and the computation on the first application as a serial execution mode.
17. The device according to any one of claims 12-16, characterized in that, The first IPC policy also includes a third sub-policy, and the determining module is specifically further used for: The m first IPC requests are registered in a preset event table to obtain m registration events, with one first IPC request corresponding to one registration event; If it is determined that the target registration event can be used for page owner transfer, the third sub-policy is determined to be a physical page mapping policy. The target registration event is one of the m registration events. The owner transfer is the transfer of physical pages belonging to the first process to the second process. The physical page mapping policy is used to represent mapping physical pages belonging to the first process to the virtual address space of the second process.
18. The device according to claim 17, wherein the determining module is further configured to: Determine whether the address of the target first data to be transmitted corresponding to the target registration event is page-aligned, wherein the target first data to be transmitted is one of the m first data to be transmitted; If so, it is determined that the target registration event can be used for owner transfer.
19. The device according to any one of claims 17-18, characterized in that, The adjustment module is also used for: If the target first IPC request corresponding to the target registration event is completed, the target registration event is deleted from the event table. The target first IPC request is one of the m first IPC requests.
20. The device according to claim 19, characterized in that, The adjustment module is also used for: After deleting the target registration event from the event table, if the target attribute exists in the page table of the first data to be transmitted, the target attribute in the page table of the first data to be transmitted is deleted.
21. The device according to any one of claims 17-20, characterized in that, The fact that the m first IPC requests do not meet the first preset condition also includes: The target registration event cannot be transferred to a new owner; or, The number of times the first process causes a copy-on-write (COW) exception during a preset operation reaches a second preset frequency.
22. The device according to any one of claims 17-21, characterized in that, The second IPC policy also includes a fourth sub-policy, which includes: A data copying strategy is used to characterize the process of first copying the n second data to be transmitted from the first application to the kernel state, and then copying them from the kernel state to a second application in the user state, wherein the second application is another application.
23. A computer device comprising a processor and a memory, the processor being coupled to the memory, characterized in that, The memory is used to store programs; The processor is configured to execute a program in the memory, causing the computer device to perform the method as described in any one of claims 1-11.
24. A computer storage medium, characterized in that, The device stores computer-readable instructions, which, when executed by a processor, implement the method as described in any one of claims 1-11.
25. A computer program product, characterized in that, The computer program product includes computer-readable instructions that, when executed by a processor, implement the method as described in any one of claims 1-11.
26. A chip, the chip comprising a processor and a data interface, characterized in that, The processor reads instructions stored in the memory through the data interface and executes the method as described in any one of claims 1-11.