A method and system for handling cross-process control requests

By establishing an access identifier and category mapping in the user-space compatibility layer of the Linux operating system, and detecting and constructing a proxy buffer, the problem of device control request processing caused by the lack of public access to vendor-specific parameter structures is solved, and the correctness and universality of cross-process communication are achieved.

CN123115010APending Publication Date: 2026-11-17联想开天科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the user-space compatibility layer of the Linux operating system, the address space boundary between the application and the driver logic process causes device control requests to be processed incorrectly. In particular, the lack of public disclosure of vendor-specific parameter structures and the unreliability of control code encoding result in response data not being written back to the correct memory location of the calling process.

Method used

By establishing a mapping relationship between access identifiers and specific categories, utilizing protocol feature fields and geometric boundary features of the input data area to detect memory reference information, constructing a proxy buffer and modifying transmission attributes, cross-process communication is achieved, ensuring that response data is written to the caller process's address space.

Benefits of technology

Without relying on vendor-specific structure definitions, it achieves automatic identification and cross-process transmission of embedded pointers, ensuring that response data is correctly written to the caller process, eliminating the dependence on vendor-specific reverse engineering and hard coding, and providing a unified cross-vendor general solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123115010A_ABST
    Figure CN123115010A_ABST
Patent Text Reader

Abstract

This application provides a cross-process control request processing method and system. The method includes: responding to an access request from a calling process for a target device, establishing a mapping relationship between an access identifier indicating the target device and a specific category based on the context information of the access request; receiving a control request initiated by the calling process through the access identifier; determining a distribution path based on the mapping relationship and protocol feature fields; in the adaptation processing path, detecting whether the input data area contains memory reference information pointing to the address space of the calling process based on the geometric boundary features of the input data area; when memory reference information is detected, constructing a proxy buffer; sending the control request carrying the proxy buffer to the responding process via a cross-process communication channel; receiving the processing result returned by the responding process; and writing the processing result into the memory location pointed to by the memory reference information in the address space of the calling process to obtain the processing result of the control request.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of data processing technology, specifically relating to a cross-process control request processing method and system. Background Technology

[0002] In Windows operating systems, applications interact with device drivers through the DeviceIoControl interface and its underlying NtDeviceIoControlFile system service. When such applications need to run in the user-mode compatibility layer of a Linux operating system, device control requests must cross the address space boundary between the application process and the driver logic process. Existing compatibility technologies typically assume that the device type field of the control code is reliable, the parameter structure is known, and the transmission completion semantics are consistent with the native environment. However, these three assumptions do not hold true for a large number of vendor-specific device software, especially since vendor-specific parameter structures are not publicly available and differ between vendors, leading to the following technical problems faced by the compatibility layer: Some vendor drivers embed a user-mode pointer to the caller process's address space in the input buffer of the control request. This allows the driver logic to directly write response data back to the memory location pointed to by the pointer. In a native Windows environment, the kernel can access the user address space, making this design feasible.

[0003] However, in a compatibility layer environment where the calling and responding processes reside in different address spaces, the compatibility layer cannot locate the embedded pointer according to its known structure definition because the vendor's parameter structure is not publicly available. Furthermore, the embedded pointer cannot be dereferenced in the responding process. If the compatibility layer cannot recognize and correctly process the embedded pointer, the responding process will be unable to write the response data back to the correct memory location of the calling process after performing device operations, resulting in the application being unable to obtain valid response data. Summary of the Invention

[0004] This application provides a method and system for handling cross-process control requests, which can at least solve the problem of how to enable Windows proprietary device control software to obtain execution results semantically equivalent to the native environment under constraints such as isolation between application processes and driver logic processes, undisclosed vendor parameter structures, unreliable control code encoding, and inconsistent semantics of the underlying transport stack. The technical solution of this invention is shown below.

[0005] On the one hand, a cross-process control request handling method is provided, applicable to a compatibility layer environment where the calling process and the responding process reside in different address spaces. The method includes: In response to an access request from a calling process for a target device, a mapping relationship is established based on the context information of the access request to indicate the access identifier of the target device and a specific category; Receive the control request initiated by the calling process through the access identifier. The control request is associated with an input data area and carries a protocol feature field for routing discrimination. The distribution path is determined based on the mapping relationship and the protocol feature field; if the mapping relationship indicates that the access identifier belongs to a specific category, it is determined whether to suppress the default processing path according to the relationship between the protocol feature field and the encoding corresponding to the default processing path, and the control request is distributed to the adaptation processing path corresponding to the specific category; In the adaptation processing path, based on the geometric boundary features of the input data area, it is detected whether the input data area contains memory reference information pointing to the address space of the calling process; Upon detecting the memory reference information, a proxy buffer is constructed to replace the original output data area parameters in the control request, and the transport attributes of the control request are modified. The modified control request and the proxy buffer are sent to the responding process for processing to obtain the processing result; Based on the memory reference information, the processing result is written into the memory location pointed to by the memory reference information in the address space of the calling process to obtain the processing result of the control request.

[0006] In one optional implementation, in response to an access request from a calling process for a target device, a mapping relationship is established based on the context information of the access request to indicate the access identifier of the target device and a specific category, including: Obtain the path information of the access path used by the access request; The category of the target device is determined based on the path information; Establish a mapping relationship between the access identifier and the category.

[0007] In one optional implementation, determining whether to suppress the default processing path based on the relationship between the protocol feature field and the encoding corresponding to the default processing path includes: If the value of the protocol feature field is the same as the encoding corresponding to the default processing path, then the default processing path is suppressed. If the value of the protocol feature field is different from the encoding corresponding to the default processing path, it is determined that the default processing path will not be suppressed.

[0008] In one optional implementation, before detecting whether the input data area contains memory reference information pointing to the caller process's address space, the method further includes: Verify that all of the following conditions are met: The mapping relationship indicates that the access identifier belongs to the specific category; The value of the protocol feature field is different from the standard code of the category to which the target device belongs; The transmission attribute of the control request indicates that it is in non-system buffer mode; The output data area length information of the control request indicates that the output data area length is zero; The input data area is valid and its length is not less than a preset threshold. If all the conditions are met, check whether the input data area contains memory reference information pointing to the address space of the calling process.

