CN114691390A - User mode program processing method and device, storage medium and processor - Google Patents

User mode program processing method and device, storage medium and processor Download PDF

Info

Publication number
CN114691390A
CN114691390A CN202210225322.0A CN202210225322A CN114691390A CN 114691390 A CN114691390 A CN 114691390A CN 202210225322 A CN202210225322 A CN 202210225322A CN 114691390 A CN114691390 A CN 114691390A
Authority
CN
China
Prior art keywords
communication module
user mode
file descriptor
mode program
host side
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210225322.0A
Other languages
Chinese (zh)
Inventor
徐云
邹南海
沈益斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202210225322.0A priority Critical patent/CN114691390A/en
Publication of CN114691390A publication Critical patent/CN114691390A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • G06F9/548Object oriented; Remote method invocation [RMI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/545Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/544Remote

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a processing method and device of a user mode program, a storage medium and a processor. Wherein, the method comprises the following steps: the user mode program acquires a file descriptor of a host side through the first communication module and the second communication module, wherein the file descriptor of the host side is an identifier corresponding to a kernel mode function module which needs to be called by the user mode program; the user mode program constructs a local file descriptor through the second communication module and constructs a mapping relation between the local file descriptor and a file descriptor of the host side; and the user mode program calls the kernel mode functional module through the local file descriptor and the file descriptor of the host side so as to enable the user mode program to respond to the ioctl request. The invention solves the technical problem of low efficiency caused by adopting a syscall remote proxy mode to realize the normal operation of the service of the user mode program.

Description

User mode program processing method and device, storage medium and processor
Technical Field
The invention relates to the technical field of cloud servers, in particular to a user mode program processing method and device, a storage medium and a processor.
Background
At present, with the maturity of software and hardware integration technology, more and more enterprises realize the operation of company services through cloud servers, and for a cloud server (which may also be referred to as a host) purchased by an enterprise, it is often desired to include only a kernel mode functional module, and for a user mode program, the kernel mode functional module is set on an uninstalling card. After a user mode program is unloaded to an unloading card, a communication interface needs to be rewritten, and a kernel mode functional module can be normally called to complete service operation.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a processing method and device of a user mode program, a storage medium and a processor, which at least solve the technical problem of low efficiency caused by the fact that the service normal operation of the user mode program is realized by adopting a syscall remote proxy mode.
According to an aspect of the embodiments of the present invention, there is provided a processing method of a user mode program, including: the user mode program acquires a file descriptor of a host side through the first communication module and the second communication module, wherein the file descriptor of the host side is an identifier corresponding to a kernel mode function module which needs to be called by the user mode program; the user mode program constructs a local file descriptor through the second communication module and constructs a mapping relation between the local file descriptor and a file descriptor of the host side; and the user mode program calls the kernel mode functional module through the local file descriptor and the file descriptor of the host side so as to enable the user mode program to respond to the ioctl request.
Further, 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: and processing the first communication module and the second communication module so as to realize mutual identification of the first communication module and the second communication module.
Further, processing the first communication module and the second communication module to enable the first communication module and the second communication module to realize mutual identification includes: the user mode program controls the second communication module to generate a shared key verification code corresponding to the user mode program; sending 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 for enabling the user mode program to call the kernel mode function module, and the first identifier represents that the target agent process is generated by the first communication module; and under the condition that the second communication module receives the first identifier, confirming that the first communication module and the second communication module realize mutual identification.
Further, 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: and registering the kernel mode functional module in the first communication module to obtain a file descriptor of the host side corresponding to the kernel mode functional module.
Further, the obtaining, by the user mode program through the first communication module and the second communication module, the file descriptor of the host side includes: the user mode program controls the second communication module to send a second identifier to the first communication module, wherein under the condition that the first communication module receives the second identifier, a file descriptor of a host side corresponding to a kernel mode function module which needs to be called by the user mode program is returned to the second communication module; and receiving the file descriptor of the host side.
Further, the calling, by the user mode program, 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, including: the user mode 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 command identifier is analyzed into a starting instruction through a target agent process generated by the first communication module, the starting instruction is sent to a file descriptor of the host side, and the target agent process is used for realizing that the user mode program calls the kernel mode functional module; and the file descriptor of the host side starts the kernel mode functional module according to the starting instruction so that the user mode program calls the kernel mode functional module to complete the ioctl request.
Further, after 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 an ioctl request, the method further includes: the second communication module monitors the state of the user mode program; if the user mode 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 represents that the user mode program has completed service operation, and under the condition that the first communication module receives the third identifier, a closing instruction is sent to a file descriptor of the host side; and the file descriptor of the host side closes the kernel mode functional module according to the closing instruction.
According to an aspect of an embodiment of the present invention, there is provided a processing system of a user mode program, including: a host, wherein the host comprises at least one or more kernel-mode functional modules; unloading a card, wherein the unloading card at least comprises one or more user mode programs, and the user mode programs call the kernel mode functional module to enable the user mode programs to respond to ioctl requests; the first communication module is arranged on the host; the second communication module is arranged on the uninstall card, a file descriptor on a host side is obtained through the first communication module and the second communication module, a local file descriptor is built through the second communication module, a mapping relation between the local file descriptor and the file descriptor on the host side is built, and the user mode program calls the kernel mode function module through the local file descriptor and the file descriptor on the host side so as to enable the user mode program to respond to an ioctl request.
According to another aspect of the embodiments of the present invention, there is also provided a processing apparatus of a user mode program, including: an obtaining unit, configured to obtain, by the user mode program through the first communication module and the second communication module, a file descriptor on a host side, where 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; the building unit is used for building a local file descriptor by the user mode program through the second communication module and building a mapping relation between the local file descriptor and the file descriptor on the host side; and the calling unit is used for calling the kernel mode functional module by the user mode program through the local file descriptor and the file descriptor on the host side so as to enable the user mode program to respond to the ioctl request.
Further, the apparatus further comprises: and the processing unit is used for processing the first communication module and the second communication module before the user mode program acquires the file descriptor of the host side through the first communication module and the second communication module so as to realize mutual identification of the first communication module and the second communication module.
Further, the processing unit includes: the generating module is used for controlling the second communication module to generate a shared key verification code corresponding to the user mode program by the user mode program; a first sending module, configured to send the shared key verification code to the first communication module, where 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, where the target proxy process is used to enable the user mode program to call the kernel mode function module, and the first identifier indicates that the target proxy process has been generated by the first communication module; and the confirming module is used for confirming that the first communication module and the second communication module realize mutual identification under the condition that the second communication module receives the first identification.
Further, the apparatus further comprises: and the registering unit is used for registering the kernel mode functional module in the first communication module before the user mode program acquires the file descriptor of the host side through the first communication module and the second communication module, so as to acquire the file descriptor of the host side corresponding to the kernel mode functional module.
Further, the acquisition unit includes: a second sending module, configured to control, by the user mode program, the second communication module to send a second identifier to the first communication module, where, when the first communication module receives the second identifier, a file descriptor on the host side corresponding to a kernel mode function module that needs to be called by the user mode program is returned to the second communication module; a receiving module, configured to receive the file descriptor on the host side.
Further, the calling unit includes: a third sending module, configured to send, by the user mode program, an ioctl request to the local file descriptor; the processing module is used for responding to the ioctl request by the local file descriptor and packaging the ioctl request into a command identifier in a preset format; a fourth sending module, configured to send the command identifier to the first communication module by the second communication module, where the command identifier is analyzed into a start instruction by a target proxy process generated by the first communication module, and the start instruction is sent to the file descriptor on the host side, where the target proxy process is used to implement that the user mode program calls the kernel mode function module; and the starting module is used for starting the kernel mode functional module by the file descriptor of the host side according to the starting instruction so as to enable the user mode program to call the kernel mode functional module to complete the ioctl request.
Further, the apparatus further comprises: a monitoring unit, configured to call the kernel mode function module by the user mode program through the local file descriptor and the file descriptor on the host side, so that after the user mode program responds to an ioctl request, the second communication module monitors a state of the user mode program; a sending unit, configured to send, by the second communication module, a third identifier to the first communication module if the user mode program is in a state where the ioctl request is completed, where the third identifier indicates that the user mode program has completed service operation, and send a close instruction to the file descriptor on the host side when the first communication module receives the third identifier; and the closing unit is used for closing the kernel mode functional module by the file descriptor of the host side according to the closing instruction.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium storing a program, where the program, when executed, controls a device on the storage medium to execute the processing method of the user mode program.
According to another aspect of the embodiments of the present invention, there is also provided a processor, where the processor is configured to execute a program, where the program executes a processing method of any one of the above user mode programs when running.
In the embodiment of the invention, a mode of respectively setting communication modules on a host and an uninstalling card is adopted, a file descriptor at the host side is obtained through a communication module user mode program, a local file descriptor is generated, a mapping relation between the file descriptor at the host side and the local file descriptor is established, and the user mode program achieves the purpose of calling a kernel mode function module to realize service operation through the local file descriptor and the file descriptor at the host side, so that the technical effect of improving the efficiency is realized, and the technical problem of lower efficiency caused by the fact that the service normal operation of the user mode program is realized through a syscall remote agent mode is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware configuration of a computer terminal according to an embodiment of the present invention;
FIG. 2 is a flow chart of a processing method of a user mode program according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a processing device of a user mode program according to a third embodiment of the present invention;
fig. 4 is a block diagram of an alternative computer terminal according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
There is also provided, in accordance with an embodiment of the present invention, an embodiment of a method for processing a user-mode program, where it is noted that the steps illustrated in the flowchart of the accompanying figures may be implemented in a computer system such as a set of computer-executable instructions, and where, although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order different than here.
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Fig. 1 shows a hardware configuration block diagram of a computer terminal (or mobile device) for implementing a processing method of a user mode program. As shown in fig. 1, the computer terminal 10 (or mobile device 10) may include one or more processors (shown as 102a, 102b, … …, 102n in the figures) which may include, but are 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. Besides, the method can also comprise the following steps: 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), a network interface, a power source, and/or a camera. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the electronic device. For example, the computer terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
It should be noted that the one or more processors and/or other data processing circuitry described above may be referred to generally herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part in software, hardware, firmware, or any combination thereof. Further, the data processing circuit may be a single stand-alone processing module, or incorporated in whole or in part into any of the other elements in the computer terminal 10 (or mobile device). As referred to in the embodiments of the application, the data processing circuit acts as a processor control (e.g. selection of a variable resistance termination path connected to the interface).
The memory 104 may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the processing method of the user mode program in the embodiment of the present invention, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the processing method of the user mode program. The memory 104 may include high speed random access memory, and may also include 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 memory located remotely from the processor, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above 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 (NIC) that can be connected to other Network devices through a base station 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 in a wireless manner.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the computer terminal 10 (or mobile device).
Under the above operating environment, the present application provides a processing method of the user mode program as shown in fig. 2. Fig. 2 is a flowchart of a processing method of a user mode program according to a first embodiment of the present invention.
Step S201, the user mode program obtains a file descriptor of the host side through the first communication module and the second communication module, where the file descriptor of the host side is an identifier corresponding to a kernel mode function module that the user mode program needs to call.
Specifically, in order to enable the user mode program to normally call the kernel mode function module, first, a first communication module and a second communication module are respectively arranged on the host and the uninstall card. A plurality of kernel mode functional modules are included on the host, and a plurality of user mode programs are included on the offload card. Each user mode program needs to obtain a file descriptor of the host side corresponding to the kernel mode functional module needing to be called through the first communication module and the second communication module. It should be noted that one user mode program may need to call the operation of the plurality of kernel mode function modules practice the service. For example, the host comprises a kernel mode functional module 1, a kernel mode functional module 2, a kernel mode functional module 3 and a kernel mode functional module 4; the uninstalling card comprises a user mode program 1 and a user mode program 2. The user mode program 1 needs to call the kernel mode functional module 1 and the kernel mode functional module 2 to realize service operation, and then the user mode program 1 acquires the host side file descriptor 1 and the host side file descriptor 2 corresponding to the kernel mode functional module 1 and the kernel mode functional module 2 through the first communication module and the second communication module. The operation of the kernel mode function module is realized through a file descriptor (fd) on the host side.
Step S202, the user mode program constructs a local file descriptor through the second communication module, and constructs a mapping relation between the local file descriptor and a file descriptor on the host side.
Specifically, after the user mode program acquires the fd of the host side, a local fd is constructed through the second communication module, and a one-to-one correspondence relationship between the fd of the host side and the local fd is constructed. For example, the user mode program 1 acquires the fd1 on the host side and the fd2 on the host side, and the communication module constructs the local fd1 and the local fd 2. The mapping relationship is constructed such that the local fd1 corresponds to the fd1 of the host side, and the local fd2 corresponds to the fd2 of the host side.
In 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.
Specifically, the user mode program accurately calls the corresponding kernel mode function module through the fd of the host side and the local fd to realize service operation, that is, to complete an ioctl request.
In summary, by associating the fd of the host side with the local fd through the communication module, the user mode program can call the kernel mode function module to complete the service operation, and the rewriting of the call interface information is avoided, thereby solving the technical problem of low efficiency caused by the adoption of the syscall remote proxy mode to realize the normal service operation of the user mode program.
Optionally, in the processing method of the user mode program provided in the first embodiment 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 further includes: and processing the first communication module and the second communication module so as to realize mutual identification of the first communication module and the second communication module.
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 are identified with each other. Only if the first communication module and the second communication module are mutually identified, the user mode program can accurately obtain the file descriptor of the host side through the communication module.
Optionally, in the processing method of the user mode program provided in the first embodiment of the present invention, processing the first communication module and the second communication module to enable the first communication module and the second communication module to implement mutual identification includes: the user mode program controls the second communication module to generate a shared key verification code corresponding to the user mode program; sending the shared key verification code to a 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 a second communication module, the target proxy process is used for realizing that a user mode program calls a kernel mode function module, and the first identifier represents that the first communication module generates the target proxy process; and under the condition that the second communication module receives the first identifier, the first communication module and the second communication module are confirmed to realize mutual identification.
Specifically, the mutual identification of the first communication module and the second communication module includes: the user mode program controls the second communication module to generate a shared key verification code (or a shared key) corresponding to the user mode program, and sends the shared key to the first communication module, the first communication module generates a corresponding target agent process according to the received shared key, and then the first communication module sends an identifier (namely the first identifier) of the generated target agent process to the second communication module. And the second communication module receives the identification, and indicates that the two communication modules finish mutual identification. Through the steps, mutual identification between the first communication module and the second communication module is realized, and preparation is made for accurately acquiring the file descriptor of the host side subsequently.
Optionally, in the processing method of the user mode program provided in the first embodiment 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 further includes: and registering the kernel mode functional module in the first communication module to obtain a file descriptor of the host side corresponding to the kernel mode functional module.
Specifically, each kernel mode functional module needs to perform registration work in the first communication module, so that a subsequent user mode program can obtain a descriptor of the host side corresponding to the kernel mode functional module through the first communication module.
Optionally, in the processing method of the user mode program provided in the first embodiment of the present invention, the obtaining, by the user mode program through the first communication module and the second communication module, the file descriptor of the host side includes: the user mode program controls the second communication module to send a second identifier to the first communication module, wherein under the condition that the first communication module receives the second identifier, a file descriptor of the host side corresponding to the kernel mode functional module which needs to be called by the user mode program is returned to the second communication module; a file descriptor on a host side is received.
Specifically, the user mode program sends a 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 mode function module, which needs to be called by the user mode program, to the second communication module. Through the steps, the user mode program can accurately obtain the file descriptor of the host side.
Optionally, in the processing method of the user mode program provided in the first embodiment of the present invention, the calling, by the user mode program, 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, includes: the 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 command identifier is analyzed into a starting instruction through a target proxy process generated by the first communication module, the starting instruction is sent to a file descriptor on the host side, and the target proxy process is used for realizing that a user mode program calls a kernel mode function module; and starting the kernel mode functional module by the file descriptor of the host side according to the starting instruction so that the user mode program calls the kernel mode functional module to complete the ioctl request.
Specifically, the step of the user mode program calling a corresponding kernel mode functional module to respond to the ioctl request through the local file descriptor and the file descriptor on the host side includes: firstly, a user mode program sends a request for executing a task (namely, the ioctl request) to a local file descriptor, the local descriptor encapsulates the request for executing the task into a command identifier with a preset format, a second communication module sends the command identifier to a first communication module, the first communication module immediately resolves the command identifier into a starting instruction after receiving the command identifier and sends the starting instruction to a file descriptor at a host side, and the file descriptor at the host side starts a corresponding kernel mode function module, so that the user mode program can call the kernel mode function module to complete service operation. Through the steps, the user mode program can call the kernel mode functional module only by sending a request for executing the task.
Optionally, in the processing method of the user mode program provided in the first embodiment of the present invention, after 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, the method further includes: the second communication module monitors the state of the user mode program; if the user mode 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 represents that the user mode program has completed the service operation, and under the condition that the first communication module receives the third identifier, a closing instruction is sent to a file descriptor of the host side; and the file descriptor of the host side closes the kernel mode functional module according to the closing instruction.
Specifically, the second communication module monitors the state of the user mode program, and when the second communication module monitors that the user mode program is in a state of completing an ioctl request, that is, a state of completing service execution, the second communication module sends a third identifier to the first communication module, the first communication module sends a close instruction to the file descriptor on the host side, and the file descriptor on the host side closes the corresponding kernel mode function module. And after the user mode program completes the service, the corresponding kernel mode functional module is closed in time, so that the kernel mode functional module is prevented from being in a standby state for a long time, and the problem of unnecessary resource waste is reduced.
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, where the file descriptor of the host side is an identifier corresponding to a kernel mode function module that the user mode program needs to call; the user mode program constructs a local file descriptor through the second communication module and constructs a mapping relation between the local file descriptor and a file descriptor at the host side; the user mode program calls 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 the ioctl request, and the technical problem of low efficiency caused by the fact that the service normal operation of the user mode program is achieved in a syscall remote proxy mode is solved. Through the two communication modules, the file descriptor at the host side is associated with the local file descriptor, so that a user mode program can call the kernel mode functional module to complete service operation, the calling interface information is prevented from being rewritten, and the problem of improving efficiency is further solved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention or portions thereof contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes several instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the method of the embodiments of the present invention.
Example 2
According to the embodiment of the present invention, an embodiment of a processing system for a user mode program is further provided, and it should be noted that the processing system may be used to execute the processing method for a user mode program provided in the embodiment of the present application. The processing system comprises: the host computer comprises at least one or more kernel mode functional modules; the unloading card at least comprises one or more user mode programs, and the user mode programs call the kernel mode functional module to enable the user mode programs to respond to ioctl requests; the first communication module is arranged on the host; and the second communication module is arranged on the uninstalling card, the file descriptor of the host side is obtained through the first communication module and the second communication module, the local file descriptor is constructed through the second communication module, the mapping relation 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 as to enable the user mode program to respond to the ioctl request.
Specifically, the processing system of the user mode program comprises a host, an uninstalling card, a first communication device and a second communication device. In order to enable the user mode program to normally call the kernel mode functional module, a first communication module and a second communication module are respectively arranged on the host and the uninstalling card. One or more kernel-mode functional modules are included on the host and one or more user-mode programs are included on the offload card. And finally, the user mode program can call the corresponding kernel mode functional module through the local file descriptor and the file descriptor of the host side. By the processing system, the user mode program can call the kernel mode functional module to respond to the ioctl request, the calling interface information is prevented from being rewritten, and the service processing efficiency is improved.
Example 3
According to an embodiment of the present invention, there is further provided a processing apparatus for implementing the user mode program, as shown in fig. 3, the apparatus includes: an acquisition unit 301, a construction unit 302 and a calling unit 303.
An obtaining unit 301, configured to obtain, by the user mode program through the first communication module and the second communication module, a file descriptor on the host side, where 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.
The constructing unit 302 is configured to construct, by the user mode program, a local file descriptor through the second communication module, and construct a mapping relationship between the local file descriptor and the file descriptor on the host side.
A calling unit 303, configured to call, by the user mode program, 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.
In the processing apparatus of the user mode program according to the third embodiment of the present invention, the obtaining unit 301 obtains the file descriptor of the host side through the first communication module and the second communication module, where the file descriptor of the host side is an identifier corresponding to a kernel mode function module that needs to be called by the user mode program. The building unit 302 builds the local file descriptor through the second communication module, and builds a 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 by the user mode program through the local file descriptor and the file descriptor on the host side, so that the user mode program responds to the ioctl request, and the technical problem of low efficiency caused by normal operation of the service of the user mode program in a syscall remote proxy manner is solved. Through the two communication modules, the file descriptor at the host side is associated with the local file descriptor, so that a user mode program can call the kernel mode functional module to complete service operation, the calling interface information is prevented from being rewritten, and the problem of improving efficiency is further solved.
Optionally, in the processing apparatus of the user mode program provided in the third embodiment of the present invention, the apparatus further includes: and the processing unit is used for processing the first communication module and the second communication module before the user mode program acquires the file descriptor of the host side through the first communication module and the second communication module so as to realize mutual identification of the first communication module and the second communication module.
Optionally, in the processing apparatus of the user mode program provided in the third embodiment of the present invention, the processing unit includes: the generating module is used for controlling the second communication module to generate a shared key verification code corresponding to the user mode program by the user mode program; the first sending module is used for 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 for realizing that a user mode program calls a kernel mode function module, and the first identifier represents that the first communication module generates the target proxy process; and the confirmation module is used for confirming that the first communication module and the second communication module realize mutual identification under the condition that the second communication module receives the first identification.
Optionally, in the processing apparatus of the user mode program provided in the third embodiment of the present invention, the apparatus further includes: and the registration unit is used for registering the kernel mode functional module in the first communication module before the user mode program acquires 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 mode functional module.
Optionally, in the processing apparatus of the user mode program provided in the third embodiment of the present invention, the obtaining unit includes: the second sending module is used for controlling the second communication module to send a second identifier to the first communication module by the user mode program, wherein under the condition that the first communication module receives the second identifier, a file descriptor of the host side corresponding to the kernel mode functional module which needs to be called by the user mode program is returned to the second communication module; and the receiving module is used for receiving the file descriptor of the host side.
Optionally, in the processing apparatus of the user mode program provided in the third embodiment of the present invention, the invoking unit includes: the third sending module is used for sending the ioctl request to the local file descriptor by the user mode program; the processing module is used for responding the ioctl request by the local file descriptor and packaging the ioctl request into a command identifier in a preset format; the fourth sending module is used for sending the command identifier to the first communication module by the second communication module, wherein the command identifier is analyzed into a starting instruction by a target agent process generated by the first communication module, the starting instruction is sent to a file descriptor on the host side, and the target agent process is used for realizing that a user mode program calls a kernel mode function module; and the starting module is used for starting the kernel mode function module by the file descriptor of the host side according to the starting instruction so as to enable the user mode program to call the kernel mode function module to complete the ioctl request.
Optionally, in the processing apparatus of the user mode program provided in the third embodiment of the present invention, the apparatus further includes: the monitoring unit is used for calling the kernel mode functional module by the user mode program through the local file descriptor and the file descriptor on the host side so as to enable the user mode program to monitor the state of the user mode program after the user mode program responds to the ioctl request; the sending unit is used for sending a third identifier to the first communication module by the second communication module if the user mode program is in the state of completing the ioctl request, wherein the third identifier represents that the user mode program completes the service operation, and sending a closing instruction to the file descriptor of the host side under the condition that the first communication module receives the third identifier; and the closing unit is used for closing the kernel mode functional module by the file descriptor of the host side according to the closing instruction.
It should be noted here that the above-mentioned acquiring unit 301, constructing unit 302 and calling unit 303 correspond to steps S201 to S203 in embodiment 1, and the two modules are the same as the corresponding steps in the implementation example and application scenario, but are not limited to the disclosure in the above-mentioned third embodiment. It should be noted that the modules described above as a part of the apparatus may be operated in the computer terminal 10 provided in the third embodiment.
Example 4
The embodiment of the 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 may also be replaced with a terminal device such as a mobile terminal.
Optionally, in this embodiment, the computer terminal may be located in at least one network device of a plurality of network devices of a computer network.
In this embodiment, the computer terminal may execute program codes of the following steps in the processing method of the user-mode program: the user mode program acquires a file descriptor of a host side through a first communication module and a second communication module, wherein the file descriptor of the host side is an identifier corresponding to a kernel mode function module which needs to be called by the user mode program; the user mode program constructs a local file descriptor through the second communication module and constructs a mapping relation between the local file descriptor and a file descriptor at the host side; and the user mode program calls the kernel mode functional module through the local file descriptor and the file descriptor on the host side so as to enable the user mode program to respond to the ioctl request.
The computer terminal may further execute program codes of the following steps in the processing method of the user mode program: and processing the first communication module and the second communication module so as to realize mutual identification of the first communication module and the second communication module.
The computer terminal may further execute a program code of the following steps in the processing method of the user mode program: the first communication module and the second communication module are processed to realize mutual identification of the first communication module and the second communication module, and the method comprises the following steps: the user mode program controls the second communication module to generate a shared key verification code corresponding to the user mode program; sending the shared key verification code to a 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 a second communication module, the target proxy process is used for realizing that a user mode program calls a kernel mode function module, and the first identifier represents that the first communication module generates the target proxy process; and under the condition that the second communication module receives the first identifier, the first communication module and the second communication module are confirmed to realize mutual identification.
The computer terminal may further execute program codes of the following steps in the processing method of the user mode program: and registering the kernel mode functional module in the first communication module to obtain a file descriptor of the host side corresponding to the kernel mode functional module.
The computer terminal may further execute program codes of the following steps in the processing method of the user mode program: the user mode program obtains the file descriptor of the host side through the first communication module and the second communication module, and the method comprises the following steps: the user mode program controls the second communication module to send a second identifier to the first communication module, wherein under the condition that the first communication module receives the second identifier, a file descriptor of the host side corresponding to the kernel mode functional module which needs to be called by the user mode program is returned to the second communication module; a file descriptor on a host side is received.
The computer terminal may further execute program codes of the following steps in the processing method of the user mode program: 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, and the method comprises the following steps: the 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 identification to the first communication module, wherein the command identification is analyzed into a starting instruction through a target proxy process generated by the first communication module, the starting instruction is sent to a file descriptor of the host side, and the target proxy process is used for realizing that a user mode program calls a kernel mode function module; and starting the kernel mode functional module by the file descriptor of the host side according to the starting instruction so that the user mode program calls the kernel mode functional module to complete the ioctl request.
The computer terminal may further execute program codes of the following steps in the processing method of the user mode program: the second communication module monitors the state of the user mode program; if the user mode 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 represents that the user mode program completes the ioctl request, and under the condition that the first communication module receives the third identifier, a closing instruction is sent to a file descriptor on the host side; and the file descriptor of the host side closes the kernel mode functional module according to the closing instruction.
Fig. 4 is a block diagram of a computer terminal according to an embodiment of the present invention. As shown in fig. 4, the computer terminal 10 may include: one or more processors (only one shown), memory.
The memory may be configured to store software programs and modules, such as program instructions/modules corresponding to the processing method and apparatus for a user mode program in the embodiments of the present invention, and the processor executes various functional applications and data processing by operating the software programs and modules stored in the memory, that is, implements the processing method for the user mode program. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memories may further include a memory located remotely from the processor, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The processor can call the information and application program stored in the memory through the transmission device to execute the following steps: the user mode program acquires a 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 an identifier corresponding to a kernel mode functional module which needs to be called by the user mode program; the user mode program constructs a local file descriptor through the second communication module and constructs a mapping relation between the local file descriptor and a file descriptor at the host side; and the user mode program calls the kernel mode functional module through the local file descriptor and the file descriptor on the host side so as to enable the user mode program to respond to the ioctl request.
The processor may further execute the program code for: and processing the first communication module and the second communication module so as to realize mutual identification of the first communication module and the second communication module.
The processor may further execute the program code for: the user mode program controls the second communication module to generate a shared key verification code corresponding to the user mode program; sending the shared key verification code to a 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 a second communication module, the target proxy process is used for realizing that a user mode program calls a kernel mode function module, and the first identifier represents that the first communication module generates the target proxy process; and under the condition that the second communication module receives the first identifier, the first communication module and the second communication module are confirmed to realize mutual identification.
The processor may further execute the program code for: and registering the kernel mode functional module in the first communication module to obtain a file descriptor of the host side corresponding to the kernel mode functional module.
The processor may further execute the program code for: the user mode program controls the second communication module to send a second identifier to the first communication module, wherein under the condition that the first communication module receives the second identifier, a file descriptor of the host side corresponding to the kernel mode functional module which needs to be called by the user mode program is returned to the second communication module; a file descriptor on a host side is received.
The processor may further execute the program code for: the 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 identification to the first communication module, wherein the command identification is analyzed into a starting instruction through a target proxy process generated by the first communication module, the starting instruction is sent to a file descriptor of the host side, and the target proxy process is used for realizing that a user mode program calls a kernel mode function module; and starting the kernel mode functional module by the file descriptor of the host side according to the starting instruction so that the user mode program calls the kernel mode functional module to complete the ioctl request.
The processor may further execute the program code for: the second communication module monitors the state of the user mode program; if the user mode 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 represents that the user mode program completes the ioctl request, and under the condition that the first communication module receives the third identifier, a closing instruction is sent to a file descriptor on the host side; and the file descriptor of the host side closes the kernel mode functional module according to the closing instruction.
The embodiment of the invention provides a processing method of a user mode program, which adopts a mode of respectively setting communication modules on a host and an uninstalling card, obtains a file descriptor at the host side through the user mode program of the communication modules, generates a local file descriptor, and establishes a mapping relation between the file descriptor at the host side and the local file descriptor, and the user mode program achieves the purpose of calling a kernel mode functional module to enable the user mode program to respond to an ioctl request through the local file descriptor and the file descriptor at the host side, thereby realizing the technical effect of improving the efficiency and further solving the technical problem of lower efficiency caused by the fact that the service normal operation of the user mode program is realized by adopting a syscall remote agent mode.
It can be understood by those skilled in the art that the structure shown in fig. 4 is only an illustration, and the computer terminal may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 4 does not limit the structure of the electronic device. For example, the computer terminal 10 may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 4, or have a different configuration than shown in FIG. 4.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Embodiments of the present invention also provide a computer-readable storage medium. Optionally, in this embodiment, the storage medium may be configured to store a program code executed by the processing method of the user mode program provided in the third embodiment.
Optionally, in this embodiment, the storage medium may be located in any one of computer terminals in a computer terminal group in a computer network, or in any one of mobile terminals in a mobile terminal group.
Optionally, in this embodiment, the storage medium is configured to store program codes for performing the following steps: the user mode program acquires a file descriptor of a host side through a first communication module and a second communication module, wherein the file descriptor of the host side is an identifier corresponding to a kernel mode function module which needs to be called by the user mode program; the user mode program constructs a local file descriptor through the second communication module and constructs a mapping relation between the local file descriptor and a file descriptor at the host side; and the user mode program calls the kernel mode functional module through the local file descriptor and the file descriptor on the host side so as to enable the user mode program to respond to the ioctl request.
The storage medium described above is further configured to store program code for performing the steps of: and processing the first communication module and the second communication module so as to realize mutual identification of the first communication module and the second communication module.
The storage medium is further configured to store program code for performing the steps of: the user mode program controls the second communication module to generate a shared key verification code corresponding to the user mode program; sending the shared key verification code to a 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 a second communication module, the target proxy process is used for realizing that a user mode program calls a kernel mode function module, and the first identifier represents that the first communication module generates the target proxy process; and under the condition that the second communication module receives the first identifier, the first communication module and the second communication module are confirmed to realize mutual identification. The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The storage medium is further configured to store program code for performing the steps of: and registering the kernel mode functional module in the first communication module to obtain a file descriptor of the host side corresponding to the kernel mode functional module.
The storage medium is further configured to store program code for performing the steps of: the user mode program controls the second communication module to send a second identifier to the first communication module, wherein under the condition that the first communication module receives the second identifier, a file descriptor of the host side corresponding to the kernel mode functional module which needs to be called by the user mode program is returned to the second communication module; a file descriptor on the host side is received.
The storage medium is further configured to store program code for performing the steps of: the 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 identification to the first communication module, wherein the command identification is analyzed into a starting instruction through a target proxy process generated by the first communication module, the starting instruction is sent to a file descriptor of the host side, and the target proxy process is used for realizing that a user mode program calls a kernel mode function module; and starting the kernel mode functional module by the file descriptor of the host side according to the starting instruction so that the user mode program calls the kernel mode functional module to complete the ioctl request.
The storage medium described above is further configured to store program code for performing the steps of: the second communication module monitors the state of the user mode program; if the user mode 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 represents that the user mode program completes the ioctl request, and under the condition that the first communication module receives the third identifier, a closing instruction is sent to a file descriptor on the host side; and the file descriptor of the host side closes the kernel mode functional module according to the closing instruction.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be an indirect coupling or communication connection through some interfaces, units or modules, and may be electrical or in other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (11)

