Data processing methods, computer system, storage medium and program product

By building a shared memory area between kernel state and user state and performing dynamic memory mapping, the problem of low data access efficiency between user state service programs is solved, and data zero copy and high-speed data transmission are achieved.

WO2025202745A1PCT designated stage Publication Date: 2025-10-02CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD

Patent Information

Application Number
PCT/IB2025/051583
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-28
Filing Date
2025-02-14
Publication Date
2025-10-02

AI Technical Summary

Technical Problem

In a computer system, when service programs running in user mode access data, they need to copy the data to kernel mode through system calls, resulting in a large number of data copy operations, affecting data processing efficiency.

Method used

By building a shared memory area between kernel state and user state, including a service data storage area and a control command storage area, dynamic memory mapping is used to achieve data zero copy, separate the control link and data link, and improve data transmission efficiency.

Benefits of technology

It achieves high-speed data transmission between user state and kernel state, reduces data copy operations, improves data processing efficiency and saves system resources and memory bandwidth.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure IB2025051583_02102025_PF_FP_ABST
    Figure IB2025051583_02102025_PF_FP_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure provide data processing methods, a computer system, a computer-readable storage medium and a computer program product. A data processing method comprises: acquiring a first control command transmitted by a second service program, and determining a physical address region; applying for a virtual address region from a second virtual address space to which a service data storage region is mapped, and on the basis of the virtual address region, generating a second control command; and establishing a mapping relationship between the virtual address region and the physical address region for a first service program to access the physical address region on the basis of the virtual address region in the second control command acquired from a control command storage region. The technical solution provided in the embodiments of the present disclosure realizes high-speed data transmission between service programs.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Data Processing Method, Computer System, Storage Medium, and Program Product This disclosure claims priority to Chinese patent application number 202410375097.8, filed with the China Patent Office on March 28, 2024, entitled "Data Processing Method, Computer System, Storage Medium, and Program Product," the entire contents of which are incorporated herein by reference. Technical Field: Embodiments of the present disclosure relate to the field of computer technology, and more particularly to a data processing method, computer system, storage medium, and program product. Background: In a computer system, multiple service programs running in user mode often require data access, such as an application service transferring data to a storage service for data storage. Data access between service programs often requires kernel involvement. For example, when an application service transfers data to a storage service, the application service must copy the data to the kernel service through a system call, and the kernel service then copies the data to the storage service. This results in a large number of data copy operations during the data access process, thereby affecting data processing efficiency. SUMMARY OF THE INVENTION Embodiments of the present disclosure provide a data processing method, a computer system, a storage medium, and a program product to address the technical problem of low data processing efficiency in the prior art. In a first aspect, embodiments of the present disclosure provide a data processing method for a kernel program running in kernel mode. A shared memory area is established between the kernel program and a first service program running in user mode. The shared memory area includes a service data storage area and a control command storage area. The control command storage area corresponds to physical memory allocated by the kernel program and is mapped to a first virtual address space of the first service program. The method comprises: obtaining a first control command transmitted by the second service program and determining a physical address area; requesting a virtual address area from a second virtual address space mapped to the service data storage area and generating a second control command based on the virtual address area; storing the second control command in the control command storage area; and establishing a mapping relationship between the virtual address area and the physical address area, so that the first service program can access the physical address area based on the virtual address area in the second control command obtained from the control command storage area.In a second aspect, an embodiment of the present disclosure provides a data processing method, which is applied to a first service program running in user mode; a shared memory area is constructed between the first server program and the kernel program; the shared memory area includes a service data storage area and a control command storage area, the control command storage area corresponds to the physical memory allocated by the kernel program and is mapped to the first virtual address space of the first service program, and the service data storage area is mapped to the second virtual address space of the first service program, the method comprising: based on the first virtual address space, accessing the control command storage area to obtain a second control command; the second control command is generated by the kernel program obtaining the first control command passed by the second service program, determining a physical address area, and applying for a virtual address area from the second virtual address space mapped to the service data storage area, based on the virtual address area; determining the virtual address area in the second control command; performing an access operation based on the virtual address area to access the physical address area based on the mapping relationship. In a third aspect, an embodiment of the present disclosure provides a data processing method, which is applied to a second service program running in user mode; the virtual memory corresponding to the second service program includes a command cache area and a data cache area; the method includes: determining the data cache area; based on the data cache area, sending a first control command for the first service program to the kernel program; wherein a shared memory area is constructed between the first server program and the kernel program; the shared memory area includes a service data storage area and a control command storage area, the control command storage area corresponds to the physical memory allocated by the kernel program and is mapped to the first virtual address space of the first service program; the first control command is used to determine the physical address area corresponding to the data cache area, and the physical address area is used to establish a mapping relationship with the virtual address area applied for in the second virtual address space mapped from the service data storage area; the second virtual address space is used to generate a second control command and store it in the command cache area, so that the first service program can obtain it and initiate an access operation based on the second virtual address space.In a fourth aspect, an embodiment of the present disclosure provides a data processing device, which is applied to a kernel program running in kernel mode, wherein a shared memory area is constructed between the kernel program and a first service program running in user mode, the shared memory area including a service data storage area and a control command storage area, the control command storage area corresponds to the physical memory allocated by the kernel program and is mapped to the first virtual address space of the first service program, and the service data storage area is mapped to the second virtual address space of the first service program, and the device includes: a first acquisition module, which is used to obtain the first control command passed by the second service program and determine the physical address area; an address application module, which is used to apply for a virtual address area from the second virtual address space mapped by the service data storage area, and generate a second control command based on the virtual address area; a command storage module, which is used to store the second control command in the control command storage area; and a relationship establishment module, which is used to establish a mapping relationship between the virtual address area and the physical address area, so that the first service program can access the physical address area based on the virtual address area in the second control command obtained from the control command storage area. In a fifth aspect, an embodiment of the present disclosure provides a data processing device, which is applied to a first service program running in user mode; a shared memory area is constructed between the first server program and the kernel program; the shared memory area includes a service data storage area and a control command storage area, the control command storage area corresponds to the physical memory allocated by the kernel program and is mapped to the first virtual address space of the first service program, and the device includes: a first access module, which is used to access the control command storage area based on the first virtual address space to obtain a second control command; the second control command is generated by the kernel program obtaining the first control command passed by the second service program, determining the physical address area, and applying for a virtual address area from the second virtual address space mapped to the service data storage area; a first determination module, which is used to determine the virtual address area in the second control command; and a second access module, which is used to perform an access operation based on the virtual address area to access the physical address area based on the mapping relationship.In a sixth aspect, an embodiment of the present disclosure provides a data processing device, which is applied to a second service program running in user mode; the virtual memory corresponding to the second service program includes a command cache area and a data cache area; the device includes: a second determination module, which is used to determine the data cache area; a command sending module, which is used to send a first control command for the first service program to the kernel program based on the data cache area; wherein a shared memory area is constructed between the first server program and the kernel program; the shared memory area includes a service data storage area and a control command storage area, and the control command storage area corresponds to the physical memory allocated by the kernel program and is mapped to the first virtual address space of the first service program; the first control command is used to determine the physical address area corresponding to the data cache area, and the physical address area is used to establish a mapping relationship with the virtual address area applied for in the second virtual address space mapped from the service data storage area; the second virtual address space is used to generate a second control command and store it in the command cache area, so that the first service program can obtain it and initiate an access operation based on the second virtual address space. In a seventh aspect, embodiments of the present disclosure provide a computer system comprising a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are configured to be invoked and executed by the processing component to execute a kernel program in kernel mode to implement the data processing method described in the first aspect; and to execute a service program in user mode to implement the data processing methods described in the second and third aspects. In an eighth aspect, embodiments of the present disclosure provide a computer-readable storage medium storing a computer program. When executed by the processing component, the computer program implements the data processing method described in the first aspect, the data processing method described in the second aspect, or the data processing method described in the third aspect. In a ninth aspect, embodiments of the present disclosure provide a computer program product comprising a computer program / instructions. When executed by the processing component, the computer program / instructions implements the data processing method described in the first aspect, the data processing method described in the second aspect, or the data processing method described in the third aspect.In an embodiment of the present disclosure, a shared memory area is established between the kernel program and the first service program. This shared memory area includes a service data storage area and a control command storage area. The control command storage area corresponds to physical memory allocated by the kernel program and is mapped to the first virtual address space of the first service program. The second service program only needs to transmit the first control command. Based on the physical address area carried by the first control command, it can request a virtual address area from the second virtual address space mapped from the service data storage area. It then generates a second control command based on the virtual address area and stores the second control command in the control command storage area. The kernel program can also establish a mapping relationship between virtual address areas and physical address areas. The first service program can then obtain the second control command from the control command storage area and initiate an access operation based on the virtual address area in the second control command, thereby enabling the first service program to access the physical address area. In this embodiment of the present disclosure, through shared memory and dynamic memory mapping, zero-copy data is achieved between the first and second service programs. By separating the control link from the data link, high-speed data transmission is achieved between the first and second service programs. These and other aspects of the present disclosure will be more concisely understood in the following description of the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS To more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. It should be apparent that the drawings described below represent some embodiments of the present disclosure. Persons skilled in the art can also derive other drawings based on these drawings without inventive effort. FIG1 illustrates a schematic diagram of data interaction provided by the present disclosure; FIG2 illustrates a flow chart of an embodiment of a data processing method provided by an embodiment of the present disclosure; FIG3 illustrates a flow chart of an embodiment of a data processing method provided by another embodiment of the present disclosure; FIG4 illustrates a flow chart of an embodiment of a data processing method provided by another embodiment of the present disclosure; FIG5 illustrates a schematic diagram of data interaction within a computer system in an actual application of the present disclosure; FIG6 illustrates a schematic diagram of the structure of a shared memory region in an actual application of the present disclosure; FIG7 illustrates a structural diagram of a data processing device provided by an embodiment of the present disclosure; FIG8 illustrates a structural diagram of a data processing device provided by an embodiment of the present disclosure; FIG9 illustrates a structural diagram of a data processing device provided by an embodiment of the present disclosure; and FIG10 illustrates a structural diagram of a computer system provided by an embodiment of the present disclosure.DETAILED DESCRIPTION To help those skilled in the art better understand the disclosed solutions, the following will provide a clear and complete description of the technical solutions in the disclosed embodiments, with reference to the accompanying drawings. Some of the processes described in the specification and claims of this disclosure, as well as in the accompanying drawings, include multiple operations that appear in a specific order. However, it should be understood that these operations may be executed out of the order in which they appear herein or in parallel. Operation numbers, such as 101 and 102, are merely used to distinguish between different operations and do not represent any specific order of execution. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that terms such as "first" and "second" are used herein to distinguish between different messages, devices, modules, and the like, and do not imply a sequential order or limit "first" and "second" to different types. To facilitate understanding of the technical solutions of this disclosure, the following explains the technical terms that may be used in this disclosure: Kernel: This refers to the core (kernel) of the operating system. It provides the most basic functions of the operating system and is the foundation of the operating system. It can access all hardware devices, such as network cards and memory devices, and some special high-privilege system programs. Service: This refers to low-privilege applications or system programs that have limited access to a portion of memory space and no access to hardware devices. Service programs may include storage services that provide persistent storage with external storage devices, as well as network services, application services, multimedia services, and file synchronization services. Kernel Mode: This is an operating mode of the operating system, the operating state of the operating system's kernel program, and has the highest privilege level. In kernel mode, the kernel program can access and control all system resources, including the CPU (processor), memory, external devices, and all other hardware resources. The kernel program is responsible for performing core functions such as process scheduling, memory management, device drivers, and system call services. User Mode: This is an operating mode in the operating system and the default state for service programs. It has limited privilege levels. In User Mode, service programs cannot directly access system resources and can only request kernel services through system calls. Access to memory and hardware resources is strictly restricted to prevent system crashes caused by erroneous operations or malicious behavior. For example, when a service program needs to perform I / O (Input / Output) operations, the kernel program must be involved. In the disclosed embodiments, data transfer between service programs involves I / O operations.When an interrupt event (such as a hardware interrupt or software exception) occurs, the CPU automatically switches from user mode to kernel mode so that the kernel program can handle the interrupt. A system call is an interface provided by the kernel program to service programs. Service programs that need to perform operations involving underlying hardware, such as reading or writing data, creating processes, or performing network communications, must transition to kernel mode through a system call. System calls allow service programs to request kernel services under strict rules without directly manipulating hardware. System calls serve as a bridge for interaction between user and kernel modes and are a key mechanism for resource sharing, permission control, and system service invocation between service programs and the operating system kernel. A process is the fundamental unit of resource allocation and management in the operating system. It is an instance of a running program. When a program is executed, the operating system creates a process, allocates resources to the process, and executes it according to the program's instruction sequence. Simply put, a process can be considered a single execution of a program. A program can be run multiple times, each generating a separate process. A process contains various information, including program code, data, stack, heap, open file descriptors, and more. Each process has its own memory space and independent execution context. In the disclosed embodiments, a running program is also referred to as a process. Physical memory, also known as main memory, is the temporary storage component in a computer system used to store executing programs and their data. The size of physical memory directly impacts the system's ability to run multiple programs simultaneously. Virtual memory is a memory management technology that allows each process to have an independent address space that is significantly larger than the actual physical memory capacity. By temporarily saving part of a process's address space to disk (typically a swap file or page file) and loading it into physical memory when needed, virtual memory can effectively expand the number and size of executable programs. Virtual address space: A virtual address space is a memory abstraction unique to each process. It is a logically contiguous address range allocated to each process by the operating system. Operating systems use virtual memory management techniques such as paging, segmentation, swapping, and memory mapping to map and manage virtual address space to physical memory. This not only isolates processes but also allows processes to access memory resources that exceed the actual physical memory size. Virtual Pages: The virtual address space is divided into fixed-size blocks, called virtual pages. Each virtual page can be mapped to a physical page in physical memory or temporarily unmapped. The virtual address region described in the embodiments of this disclosure may refer to a virtual page.Physical Page: Physical memory is also divided into pages of equal size. Physical pages are real hardware storage units. After a virtual address is translated, the contents of the corresponding virtual page are read from or written to the physical page. The physical address region described in the embodiments of this disclosure may refer to a physical page. Memory mapping: This refers to associating physical memory with a process's virtual address space, allowing the process to access physical memory through memory access. Memory sharing: This allows multiple processes to access the same physical address region, thereby achieving data sharing. A page fault: This is a special type of interrupt triggered by hardware detection when a process accesses a virtual memory page that has not yet been mapped to physical memory during computer system execution. This interrupt suspends the normal execution of the current service program and notifies the kernel program to proceed. External devices: These are devices other than the host computer in a computer system, including input devices (such as keyboards and mice), output devices (such as monitors and printers), and external storage devices (such as hard drives, floppy disks, and optical disks). External devices can be divided into character devices, block devices, network communication devices and other device types according to their working methods.