[0009] In one optional implementation, in the adaptation processing path, detecting whether the input data area contains memory reference information pointing to the caller process's address space based on the geometric boundary features of the input data area includes: Obtain the address value at a predetermined offset position in the input data area; If the address value is equal to the sum of the starting address of the input data area and the length of the input data area, it is determined that the input data area contains memory reference information pointing to the address space of the calling process.

[0010] In one alternative implementation, it further includes: Extract additional memory reference information and additional data length information from another predetermined offset position in the input data area; When the transmission direction of the control request is from the calling process to the responding process, the data payload pointed to by the additional memory reference information is appended to the end of the input data area to form an extended input data area, which is then used to replace the input data area for cross-process communication.

[0011] In one alternative implementation, constructing the proxy buffer includes: The required capacity of the proxy buffer is determined based on the additional data length information and the preset state area length information. If the required capacity does not exceed a preset capacity threshold, a fixed-length storage area is allocated on the call stack of the calling process as the proxy buffer. If the required capacity exceeds the preset capacity threshold, the proxy buffer is obtained by allocating storage areas on demand through the dynamic storage allocation interface.

[0012] In one alternative implementation, modifying the transport attributes of the control request includes: Adjust the field in the control request that indicates the transmission method to the value used under the system buffer mode corresponding to the cross-process communication channel; The adjustment is performed only when the mapping relationship indicates that the access identifier belongs to the specific category.

[0013] In one optional implementation, writing the processing result to the memory location pointed to by the memory reference information in the caller process's address space includes: The proxy buffer is split according to a preset layout, wherein the preset layout is a first region in front and a second region behind; Write the contents of the first region to the memory location pointed to by the additional memory reference information; Write the contents of the second region to the memory location pointed to by the memory reference information.

[0014] In one optional implementation, the method further includes: Obtain the expected amount of data to be received as indicated in the control request; During the transmission process of the cross-process communication channel, a first status identifier and a second status identifier of each data receiving endpoint are recorded. The first status identifier is used to indicate whether the endpoint has received data, and the second status identifier is used to indicate whether the amount of data received by the endpoint most recently is less than the full packet data size. When submitting batch data reception and transmission, if the first status identifier and the second status identifier are both in a valid state, the first timeout parameter is used; otherwise, the second timeout parameter is used. The first timeout parameter is less than the second timeout parameter. When the transmission is complete, if the actual amount of data received is greater than zero, the first status identifier is set to a valid state, and the second status identifier is set to a valid state or an invalid state according to the comparison result between the actual amount of data received and the expected amount of data received. When the transmission times out and the actual amount of data received is zero, both the first status flag and the second status flag are set to invalid.

[0015] In one optional implementation, the method further includes: When the batch transmission times out, if the actual amount of data received is greater than zero, the completion status of this transmission is marked as successful, and the actual amount of data received is used as the result data amount. If the actual amount of data received is zero, mark this timeout as a data end event; Once marked, the transmission will not be re-initiated during the completion callback process; the initiation of subsequent transmissions will be determined by the upper-level scheduling logic.

[0016] In one optional implementation, the method further includes: Create an object to carry the transmission state of the control request, and store a pointer to the object; In the completion callback after the responder process returns the processing result, the pointer to the object is cleared with an atomic write operation of release semantics; Before initiating a cancellation operation on the cancellation path, a pointer to the object is obtained using an atomic read operation, and the cancellation operation is performed only if a non-null pointer is obtained.

[0017] In one optional implementation, the method further includes: When the control request returns to an invalid request state after being dispatched through the inter-process communication channel, the control request is re-expressed as a combination of a first operation and a second operation to be executed in sequence. If valid data exists in the input data area, the first operation is initiated based on the content of the input data area; If the first operation is successful and the control request needs to receive response data, the second operation is initiated using the output data area of ​​the control request. The combined execution result of the first operation and the second operation is used as the processing result of the control request.

[0018] Furthermore, a cross-process control request processing system is provided, applicable to a compatibility layer environment where the calling process and the responding process reside in different address spaces. The system includes: The tagging module is used to respond to an access request from a calling process for a target device and establish a mapping relationship between an access identifier for the target device and a specific category based on the context information of the access request. The routing module is used to receive control requests initiated by the calling process through the access identifier. The control requests are associated with an input data area and carry a protocol feature field for routing discrimination. The first detection module is used to determine the distribution path based on the mapping relationship and the protocol feature field; when the mapping relationship indicates that the access identifier belongs to a specific category, it determines whether to suppress the default processing path according to the relationship between the protocol feature field and the encoding corresponding to the default processing path, and distributes the control request to the adaptation processing path corresponding to the specific category. The second detection module is used to detect, based on the geometric boundary features of the input data area, whether the input data area contains memory reference information pointing to the address space of the caller process in the adaptation processing path. A construction module is used to construct a proxy buffer to replace the original output data area parameters in the control request and modify the transmission attributes of the control request when the memory reference information is detected. The communication module is used to send the modified control request and the proxy buffer to the responding process for processing and to obtain the processing result; The backfill module is used to write the processing result to the memory location pointed to by the memory reference information based on the memory reference information, so as to obtain the processing result of the control request.

[0019] The method provided in this application has at least the following beneficial effects: The method provided in this application pre-establishes a mapping relationship between access identifiers and specific categories based on the context information of access requests. When a control request arrives, the request is distributed to an adaptation processing path according to the mapping relationship and protocol feature fields. In the adaptation processing path, the method detects whether the input data area contains memory reference information pointing to the caller process's address space based on the geometric boundary features of the input data area (i.e., the starting address and length of the input data area). This detection utilizes the geometric invariant that the address value at a predetermined offset is equal to the sum of the base address and length of the input data area, which is independent of the specific definition of the vendor's proprietary structure. When memory reference information is detected, a proxy buffer is constructed to replace the original output data area parameters, and the transmission attributes are modified to adapt to the cross-process communication channel. After the request is sent to the responder process, the processing result carried in the proxy buffer is received. Finally, the processing result is written to the memory location pointed to by the memory reference information in the caller process's address space based on the memory reference information. Through the above technical solution, this application achieves automatic identification, cross-process transmission and accurate backfilling of embedded pointers without needing to know any vendor's proprietary structure definition. This enables the compatibility layer to handle control requests with unknown structures in a unified and cross-vendor manner, eliminating the dependence on vendor-specific reverse engineering and hard coding. Attached Figure Description

[0020] Figure 1 A flowchart illustrating the cross-process control request processing method provided in this application.