1. A processing method of a user mode program is characterized by comprising the following steps:
a user mode program acquires a file descriptor of a host side through a first communication module and a second communication module, wherein the file descriptor of the host side is an identifier corresponding to a kernel mode function module which needs to be called by the user mode program;
the user mode program constructs a local file descriptor through the second communication module and constructs a mapping relation between the local file descriptor and a file descriptor of the host side;
and the user mode program calls the kernel mode functional module through the local file descriptor and the file descriptor of the host side so as to enable the user mode program to respond to the ioctl request.
2. The method according to claim 1, wherein before the user mode program obtains the host-side file descriptor through the first communication module and the second communication module, the method further comprises:
and processing the first communication module and the second communication module so as to realize mutual identification of the first communication module and the second communication module.
3. The method of claim 2, wherein processing the first communication module and the second communication module to enable the first communication module and the second communication module to identify each other comprises:
the user mode program controls the second communication module to generate a shared key verification code corresponding to the user mode program;
sending 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 for enabling the user mode program to call the kernel mode function module, and the first identifier represents that the target agent process is generated by the first communication module;
and under the condition that the second communication module receives the first identifier, confirming that the first communication module and the second communication module realize mutual identification.
4. The method according to claim 1, wherein before the user mode program obtains the host-side file descriptor through the first communication module and the second communication module, the method further comprises:
and registering the kernel mode functional module in the first communication module to obtain a file descriptor of the host side corresponding to the kernel mode functional module.
5. The method according to claim 1, wherein the user mode program obtains the host-side file descriptor through the first communication module and the second communication module, and the method comprises:
the user mode program controls the second communication module to send a second identifier to the first communication module, wherein under the condition that the first communication module receives the second identifier, a file descriptor of a host side corresponding to a kernel mode function module which needs to be called by the user mode program is returned to the second communication module;
and receiving the file descriptor of the host side.
6. The method according to claim 1, wherein the user mode program calls the kernel mode function module through the local file descriptor and the host side file descriptor to enable the user mode program to respond to an ioctl request, and the method comprises:
the user mode 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 command identifier is analyzed into a starting instruction through a target proxy process generated by the first communication module, the starting instruction is sent to a file descriptor on the host side, and the target proxy process is used for realizing that the user mode program calls the kernel mode function module;
and the file descriptor of the host side starts the kernel mode functional module according to the starting instruction so that the user mode program calls the kernel mode functional module to complete the ioctl request.
7. The method according to claim 5, wherein after the user mode program calls the kernel mode function module through the local file descriptor and the host side file descriptor to make the user mode program respond to an ioctl request, the method further comprises:
the second communication module monitors the state of the user mode program;
if the user mode 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 represents that the user mode program has completed service operation, and under the condition that the first communication module receives the third identifier, a closing instruction is sent to a file descriptor of the host side;
and the file descriptor of the host side closes the kernel mode functional module according to the closing instruction.
8. A system for processing a user mode program, comprising:
a host, wherein the host comprises at least one or more kernel-mode functional modules;
the method comprises the steps that an uninstalling card at least comprises one or more user mode programs, and the user mode programs call a kernel mode function module to enable the user mode programs to respond to ioctl requests;
the first communication module is arranged on the host;
the second communication module is arranged on the uninstalling card, the first communication module and the second communication module are used for acquiring a file descriptor at a host side, a local file descriptor is established through the second communication module, a mapping relation between the local file descriptor and the file descriptor at the host side is established, and the user mode program calls the kernel mode function module through the local file descriptor and the file descriptor at the host side so as to enable the user mode program to respond to an ioctl request.
9. A processing apparatus for a user mode program, comprising:
the device comprises an acquisition unit, a first communication module and a second communication module, wherein the acquisition unit is used for acquiring a file descriptor of a host side by a user mode program through the first communication module and the second communication module, and the file descriptor of the host side is an identifier corresponding to a kernel mode function module which needs to be called by the user mode program;
the building unit is used for building a local file descriptor by the user mode program through the second communication module and building a mapping relation between the local file descriptor and the file descriptor on the host side;
and the calling unit is used for calling the kernel mode functional module by the user mode program through the local file descriptor and the file descriptor on the host side so as to enable the user mode program to respond to the ioctl request.
10. A computer-readable storage medium, characterized in that the storage medium includes a stored program, and when the program runs, the apparatus on which the storage medium is located is controlled to execute the processing method of the user mode program according to any one of claims 1 to 7.
11. A processor, configured to execute a program, wherein the program executes to perform the processing method of the user-mode program according to any one of claims 1 to 7.
CN202210225322.0A 2022-03-07 2022-03-07 User mode program processing method and device, storage medium and processor Pending CN114691390A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210225322.0A CN114691390A (en) 2022-03-07 2022-03-07 User mode program processing method and device, storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210225322.0A CN114691390A (en) 2022-03-07 2022-03-07 User mode program processing method and device, storage medium and processor