[0002] Ring Buffer: A data structure characterized by being connected end to end, forming a ring. Because data access between service programs often requires kernel involvement, traditional methods require numerous data copy operations. Figure 1 illustrates data exchange, taking data transfer from second service program 101 to first service program 102 as an example. Second service program 101 and first service program 102 are in user mode, while kernel program 103 is in kernel mode. During data transfer, second service program 101 copies data from its memory to kernel program 103's memory. Kernel program 103 then copies the data from its memory to second service program 102's memory, completing the data transfer between second service program 101 and first service program 103. This process involves numerous data copy operations, impacting data processing efficiency. During the implementation of the disclosed concepts, the inventors discovered that the kernel program typically does not process data from the source service program until it copies it to the destination service program. Instead, it performs operations such as interface conversion and protocol conversion. This large amount of data copying required to achieve these operations not only affects data processing efficiency but also system performance. To address this issue, the inventors analyzed the aforementioned process and found that the content copied from the second service program to the kernel program includes control commands and data. The kernel program primarily performs protocol conversion and interface conversion on the control commands sent by the source program, rather than processing the data. Therefore, the content copied by the second service program can be divided into two categories: control links and command links. Control commands, due to their small size, can be transmitted via copy. Regarding data links, it is unclear whether zero-copy transmission is feasible. To this end, the inventors, after a series of studies, have proposed the technical solutions of the embodiments of the present disclosure. In the embodiments of the present disclosure, through a shared memory approach and dynamic memory mapping, the physical memory of the 10 operation is dynamically mapped to a designated virtual address area, achieving zero-copy data between the first service program and the second service program. By separating the control link from the data link, high-speed data transmission between the first service program and the second service program is achieved. It should be noted that the embodiments of the present disclosure may involve the use of user data. In actual applications, user-specific personal data may be used in the solutions described herein within the scope permitted by applicable laws and regulations of the country in which the application is located (for example, with the user's explicit consent, effective notification to the user, etc.).It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, storage, and display) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. The collection, use, and processing of the relevant data must comply with the relevant laws, regulations, and standards of the relevant region, and corresponding operation portals are provided for the user to choose to authorize or reject. The following will clearly and completely describe the technical solutions in the embodiments of this disclosure in conjunction with the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of this disclosure, and not all of them. All other embodiments derived by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure. Figure 2 is a flowchart of one embodiment of a data processing method provided in the embodiments of this disclosure. The technical solutions of this embodiment can be executed by a kernel program in a computer system. In one implementation, kernel state and user state can refer to the kernel state and user state of a virtual machine created by the computer system. Of course, kernel state and user state can also refer to the kernel state and user state provided by the physical host of the computer system. The technical solutions of the embodiments of the present disclosure are applied in cloud computing scenarios. A computer system is a hardware device provided by a cloud computing provider. The created virtual machine can function as a cloud server, for example. The virtual machine can run one or more service programs for performing various processing operations. These service programs may also include cloud applications. The kernel program runs in kernel mode, while the service programs run in user mode. In the embodiments of the present disclosure, a shared memory area is established between the kernel program and a first service program. This shared memory area includes a service data storage area and a control command storage area. The control command storage area corresponds to physical memory allocated by the kernel program and is mapped to the first virtual address space of the first service program. The service data storage area is mapped to the second virtual address space of the first service program. The shared memory area can be pre-established. The data processing method of the embodiment shown in FIG2 may include the following steps:

[0003] 201: Obtain a first control command transmitted by a second service program and determine a physical address region. The first control command may be used to instruct a data processing operation, such as data storage or data reading. In an actual application of the present disclosure, the first service program may be implemented as a storage service, and the second service program may be implemented as, for example, a network service, an application service, a multimedia service, a file synchronization service, or the like. Control commands instructing data storage are used to implement persistent data storage using the first service program; control commands instructing data reading are used to obtain required data using the first service program. Depending on the service type, the data referred to herein may refer to, for example, file data, log data, configuration data, or sensor data, and this disclosure does not limit this. After the second service program is started, the kernel allocates a virtual address space for it and maps it to the corresponding physical memory. In the second service program, the virtual memory corresponding to the virtual address space may be divided into a command cache region and a data cache region, each corresponding to a different virtual address region. The command cache region stores control commands, and the data cache region stores actual data. The first control command may carry the physical address region mapped from the virtual address region allocated to the data cache region. Alternatively, the first control command may carry the virtual address region allocated to the data cache region, with the kernel determining the physical address region mapped from the virtual address region. In practical applications, the virtual address region described herein may refer to a virtual page corresponding to a virtual address range, and the physical address region may refer to a physical page corresponding to a physical address range.

[0004] 202: Apply for a virtual address area from the second virtual address space mapped from the service data storage area, and generate a second control command based on the virtual address area. The second control command may be stored in the control command storage area.

[0005] 203: Establish a mapping relationship between the virtual address region and the physical address region, allowing the first service program to access the physical address region based on the virtual address region in the second control command obtained from the control command storage region. The second virtual address space mapped to the service data storage region can be divided into multiple virtual address regions, i.e., multiple virtual pages. In response to the first control command, the kernel program can request an idle virtual address region from the second virtual address space for the first service program. The kernel program can then generate a second control command based on the virtual address region. The virtual address region can replace the physical address region in the first control command. Furthermore, based on actual needs, the first control command can be subjected to corresponding interface conversion and / or protocol conversion to generate the second control command. After generating the second control command, the kernel program can store the second control command in the control command storage region. Since the control command storage region is in a shared memory area between the kernel program and the first service program, the first service program can access the control command storage region based on the first virtual address space. Thus, the first service program can obtain the second control command by accessing the control command storage region and read the virtual address region in the second control command. A mapping relationship can be established between the virtual address region and the physical address region, thereby achieving mapping from virtual memory to physical memory. By establishing a mapping relationship between the virtual address and physical address regions, when the first service program accesses the virtual address region, it can find the corresponding physical address region based on the mapping relationship. This physical address region is then mapped to the data cache region of the second service program, ultimately enabling access to the data in the data cache region. Data in the data cache region does not need to be copied, thus achieving zero-copy data access, improving data access and processing efficiency. It should be noted that when the service data storage region is mapped to the second virtual address space, the kernel program does not allocate physical memory for the service data storage region. Instead, it dynamically performs memory mapping during data processing, establishing a mapping relationship between the virtual address region requested for the first control command and the physical address region. In the above process, the first control command can be transmitted from the second service program to the kernel program, and then from the kernel program to the first service program, using a data copy method, thereby forming a control link. However, the data to be transmitted is separated from the control link and does not need to be transmitted from the second service program to the kernel program and then to the first service program, or from the first service program to the kernel program and then to the second service program. This achieves zero data copy, thereby reducing data processing time, improving data processing efficiency, and saving system resources and memory bandwidth.In the disclosed embodiment, a shared memory area is established between the kernel program and the first service program. This shared memory area includes a service data storage area and a control command storage area. The control command storage area corresponds to physical memory allocated by the kernel program and is mapped to the first virtual address space of the first service program. The second service program only needs to transmit the first control command. Based on the physical address area carried by the first control command, it can request a virtual address area from the second virtual address space mapped from the service data storage area. It then generates a second control command based on the virtual address area and stores the second control command in the control command storage area. The kernel program also establishes a mapping relationship between the virtual address area and the physical address area. The first service program can then obtain the second control command from the control command storage area and initiate an access operation based on the virtual address area in the second control command, thereby enabling the first service program to access the physical address area. In the disclosed embodiment, through shared memory and dynamic memory mapping, zero-copy data is achieved between the first and second service programs. By separating the control link from the data link, high-speed data transmission between the first and second service programs is achieved. Because virtual address regions are dynamically mapped to physical address regions in the disclosed embodiments, it is possible that when the first service program initiates an access operation based on the virtual address region, the virtual address region is not mapped to the physical address region. In this case, a page fault interrupt will be generated, resulting in access failure. Therefore, in some embodiments, establishing a mapping relationship between the virtual address region and the physical address region may include: establishing a mapping relationship between the virtual address region and the physical address region in response to a page fault interrupt. In other words, the kernel program may establish the mapping relationship between the virtual address region and the physical address region while processing a page fault interrupt. A page fault interrupt is a special type of interrupt triggered by hardware when a process accesses a virtual memory page that has not yet been mapped to physical memory during execution of a computer system. This interrupt suspends the normal execution of the current service program and notifies the kernel program to proceed. After a page fault interrupt, the access operation of the first service program will be suspended. Therefore, in some embodiments, after the kernel program establishes a mapping relationship between the virtual address area and the physical address area in response to the page fault interrupt, the method may further include: sending a recovery instruction to the first service program, so that the first service program responds to the recovery instruction and implements access to the physical address area based on the mapping relationship.After establishing a mapping relationship between the virtual address region and the physical address region, the first service program can access the physical address region based on the generated mapping relationship. In this case, the kernel program can send a resume instruction to the first service program, which can be used to resume the access process previously suspended by the kernel program. The first service program can respond to the resume instruction and continue the access operation. In some embodiments, after requesting a virtual address region from the second virtual address space mapped to the service data storage region, the method can further include: saving a first correspondence between the virtual address region and the physical address region. In some embodiments, establishing a mapping relationship between the virtual address region and the physical address region can be specifically implemented by: searching the first correspondence based on the virtual address region to determine the physical address region; and establishing a mapping relationship between the virtual address region and the physical address region. After requesting a virtual address region from the second virtual address space, the first correspondence between the virtual address region and the physical address region can be saved to maintain the correspondence between the virtual address region and the physical address region. The mapping relationship between the virtual address region and the physical address region can be established after the kernel program stores the second control command in the control command storage region and the first service program initiates an access operation to the shared memory region based on the virtual address region obtained from the second control command. In some embodiments, the data processing method may further include: saving a second mapping relationship between the virtual address region and the physical address region. The second mapping relationship may be the same as the first mapping relationship described above, but is not limited thereto. The second mapping relationship may also be saved after the mapping relationship between the virtual address region and the physical address region is established. In some embodiments, requesting a virtual address region from the second virtual address space mapped to the service data storage region and generating the second control command based on the virtual address region includes: searching the second mapping relationship to determine whether a virtual address region is mapped to the physical address region; if no virtual address region is mapped to the physical address region, requesting a virtual address region from the second virtual address space mapped to the service data storage region and generating the second control command based on the virtual address region; and if a virtual address region is mapped to the physical address region, generating the second control command based on the found virtual address region. In actual application, for some physical address areas, mapping relationships with virtual address areas may have been created before, and the kernel program can save these mapping relationships, for example, as second corresponding relationships.To avoid frequent page faults and further ensure data processing efficiency, after receiving the first control command, the kernel program can first search the second mapping relationship to determine whether a corresponding virtual address region exists for the physical address region. If a corresponding virtual address region already exists for the physical address region, the mapping relationship can be directly reused without re-applying for a corresponding virtual address region for the physical address region. Consequently, when the first service program initiates an access operation based on the virtual address region, the access is successful because the virtual address region is mapped to a physical address region, and no page fault interrupt is generated, thereby reducing page fault interrupts. If the second mapping relationship determines that no virtual address region is mapped to the physical address region, the step of applying for a virtual address region for the physical address region can be continued. Furthermore, to efficiently manage the correspondence between virtual and physical address regions, the correspondence between virtual and physical address regions can be stored as a radix tree. A radix tree is a multi-branch tree, where each node contains a prefix and several child nodes. When constructing the mapping relationship between virtual addresses and physical addresses, tree nodes can be established level by level according to the bits of the virtual address until the leaf node stores the corresponding physical address. In some embodiments, storing the first correspondence between virtual address regions and physical address regions can be specifically implemented by constructing a first radix tree using the virtual address region as a key and the corresponding physical address region as a value. In some embodiments, storing the second correspondence between virtual address regions and physical address regions can be specifically implemented by constructing a second radix tree using the physical address region as a key and the corresponding virtual address region as a value. Different methods can be used to construct radix trees for different application scenarios. For example, in a scenario where a virtual address region needs to be searched for its corresponding physical address region, a first radix tree can be constructed using the virtual address region as a key and the corresponding physical address region as a value. For example, in a scenario where a physical address region needs to be searched for its corresponding virtual address region, a second radix tree can be constructed using the physical address region as a key and the corresponding virtual address region as a value. In the above embodiment, the first correspondence relationship and the second correspondence relationship may be stored in the form of a radix tree. This radix tree allows for fast querying, further improving data processing efficiency. Of course, the storage structure for the first correspondence relationship and the second correspondence relationship is not limited to a radix tree; other tree formats, such as a binary tree, may also be used. Before applying for a virtual address region for a physical address region, a second radix tree may be searched based on the physical address region to determine whether a virtual address region corresponding to the physical address region exists in the second radix tree.Because the second virtual address space can only be divided into a limited number of virtual address regions, after multiple virtual address region-to-physical address region mappings, the virtual address regions may be exhausted, meaning that all virtual address regions are mapped to corresponding physical address regions. In this case, a removal mechanism may be established to release virtual address region resources. Therefore, in some embodiments, the method may further include: removing the mapping relationships corresponding to virtual address regions in the second virtual address space that meet release conditions. In one possible implementation, virtual address regions may be released based on the time at which the mapping relationships were established. For example, the release condition may be that the establishment time is earlier than a preset time; in this case, mapping relationships established earlier than the preset time may be unmapped, thereby releasing the virtual address regions in those mapping relationships. For another example, the release condition may be that the establishment time is earliest; in this case, the mapping relationship with the earliest establishment time among multiple mapping relationships may be unmapped. Furthermore, the release condition may be determined based on access frequency; for example, the release condition may be that the access frequency is lower than a preset frequency. Requesting a virtual address area from the second virtual address space mapped from the service data storage area may include determining whether there is a free virtual address area in the second virtual address space. If a free virtual address area is randomly requested, if not, unmapping the corresponding virtual address area in the second virtual address space that meets the release condition. In some embodiments, to facilitate command acquisition, the control command storage area may include a command area and a description area. The command area may be implemented as a ring buffer, storing the second control command in a circular queue, and the description area storing the write pointer and read pointer of the command area. A ring buffer is a commonly used data structure consisting of a continuous memory area connected at both ends to form a closed loop. New data can be written from one end and read from the other end. When writing completes the loop, the loop returns to the starting point and continues writing, forming a loop. The write pointer can be updated by the kernel program, and the read pointer can be updated by the first service program. After generating the second control command, the second control command can be stored in the control command storage area. Storing the second control command in the control command storage area may include: writing the second control command into the command area according to a write pointer and a read pointer, and updating the write pointer in the description area. The read pointer is updated after the first service program obtains the second control command from the command area. The write pointer (also called the head pointer) is used to track the location of the next data to be written and indicates the offset of the current write location relative to the starting address of the ring buffer. Each time the kernel program writes a second control command, the write pointer increments.The read pointer (also called the tail pointer) tracks the location of the next data to be read and represents the offset of the current read position relative to the starting address of the ring buffer. Each time the first service program reads a second control command, the read pointer increments. Whether the write pointer and the read pointer are identical can be used to determine whether there are any unread second control commands in the command area. Therefore, the kernel program can write the second control command when the write pointer and the read pointer are identical, that is, when the command area is empty. If the write pointer and the read pointer are different, the first service program can read the second control command from the command area and update the read pointer until the write pointer and the read pointer are identical. In one possible implementation, the first service program can poll the description area to determine whether there are any second control commands to process. In another possible implementation, after the kernel program has filled the command area with the second control command and added the write pointer to the description area, it can send a notification message to the first service program to notify it to retrieve the second control command. In some embodiments, to ensure accurate transmission of control commands, obtaining the first control command transmitted by the second service program can be specifically implemented by obtaining the first control command copied by the second service program via a system call. As described above, the control command can be transmitted from the second service program to the kernel program, and then from the kernel program to the first service program, thereby forming a control link. During control command transmission, a system call can be used to copy the control command from the second service program to the kernel program, and then from the kernel program to the first service program. Because the data size of control commands is typically small, transmitting control commands via copying does not introduce significant overhead or consume system resources. In some embodiments, the data processing method may further include: establishing a shared memory region; allocating a first virtual address space to the control command storage region and a second virtual address space to the data storage partition from the virtual address space corresponding to the first service program; allocating physical memory to the control command storage region and establishing a mapping relationship between the physical memory and the first virtual address space; and feeding the first virtual address space and the second virtual address space back to the first service program, so that the first service program can access the control command storage region based on the first virtual address space. The shared memory region may be created based on, but is not limited to, a sharing request from the first service program. Creation may also be proactively triggered by a kernel program. For example, the kernel program may create the shared memory region upon receiving a first control command sent by the second service program to the first service program. After the shared memory region is created, a shared memory identifier may be generated for the shared memory region. The shared memory identifier may be used to uniquely identify the shared memory region.The kernel program can then provide the first service program with a corresponding shared memory identifier. The kernel program can also release the shared memory area. For example, the kernel program can release the shared memory area when the first service program terminates. The first service program can send a mapping request to the kernel program via a system call, causing the kernel program to allocate a first virtual address space for the control command storage area and a second virtual address space for the data storage partition from the virtual address space corresponding to the first service program. The kernel program then allocates physical memory for the control command storage area, establishes a mapping relationship between the physical memory and the first virtual address space, and provides the first and second virtual address spaces to the first service program, allowing the first service program to access the control command storage area based on the first virtual address space. Figure 3 is a flowchart of an embodiment of a data processing method provided by another embodiment of the present disclosure. This data processing method can be applied to a first service program running in user mode. A shared memory area is established between the first server program and the kernel program. The shared memory area includes a service data storage area and a control command storage area. The control command storage area corresponds to physical memory allocated by the kernel program and is mapped to the first virtual address space of the first service program. The service data storage area is mapped to the second virtual address space of the first service program. The data processing method of the embodiment shown in FIG3 may include the following steps.

[0006] 301: Based on the first virtual address space, access the control command storage area to obtain a second control command; the second control command is generated by the kernel program by obtaining the first control command passed by the second service program, determining the physical address area, and applying for a virtual address area from the second virtual address space mapped to the service data storage area, based on the virtual address area.

[0007] 302: Determine a virtual address area in a second control command;

[0008] 303: Perform an access operation based on the virtual address region to access the physical address region based on the mapping relationship. The second service program may, for example, include a service program that needs to transfer data with the first service program. The first control command may be used to instruct the kernel program to perform a data transfer operation with the first service program. In one embodiment of the present disclosure, the first service program may be implemented as a storage service, and the second service program may be implemented as a network service, application service, multimedia service, file synchronization service, etc. The first control command may be used to request the kernel program to transfer data to the storage service to achieve persistent data storage. The data that needs to be transferred between the first and second service programs may include file data, log data, configuration data, sensor data, etc. The first control command transmitted by the second service program to the kernel program may include a physical address region. This physical address region may be the storage address of the data to be transferred to the first service program. The second service program may inform the kernel program of the physical address range in which the data to be operated is stored by writing the physical address region into the first control command. The virtual address region may refer to a virtual page. The second virtual address space mapped to the service data storage region may be divided into multiple virtual address regions, i.e., multiple virtual pages. In response to the first control command, the kernel program can request one or more virtual pages for the first service program from multiple virtual pages in the second virtual address space. The kernel program can then generate a second control command based on the virtual address region. After generating the second control command, the kernel program can store the second control command in a control command storage region. Because the control command storage region is located in a shared memory area between the kernel program and the first service program, the first service program can access the control command storage region. Thus, the first service program can obtain the second control command by accessing the control command storage region and read the virtual pages contained in the second control command. A mapping relationship can be established between the virtual pages in the second virtual address space and a physical page in physical memory, namely, the physical address region, thereby implementing virtual-to-physical memory mapping. By establishing this mapping relationship between virtual and physical pages, when the service program accesses a virtual page, the operating system can locate the corresponding physical page based on the virtual page, thereby enabling virtual-to-physical page access. Based on this, after the kernel program establishes a mapping relationship between the virtual address area and the physical address area, the first service program can access the physical address area through the virtual address area, thereby reading data stored in the physical address area that needs to be transferred to the first service program.In some embodiments, the control command storage area includes a command area and a description area; the description area is used to store the write pointer and read pointer of the cache buffer area. In some embodiments, accessing the control command storage area to obtain a second control command based on the first virtual address space can be specifically implemented by: accessing the description area and the command area based on the first virtual address space; reading the second control command from the command area based on the read pointer and write pointer of the description area; and updating the read pointer in the description area. The write pointer can be updated by the kernel program, and the read pointer can be updated by the first service program. The second control command can be written to the command area of ​​the control command storage area. Each time the kernel program writes the second control command to the command area, the write pointer of the description area can be updated. The first service program can obtain the second control command from the command area of ​​the control command storage area. Each time the first service program obtains the second control command from the command area, the read pointer of the description area can be updated. If the write pointer and the read pointer differ, the first service program can read the second control command from the command area and update the read pointer until the write pointer and the read pointer are the same. In an actual application, the first service program may be a storage service that provides persistent storage, which can write data to or read data from a persistent storage medium. Figure 4 is a flowchart of an embodiment of a data processing method provided in another embodiment of the present disclosure. This data processing method can be applied to a second service program running in user mode; the virtual memory corresponding to the second service program includes a command cache and a data cache area. The data processing method of the embodiment shown in Figure 4 may include the following steps.

[0009] 401: Determine data cache area;

[0010] 402: Sending a first control command for a first service program to the kernel program based on the data cache area. A shared memory area is established between the first server program and the kernel program. The shared memory area includes a service data storage area and a control command storage area. The control command storage area corresponds to physical memory allocated by the kernel program and is mapped to a first virtual address space of the first service program. The first control command is used to determine a physical address area corresponding to the data cache area. The physical address area is used to establish a mapping relationship with a virtual address area requested from a second virtual address space mapped from the service data storage area. The second virtual address space is used to generate a second control command and store it in the command cache area. The first service program obtains the second control command and initiates an access operation based on the second virtual address space. The second service program may, for example, include a service program that needs to transfer data with the first service program. The first control command may be used to instruct the kernel program to perform a data transfer operation with the first service program. In one embodiment of the present disclosure, the first service program may be implemented as a storage service, and the second service program may be implemented as a network service, an application service, a multimedia service, a file synchronization service, or the like. A first control command can be used to request the kernel program to transfer data to the storage service to achieve persistent data storage. The data to be transferred between the first and second service programs may include file data, log data, configuration data, sensor data, and the like. The first control command transmitted by the second service program to the kernel program may include a physical address region, which may be the storage address of the data to be transferred to the first service program. By writing the physical address region into the first control command, the second service program can inform the kernel program of the physical address range within which the data to be operated is stored. The virtual address region may refer to a virtual page. The second virtual address space mapped to the service data storage area may be divided into multiple virtual address regions, i.e., multiple virtual pages. In response to the first control command, the kernel program may request one or more virtual pages for the first service program from the multiple virtual pages in the second virtual address space. The kernel program may then generate a second control command based on the virtual address region. After generating the second control command, the kernel program may store the second control command in the control command storage area. Because the control command storage area is in the shared memory area between the kernel program and the first service program, the first service program can access the control command storage area. Therefore, the first service program can obtain the second control command by accessing the control command storage area and read the virtual page in the second control command.Virtual pages in the second virtual address space can be mapped to physical pages in physical memory, namely, physical address regions, thereby implementing virtual-to-physical memory mapping. By establishing this mapping relationship between virtual and physical pages, when a service program accesses a virtual page, the operating system can find the corresponding physical page based on the virtual page, enabling virtual-to-physical access. Based on this, once the kernel program establishes a mapping relationship between the virtual and physical address regions, the first service program can access the physical address region through the virtual address region, thereby reading data stored in the physical address region that needs to be transferred to the first service program. For ease of understanding, the following describes the technical solutions of the present embodiment using the example of a storage service as the first service program and an application service as the second service program. Figure 5 shows a schematic diagram of data interaction within a computer system in a practical application of the present embodiment. As shown in Figure 5, application service 501 and storage service 502 are in user mode, while kernel program 503 is in kernel mode. The application service has data access requirements for the storage service, such as data storage or data reading. To enable data access, the kernel program 503 can establish a shared memory area 5031 with the storage service 502. The shared memory area 5031 can be created based on, but not limited to, a sharing request from the storage service 502. The kernel program 503 can also proactively trigger its creation. The shared memory area 5031 can include a command area 5032, a description area 5033, and a service data storage area 5034. The command area can be implemented using a ring cache, but the present disclosure is not limited to this. The description area 5033 is used to store the write pointer and read pointer of the command area 5032. The write pointer can be updated by the kernel program 503, and the read pointer can be updated by the storage service 502. The command area 5032 can be used to store control commands. The second virtual address space mapped to the service data storage area 5034 can be divided into multiple virtual address areas, namely, multiple virtual pages. When application service 501 has an access request, a first control command may be sent from command buffer area 5011 of application service 501 to command buffer area 5035 of kernel program 503. The first control command may carry a physical address area, which may be physical address area 504 corresponding to data buffer area 5012 of application service 501.After receiving the first control command, the kernel program 503 can obtain the physical address area from the first control command. Then, the kernel program 503 can first determine whether there is a virtual address area with a mapping relationship for the physical address area. If so, the corresponding virtual address area can be written into the first control command to generate a second control command, and the second control command can be stored in the command area 5032; if there is no virtual address area with a mapping relationship for the physical address area, then an idle virtual address area can be applied for from multiple virtual address areas of the second virtual address space mapped by the service data storage area 5034, and then the first correspondence between the physical address area and the virtual address area can be saved, and the virtual address area can be written into the first control command to generate a second control command, and the second control command can be stored in the command area.

[0011] 5032. After storing the second control command in command area 5032, storage service 502 can retrieve the second control command and the virtual address area written in the second control command from command area 5032 and initiate data access operations using the virtual address area. In one scenario, where a mapping relationship is established between the virtual address area and the physical address area, first service program 502 can directly access the physical address area based on the virtual address area to retrieve data. In another scenario, where the virtual address area is newly acquired by kernel program 503, kernel program 503 only stores the correspondence between the virtual address area and the physical address area and has not yet established a mapping relationship between the virtual address area and the physical address area, resulting in a page fault interrupt. In response to the page fault interrupt, kernel program 503 can establish a mapping relationship between the virtual address area and the physical address area. Storage service 502 can then access the physical memory area based on the mapping relationship to retrieve data. Figure 6 is a schematic diagram of the structure of a shared memory area in an actual application according to an embodiment of the present disclosure. As shown in Figure 6, the shared memory area includes a description area, a command area, and a service data storage area. For convenient storage, the command area can store multiple command lines. Each command line can use an IO vector to describe the corresponding service data storage area. The data address of the IO vector can be used to point to an offset address in the service data storage area, that is, a virtual address area. Thus, the first service program can directly read data by accessing the offset address. The service data storage area can be composed of multiple virtual address areas, that is, virtual pages. No actual physical pages are allocated during the initialization phase, and they are dynamically mapped to physical pages during data processing. The technical solutions of the embodiments of the present disclosure achieve zero-copy data between the first and second service programs. By separating the control link from the data link, high-speed data transmission between the first and second service programs is achieved.FIG7 is a structural diagram of a data processing device provided in one embodiment of the present disclosure. The data processing device can be applied to a kernel program running in kernel mode. A shared memory area is established between the kernel program and a first service program running in user mode. The shared memory area includes a service data storage area and a control command storage area. The control command storage area corresponds to physical memory allocated by the kernel program and is mapped to a first virtual address space of the first service program. The service data storage area is mapped to a second virtual address space of the first service program. The device includes: a first acquisition module 701 for acquiring a first control command transmitted by the second service program and determining a physical address area; an address application module 702 for applying for a virtual address area from the second virtual address space mapped from the service data storage area and generating a second control command based on the virtual address area; a command storage module 703 for storing the second control command in the control command storage area; and a relationship establishment module 704 for establishing a mapping relationship between the virtual address area and the physical address area, so that the first service program can access the physical address area based on the virtual address area in the second control command obtained from the control command storage area. In some embodiments, the data processing apparatus further comprises: a first saving module for saving a first correspondence between the virtual address region and the physical address region; in some embodiments, the relationship establishment module 704 comprises: a relationship search submodule for searching the first correspondence based on the virtual address region to determine the physical address region; and a relationship establishment submodule for establishing a mapping relationship between the virtual address region and the physical address region. In some embodiments, the data processing apparatus further comprises: a first saving module for saving a second correspondence between the virtual address region and the physical address region; in some embodiments, the address application module 702 comprises: a first search module for searching the second correspondence to determine whether a virtual address region is mapped to the physical address region; a first application submodule for, if no virtual address region is mapped to the physical address region, applying for a virtual address region from the second virtual address space mapped to the service data storage region and generating a second control command based on the virtual address region; and a command generation submodule for, if a virtual address region is mapped to the physical address region, generating the second control command based on the virtual address region. In some embodiments, the relationship establishment module 704 includes a relationship establishment submodule configured to establish a mapping relationship between a virtual address region and a physical address region in response to a page fault interrupt, where the page fault interrupt is generated when a solution operation fails. In some embodiments, the first storage module includes a first storage submodule configured to construct a first radix tree using a virtual address region as a key and a corresponding physical address region as a value.In some embodiments, the first storage module includes a second storage submodule configured to construct a second radix tree using the physical address region as a key and the corresponding virtual address region as a value. In some embodiments, the control command storage region includes a command region and a description region; the command region may be implemented as a ring cache, and the description region is configured to store the write pointer and read pointer of the command region. In some embodiments, the command storage module 703 includes a command writing submodule configured to write the second control command into the command region based on the write pointer and the read pointer, and to update the write pointer in the description region; the read pointer is updated after the first service program retrieves the second control command from the command region based on the write pointer. In some embodiments, the first acquisition module 701 includes a command acquisition submodule configured to retrieve the first control command copied by the second service program via a system call. In some embodiments, the data processing device further includes an access recovery module configured to send a recovery instruction to the first service program, so that the first service program responds to the recovery instruction and accesses the physical address region based on the mapping relationship. In some embodiments, the data processing device further includes: a region construction module for constructing a shared memory region; a first space allocation module for allocating a first virtual address space to the control command storage region and a second virtual address space to the data storage partition from the virtual address space corresponding to the first service program; a second space allocation module for allocating physical memory to the control command storage region and establishing a mapping relationship between the physical address region of the physical memory and the first virtual address space; and a feedback module for feeding back the first virtual address space and the second virtual address space to the first service program, so that the first service program can access the control command storage region based on the first virtual address space. In some embodiments, the data processing device further includes: a release module for releasing the corresponding mapping relationship from the virtual address region in the second virtual address space that meets the release condition. The data processing device of FIG7 can execute the data processing method of the embodiment shown in FIG2 , and its implementation principles and technical effects will not be further described. The specific manner in which the various modules and units of the data processing device in the above-mentioned embodiment perform operations has been described in detail in the embodiments related to the method and will not be elaborated here.FIG8 is a structural diagram of a data processing device provided by an embodiment of the present disclosure, which is applied to a first service program running in user mode. A shared memory area is established between the first server program and the kernel program. The shared memory area includes a service data storage area and a control command storage area. The control command storage area corresponds to physical memory allocated by the kernel program and is mapped to the first virtual address space of the first service program. The device includes: a first access module 801, configured to access the control command storage area based on the first virtual address space to obtain a second control command; the second control command is generated based on the virtual address area by the kernel program receiving the first control command transmitted by the second service program, determining the physical address area, and applying for a virtual address area from the second virtual address space mapped from the service data storage area; a first determination module 802, configured to determine the virtual address area in the second control command; and a second access module 803, configured to perform an access operation based on the virtual address area to access the physical address area based on the mapping relationship. In some embodiments, the control command storage area includes a command area and a description area; the description area is configured to store a write pointer and a read pointer for the command area. In some embodiments, the first access module 801 includes: a first access submodule for accessing the description area and the control command storage area based on the first virtual address space; a command reading submodule for reading a second control command from the control command storage area based on the write pointer of the description area; and an update submodule for updating the read pointer in the description area. In some embodiments, the first service program is a storage service. The data processing device of FIG8 can execute the data processing method of the embodiment shown in FIG3 , and its implementation principles and technical effects are not further described. The specific manner in which the various modules and units of the data processing device in the above-mentioned embodiment perform operations has been described in detail in the embodiments related to the method and will not be elaborated here.FIG9 is a structural diagram of a data processing device provided by one embodiment of the present disclosure, which is applied to a second service program running in user mode. The virtual memory corresponding to the second service program includes a command cache area and a data cache area. The device includes: a second determination module 901 for determining the data cache area; a command sending module 902 for sending a first control command for the first service program to the kernel program based on the data cache area. A shared memory area is established between the first server program and the kernel program. The shared memory area includes a service data storage area and a control command storage area. The control command storage area corresponds to physical memory allocated by the kernel program and is mapped to a first virtual address space of the first service program. The first control command is used to determine a physical address area corresponding to the data cache area. The physical address area is used to establish a mapping relationship with a virtual address area requested in a second virtual address space mapped from the service data storage area. The second virtual address space is used to generate a second control command and store it in the command cache area, which is used by the first service program to obtain and initiate access operations based on the second virtual address space. The data processing device of FIG9 can implement the data processing method of the embodiment shown in FIG4 , and its implementation principles and technical effects are not further described. The specific manner in which the various modules and units in the data processing device of the above-mentioned embodiment perform operations has been described in detail in the embodiment related to the method and will not be elaborated upon here. Furthermore, an embodiment of the present disclosure further provides a computer system. As shown in FIG10 , the computer system may include a storage component 1001 and a processing component 1002. The storage component 1001 stores one or more computer instructions. The one or more computer instructions are used to be called and executed by the processing component 1002 to run a kernel program in kernel mode to implement the data processing method of the embodiment shown in FIG2 , and to run a service program in user mode to implement the data processing method of the embodiment shown in FIG3 and the data processing method of the embodiment shown in FIG4 . Of course, the computer system may also include other components, such as an input / output interface, a display component, and a communication component. The input / output interface provides an interface between the processing component and a peripheral interface module, which may be an output device, an input device, or the like. The communication component is configured to facilitate wired or wireless communication between the computing device and other devices. The processing component may include one or more processors to execute computer instructions to complete all or part of the steps of the above-mentioned method.Of course, the processing component can also be implemented as one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-mentioned methods. The storage component is configured to store various types of data to support operations on the terminal. The storage component can be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk. The display component can be an electroluminescent (EL) element, a liquid crystal display, or a microdisplay with a similar structure, or a direct retinal display or similar laser scanning display. It should be noted that the computing device described above can be a physical device or an elastic computing host provided by a cloud computing platform. It can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or terminal device. The present disclosure also provides a computer-readable storage medium storing a computer program. When executed by a computer, the computer program can implement the data processing methods of the embodiments shown in Figures 2, 3, and 4. The computer-readable medium can be included in the electronic device described in the above embodiments, or it can exist independently and not be incorporated into the electronic device. The present disclosure also provides a computer program product, comprising a computer program carried on a computer-readable storage medium. When executed by a computer, the computer program can implement the data processing methods of the embodiments shown in Figures 2, 3, and 4. In such an embodiment, the computer program can be downloaded and installed from a network and / or installed from removable media. When executed by a processor, the computer program performs the various functions defined in the system of the present disclosure. Those skilled in the art will clearly understand that, for ease of description and brevity, the specific operating procedures of the systems, devices, and units described above can refer to the corresponding procedures in the aforementioned method embodiments and will not be further described here. The apparatus embodiments described above are merely illustrative, wherein 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 based on actual needs to achieve the objectives of the present embodiment. Persons skilled in the art can understand and implement the present embodiment without inventive effort. Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software and a necessary general-purpose hardware platform, or alternatively, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes instructions for enabling a computer device (such as a personal computer, a server, or a network device) to execute the methods described in each embodiment or portions thereof. Finally, it should be noted that the above embodiments are intended only to illustrate the technical solutions of the present disclosure and are not intended to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, persons skilled in the art should understand that modifications may be made to the technical solutions described in the aforementioned embodiments, or that some of the technical features therein may be replaced with equivalents. However, such modifications or replacements do not deviate from the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present disclosure.

Claims

Claims 1. A data processing method, wherein: Applied to a kernel program, a shared memory area is constructed between the kernel program and a first service program, the shared memory area includes a service data storage area and a control command storage area, the control command storage area corresponds to the physical memory allocated by the kernel program and is mapped to the first virtual address space of the first service program, and the service data storage area is mapped to the second virtual address space of the first service program. The method includes: obtaining a first control command transmitted by the second service program and determining a physical address area; applying for a virtual address area from the second virtual address space mapped by the service data storage area, and generating a second control command based on the virtual address area; establishing a mapping relationship between the virtual address area and the physical address area, so that the first service program can access the physical address area based on the virtual address area in the second control command obtained from the control command storage area.

2. The method according to claim 1, wherein: After applying for a virtual address area from the second virtual address space mapped from the service data storage area, the method further includes: saving a first correspondence between the virtual address area and the physical address area; establishing a mapping relationship between the virtual address area and the physical address area includes: searching for the first correspondence based on the virtual address area to determine the physical address area; and establishing a mapping relationship between the virtual address area and the physical address area.

3. The method according to claim 1 or 2, wherein: It also includes: saving a second correspondence between the virtual address area and the physical address area; applying for a virtual address area from the second virtual address space mapped from the service data storage area, and generating a second control command based on the virtual address area includes: searching the second correspondence to determine whether there is a virtual address area mapped to the physical address area; if not, applying for a virtual address area from the second virtual address space mapped from the service data storage area, and generating a second control command based on the virtual address area; if so, generating a second control command based on the virtual address area.

4. The method according to any one of claims 1 to 3, wherein: The establishing of the mapping relationship between the virtual address region and the physical address region includes: establishing the mapping relationship between the virtual address region and the physical address region in response to a page fault interrupt, where the page fault interrupt is generated when an access operation fails.

5. The method according to claim 2, wherein: The storing of the first correspondence between the virtual address region and the physical address region includes: constructing a first radix tree using the virtual address region as a key and the corresponding physical address region as a value.

6. The method according to claim 3, wherein: The storing of the second correspondence between the virtual address area and the physical address area comprises: 22 A second radix tree is constructed using the physical address area as a key and the corresponding virtual address area as a value.

7. The method according to any one of claims 1 to 6, wherein: The control command storage area includes a command area and a description area; the description area is used to store a write pointer and a read pointer of the command area; the method further includes: writing the second control command into the command area according to the write pointer and the read pointer, and updating the write pointer in the description area; The read pointer is used to be updated after the first service program obtains the second control command from the command area.

8. The method according to any one of claims 1 to 7, wherein: The acquiring the first control command transferred by the second service program includes: acquiring the first control command copied by the second service program through a system call.

9. The method according to claim 4, wherein: After establishing a mapping relationship between the virtual address region and the physical address region in response to a page fault interrupt, the method further includes: sending a recovery instruction to the first service program, so that the first service program responds to the recovery instruction and accesses the physical address region based on the mapping relationship.

10. The method according to any one of claims 1 to 9, wherein: Also includes: Constructing the shared memory area; Allocate a first virtual address space for the control command storage area and a second virtual address space for the data storage partition from the virtual address space corresponding to the first service program; allocate physical memory to the control command storage area, and establish a mapping relationship between the physical address area of ​​the physical memory and the first virtual address space; and feed back the first virtual address space and the second virtual address space to the first service program so that the first service program can access the control command storage area based on the first virtual address space.

11. The method according to any one of claims 1 to 10, wherein: Also includes: The corresponding mapping relationship of the virtual address area that meets the release condition in the second virtual address space is released.

12. A data processing method, wherein: A first service program is applied to user mode operation; a shared memory area is constructed between the first server program and the kernel program; the shared memory area includes a service data storage area and a control command storage area, the control command storage area corresponds to the physical memory allocated by the kernel program and is mapped to the first virtual address space of the first service program, and the service data storage area is mapped to the second virtual address space of the first service program, the method comprising: based on the first virtual address space, accessing the control command storage area to obtain a second control command; the kernel program obtains the first control command transmitted by the second service program, determines the physical address area, and applies for a virtual address area from the second virtual address space mapped by the service data storage area, and generates a virtual address area based on the virtual address area; determines the virtual address area in the second control command; An access operation is performed based on the virtual address region to access the physical address region based on a mapping relationship.

13. The method according to claim 12, wherein: The control command storage area includes a command area and a description area; the description area is used to store a write pointer and a read pointer of the command area; accessing the control command storage area to obtain a second control command based on the first virtual address space includes: accessing the description area and the command area based on the first virtual address space; reading the second control command from the command area according to the read pointer and the write pointer of the description area; A read pointer in the description area is updated.

14. The data processing method according to claim 12, wherein: The first service program is a storage service.

15. A data processing method, wherein: A second service program applied to user mode operation; the virtual memory corresponding to the second service program includes a command cache area and a data cache area; the method includes: determining the data cache area; based on the data cache area, sending a first control command for the first service program to the kernel program; wherein a shared memory area is constructed between the first server program and the kernel program; the shared memory area includes a service data storage area and a control command storage area, the control command storage area corresponds to the physical memory allocated by the kernel program and is mapped to the first virtual address space of the first service program; the first control command is used to determine the physical address area corresponding to the data cache area, and the physical address area is used to establish a mapping relationship with the virtual address area applied for in the second virtual address space mapped from the service data storage area; the second virtual address space is used to generate a second control command and store it in the command cache area, so that the first service program can obtain it and initiate an access operation based on the second virtual address space.

16. A computer system, wherein: The device comprises a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to run a kernel program in kernel mode to implement the data processing method according to claim 1; And running the service program in user mode to implement the data processing method as claimed in claim 12 and claim 15.

17. A computer-readable storage medium, wherein: A computer program is stored thereon, and when the computer program is executed by the processing component, the data processing method according to claim 1 is implemented, or the data processing method according to claim 12 is implemented, or the data processing method according to claim 15 is implemented.

18. A computer program product, wherein: The computer program / instruction comprises a computer program / instruction, which, when executed by a processing component, implements the data processing method according to claim 1, or implements the data processing method according to claim 12, or implements the data processing method according to claim 15.

Citation Information

Patent Citations

  • Upgrading system and virtual machine-based upgrading method and device

    CN108021378A

  • Accelerated processing method and device for memory, storage medium and processor

    CN109800190A

  • Data transmission and task processing method, device and equipment

    CN111309649A

  • Cross-system data processing method and device

    CN115357416A

  • Data request processing method and device, equipment and storage medium

    CN116954947A

Cited By

  • NVMe command transparent transmission method, NVMe command generation method and NVMe command cross test method

    CN120950427A

  • Distributed industrial personal computer based on OpenHarmony system and data collaboration method thereof

    CN121092340A

  • Distributed industrial computer based on openharmony system and data collaboration method thereof

    CN121092340B

  • Method and system for optimizing performance of digital signal processor simulation based on mirror memory

    CN122491168A