[0021] Figure 2 A schematic diagram of the access identifier marking process provided in this application.

[0022] Figure 3 A schematic diagram of the memory reference information detection process provided in this application.

[0023] Figure 4 A flowchart illustrating the specific process of step S1 provided in this application.

[0024] Figure 5 A schematic diagram of the result return process provided for this application.

[0025] Figure 6 This is a schematic diagram of the three-phase adaptive timeout process provided in this application.

[0026] Figure 7 A block diagram of the cross-process control request processing system provided in this application. Detailed Implementation

[0027] The present application will now be described in detail with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.

[0028] The following detailed descriptions are exemplary and intended to provide further detailed explanation of this application. Unless otherwise specified, all technical terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application.

[0029] In Windows operating systems, applications interact with device drivers through the DeviceIoControl application programming interface and its underlying NtDeviceIoControlFile system service. When such applications need to run in the user-space compatibility layer of the Linux operating system, device control requests must cross the address space boundary between the application process and the driver logic process. Existing compatibility technologies typically assume that: the device type field of the control code is reliable, the parameter structure is known, and the transmission completion semantics are consistent with the native environment. Through long-term engineering practice, the applicant has found that these three assumptions do not hold true for a large number of vendor-specific device software, resulting in three types of deep-seated technical problems that existing technologies cannot solve.

[0030] Problem 1: Misrouting caused by control code namespace conflicts. The high 16 bits of the Windows control code are the device type field. The operating system reserves encoding ranges for built-in device categories and allows manufacturers to define private control codes using custom encoding ranges. However, many manufacturer drivers do not adhere to the encoding specifications, and the device type field of their private control codes may have the same encoding value as the system's built-in device types such as network devices and buzzer devices. If the system service entry point in the compatibility layer routes solely based on the device type field, it will incorrectly distribute manufacturer-specific control requests destined for physical peripherals to the socket processing module or other built-in processing modules, resulting in difficult-to-locate functional failures. This indicates that the control code bit fields themselves do not constitute a reliable routing basis, and a second criterion independent of the control code must be introduced.

[0031] Question 2: The lack of public access to proprietary structures makes it impossible to locate embedded pointers. Some vendor drivers embed user-mode memory pointers in the input buffer of control requests, allowing the kernel driver to directly write back response data. In a native environment, the kernel can access the user address space, making this design feasible; however, in the compatibility layer, the driver logic runs in an independent process, and the embedded pointers cannot be dereferenced. More problematic is that vendor parameter structures are not public and vary from vendor to vendor, making it impossible for the compatibility layer to extract pointers by field definition as it would with public structures. Existing technologies in this scenario either abandon support or reverse engineer and hardcode the structure definition for each vendor individually, failing to establish a universal method.

[0032] Question 3: Loss of Transmission Boundary Semantics. In bulk input transfers, the Windows USB host controller uses the timeout period for a continuous negative acknowledgment (NAK) as the condition for transmission completion. The vendor driver uses this to perceive data block boundaries and drive its internal protocol state machine. The Linux user-space transfer stack retryes negative acknowledgments indefinitely when the timeout parameter is zero, only returning when the buffer is full, completely burying block boundary information. If a fixed short timeout is simply set, legitimate data gaps caused by device mechanical actions (such as light source preheating, paper feeding, or page changing) will be misinterpreted as transmission completion, leading to data truncation. Neither fixed timeouts nor infinite retries can reproduce the original boundary semantics.

[0033] Existing layered driver adaptation solutions (such as building a multi-layered driver stack consisting of a TWAIN data source manager layer, a device driver layer, and a transmission backend layer, as well as cross-process data marshalling based on known parameter structures and system buffers) address the problem of "missing driver runtime environment." Their marshalling mechanisms rely on known parameter structures and standardized control codes and device types, with the focus on the driver process side. This application differs: it does not involve the construction method of the driver stack; all its innovative mechanisms reside at the system service entry point of the calling process and the completion path of the transmission backend, i.e., at both ends of the request chain. This application deals with vendor-specific requests with unknown structures and coding violations, employing dual-criteria routing, invariant detection, and boundary reclassification, none of which rely on any structural definition or coding standard. The two solutions address different technical problems, have different roles, and employ different technical means; they can be implemented independently or in combination.

[0034] Please see Figure 1 This application provides a method for handling cross-process control requests. M100 is applied in compatibility layer environments where the calling process and the responding process reside in different address spaces. The methods include: Step S1: In response to the caller process's access request for the target device, establish a mapping relationship between the access identifier of the target device and a specific category based on the context information of the access request.

[0035] Step S2: Receive the control request initiated by the calling process through the access identifier. The control request is associated with the input data area and carries the protocol feature field used for routing determination.

[0036] Step S3: Determine the distribution path based on the mapping relationship and protocol feature fields; if the mapping relationship indicates that the access identifier belongs to a specific category, determine whether to suppress the default processing path based on the relationship between the protocol feature fields and the encoding corresponding to the default processing path, and distribute the control request to the adapted processing path corresponding to the specific category.

[0037] Step S4: In the adaptation processing path, based on the geometric boundary features of the input data area, detect whether the input data area contains memory reference information pointing to the address space of the calling process.

[0038] Step S5: Upon detecting memory reference information, construct a proxy buffer to replace the original output data area parameters in the control request, and modify the transfer attributes of the control request to adapt to the cross-process communication channel.

[0039] Step S6: Send the control request carrying the proxy buffer to the responding process via the inter-process communication channel for processing and obtain the processing result.

[0040] Step S7: Based on the memory reference information, write the processing result to the memory location pointed to by the memory reference information in the address space of the calling process to obtain the processing result of the control request.

[0041] Please see Figure 2 In step S1, in response to the caller process’s access request for the target device, a mapping relationship between the access identifier of the target device and a specific category is established based on the context information of the access request.

[0042] When a calling process (i.e., the application process) initiates an access request for a target device, the system service library responds to the request. First, it obtains the context information of the access request, which refers to the semantic characteristics of the device naming path used in the access request, such as the device name prefix and instance number pattern. Then, based on this context information, it establishes a mapping relationship between the access identifier (i.e., handle) indicating the target device and specific categories.

[0043] It is understandable that there are multiple paths to open the device within the compatibility layer, for example... Figure 2In this process, the device namespace is directly opened, the server namespace is resolved, and the file system symbol rollback is enabled. If device type identification is only attempted when a control request arrives, identification may fail or be delayed due to differences in the format of information obtained from different paths. Therefore, this application completes the category marking during the device access establishment phase and stores the marking results in the calling process in the form of a mapping relationship, ensuring that the marking information is ready when any subsequent control request arrives, eliminating the need for repeated identification.

[0044] In step S2, a control request initiated by the calling process through an access identifier is received. The control request is associated with an input data area and carries a protocol feature field for routing determination.

[0045] The system service entry point receives control requests initiated by the calling process using the aforementioned access identifier. This control request is a device control operation initiated by the application through the DeviceIoControl interface, which is associated with an input data area (i.e., an input buffer) and carries a protocol feature field for routing determination (i.e., the device type field in the control code).

[0046] In step S3, the distribution path is determined based on the mapping relationship and the protocol feature field. When the mapping relationship indicates that the access identifier belongs to a specific category, the relationship between the protocol feature field and the encoding corresponding to the default processing path is used to determine whether to suppress the default processing path and distribute the control request to the adaptation processing path corresponding to the specific category.

[0047] The system service entry point determines the distribution path (i.e., routing method) based on the mapping relationship and protocol feature fields. When the mapping relationship indicates that the access identifier belongs to a specific category (i.e., proprietary device category), it determines whether to suppress the default processing path based on the relationship between the protocol feature fields and the encoding corresponding to the default processing path, and distributes the control request to the adapted processing path corresponding to the specific category.

[0048] It's important to note that while the operating system reserves encoding ranges for built-in device categories, it also allows vendors to define proprietary control codes using custom encoding ranges. However, many vendor drivers do not adhere to these encoding standards, and their proprietary control codes may have the exact same encoding values ​​for the device type field as those for system-built-in device types such as network devices. If the system service entry point in the compatibility layer routes requests solely based on the device type field, it will incorrectly distribute vendor-specific control requests destined for physical peripherals to the socket processing module or other built-in processing modules, resulting in difficult-to-locate functional faults.

[0049] This application fundamentally eliminates the possibility of misrouting by introducing a mapping relationship (i.e., handle source marker) as a second criterion independent of the control code. When the mapping relationship indicates that the access identifier belongs to a proprietary device category, even if the value of the protocol feature field is the same as the encoding corresponding to the default processing path (i.e., a namespace conflict occurs), the system will suppress the default processing path and redirect the request to the proprietary processing path.

[0050] Please see Figure 3 In step S4, during the adaptation processing path, based on the geometric boundary features of the input data area, it is detected whether the input data area contains memory reference information (i.e., embedded user-mode pointer) pointing to the address space of the calling process.

[0051] Some vendor drivers embed user-mode memory pointers in the input buffer of control requests, allowing the kernel driver to directly write back response data. In a native Windows environment, the kernel can access the user address space; however, in the compatibility layer, driver logic runs in an independent process, and the embedded pointers cannot be dereferenced. Furthermore, vendor parameter structures are not publicly available and differ between vendors, making it impossible for the compatibility layer to extract pointers by field definition as it would with publicly available structures.

[0052] This application does not rely on any vendor-specific parameter structure definition. Instead, it utilizes the inherent geometric properties of buffer layout. Specifically, the application arranges the request parameter structure and response receiving area contiguously within the same input buffer, with the response pointer in the parameter structure pointing precisely to the end of the input buffer. This satisfies the self-referential equation: the pointer value at a predetermined offset equals the input buffer base address plus the input buffer length. This equation is independent of the field naming and order in the vendor's structure, exhibiting cross-vendor universality.

[0053] Step S5: When memory reference information is detected, a proxy buffer (i.e., shadow output buffer) is constructed to replace the original output data area parameters in the control request, and the transfer attributes of the control request are modified to adapt to the cross-process communication channel.

[0054] Because the output address is embedded in the input data area, the original output data area has a length of zero, and the pointer to the original output data area points to the address space of the calling process, making it unretrievable in the responding process. If the original parameters are passed directly, the inter-process communication channel cannot correctly carry the response data. Therefore, this application synthesizes a proxy buffer within the calling process to replace the original zero-length output data area parameter, enabling the general inter-process communication channel to carry response data.

[0055] Simultaneously, this application modifies the transmission attributes of the control request. Specifically, it adjusts the field indicating the transmission method (i.e., the lowest two bits of the control code) in the control request to the values ​​used under the system buffering method corresponding to the inter-process communication channel. This normalizes the direct memory mapping buffering method to the system buffering method, enabling the server to move the proxy buffer according to a unified copy semantic. This modification only applies to control requests corresponding to access identifiers already marked as proprietary device categories and does not affect requests from other devices.

[0056] In step S6, the system sends the control request carrying the proxy buffer to the responding process (i.e., the driver host process) via the inter-process communication channel. This inter-process communication channel is a server relay channel pre-established in the compatibility layer, used to transmit requests and responses between the application process and the responding process.

[0057] After the transformation in step S5, the original request containing non-dereferenced pointers has been converted into a standard, cross-process-transferable request. The driver logic reads the payload using system buffering, performs device operations, and writes the response to the proxy buffer.

[0058] After the responding process completes the device operation, it writes the response data to the agent buffer and returns it through the cross-process communication channel.

[0059] The proxy buffer resides within the calling process and is managed and accessed by the calling process; therefore, the received processing results are readable by the calling process. This has the same effect as directly writing data to the calling process's address space, but avoids permission issues related to cross-address space access.

[0060] Step S7: Based on the memory reference information detected in step S4, the system writes the processing result into the memory location pointed to by the memory reference information in the address space of the calling process, and obtains the processing result of the control request.

[0061] In other words, the response data in the proxy buffer is only temporarily stored and must be moved to the target memory location initially specified by the application in order for the application to correctly obtain the response data.

[0062] Please see Figure 4 In one optional implementation, step S1 includes: step S11, step S12, and step S13.

[0063] Step S11: Obtain the path information of the access path used by the access request.

[0064] Step S12: Determine the category of the target device based on the path information.

[0065] Step S13: Establish the mapping relationship between access identifiers and categories.

[0066] The access path includes at least one of the following: direct access path to the device namespace, access path to the server namespace resolution, and access path to the file system symbol rollback path.

[0067] When establishing a mapping relationship, the path information of the access path used by the access request is first obtained. There are multiple access paths for device objects in the compatibility layer, including at least the direct access path to the device namespace, the server namespace resolution access path, and the file system symbol fallback access path. Then, the category of the target device is determined based on the path information. Finally, a mapping relationship is established between the access identifier and that category.

[0068] This implementation ensures the integrity and consistency of the marking information by uniformly marking at all possible device access path exits and importing it into the same mapping table. This avoids the omission of markings due to different access paths and provides a reliable basis for subsequent distribution decisions.

[0069] In an optional implementation, step S3, determining whether to suppress the default processing path based on the relationship between the protocol feature field and the encoding corresponding to the default processing path, includes: If the value of the protocol feature field is the same as the encoding corresponding to the default processing path, it indicates that the protocol feature field of the control request conflicts with the encoding space of the system's built-in device type. In this case, the default processing path is suppressed.

[0070] If the value of the protocol feature field is different from the encoding corresponding to the default processing path, it is determined that the default processing path will not be suppressed, that is, it will be processed according to the original distribution logic.

[0071] It's important to note that "identical" here refers to the vendor's proprietary control code's protocol characteristic field value being completely identical to the system's built-in device type encoding value, meaning there's an overlap in encoding space. Only when the two values ​​are exactly equal is there a risk of mis-distribution, necessitating suppression of the default path. If the two values ​​differ, there's no conflict, and normal distribution is sufficient. This precise judgment rule ensures the accuracy of distribution decisions, preventing both excessive suppression leading to misprocessing of specification requests and insufficient suppression resulting in mis-distribution of conflicting requests.

[0072] As an example, a scanner from a certain manufacturer has a protocol feature field value of 0x0002 for its control code, and the code for the system's built-in network device type is also 0x0002. Since this access identifier has been marked as a proprietary device category, and the protocol feature field value (0x0002) is the same as the code (0x0002) corresponding to the default processing path (network device processing path), it is determined that the default processing path should be suppressed, and the request should be distributed to the appropriate processing path. If another manufacturer's control code has a protocol feature field value of 0x0080, which is different from the code corresponding to any default processing path, it is determined that the default processing path should not be suppressed.

[0073] This application eliminates mis-distribution caused by vendor coding violations from a mechanism perspective, while avoiding the impact of excessive suppression on specification requests, thus ensuring the accuracy and reliability of distribution decisions.

[0074] In one optional implementation, before detecting whether the input data area contains memory reference information pointing to the caller process's address space, the method further includes: Verify that all of the following conditions are met: The mapping relationship indicates that the access identifier belongs to a specific category; that is, the access identifier has been marked as a proprietary device category. This ensures that detection is performed only on proprietary devices, avoiding unnecessary detection of requests for built-in system devices.

[0075] The value of the protocol feature field is different from the standard code of the target device category; that is, if the protocol feature field is already equal to the standard code of the category, it means that the encoding is standard and there is no need to trigger the detection logic of this application; only when the encoding is not standard (i.e., not equal to the standard code) is further detection required.

[0076] The transport attribute of the control request indicates that it is in non-system buffer mode; The output data area length information of the control request indicates that the output data area length is zero; when the output data area length is zero but the input data area contains a pointer to the caller process's address space, it indicates that the request uses a special calling mode that embeds the response pointer in the input data area.

[0077] The input data area is valid and its length is not less than a preset threshold. If all conditions are met, check whether the input data area contains memory reference information pointing to the caller process's address space.

[0078] This application ensures that the triggering time of detection based on geometric boundary features is accurate and the applicable scenarios are reasonable by combining and screening five preconditions. This avoids unnecessary processing overhead and guarantees the accuracy and reliability of detection.

[0079] In one optional implementation, detecting whether the input data area contains memory reference information pointing to the caller process's address space based on the geometric boundary features of the input data area includes: Obtain the address value at a predetermined offset position in the input data area; If the address value equals the sum of the starting address of the input data area and the length of the input data area, it is determined that the input data area contains memory reference information pointing to the address space of the calling process.

[0080] Specifically, the system first obtains the address value (i.e., the pointer width) at a predetermined offset position in the input data area, and then determines whether this address value is equal to the sum of the starting address and the length of the input data area. When the address value is equal to the sum of the starting address and the length of the input data area, it is determined that the input data area contains memory reference information pointing to the caller process's address space. This determination does not depend on the definition of any vendor-specific proprietary parameter structures.

[0081] Regardless of how the specific layout of the vendor's proprietary structure changes, as long as the application adopts the calling pattern of embedding the response pointer in the input data area, the value of the pointer cannot point to the inside of the input data area (because the inside has been occupied by the parameter structure), and the most natural place is at the end boundary of the input data area.

[0082] This implementation transforms the location of embedded pointers into a purely geometric decision problem, enabling the compatibility layer to locate and identify embedded pointers without needing to know any vendor's proprietary structure. It transforms the vendor-specific reverse hard-coding adaptation method into a one-time implementation of a universal mathematical criterion, greatly reducing adaptation costs.

[0083] In one optional implementation, the method provided in this application further includes: Extract additional memory reference information and additional data length information from another predetermined offset position in the input data area; When the transmission direction of the control request is from the calling process to the responding process, the data payload pointed to by the additional memory reference information is appended to the end of the input data area to form an extended input data area, which is then used to replace the input data area in cross-process communication.

[0084] Upon detecting memory reference information, the system extracts additional memory reference information (i.e., a data pointer) and additional data length information from another predetermined offset location in the input data area. When the control request is transmitted from the calling process to the responding process (i.e., from host to device), the data payload pointed to by the additional memory reference information is appended to the end of the input data area to form an extended input data area. This extended input data area replaces the original input data area in cross-process communication.

[0085] It should be noted that for control requests transmitted from the calling process to the responding process, the input data area contains not only memory reference information (response pointer), but may also contain additional memory reference information (data pointer) and additional data length information. The additional memory reference information points to the data payload to be sent to the device. In a native Windows environment, the kernel can directly dereference this additional memory reference information to obtain the payload content. However, in a compatibility layer environment, the driver logic runs in an independent process and cannot dereference the pointer of the calling process. Therefore, this application pre-extracts the data payload pointed to by the additional memory reference information within the calling process and appends it to the end of the input data area to form an extended input data area. In this way, the input data area received by the driver logic contains both the original request parameter structure and the complete payload data, allowing it to obtain all input information without dereferencing any pointers.

[0086] In one optional implementation, when constructing the proxy buffer, the required capacity of the proxy buffer is first determined based on the additional data length information and the preset state area length information, and this capacity is not less than a preset lower limit. Then, an allocation strategy is selected based on the required capacity: when the required capacity does not exceed the preset capacity threshold, a fixed-length storage area is allocated on the call stack of the calling process as the proxy buffer; when the required capacity exceeds the preset capacity threshold, a storage area is allocated on demand through a dynamic storage allocation interface.

[0087] Understandably, the capacity requirements of the proxy buffer vary depending on the request. Small requests may only require tens of bytes, while large requests may reach several megabytes. If dynamic memory allocation is used uniformly, it will incur significant allocation overhead for frequent, small requests; if allocation is uniformly used on the call stack, it cannot meet the capacity requirements of large-volume requests. This application adopts a hybrid allocation strategy: when the required capacity does not exceed a preset capacity threshold, a fixed-length array reserved on the call stack is used as a fast path with zero allocation overhead, suitable for frequent, small request scenarios; when the required capacity exceeds the preset capacity threshold, dynamic storage allocation is used on demand, suitable for large-volume request scenarios. Both paths are uniformly controlled by the same capacity judgment logic, transparent to the upper-layer caller.

[0088] In one alternative implementation, modifying the transport attributes of the control request includes: Adjust the field in the control request that indicates the transmission method to the value used under the system buffer mode corresponding to the inter-process communication channel; The adjustment is only performed when the mapping relationship indicates that the access identifier belongs to a specific category.

[0089] The field in the control request that indicates the transmission method (i.e., the lowest two bits of the control code) specifies how data is transferred between the I / O manager and the driver. The system buffer method means that the I / O manager copies the user-mode input data area to the system buffer before calling the driver, the driver operates on this buffer, and then copies the data back to user mode. In cross-process communication scenarios within the compatibility layer, the system buffer method is the most suitable transmission method because the entire data transfer process is managed uniformly by the cross-process communication channel, and the driver logic does not need to concern itself with whether the data source is the calling process or the proxy buffer.

[0090] This application adjusts the fields in the control request that indicate the transmission method to values ​​corresponding to the system buffering method, normalizing the direct memory mapping buffering method to the system buffering method. This operation is only performed on control requests corresponding to access identifiers that have been marked as proprietary device categories, and does not affect the normal distribution and processing of requests from other devices. The adjusted transmission attributes are parsed as system buffering methods on the server side, and the server moves the input data area and proxy buffer according to a unified replication semantic.

[0091] In one optional implementation, writing the processing result to the memory location pointed to by the memory reference information in the caller process's address space includes: The proxy buffer is split according to a preset layout, with the first area in front and the second area behind. Write the contents of the first region to the memory location pointed to by the additional memory reference information; Write the contents of the second region to the memory location pointed to by the memory reference information.

[0092] When writing the processing results, the system splits the proxy buffer according to a preset layout, which is a two-region layout with the first region first and the second region last. Then, the contents of the first region are written to the memory location pointed to by the additional memory reference information, and the contents of the second region are written to the memory location pointed to by the memory reference information.

[0093] Please see Figure 5 The response data carried in the proxy buffer consists of two parts: the actual response data area (business data written by the driver) and the second area (transmission status information written by the driver). These two parts are stored contiguously in the proxy buffer, with the first area first and the second area second. The corresponding target memory locations in the calling process also have two locations: one pointed to by the additional memory reference information (data pointer) (used to receive response data) and the other pointed to by the memory reference information (response pointer) (used to receive status information). This application copies the two parts of data to their corresponding target memory locations in the same layout order, ensuring that the data is correctly placed and avoiding application malfunctions caused by data misalignment.

[0094] In one optional implementation, the method provided in this application further includes: Get the expected amount of data to be received as indicated in the control request; this expected amount of data is the number of bytes of data that the application expects to read when initiating the control request, corresponding to the URB request length in bulk input transfers.

[0095] During the transmission of data through the inter-process communication channel, the first status identifier and the second status identifier of each data receiving endpoint are recorded. The first status identifier is used to indicate whether the endpoint has received data, and the second status identifier is used to indicate whether the amount of data received by the endpoint most recently is less than the full packet size (i.e., whether it is a short packet). The status identifiers of all endpoints are aggregated into two bitmask variables that are read and written atomically (for example, each bit of the first bitmask corresponds to the first status identifier of an endpoint, and each bit of the second bitmask corresponds to the second status identifier of an endpoint), which can be safely concurrent between the submission thread and the completion callback thread.

[0096] When submitting batch data reception and transmission, if the first status identifier and the second status identifier are both in a valid state (i.e., data has been received and the last packet was a short packet, corresponding to the probe phase), then the first timeout parameter (short probe timeout, e.g., 2 seconds) is used; otherwise (no data received, or the last packet was a full packet, corresponding to the initial phase and the active phase), the second timeout parameter (long active timeout, e.g., 30 seconds) is used. The first timeout parameter is less than the second timeout parameter.

[0097] When the transmission is complete, if the actual amount of data received is greater than zero, the first status flag is set to the valid state, and the second status flag is set to the valid state (the actual amount of data received is less than the expected amount of data received, i.e., short packet) or the invalid state (the actual amount of data received is equal to the expected amount of data received, i.e., full packet) based on the comparison result between the actual amount of data received and the expected amount of data received.

[0098] When the transmission times out and the actual amount of data received is zero, both the first status flag and the second status flag are set to invalid.

[0099] Understandably, in bulk input transfers, the Windows USB host controller uses the timeout period for a continuous negative acknowledgment (NAK) from the device as a condition for transfer completion. The manufacturer's driver uses this to perceive data block boundaries and drive its internal protocol state machine. The Linux user-space transfer stack retryes negative acknowledgments indefinitely when the timeout parameter is zero, only returning when the buffer is full, completely ignoring block boundary information. If a fixed short timeout is simply set, legitimate data gaps caused by device mechanical actions (such as light source preheating, paper feeding, and page changing) will be misjudged as the end of the transfer, resulting in data truncation.

[0100] Please see Figure 6This application employs a three-phase approach: the initial phase and the active phase (no data received, or the last packet was full) use a long active timeout to cover mechanical gaps such as light source preheating, paper feeding, and page changing; the detection phase (data received and the last packet was short) uses a short detection timeout to achieve rapid boundary determination at the end of the data. The switching between the long active timeout and the short detection timeout is driven by the real-time status of the two status indicators, which is a closed-loop adaptive mechanism.