Publications (1)

Publication Number Publication Date
CN114691390A true CN114691390A (en) 2022-07-01

Family

ID=82137542

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210225322.0A Pending CN114691390A (en) 2022-03-07 2022-03-07 User mode program processing method and device, storage medium and processor

Country Status (1)

Country Link
CN (1) CN114691390A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115460470A (en) * 2022-08-19 2022-12-09 武汉烽火技术服务有限公司 Multicast data forwarding method, device, equipment and readable storage medium
CN116521249A (en) * 2023-07-03 2023-08-01 北京左江科技股份有限公司 Kernel state message distribution method based on process file descriptor

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115460470A (en) * 2022-08-19 2022-12-09 武汉烽火技术服务有限公司 Multicast data forwarding method, device, equipment and readable storage medium
CN115460470B (en) * 2022-08-19 2024-03-26 烽火通信科技股份有限公司 Multicast data forwarding method, device, equipment and readable storage medium
CN116521249A (en) * 2023-07-03 2023-08-01 北京左江科技股份有限公司 Kernel state message distribution method based on process file descriptor
CN116521249B (en) * 2023-07-03 2023-10-10 北京左江科技股份有限公司 Kernel state message distribution method based on process file descriptor

Similar Documents

Publication Publication Date Title
CN113595961A (en) Protocol conversion method and system, and gateway device
CN114691390A (en) User mode program processing method and device, storage medium and processor
US20170111938A1 (en) Method, terminal, client, smartcard, and system for accessing wireless network
CN107844306B (en) Application program repairing method and device, storage medium and terminal
CN113296871A (en) Method, equipment and system for processing container group instance
CN110879741A (en) Virtual machine live migration method and device, storage medium and processor
CN107526584B (en) Data access method and device
CN110737502B (en) Mirror image file processing method, device and system
CN114637549A (en) Data processing method, system and storage medium for service grid-based application
CN112559114A (en) Virtual machine generation method and device
CN114020478A (en) Management method and device of hybrid cloud resources, storage medium and computing equipment
CN112416617A (en) Control method and device of Bluetooth equipment, storage medium and electronic device
CN115495161B (en) BIOS option modification validation method and device and storage medium
CN115268969A (en) Android system upgrading method and device and terminal equipment
CN115469964A (en) Method and device for determining mapping relation between block device and virtual machine disk character
CN110874264A (en) Example hot migration method and device, storage medium and processor
CN115016779A (en) Audio and video function processing method and device, storage medium and processor
CN107231244B (en) System, method and device for initializing encryption machine
CN113312159A (en) Processing method and device for load balancing of Kubernetes cluster and storage medium
WO2020093910A1 (en) Wireless access platform and switching method
CN112486583A (en) System, method, apparatus and storage medium for configuring parameters
CN112306843A (en) Test method, test device and storage medium
CN110609781A (en) Interface test method, device and storage medium
CN111124445A (en) Home gateway upgrading method and home gateway
CN115576585A (en) Firmware upgrading method and device based on GPU Box

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination