Search

CN-121979696-A - Data processing method and computer equipment

CN121979696ACN 121979696 ACN121979696 ACN 121979696ACN-121979696-A

Abstract

The application provides a data processing method and computer equipment, which can be applied to the field of IPC communication, wherein the method executes the following operations through an object code segment running in the kernel mode of the computer equipment: the method comprises the steps of obtaining m first IPC requests transmitted by any application in a user state, determining a first IPC policy according to the m first IPC requests, transmitting m first data to be transmitted corresponding to the m first IPC requests based on the first IPC policies, adjusting the first IPC policies to second IPC policies under the condition that the m first IPC requests do not meet first preset conditions, and transmitting n second data to be transmitted corresponding to n newly generated second IPC requests of the first application based on the second IPC policies. The application obtains the most suitable IPC strategy through strategy selection for each IPC request, and judges whether the current IPC strategy is suitable for the current situation (namely whether the first preset condition is met) or not by monitoring the workload of the IPC request, thereby realizing the function of dynamically adjusting the IPC strategy in real time.

Inventors

  • LIU MINGRUI
  • HUANG XIAOJIA
  • LIU YUBO
  • REN YUXIN
  • LIAO CHANG
  • GUO HANJUN

Assignees

  • 华为技术有限公司

Dates

Publication Date
20260505
Application Date
20241030