[0101] As an example, in this embodiment, the full packet data volume of the batch input endpoint of a scanning device is 512 bytes. The long activity timeout is 30 seconds, and the short probe timeout is 2 seconds. The typical timing sequence of the scanning device is as follows: During the warm-up period, there is no data, and multiple 30-second waits occur (initial phase, first state identifier is invalid, second state identifier is invalid, not meeting the condition of being simultaneously in a valid state, therefore a long activity timeout is used); during the output phase, there are continuous full packets (active phase, first state identifier is valid, second state identifier is invalid, not meeting the condition of being simultaneously in a valid state, therefore a long activity timeout continues); a short packet appears at the end of the page (e.g., the last packet data is 128 bytes, less than 512 bytes), the state machine enters the probe phase (first state identifier is valid, second state identifier is valid, meeting the condition of being simultaneously in a valid state, therefore a two-second short probe timeout is used), zero bytes are detected within two seconds, timeout (the device no longer returns data), transmission timeout occurs and the actual received data volume is zero, both the first and second state identifiers are set to invalid, the state machine resets and waits for the next page.

[0102] In one optional implementation, the method provided in this application further includes: If the actual amount of data received is greater than zero (i.e., the transmission terminated due to timeout, but some data has been received), the completion status of this transmission is marked as successful, and the actual amount of data received is used as the result data amount, constituting a successful short transmission. If the actual amount of data received is zero, this timeout is considered a data end event. Transmissions after reclassification are not re-initiated during the completion callback process to avoid disrupting the internal state of the transmission framework. The initiation of subsequent transmissions is determined by the upper-layer scheduling logic (i.e., the upper-layer request loop).

[0103] In the native Windows environment, a NAK timeout does not indicate a transmission failure, but rather that there is no more data available. This could be a successful short transmission (the last data packet was received) or a data end marker (no more data to be received). This application transforms timeout events from the underlying transmission stack into normal completion semantics that are recognizable by the upper layer by reclassifying timeout events as successful short transmissions or data ends.

[0104] Meanwhile, the restriction against resubmitting within a completion callback ensures the stability of the internal state of the transmission framework. Resubmitting within a completion callback could cause the transmission framework's state machine to enter unpredictable states, making it difficult to track the number of transmission completions. This application delegates the decision-making power for resubmission to the upper-level scheduling logic, guaranteeing the unidirectionality and traceability of state transitions.

[0105] In an optional implementation, the method provided in this application further includes: first, the system creates an object (i.e., a transmission object, such as a USB request block URB) for carrying the transmission state of the control request, and stores a pointer to the object.

[0106] This object exists within the transmission lifecycle and carries the transmission status information (such as transmission progress, completion status, return code, etc.) of the current control request in the inter-process communication channel.

[0107] In the completion callback after the responder process returns the processing result, the system clears the pointer to the object with an atomic write operation that releases the semantics.

[0108] Before initiating the cancellation operation on the cancellation path, the system obtains a pointer to the object using an atomic read operation, and performs the cancellation operation only if a non-null pointer is obtained. In the transport backend, the completion callback thread and the cancellation thread might access the same transport object simultaneously. If the completion callback executes first, the transport object is released, and then the cancellation thread attempts to access that object, a dangling pointer access will occur, causing the program to crash. If the cancellation thread executes first, cancels the transport, and then the completion callback attempts to access the already canceled object, the same exception may occur.

[0109] This application treats the pointer to the transferred object as an atomic variable. The completion callback atomically clears this pointer before returning, and the cancellation path atomically reads this pointer before initiating cancellation. Since atomic operations are indivisible, there is no race window between the two operations. If the pointer read by the cancellation path is non-null, it means the transferred object has not yet been released, and the cancellation operation can be safely executed; if the pointer read is null, it means the completion callback has already completed and released the transferred object, and the cancellation path returns directly without performing any operation.

[0110] This implementation eliminates cancellation races at the cost of two atomic instructions, ensuring the safety of cancellation operations in multi-threaded concurrent scenarios, avoiding program crashes caused by dangling pointer access, and significantly improving system stability.

[0111] In one optional implementation, the method provided in this application further includes: When a control request returns to an invalid request status after being dispatched through the inter-process communication channel, the control request is re-expressed as a combination of the first and second operations to be executed in sequence. If valid data exists in the input data area, the first operation (i.e., a write request, corresponding to USB bulk output transfer) is initiated with the content of the input data area.

[0112] If the first operation is successful and the control request needs to receive response data, then the second operation (i.e., a read request, corresponding to USB bulk input transfer) is initiated using the output data area of ​​the control request.

[0113] The combined execution result of the first and second operations is returned as the processing result of the original control request.

[0114] Understandably, in some scenarios, vendor-driven control requests may fail to be dispatched in the driver host process and return an invalid request status. This could be because the compatibility layer's dispatch chain for specific protocol feature fields is incomplete, or it could be because the driver itself only implements a simplified data flow interface and not the complete control code interface.

[0115] This application leverages this property to automatically decompose undeliverable control requests into a sequential combination of write and read requests. The first operation (write request) delivers the contents of the input data area (i.e., commands or data that the application wishes to send to the device) to the device via the bulk output endpoint; the second operation (read request) receives response data from the device and retrieves it via the bulk input endpoint. The retrieval process is also protected by the three-phase timeout state machine of claim 10, ensuring the correctness of the boundary semantics of the read request.

[0116] On the other hand, please see Figure 7 This application provides a cross-process control request processing system 100, applied in a compatibility layer environment where the calling process and the responding process reside in different address spaces. The system includes: The tagging module 101 is used to, in response to an access request from a calling process for a target device, establish a mapping relationship between an access identifier of the target device and a specific category based on the context information of the access request; The routing module 102 is used to receive a control request initiated by the calling process through the access identifier. The control request is associated with an input data area and carries a protocol feature field for routing discrimination. The first detection module 103 is used to determine the distribution path based on the mapping relationship and the protocol feature field; when the mapping relationship indicates that the access identifier belongs to a specific category, it determines whether to suppress the default processing path according to the relationship between the protocol feature field and the encoding corresponding to the default processing path, and distributes the control request to the adaptation processing path corresponding to the specific category. The second detection module 104 is used to detect, based on the geometric boundary features of the input data area, whether the input data area contains memory reference information pointing to the address space of the caller process in the adaptation processing path. The construction module 105 is used to construct a proxy buffer to replace the original output data area parameters in the control request when the memory reference information is detected, and to modify the transmission attributes of the control request. Communication module 106 is used to send the modified control request and the proxy buffer to the responding process for processing and to obtain the processing result; The backfill module 107 is used to write the processing result to the memory location pointed to by the memory reference information based on the memory reference information, so as to obtain the processing result of the control request.

