Search

WO-2026091582-A1 - DATA PROCESSING METHOD AND COMPUTER DEVICE

WO2026091582A1WO 2026091582 A1WO2026091582 A1WO 2026091582A1WO-2026091582-A1

Abstract

The present application provides a data processing method and a computer device, applicable to the field of IPC communications. The method comprises executing the following operations by means of a target code segment running in a kernel mode of a computer device: acquiring m first IPC requests transmitted by any application in a user mode; on this basis, determining a first IPC policy, and then on the basis of the first IPC policy, transmitting m pieces of first data to be transmitted corresponding to the m first IPC requests; and when the m first IPC requests do not satisfy a first preset condition, adjusting the first IPC policy to a second IPC policy, and on the basis of the second IPC policy, transmitting n pieces of second data to be transmitted corresponding to n second IPC requests newly generated by a first application. In the present application, for each IPC request, a most suitable IPC policy is obtained by means of policy selection, and whether the current IPC policy is suitable for the current situation (i.e., whether a first preset condition is satisfied) is determined by monitoring the workload of the IPC request, thereby implementing the function of dynamically adjusting IPC policies in real time.

Inventors

  • LIU, Mingrui
  • HUANG, Xiaojia
  • LIU, YUBO
  • REN, Yuxin
  • LIAO, Chang
  • GUO, Hanjun

Assignees

  • 华为技术有限公司

Dates

Publication Date
20260507
Application Date
20250625
Priority Date
20241030

Claims (20)

  1. A data processing method, characterized in that it is applied to a computer device, the computer device comprising at least two applications in user mode and a target code segment in kernel mode, the method comprising: 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. According to the method of claim 1, 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. According to claim 2, the method is 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. According to the method of claim 3, the m first IPC requests not satisfying the first preset condition includes: 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 strategy includes at least a second sub-strategy, the second sub-strategy comprising: 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 strategy further includes a third sub-strategy, and the determination of the first IPC strategy 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. According to the method of claim 6, the step of determining that the target registration event can be used 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 comprises: 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 registration 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 m first IPC requests not satisfying the first preset condition further 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 strategy further includes a fourth sub-strategy, the fourth sub-strategy comprising: 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 it comprises: 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, wherein 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, wherein 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, wherein the m first IPC requests not satisfying the first preset condition includes: 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, the second sub-policy including: 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 further 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 further configured to: 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, wherein the adjustment module 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, the target attribute in the page table of the first data to be transmitted is deleted.

Description

A data processing method and a computer device This application claims priority to Chinese Patent Application No. 202411538848.X, filed with the State Intellectual Property Office of China on October 30, 2024, entitled "A Data Processing Method and Computer Equipment", the entire contents of which are incorporated herein by reference. Technical Field 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 In an operating system, resources are represented by processes. Typically, one process represents one 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. Existing IPC solutions have high overhead. Two sets of experiments illustrate this: a) IPC overhead accounts for over 32% of the Redis Remote Dictionary Server's (Redis) internal overhead, 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. 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 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. Based on this, the embodiments of this application provide the following technical solutions: 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. 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. 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