Claims (20)

  1. 1. A method of data processing applied to a computer device comprising at least two applications in a user state and an object code segment in a kernel state, the method comprising: By running the object code segment, the following operations are performed: obtaining m first inter-process communication IPC requests transmitted by a first application, wherein the first application is one of the applications, and m is more than or equal to 1; determining a first IPC policy, and transmitting m first data to be transmitted corresponding to the m first IPC requests based on the first IPC policy, wherein the IPC policy is used for representing a transmission mode adopted by the data to be transmitted corresponding to the IPC requests, and one first IPC request corresponds to one first data to be transmitted; And under the condition that the m first IPC requests do not meet a first preset condition, the first IPC strategy is adjusted to be a second IPC strategy, and n second data to be transmitted corresponding to the n second IPC requests are transmitted based on the second IPC strategy, wherein the n second IPC requests are newly generated by the first application after the fact that the first preset condition is not met is determined, one second IPC request corresponds to one second data to be transmitted, and n is more than or equal to 1.
  2. 2. The method of claim 1, wherein the first IPC policy comprises at least a first sub-policy, and wherein the determining the first IPC policy comprises: and determining the first sub-strategy as a parallel execution strategy for characterizing the m first IPC requests and the computation as a parallel execution mode under the condition that the m first IPC requests can be executed in parallel with the computation on the first application.
  3. 3. The method of claim 2, wherein the determining that the m first IPC requests can be performed in parallel with the computation on the first application comprises: Judging whether a target attribute exists in page tables of the m first data to be transmitted or not, wherein the target attribute is used for representing that the execution of a page miss flow is triggered when the first data to be transmitted is accessed before the first data to be transmitted is not ready; if yes, and under the condition that the execution times of the page miss flow are lower than a first preset frequency, determining that the m first IPC requests can be executed in parallel with the computation on the first application.
  4. 4. The method of claim 3, wherein the m first IPC requests do not satisfy a first preset condition comprises: and the execution times of the page miss flow reach the first preset frequency.
  5. 5. The method of any of claims 1-4, wherein the second IPC policy comprises at least a second sub-policy comprising: And the serial execution strategy is used for representing that the calculation on the n second IPC requests and the first application is serial execution mode.
  6. 6. The method of any of claims 1-5, wherein the first IPC policy further comprises a third sub-policy, the determining the first IPC policy comprising: Registering the m first IPC requests in a preset event table to obtain m registration events, wherein one first IPC request corresponds to one registration event; And under the condition that the target registration event is determined to be capable of performing page master transfer, determining the third sub-policy as a physical page mapping policy, wherein the target registration event is one of the m registration events, the owner transfer is performed by transferring physical pages belonging to a first process to a second process, and the physical page mapping policy is used for representing a virtual address space for mapping the physical pages belonging to the first process to the second process.
  7. 7. The method of claim 6, wherein the determining that the target registration event can make a page master transfer comprises: Judging whether the address of target first data to be transmitted corresponding to the target registration event is aligned according to pages, wherein the target first data to be transmitted is one of the m first data to be transmitted; If yes, determining that the target registration event can be transferred to the owner.
  8. 8. The method according to any one of claims 6-7, further comprising: And deleting the target registration event from the event table under the condition that the execution of 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.
  9. 9. The method of claim 8, wherein after deleting the target registration event from the event table, the method further comprises: And deleting the target attribute in the page table of the target first data to be transmitted under the condition that the target attribute exists in the page table of the target first data to be transmitted.
  10. 10. The method of any one of claims 6-9, wherein the m first IPC requests do not meet a first preset condition further comprises: The target registration event may not be a business owner transfer; Or alternatively, the first and second heat exchangers may be, And the number of times of copy-on-write (COW) abnormality caused by the preset operation executed by the first process reaches a second preset frequency.
  11. 11. The method of any of claims 6-10, wherein the second IPC policy further comprises a fourth sub-policy comprising: And the data copying strategy is used for representing that the n second data to be transmitted are firstly copied from the first application to the kernel state and then copied from the kernel state to a second application in a user state, and the second application is another application in the applications.
  12. 12. A computer device, comprising: The acquisition module is used for acquiring m first inter-process communication IPC requests transmitted by a first application, wherein the first application is one of the applications, and m is more than or equal to 1; The determining module is used for determining a first IPC strategy and transmitting 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 for representing a transmission mode adopted by the data to be transmitted corresponding to the IPC requests, and one first IPC request corresponds to one first data to be transmitted; The adjustment module is configured to adjust the first IPC policy to a second IPC policy when the m first IPC requests do not meet a first preset condition, and transmit n second data to be transmitted corresponding to the n second IPC requests based on the second IPC policy, where the n second IPC requests are IPC requests newly generated by the first application after determining that the first preset condition is not met, and n is greater than or equal to 1.
  13. 13. The device according to claim 12, wherein the first IPC policy comprises at least a first sub-policy, the determining module being specifically configured to: and determining the first sub-strategy as a parallel execution strategy for characterizing the m first IPC requests and the computation as a parallel execution mode under the condition that the m first IPC requests can be executed in parallel with the computation on the first application.
  14. 14. The device according to claim 13, characterized in that said determining module is further adapted in particular to: Judging whether a target attribute exists in page tables of the m first data to be transmitted or not, wherein the target attribute is used for representing that the execution of a page miss flow is triggered when the first data to be transmitted is accessed before the first data to be transmitted is not ready; if yes, and under the condition that the execution times of the page miss flow are lower than a first preset frequency, determining that the m first IPC requests can be executed in parallel with the computation on the first application.
  15. 15. The apparatus of claim 14, wherein the m first IPC requests do not satisfy a first preset condition comprises: and the execution times of the page miss flow reach the first preset frequency.
  16. 16. The apparatus of any of claims 12-15, wherein the second IPC policy comprises at least a second sub-policy comprising: And the serial execution strategy is used for representing that the calculation on the n second IPC requests and the first application is serial execution mode.
  17. 17. The device according to any of the claims 12-16, characterized in that the first IPC policy further comprises a third sub-policy, the determining module being in particular further adapted to: Registering the m first IPC requests in a preset event table to obtain m registration events, wherein one first IPC request corresponds to one registration event; And under the condition that the target registration event is determined to be capable of performing page master transfer, determining the third sub-policy as a physical page mapping policy, wherein the target registration event is one of the m registration events, the owner transfer is performed by transferring physical pages belonging to a first process to a second process, and the physical page mapping policy is used for representing a virtual address space for mapping the physical pages belonging to the first process to the second process.
  18. 18. The apparatus of claim 17, the determining module being further specifically configured to: Judging whether the address of target first data to be transmitted corresponding to the target registration event is aligned according to pages, wherein the target first data to be transmitted is one of the m first data to be transmitted; If yes, determining that the target registration event can be transferred to the owner.
  19. 19. The apparatus of any one of claims 17-18, wherein the adjustment module is further configured to: And deleting the target registration event from the event table under the condition that the execution of 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.
  20. 20. The apparatus of claim 19, wherein the adjustment module is further configured to: After deleting the target registration event from the event table, deleting the target attribute in the page table of the target first data to be transmitted under the condition that the target attribute exists in the page table of the target first data to be transmitted.