[0117] In another aspect, a computer device is provided, including a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement any of the methods described above.

[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and not to limit them. Although this application has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of this application. Any modifications or equivalent substitutions that do not depart from the spirit and scope of this application should be covered within the protection scope of the claims of this application.

Claims

1. A cross-process control request processing method, applied to a compatible layer environment in which a calling process and a responding process are located in different address spaces, characterized in that, The method includes: In response to an access request from a calling process for a target device, a mapping relationship is established based on the context information of the access request to indicate the access identifier of the target device and a specific category; Receive the control request initiated by the calling process through the access identifier. The control request is associated with an input data area and carries a protocol feature field for routing discrimination. The distribution path is determined based on the mapping relationship and the protocol feature field; if the mapping relationship indicates that the access identifier belongs to a specific category, it is determined whether to suppress the default processing path according to the relationship between the protocol feature field and the encoding corresponding to the default processing path, and the control request is distributed to the adaptation processing path corresponding to the specific category; In the adaptation processing path, based on the geometric boundary features of the input data area, it is detected whether the input data area contains memory reference information pointing to the address space of the calling process; Upon detecting the memory reference information, a proxy buffer is constructed to replace the original output data area parameters in the control request, and the transmission attributes of the control request are modified. The modified control request and the proxy buffer are sent to the responding process for processing to obtain the processing result; Based on the memory reference information, the processing result is written to the memory location pointed to by the memory reference information to obtain the processing result of the control request.

2. The method of claim 1, wherein, In response to an access request from a calling process for a target device, establishing a mapping relationship between an access identifier for the target device and a specific category based on the context information of the access request includes: Obtain the path information of the access path used by the access request; The category of the target device is determined based on the path information; Establish a mapping relationship between the access identifier and the category.

3. The method of claim 1, wherein, When the mapping relationship indicates that the access identifier belongs to a specific category, determining whether to suppress the default processing path based on the relationship between the protocol feature field and the encoding corresponding to the default processing path includes: If the value of the protocol feature field is the same as the encoding corresponding to the default processing path, then the default processing path is suppressed. If the value of the protocol feature field is different from the encoding corresponding to the default processing path, it is determined that the default processing path will not be suppressed.

4. The method of claim 1, wherein, Before detecting whether the input data area contains memory reference information pointing to the caller process's address space based on the geometric boundary features of the input data area, the method further includes: Verify that all of the following conditions are met: The mapping relationship indicates that the access identifier belongs to the specific category; The value of the protocol feature field is different from the standard code of the category to which the target device belongs; The transmission attribute of the control request indicates that it is in non-system buffer mode; The output data area length information of the control request indicates that the output data area length is zero; The input data area is valid and its length is not less than a preset threshold. If all the conditions are met, check whether the input data area contains memory reference information pointing to the address space of the calling process.

5. The method of claim 1, wherein, In the adaptation processing path, based on the geometric boundary features of the input data area, detecting whether the input data area contains memory reference information pointing to the caller process's address space includes: Obtain the address value at a predetermined offset position in the input data area; If the address value is equal to the sum of the starting address of the input data area and the length of the input data area, it is determined that the input data area contains memory reference information pointing to the address space of the calling process.

6. The method of claim 5, wherein, The method further includes: Extract additional memory reference information and additional data length information from another predetermined offset position in the input data area; When the transmission direction of the control request is from the calling process to the responding process, the data payload pointed to by the additional memory reference information is appended to the end of the input data area to form an extended input data area; Inter-process communication is performed by replacing the input data area with the extended input data area.

7. The method of claim 6, wherein, The construction of the proxy buffer to replace the original output data area parameters in the control request includes: The required capacity of the proxy buffer is determined based on the additional data length information and the preset state area length information. If the required capacity does not exceed a preset capacity threshold, a fixed-length storage area is allocated on the call stack of the calling process as the proxy buffer. If the required capacity exceeds the preset capacity threshold, the proxy buffer is obtained by allocating storage areas on demand through the dynamic storage allocation interface.

8. The method of claim 6, wherein, Based on the memory reference information, writing the processing result to the memory location pointed to by the memory reference information includes: The proxy buffer is split according to a preset layout, wherein the preset layout is a first region in front and a second region behind; Write the contents of the first region to the memory location pointed to by the additional memory reference information; Write the contents of the second region to the memory location pointed to by the memory reference information.

9. The method of claim 1, wherein, The method further includes: Extract additional memory reference information and additional data length information from another predetermined offset position in the input data area; When the transmission direction of the control request is from the calling process to the responding process, the data payload pointed to by the additional memory reference information is appended to the end of the input data area to form an extended input data area; Inter-process communication is performed by replacing the input data area with the extended input data area.

10. A cross-process control request handling system, characterized by, A compatibility layer environment applied to where the calling process and the responding process reside in different address spaces, the system includes: The tagging module is used to respond to an access request from a calling process for a target device and establish a mapping relationship between an access identifier for the target device and a specific category based on the context information of the access request. The routing module is used to receive control requests initiated by the calling process through the access identifier. The control requests are associated with an input data area and carry a protocol feature field for routing discrimination. The first detection module is used to determine the distribution path based on the mapping relationship and the protocol feature field; when the mapping relationship indicates that the access identifier belongs to a specific category, it determines whether to suppress the default processing path according to the relationship between the protocol feature field and the encoding corresponding to the default processing path, and distributes the control request to the adaptation processing path corresponding to the specific category. The second detection module is used to detect, based on the geometric boundary features of the input data area, whether the input data area contains memory reference information pointing to the address space of the caller process in the adaptation processing path. A construction module is used to construct a proxy buffer to replace the original output data area parameters in the control request and modify the transmission attributes of the control request when the memory reference information is detected. The communication module is used to send the modified control request and the proxy buffer to the responding process for processing and to obtain the processing result; The backfill module is used to write the processing result to the memory location pointed to by the memory reference information based on the memory reference information, so as to obtain the processing result of the control request.