User-mode program processing method and device, storage medium and processor
By setting up communication modules on the host and uninstall card of the cloud server, the user-state program obtains and maps file descriptors to call the kernel-state function module, the problem of inefficiency of syscall remote proxy is solved and more efficient business operation is achieved.
Patent Information
- Application Number
- CN202210225322.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-07
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2042-03-07
AI Technical Summary
In the prior art, the syscall remote proxy method is used to realize the calling efficiency of user-state programs and kernel-state functional modules is low, mainly due to the need to understand complex calling parameter information.
By setting the first communication module and the second communication module on the host and the uninstall card, the user-state program obtains the file descriptor on the host side, constructs the local file descriptor, and establishes a mapping relationship between them, thereby calling the kernel-state function Module.
This method improves the efficiency of user-state programs calling kernel-state functional modules, avoids the need to overwrite the call interface information, and solves the problem of inefficient syscall remote proxy method.
Smart Images

Figure CN114691390B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud servers, and in particular to a method and device for processing user-mode programs, a storage medium, and a processor. Background Art
[0002] At present, with the maturity of software and hardware integration technology, more and more enterprises realize the operation of their business through cloud servers. For the cloud servers (also called hosts) purchased by enterprises, they often hope to only include kernel-mode functional modules, and set user-mode programs on the offload card, because this approach can reduce the overhead of the host's computing nodes and improve the running speed of the host. After the user-mode program is unloaded to the offload card, the communication interface needs to be rewritten before the kernel-mode functional module can be called normally to complete the business operation. The existing technology adopts the syscall (system call) remote agent method to achieve this, but the syscall remote agent needs to understand the parameter information of each call. Since the call parameters are very complex and it is very difficult to fully understand, the use of the syscall remote agent has the problem of low efficiency.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present invention provide a method and device for processing a user-mode program, a storage medium, and a processor, so as to at least solve the technical problem of low efficiency caused by using a syscall remote proxy to realize normal business operation of the user-mode program.
[0005] According to one aspect of an embodiment of the present invention, a method for processing a user-state program is provided, comprising: the user-state program obtains a file descriptor on the host side through the first communication module and the second communication module, wherein the file descriptor on the host side is an identifier corresponding to a kernel-state function module that the user-state program needs to call; the user-state program constructs a local file descriptor through the second communication module, and constructs a mapping relationship between the local file descriptor and the file descriptor on the host side; the user-state program calls the kernel-state function module through the local file descriptor and the file descriptor on the host side, so that the user-state program responds to an ioctl request.
[0006] Furthermore, before the user-mode program obtains the file descriptor of the host side through the first communication module and the second communication module, the method also includes: processing the first communication module and the second communication module so that the first communication module and the second communication module can identify each other.
[0007] Furthermore, the first communication module and the second communication module are processed so that the first communication module and the second communication module can achieve mutual identification, including: the user state program controls the second communication module to generate a shared key verification code corresponding to the user state program; the shared key verification code is sent to the first communication module, wherein a target agent process corresponding to the shared key verification code is generated in the first communication module, and a first identifier is returned to the second communication module, the target agent process is used to implement the user state program calling the kernel state function module, and the first identifier indicates that the first communication module has generated the target agent process; when the second communication module receives the first identifier, it is confirmed that the first communication module and the second communication module have achieved mutual identification.
[0008] Furthermore, before the user-state program obtains the file descriptor of the host side through the first communication module and the second communication module, the method also includes: registering the kernel-state function module in the first communication module to obtain the file descriptor of the host side corresponding to the kernel-state function module.
[0009] Furthermore, the user-state program obtains the file descriptor of the host side through the first communication module and the second communication module, including: the user-state program controls the second communication module to send a second identifier to the first communication module, wherein, when the first communication module receives the second identifier, the file descriptor of the host side corresponding to the kernel-state function module that the user-state program needs to call is returned to the second communication module; and the file descriptor of the host side is received.
[0010] Furthermore, the user-state program calls the kernel-state function module through the local file descriptor and the file descriptor on the host side, so that the user-state program responds to the ioctl request, including: the user-state program sends an ioctl request to the local file descriptor; the local file descriptor responds to the ioctl request and encapsulates the ioctl request into a command identifier in a preset format; the second communication module sends the command identifier to the first communication module, wherein the target agent process generated by the first communication module parses the command identifier into a startup instruction, and sends the startup instruction to the file descriptor on the host side, and the target agent process is used to implement the user-state program calling the kernel-state function module; the file descriptor on the host side starts the kernel-state function module according to the startup instruction, so that the user-state program calls the kernel-state function module to complete the ioctl request.
[0011] Furthermore, after the user state program calls the kernel state function module through the local file descriptor and the file descriptor on the host side so that the user state program responds to the ioctl request, the method also includes: the second communication module monitors the status of the user state program; if the user state program is in a state of having completed the ioctl request, the second communication module sends a third identifier to the first communication module, wherein the third identifier indicates that the user state program has completed the business operation, and when the first communication module receives the third identifier, it sends a close instruction to the file descriptor on the host side; the file descriptor on the host side closes the kernel state function module according to the close instruction.
[0012] According to one aspect of an embodiment of the present invention, a system for processing user-mode programs is provided, comprising: a host, wherein the host includes at least one or more kernel-mode functional modules; an offload card, wherein the offload card includes at least one or more user-mode programs, and the user-mode program calls the kernel-mode functional module to enable the user-mode program to respond to an ioctl request; a first communication module, wherein the first communication module is arranged on the host; and a second communication module, wherein the second communication module is arranged on the offload card, and a file descriptor on the host side is obtained through the first communication module and the second communication module, a local file descriptor is constructed through the second communication module, and a mapping relationship between the local file descriptor and the file descriptor on the host side is constructed, and the user-mode program calls the kernel-mode functional module through the local file descriptor and the file descriptor on the host side to enable the user-mode program to respond to the ioctl request.
[0013] According to another aspect of an embodiment of the present invention, a processing device for a user-mode program is also provided, including: an acquisition unit, used by the user-mode program to acquire a file descriptor on the host side through the first communication module and the second communication module, wherein the file descriptor on the host side is an identifier corresponding to a kernel-mode functional module that the user-mode program needs to call; a construction unit, used by the user-mode program to construct a local file descriptor through the second communication module, and to construct a mapping relationship between the local file descriptor and the file descriptor on the host side; and a calling unit, used by the user-mode program to call the kernel-mode functional module through the local file descriptor and the file descriptor on the host side, so that the user-mode program responds to an ioctl request.
[0014] Furthermore, the device also includes: a processing unit, which is used for processing the first communication module and the second communication module before the user-state program obtains the file descriptor of the host side through the first communication module and the second communication module, so that the first communication module and the second communication module can identify each other.
[0015] Furthermore, the processing unit includes: a generation module, used by the user state program to control the second communication module to generate a shared key verification code corresponding to the user state program; a first sending module, used to send the shared key verification code to the first communication module, wherein a target agent process corresponding to the shared key verification code is generated in the first communication module, and a first identifier is returned to the second communication module, the target agent process is used to implement the user state program calling the kernel state function module, and the first identifier indicates that the first communication module has generated the target agent process; a confirmation module, used to confirm that the first communication module and the second communication module have achieved mutual identification when the second communication module receives the first identifier.
[0016] Furthermore, the device also includes: a registration unit, which is used to register the kernel state function module in the first communication module before the user state program obtains the file descriptor of the host side through the first communication module and the second communication module, so as to obtain the file descriptor of the host side corresponding to the kernel state function module.
[0017] Further, the acquisition unit includes: a second sending module, used for the user-state program to control the second communication module to send a second identifier to the first communication module, wherein, when the first communication module receives the second identifier, the file descriptor of the host side corresponding to the kernel-state function module that the user-state program needs to call is returned to the second communication module; and a receiving module, used to receive the file descriptor of the host side.
[0018] Furthermore, the calling unit includes: a third sending module, used for the user-state program to send an ioctl request to the local file descriptor; a processing module, used for the local file descriptor to respond to the ioctl request and encapsulate the ioctl request into a command identifier in a preset format; a fourth sending module, used for the second communication module to send the command identifier to the first communication module, wherein the target agent process generated by the first communication module parses the command identifier into a startup instruction and sends the startup instruction to the file descriptor on the host side, and the target agent process is used to implement the user-state program calling the kernel-state function module; a startup module, used for the file descriptor on the host side to start the kernel-state function module according to the startup instruction, so that the user-state program calls the kernel-state function module to complete the ioctl request.
[0019] Furthermore, the device also includes: a monitoring unit, used for, after the user state program calls the kernel state function module through the local file descriptor and the file descriptor on the host side so that the user state program responds to the ioctl request, the second communication module monitors the state of the user state program; a sending unit, used for, if the user state program is in a state of having completed the ioctl request, the second communication module sends a third identifier to the first communication module, wherein the third identifier indicates that the user state program has completed the business operation, and when the first communication module receives the third identifier, it sends a closing instruction to the file descriptor on the host side; a closing unit, used for the file descriptor on the host side to close the kernel state function module according to the closing instruction.
[0020] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores a program, wherein when the program is running, the device where the storage medium is located is controlled to execute any one of the above-mentioned user-mode program processing methods.
[0021] According to another aspect of an embodiment of the present invention, a processor is further provided, the processor being used to run a program, wherein the program executes any one of the above-mentioned methods for processing a user-mode program when the program is running.
[0022] In an embodiment of the present invention, a communication module is respectively set on the host and the offload card, and the file descriptor of the host side is obtained by the user-state program of the communication module, a local file descriptor is generated, and a mapping relationship between the file descriptor of the host side and the local file descriptor is established. The user-state program achieves the purpose of calling the kernel-state functional module to realize business operation through the local file descriptor and the file descriptor of the host side, thereby achieving the technical effect of improving efficiency, and further solving the technical problem of low efficiency caused by the use of syscall remote proxy to realize the normal operation of the user-state program. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0024] Figure 1 is a hardware structure block diagram of a computer terminal according to an embodiment of the present invention;
[0025] Figure 2 is a flowchart of a method for processing a user mode program provided according to a first embodiment of the present invention;
[0026] Figure 3 is a schematic diagram of a device for processing a user-mode program according to a third embodiment of the present invention;
[0027] Figure 4 It is a structural block diagram of an optional computer terminal according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] Example 1
[0031] According to an embodiment of the present invention, an embodiment of a method for processing a user-mode program is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0032] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for processing a user-mode program is shown. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more (shown as 102a, 102b, ..., 102n in the figure) processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0033] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As involved in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0034] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the processing method of the user-mode program in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the processing method of the user-mode program mentioned above. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0035] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0036] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0037] Under the above operating environment, this application provides Figure 2 The processing method of the user mode program is shown. Figure 2 4 is a flowchart of a method for processing a user mode program according to a first embodiment of the present invention.
[0038] Step S201: The user-mode program obtains a file descriptor on the host side through the first communication module and the second communication module, wherein the file descriptor on the host side is an identifier corresponding to a kernel-mode function module that the user-mode program needs to call.
[0039] Specifically, in order for the user-state program to call the kernel-state function module normally, the first communication module and the second communication module are firstly set on the host and the offload card respectively. The host includes multiple kernel-state function modules, and the offload card includes multiple user-state programs. Each user-state program needs to obtain the file descriptor on the host side corresponding to the kernel-state function module to be called through the first communication module and the second communication module. It should be noted that a user-state program may need to call multiple kernel-state function modules to practice the operation of the business. For example, the host includes kernel-state function module 1, kernel-state function module 2, kernel-state function module 3 and kernel-state function module 4; the offload card includes user-state program 1 and user-state program 2. User-state program 1 needs to call kernel-state function module 1 and kernel-state function module 2 to realize the business operation, so user-state program 1 obtains the file descriptor 1 on the host side and the file descriptor 2 on the host side corresponding to kernel-state function module 1 and kernel-state function module 2 through the first communication module and the second communication module. The operation of the kernel-state function module is realized through the file descriptor (filedescriptor, fd) on the host side.
[0040] Step S202: The user-mode program constructs a local file descriptor through the second communication module, and constructs a mapping relationship between the local file descriptor and the file descriptor on the host side.
[0041] Specifically, after the user-mode program obtains the fd on the host side, it constructs the local fd through the second communication module, and constructs a one-to-one correspondence between the fd on the host side and the local fd. For example, user-mode program 1 obtains fd1 on the host side and fd2 on the host side, and the communication module constructs local fd1 and local fd2. The mapping relationship is that local fd1 corresponds to fd1 on the host side, and local fd2 corresponds to fd2 on the host side.
[0042] Step S203: the user-mode program calls the kernel-mode function module through the local file descriptor and the file descriptor on the host side, so that the user-mode program responds to the ioctl request.
[0043] Specifically, the user-mode program accurately calls the corresponding kernel-mode function module through the host-side fd and the local fd to implement business operations, that is, to complete the ioctl request.
[0044] To summarize, by associating the fd on the host side with the local fd through the communication module, the user-mode program can call the kernel-mode function module to complete business operations, avoiding rewriting the calling interface information, and thus solving the technical problem of low efficiency caused by the use of syscall remote proxy to achieve normal business operations of user-mode programs.
[0045] Optionally, in the user-mode program processing method provided in Embodiment 1 of the present invention, before the user-mode program obtains the file descriptor on the host side through the first communication module and the second communication module, the method also includes: processing the first communication module and the second communication module so that the first communication module and the second communication module can identify each other.
[0046] Specifically, before the user-mode program obtains the file descriptor on the host side, the first communication module and the second communication module need to be processed so that the first communication module and the second communication module identify each other. Only when the first communication module and the second communication module identify each other can the user-mode program accurately obtain the file descriptor on the host side through the communication module.
[0047] Optionally, in the processing method of the user state program provided in the first embodiment of the present invention, the first communication module and the second communication module are processed so that the first communication module and the second communication module can achieve mutual identification, including: the user state program controls the second communication module to generate a shared key verification code corresponding to the user state program; the shared key verification code is sent to the first communication module, wherein a target proxy process corresponding to the shared key verification code is generated in the first communication module, and a first identifier is returned to the second communication module, the target proxy process is used to implement the user state program calling the kernel state function module, and the first identifier indicates that the first communication module has generated the target proxy process; when the second communication module receives the first identifier, it is confirmed that the first communication module and the second communication module have achieved mutual identification.
[0048] Specifically, the mutual identification of the first communication module and the second communication module includes: the user state program controls the second communication module to generate a shared key verification code (also known as a shared key) corresponding to the user state program, and sends this shared key to the first communication module, the first communication module generates a corresponding target proxy process according to the received shared key, and then the first communication module sends the identifier of the generated target proxy process (i.e. the above-mentioned first identifier) to the second communication module. When the second communication module receives the above-mentioned identifier, it indicates that the two communication modules have completed mutual identification. Through the above steps, the mutual identification between the first communication module and the second communication module is realized, and preparations are made for the subsequent accurate acquisition of the file descriptor on the host side.
[0049] Optionally, in the user-state program processing method provided in Embodiment 1 of the present invention, before the user-state program obtains the file descriptor of the host side through the first communication module and the second communication module, the method also includes: registering the kernel-state function module in the first communication module to obtain the file descriptor of the host side corresponding to the kernel-state function module.
[0050] Specifically, each kernel-mode functional module needs to be registered in the first communication module, so that subsequent user-mode programs can obtain the host-side descriptor corresponding to the kernel-mode functional module through the first communication module.
[0051] Optionally, in the processing method of the user-state program provided in Embodiment 1 of the present invention, the user-state program obtains the file descriptor of the host side through the first communication module and the second communication module, including: the user-state program controls the second communication module to send the second identifier to the first communication module, wherein, when the first communication module receives the second identifier, the file descriptor of the host side corresponding to the kernel-state function module that the user-state program needs to call is returned to the second communication module; and the file descriptor of the host side is received.
[0052] Specifically, the user state program sends the second identifier to the first communication module through the second communication module, and after receiving the second identifier, the second communication module returns the file descriptor of the host side corresponding to the kernel state function module that the user state program needs to call to the second communication module. Through the above steps, the user state program can accurately obtain the file descriptor of the host side.
[0053] Optionally, in the processing method of the user-state program provided in the first embodiment of the present invention, the user-state program calls the kernel-state function module through the local file descriptor and the file descriptor on the host side, so that the user-state program responds to the ioctl request, including: the user-state program sends the ioctl request to the local file descriptor; the local file descriptor responds to the ioctl request, and encapsulates the ioctl request into a command identifier in a preset format; the second communication module sends the command identifier to the first communication module, wherein the target proxy process generated by the first communication module parses the command identifier into a startup instruction, and sends the startup instruction to the file descriptor on the host side, and the target proxy process is used to implement the user-state program calling the kernel-state function module; the file descriptor on the host side starts the kernel-state function module according to the startup instruction, so that the user-state program calls the kernel-state function module to complete the ioctl request.
[0054] Specifically, the user-mode program calls the corresponding kernel-mode function module to respond to the ioctl request through the local file descriptor and the file descriptor on the host side, including: first, the user-mode program sends a request to execute a task (i.e., the above-mentioned ioctl request) to the local file descriptor, and the local descriptor encapsulates the request to execute the task into a command identifier in a preset format, and the second communication module sends the above-mentioned command identifier to the first communication module, and the first communication module immediately parses the command identifier into a startup instruction after receiving the command identifier, and sends the above-mentioned startup instruction to the file descriptor on the host side, and the file descriptor on the host side starts the corresponding kernel-mode function module, so that the user-mode program can call the kernel-mode function module to complete the business operation. Through the above steps, the user-mode program only needs to send a request to execute the task to realize the call of the kernel-mode function module.
[0055] Optionally, in the processing method of the user-state program provided in the first embodiment of the present invention, after the user-state program calls the kernel-state function module through the local file descriptor and the file descriptor on the host side so that the user-state program responds to the ioctl request, the method also includes: the second communication module monitors the status of the user-state program; if the user-state program is in the ioctl request completed state, the second communication module sends a third identifier to the first communication module, wherein the third identifier indicates that the user-state program has completed the business operation, and when the first communication module receives the third identifier, it sends a close instruction to the file descriptor on the host side; the file descriptor on the host side closes the kernel-state function module according to the close instruction.
[0056] Specifically, the second communication module monitors the state of the user-mode program. When the second communication module monitors that the user-mode program is in the state of completing the ioctl request, that is, the state of completing the business, the third identifier is sent to the first communication module, and the first communication module sends a closing instruction to the file descriptor on the host side, and the file descriptor on the host side closes the corresponding kernel-mode function module. After the user-mode program completes the business, the corresponding kernel-mode function module is closed in time to avoid the kernel-mode function module being in standby state for a long time, thereby reducing unnecessary waste of resources.
[0057] In summary, in the processing method of the user-mode program provided in the first embodiment of the present invention, the user-mode program obtains the file descriptor of the host side through the first communication module and the second communication module, wherein the file descriptor of the host side is the identifier corresponding to the kernel-mode function module that the user-mode program needs to call; the user-mode program constructs the local file descriptor through the second communication module, and constructs the mapping relationship between the local file descriptor and the file descriptor of the host side; the user-mode program calls the kernel-mode function module through the local file descriptor and the file descriptor of the host side, so that the user-mode program responds to the ioctl request, and solves the technical problem of low efficiency caused by the normal operation of the user-mode program's business by using the syscall remote proxy method. By associating the file descriptor of the host side with the local file descriptor through two communication modules, the user-mode program can call the kernel-mode function module to complete the business operation, avoid rewriting the calling interface information, and thus achieve the problem of improving efficiency.
[0058] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0059] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present invention.
[0060] Example 2
[0061] According to an embodiment of the present invention, there is also provided an embodiment of a processing system for a user-mode program. It should be noted that the above processing system can be used to execute the processing method for the user-mode program provided in the embodiment of the present application. The above processing system includes: a host, wherein the host includes at least one or more kernel-mode function modules; an uninstall card, wherein the uninstall card includes at least one or more user-mode programs, and the user-mode program calls the kernel-mode function module to make the user-mode program respond to the ioctl request; a first communication module, wherein the first communication module is arranged on the host; a second communication module, wherein the second communication module is arranged on the uninstall card, and the file descriptor of the host side is obtained through the first communication module and the second communication module, and the local file descriptor is constructed through the second communication module, and the mapping relationship between the local file descriptor and the file descriptor of the host side is constructed, and the user-mode program calls the kernel-mode function module through the local file descriptor and the file descriptor of the host side, so that the user-mode program responds to the ioctl request.
[0062] Specifically, the processing system of the user state program includes a host, an uninstall card, a first communication device and a second communication device. In order for the user state program to call the kernel state function module normally, the first communication module and the second communication module are respectively set on the host and the uninstall card. The host includes one or more kernel state function modules, and the uninstall card includes one or more user state programs. The user state program obtains the file descriptor of the host side through the first communication module and the second communication module, and then constructs the local file descriptor through the second communication module, and constructs the mapping relationship between the local file descriptor and the file descriptor of the host side. Finally, the user state program can call the corresponding kernel state function module through the local file descriptor and the file descriptor of the host side. Through the above-mentioned processing system, it is possible to realize that the user state program calls the kernel state function module to respond to the ioctl request, avoid rewriting the calling interface information, and improve the efficiency of business processing.
[0063] Example 3
[0064] According to an embodiment of the present invention, a processing device for implementing the above user mode program is also provided, such as Figure 3 As shown, the device includes: an acquisition unit 301, a construction unit 302 and a calling unit 303.
[0065] The acquisition unit 301 is used for the user-mode program to acquire the file descriptor of the host side through the first communication module and the second communication module, wherein the file descriptor of the host side is the identifier corresponding to the kernel-mode function module that the user-mode program needs to call.
[0066] The construction unit 302 is used for the user-mode program to construct a local file descriptor through the second communication module, and to construct a mapping relationship between the local file descriptor and the file descriptor on the host side.
[0067] The calling unit 303 is used for the user-mode program to call the kernel-mode function module through the local file descriptor and the file descriptor on the host side, so that the user-mode program responds to the ioctl request.
[0068] The processing device of the user-mode program provided in the third embodiment of the present invention obtains the file descriptor of the host side through the first communication module and the second communication module through the acquisition unit 301. The file descriptor of the host side is the identifier corresponding to the kernel-mode function module that the user-mode program needs to call. The construction unit 302 constructs the local file descriptor through the second communication module, and constructs the mapping relationship between the local file descriptor and the file descriptor on the host side. The calling unit 303 calls the kernel-mode function module through the local file descriptor and the file descriptor on the host side, so that the user-mode program responds to the ioctl request, which solves the technical problem of low efficiency caused by the normal operation of the user-mode program's business by using the syscall remote proxy method. Through two communication modules, the file descriptor on the host side is associated with the local file descriptor, so that the user-mode program can call the kernel-mode function module to complete the business operation, avoid rewriting the calling interface information, and thus achieve the problem of improving efficiency.
[0069] Optionally, in the processing device for the user-mode program provided in Embodiment 3 of the present invention, the device also includes: a processing unit, which is used to process the first communication module and the second communication module before the user-mode program obtains the file descriptor of the host side through the first communication module and the second communication module, so that the first communication module and the second communication module can identify each other.
[0070] Optionally, in the processing device for the user state program provided in Example 3 of the present invention, the processing unit includes: a generation module, which is used for the user state program to control the second communication module to generate a shared key verification code corresponding to the user state program; a first sending module, which is used to send the shared key verification code to the first communication module, wherein a target proxy process corresponding to the shared key verification code is generated in the first communication module, and a first identifier is returned to the second communication module, the target proxy process is used to implement the user state program calling the kernel state function module, and the first identifier indicates that the first communication module has generated the target proxy process; and a confirmation module, which is used to confirm that the first communication module and the second communication module have achieved mutual identification when the second communication module receives the first identifier.
[0071] Optionally, in the processing device for user-mode programs provided in Embodiment 3 of the present invention, the device further includes: a registration unit, for registering the kernel-mode functional module in the first communication module before the user-mode program obtains the file descriptor on the host side through the first communication module and the second communication module, so as to obtain the file descriptor on the host side corresponding to the kernel-mode functional module.
[0072] Optionally, in the processing device of the user-mode program provided in Example 3 of the present invention, the acquisition unit includes: a second sending module, used for the user-mode program to control the second communication module to send a second identifier to the first communication module, wherein, when the first communication module receives the second identifier, the file descriptor of the host side corresponding to the kernel-mode function module that the user-mode program needs to call is returned to the second communication module; and a receiving module, used to receive the file descriptor of the host side.
[0073] Optionally, in the processing device of the user-state program provided in Example 3 of the present invention, the calling unit includes: a third sending module, used for the user-state program to send an ioctl request to a local file descriptor; a processing module, used for the local file descriptor to respond to the ioctl request, and encapsulate the ioctl request into a command identifier in a preset format; a fourth sending module, used for the second communication module to send the command identifier to the first communication module, wherein the target agent process generated by the first communication module parses the command identifier into a startup instruction, and sends the startup instruction to the file descriptor on the host side, and the target agent process is used to implement the user-state program calling the kernel-state function module; a startup module, used for the file descriptor on the host side to start the kernel-state function module according to the startup instruction, so that the user-state program calls the kernel-state function module to complete the ioctl request.
[0074] Optionally, in the processing device for the user-state program provided in the third embodiment of the present invention, the device also includes: a monitoring unit, which is used for the second communication module to monitor the status of the user-state program after the user-state program calls the kernel-state function module through the local file descriptor and the file descriptor on the host side so that the user-state program responds to the ioctl request; a sending unit, which is used for the second communication module to send a third identifier to the first communication module if the user-state program is in a state of completing the ioctl request, wherein the third identifier indicates that the user-state program has completed the business operation, and when the first communication module receives the third identifier, it sends a close instruction to the file descriptor on the host side; and a closing unit, which is used for the file descriptor on the host side to close the kernel-state function module according to the close instruction.
[0075] It should be noted that the above-mentioned acquisition unit 301, construction unit 302 and calling unit 303 correspond to steps S201 to S203 in Example 1, and the examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 3. It should be noted that the above-mentioned modules as part of the device can be run in the computer terminal 10 provided in Example 3.
[0076] Example 4
[0077] The embodiment of the present invention can provide a computer terminal, which can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal can also be replaced by a terminal device such as a mobile terminal.
[0078] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of the computer network.
[0079] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the processing method of the user-state program: the user-state program obtains the file descriptor on the host side through the first communication module and the second communication module, wherein the file descriptor on the host side is the identifier corresponding to the kernel-state function module that the user-state program needs to call; the user-state program constructs a local file descriptor through the second communication module, and constructs a mapping relationship between the local file descriptor and the file descriptor on the host side; the user-state program calls the kernel-state function module through the local file descriptor and the file descriptor on the host side, so that the user-state program responds to the ioctl request.
[0080] The computer terminal can also execute the program code of the following steps in the method for processing a user-mode program: processing the first communication module and the second communication module so that the first communication module and the second communication module can identify each other.
[0081] The above-mentioned computer terminal can also execute the program code of the following steps in the processing method of the user state program: processing the first communication module and the second communication module so that the first communication module and the second communication module can achieve mutual identification, including: the user state program controls the second communication module to generate a shared key verification code corresponding to the user state program; sending the shared key verification code to the first communication module, wherein a target proxy process corresponding to the shared key verification code is generated in the first communication module, and a first identifier is returned to the second communication module, the target proxy process is used to implement the user state program calling the kernel state function module, and the first identifier indicates that the first communication module has generated the target proxy process; when the second communication module receives the first identifier, it is confirmed that the first communication module and the second communication module have achieved mutual identification.
[0082] The computer terminal can also execute the program code of the following steps in the method for processing a user-mode program: registering the kernel-mode function module in the first communication module to obtain a file descriptor on the host side corresponding to the kernel-mode function module.
[0083] The above-mentioned computer terminal can also execute the program code of the following steps in the processing method of the user-state program: the user-state program obtains the file descriptor on the host side through the first communication module and the second communication module, including: the user-state program controls the second communication module to send the second identifier to the first communication module, wherein, when the first communication module receives the second identifier, the file descriptor on the host side corresponding to the kernel-state function module that the user-state program needs to call is returned to the second communication module; and the file descriptor on the host side is received.
[0084] The above-mentioned computer terminal can also execute the program code of the following steps in the processing method of the user-state program: the user-state program calls the kernel-state function module through the local file descriptor and the file descriptor on the host side, so that the user-state program responds to the ioctl request, including: the user-state program sends the ioctl request to the local file descriptor; the local file descriptor responds to the ioctl request, and encapsulates the ioctl request into a command identifier in a preset format; the second communication module sends the command identifier to the first communication module, wherein the target proxy process generated by the first communication module parses the command identifier into a startup instruction, and sends the startup instruction to the file descriptor on the host side, and the target proxy process is used to implement the user-state program calling the kernel-state function module; the file descriptor on the host side starts the kernel-state function module according to the startup instruction, so that the user-state program calls the kernel-state function module to complete the ioctl request.
[0085] The above-mentioned computer terminal can also execute the program code of the following steps in the processing method of the user state program: the second communication module monitors the status of the user state program; if the user state program is in a completed ioctl request state, the second communication module sends a third identifier to the first communication module, wherein the third identifier indicates that the user state program has completed the ioctl request, and when the first communication module receives the third identifier, it sends a close instruction to the file descriptor on the host side; the file descriptor on the host side closes the kernel state function module according to the close instruction.
[0086] Figure 4 is a structural block diagram of a computer terminal according to an embodiment of the present invention. Figure 4 As shown, the computer terminal 10 may include: one or more (only one is shown in the figure) processors and a memory.
[0087] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the processing method and device of the user-mode program in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned processing method of the user-mode program. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0088] The processor can call the information and application programs stored in the memory through the transmission device to execute the following steps: the user-state program obtains the file descriptor of the host side through the first communication module and the second communication module, wherein the file descriptor of the host side is the identifier corresponding to the kernel-state function module that the user-state program needs to call; the user-state program constructs a local file descriptor through the second communication module, and constructs a mapping relationship between the local file descriptor and the file descriptor on the host side; the user-state program calls the kernel-state function module through the local file descriptor and the file descriptor on the host side, so that the user-state program responds to the ioctl request.
[0089] The processor may also execute program codes of the following steps: processing the first communication module and the second communication module so that the first communication module and the second communication module can identify each other.
[0090] The above-mentioned processor can also execute the program code of the following steps: the user state program controls the second communication module to generate a shared key verification code corresponding to the user state program; the shared key verification code is sent to the first communication module, wherein a target proxy process corresponding to the shared key verification code is generated in the first communication module, and a first identifier is returned to the second communication module, the target proxy process is used to implement the user state program calling the kernel state function module, and the first identifier indicates that the first communication module has generated the target proxy process; when the second communication module receives the first identifier, it is confirmed that the first communication module and the second communication module have achieved mutual identification.
[0091] The processor may also execute program code of the following steps: registering the kernel state function module in the first communication module, and obtaining a file descriptor of the host side corresponding to the kernel state function module.
[0092] The above-mentioned processor can also execute the program code of the following steps: the user-state program controls the second communication module to send the second identifier to the first communication module, wherein, when the first communication module receives the second identifier, the file descriptor on the host side corresponding to the kernel-state function module that the user-state program needs to call is returned to the second communication module; and the file descriptor on the host side is received.
[0093] The above-mentioned processor can also execute the program code of the following steps: the user-state program sends an ioctl request to the local file descriptor; the local file descriptor responds to the ioctl request and encapsulates the ioctl request into a command identifier in a preset format; the second communication module sends the command identifier to the first communication module, wherein the target proxy process generated by the first communication module parses the command identifier into a startup instruction and sends the startup instruction to the file descriptor on the host side, and the target proxy process is used to implement the user-state program calling the kernel-state function module; the file descriptor on the host side starts the kernel-state function module according to the startup instruction, so that the user-state program calls the kernel-state function module to complete the ioctl request.
[0094] The above-mentioned processor can also execute the program code of the following steps: the second communication module monitors the status of the user state program; if the user state program is in the state of completing the ioctl request, the second communication module sends a third identifier to the first communication module, wherein the third identifier indicates that the user state program has completed the ioctl request, and when the first communication module receives the third identifier, it sends a close instruction to the file descriptor on the host side; the file descriptor on the host side closes the kernel state function module according to the close instruction.
[0095] By adopting the embodiment of the present invention, a method for processing a user-mode program is provided. In the method of respectively setting communication modules on a host and an offload card, the user-mode program obtains a file descriptor on the host side through the communication module, generates a local file descriptor, and establishes a mapping relationship between the file descriptor on the host side and the local file descriptor. The user-mode program achieves the purpose of calling a kernel-mode function module to make the user-mode program respond to an ioctl request through the local file descriptor and the file descriptor on the host side, thereby achieving the technical effect of improving efficiency, and further solving the technical problem of low efficiency caused by the use of a syscall remote proxy to achieve normal business operation of the user-mode program.
[0096] It can be understood by those skilled in the art that Figure 4 The structure shown is for illustration only, and the computer terminal may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Figure 4The structure of the electronic device is not limited. For example, the computer terminal 10 may also include Figure 4 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 4 Different configurations are shown.
[0097] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0098] The embodiment of the present invention further provides a computer-readable storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the method for processing a user-mode program provided in the third embodiment.
[0099] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0100] Optionally, in this embodiment, the above-mentioned storage medium is configured to store program codes for executing the following steps: the user state program obtains the file descriptor of the host side through the first communication module and the second communication module, wherein the file descriptor of the host side is the identifier corresponding to the kernel state function module that the user state program needs to call; the user state program constructs a local file descriptor through the second communication module, and constructs a mapping relationship between the local file descriptor and the file descriptor on the host side; the user state program calls the kernel state function module through the local file descriptor and the file descriptor on the host side, so that the user state program responds to the ioctl request.
[0101] The storage medium is also configured to store program codes for executing the following steps: processing the first communication module and the second communication module so that the first communication module and the second communication module can identify each other.
[0102] The storage medium is also configured to store program codes for executing the following steps: the user state program controls the second communication module to generate a shared key verification code corresponding to the user state program; the shared key verification code is sent to the first communication module, wherein a target proxy process corresponding to the shared key verification code is generated in the first communication module, and a first identifier is returned to the second communication module, the target proxy process is used to implement the user state program calling the kernel state function module, and the first identifier indicates that the first communication module has generated the target proxy process; when the second communication module receives the first identifier, it is confirmed that the first communication module and the second communication module have achieved mutual identification. The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments.
[0103] The storage medium is also configured to store program codes for executing the following steps: registering the kernel state function module in the first communication module, and obtaining a host-side file descriptor corresponding to the kernel state function module.
[0104] The above-mentioned storage medium is also configured to store program codes for executing the following steps: the user-mode program controls the second communication module to send a second identifier to the first communication module, wherein, when the first communication module receives the second identifier, the file descriptor on the host side corresponding to the kernel-mode function module that the user-mode program needs to call is returned to the second communication module; and the file descriptor on the host side is received.
[0105] The above-mentioned storage medium is also configured to store program codes for executing the following steps: a user-mode program sends an ioctl request to a local file descriptor; the local file descriptor responds to the ioctl request and encapsulates the ioctl request into a command identifier in a preset format; the second communication module sends the command identifier to the first communication module, wherein the target proxy process generated by the first communication module parses the command identifier into a startup instruction and sends the startup instruction to the file descriptor on the host side, and the target proxy process is used to implement the user-mode program calling the kernel-mode function module; the file descriptor on the host side starts the kernel-mode function module according to the startup instruction, so that the user-mode program calls the kernel-mode function module to complete the ioctl request.
[0106] The above-mentioned storage medium is also configured to store program codes for executing the following steps: the second communication module monitors the status of the user-state program; if the user-state program is in a state of having completed an ioctl request, the second communication module sends a third identifier to the first communication module, wherein the third identifier indicates that the user-state program has completed the ioctl request, and when the first communication module receives the third identifier, a close instruction is sent to the file descriptor on the host side; the file descriptor on the host side closes the kernel-state function module according to the close instruction.
[0107] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0108] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0109] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0110] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0111] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0112] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for processing a user-mode program, characterized in that: include: The user state program obtains the file descriptor of the host side through the first communication module and the second communication module, wherein the file descriptor of the host side is the identifier corresponding to the kernel state function module that the user state program needs to call; The user state program constructs a local file descriptor through the second communication module, and constructs a mapping relationship between the local file descriptor and the file descriptor on the host side; The user state program calls the kernel state function module through the local file descriptor and the file descriptor of the host side, so that the user state program responds to the ioctl request; The user state program calls the kernel state function module through the local file descriptor and the file descriptor of the host side so that the user state program responds to the ioctl request, including: The local file descriptor encapsulates the ioctl request into a command identifier in a preset format; The first communication module parses the command identifier into a startup instruction, and the file descriptor on the host side starts the kernel state function module according to the startup instruction, so that the user state program calls the kernel state function module to complete the ioctl request.
2. The method according to claim 1, characterized in that: Before the user-mode program obtains the file descriptor of the host side through the first communication module and the second communication module, the method further includes: The first communication module and the second communication module are processed so that the first communication module and the second communication module can identify each other.
3. The method according to claim 2, characterized in that Processing the first communication module and the second communication module so that the first communication module and the second communication module can identify each other includes: The user state program controls the second communication module to generate a shared key verification code corresponding to the user state program; Sending the shared key verification code to the first communication module, wherein a target proxy process corresponding to the shared key verification code is generated in the first communication module, and a first identifier is returned to the second communication module, the target proxy process is used to implement the user state program calling the kernel state function module, and the first identifier indicates that the first communication module has generated the target proxy process; When the second communication module receives the first identification, it is confirmed that the first communication module and the second communication module have achieved mutual identification.
4. The method according to claim 1, characterized in that Before the user-mode program obtains the file descriptor of the host side through the first communication module and the second communication module, the method further includes: The kernel state function module is registered in the first communication module to obtain a host-side file descriptor corresponding to the kernel state function module.
5. The method according to claim 1, characterized in that The user state program obtains the file descriptor of the host side through the first communication module and the second communication module, including: The user-mode program controls the second communication module to send a second identifier to the first communication module, wherein, when the first communication module receives the second identifier, a file descriptor of the host side corresponding to the kernel-mode function module that the user-mode program needs to call is returned to the second communication module; Receive the file descriptor of the host side.
6. The method according to claim 1, characterized in that The user state program calls the kernel state function module through the local file descriptor and the file descriptor of the host side, so that the user state program responds to the ioctl request, including: The user state program sends an ioctl request to the local file descriptor; The local file descriptor responds to the ioctl request and encapsulates the ioctl request into a command identifier in a preset format; The second communication module sends the command identifier to the first communication module, wherein the target proxy process generated by the first communication module parses the command identifier into a startup instruction and sends the startup instruction to the file descriptor on the host side, and the target proxy process is used to implement the user state program calling the kernel state function module; The file descriptor on the host side starts the kernel state function module according to the startup instruction, so that the user state program calls the kernel state function module to complete the ioctl request.
7. The method according to claim 5, characterized in that After the user state program calls the kernel state function module through the local file descriptor and the file descriptor on the host side so that the user state program responds to the ioctl request, the method further includes: The second communication module monitors the user state program status; If the user-mode program is in a state of having completed the ioctl request, the second communication module sends a third identifier to the first communication module, wherein the third identifier indicates that the user-mode program has completed business operation, and when the first communication module receives the third identifier, a close instruction is sent to the file descriptor on the host side; The file descriptor on the host side closes the kernel mode function module according to the close instruction.
8. A user-mode program processing system, characterized in that: include: A host, wherein the host comprises at least one or more kernel-mode functional modules; An uninstall card, wherein the uninstall card at least comprises one or more user-mode programs, and the user-mode programs call the kernel-mode function module so that the user-mode programs respond to ioctl requests; A first communication module, wherein the first communication module is arranged on the host; a second communication module, wherein the second communication module is arranged on the offload card, obtains the file descriptor of the host side through the first communication module and the second communication module, constructs the local file descriptor through the second communication module, and constructs a mapping relationship between the local file descriptor and the file descriptor of the host side, and the user state program calls the kernel state function module through the local file descriptor and the file descriptor of the host side, so that the user state program responds to the ioctl request; The user state program calls the kernel state function module through the local file descriptor and the file descriptor of the host side, so that the user state program responds to the ioctl request, including: The local file descriptor encapsulates the ioctl request into a command identifier in a preset format; The first communication module parses the command identifier into a startup instruction, and the file descriptor on the host side starts the kernel state function module according to the startup instruction, so that the user state program calls the kernel state function module to complete the ioctl request.
9. A processing device for a user-mode program, characterized in that: include: An acquisition unit, used for the user-mode program to acquire a file descriptor on the host side through the first communication module and the second communication module, wherein the file descriptor on the host side is an identifier corresponding to a kernel-mode function module that the user-mode program needs to call; A construction unit, used for the user-mode program to construct a local file descriptor through the second communication module, and to construct a mapping relationship between the local file descriptor and the file descriptor on the host side; A calling unit, used for the user-mode program to call the kernel-mode function module through the local file descriptor and the file descriptor on the host side, so that the user-mode program responds to the ioctl request; The device is also used for: the local file descriptor encapsulates the ioctl request into a command identifier in a preset format; The first communication module parses the command identifier into a startup instruction, and the file descriptor on the host side starts the kernel state function module according to the startup instruction, so that the user state program calls the kernel state function module to complete the ioctl request.
10. A computer-readable storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the method for processing a user-mode program according to any one of claims 1 to 7.
11. A processor, characterized in that: The processor is used to run a program, wherein the program, when running, executes the method for processing a user-mode program according to any one of claims 1 to 7.
Citation Information
Patent Citations
User mode program memory allocation method and system and related components
CN111143072A
File management method and device, storage medium and computer equipment
CN113468112A