Description

Data processing method and computer equipment Technical Field The present application relates to the field of interprocess communication (Inter Process Communication, IPC), and more particularly to a method of data processing and a computer device. Background The entities of the resources on the operating system are processes, typically one process represents an application, and inter-process data is isolated. And inter-process communication breaks this isolation to complete inter-application collaboration. Inter-process communication, IPC for short. Application scenarios of IPC are widely available and include, but are not limited to, high value scenarios such as databases, network function virtualization (Network Functions Virtualization, NFV), high performance computing (Network Functions Virtualization, HPC), yun Yuansheng, etc. The scheme cost of the existing IPC is high, and two groups of experiments are used for illustrating that the cost of a and the IPC accounts for 32 percent in a remote dictionary service (Remote Dictionary Server, redis), so that the IPC is a key performance bottleneck of the Redis. b. The data transmission overhead accounts for 6% -67% of the IPC, and the overhead increases with the increase of the message data quantity, which indicates that the data transmission is the main overhead of the IPC. The existing IPC strategies have a plurality of strategies, such as 1, data transmission in a copying mode, 2, data transmission in a zero-copying mode, 3, IPC in a synchronous mode, 4, IPC in an asynchronous mode, 5, IPC in a batch processing mode and the like. The IPC policies required for different applications may be different, whereas the IPC policies of the prior art solutions are a combination of one or more of the above policies, but cannot be modified once the policies are selected. It cannot dynamically adjust and select the optimal strategy according to the running characteristics of the application. Disclosure of Invention The application provides a data processing method and computer equipment, which are used for obtaining the most suitable IPC strategy through strategy selection for each IPC request transmitted by an application, judging whether the current IPC strategy is suitable for the current situation (namely judging whether a first preset condition is met) or not by monitoring the workload of the IPC request, and realizing the function of dynamically adjusting the IPC strategy in real time. Based on the above, the embodiment of the application provides the following technical scheme: In a first aspect, the present application provides a method for processing data, where the method specifically includes first obtaining a first IPC request transmitted by a first application, where the first IPC request may be a sending data or a receiving data, and the application is not limited to this. The first IPC request may be one or more, and the application is not limited thereto, where the first IPC request is any one of a plurality of applications in a user state. And then, determining a first IPC policy, and transmitting m first data to be transmitted corresponding to the m first IPC requests (one first IPC request corresponds to one first data to be transmitted) based on the first IPC policy, wherein the IPC policy is used for representing a transmission mode adopted by the data to be transmitted corresponding to the IPC requests. If the m first IPC requests do not meet the first preset condition, the first IPC policy is adjusted to be a second IPC policy, and n second data to be transmitted corresponding to the n second IPC requests are transmitted based on the second IPC policy, wherein the n second IPC requests are the new IPC requests generated by the first application after the fact that the first preset condition is not met is determined, one second IPC request corresponds to one second data to be transmitted, and n is more than or equal to 1. In the above embodiment of the present application, for each IPC request transferred by an application, the most suitable IPC policy is obtained through policy selection, and whether the current IPC policy is suitable for the current situation (i.e. whether the first preset condition is met) is judged by monitoring the workload of the IPC request, so as to realize the function of dynamically adjusting the IPC policy in real time. In a possible implementation manner of the first aspect, the first IPC policy may be one IPC policy, or may be a combination of multiple IPC policies (in this case, the multiple IPC policies may be referred to as sub-policies), which is not limited by the present application. In particular, the first IPC policy includes at least a first sub-policy, in which case, one implementation manner of determining the first IPC policy may be to determine whether the m first IPC requests may be executed in parallel with the computation on the first application (except for the IPC task and other tasks within the ap