Microkernel-based ioctl parameter transmission method, apparatus and device, and medium
By adding encoding and decoding layers in the microkernel environment and adjusting the parameter length, the problem of transmission loss caused by the inability to continuously represent the parameter length in ioctl calls is solved, achieving complete parameter transmission and improving efficiency.
Patent Information
- Application Number
- CN202310198332.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2024-08-27
AI Technical Summary
In the microkernel environment, when calling ioctl, the parameter length cannot be represented by a continuous piece of memory, resulting in the problem of losing the parameters passed.
By adding a coding layer and a decoding layer to the ioctl parameter transmission link, the parameter length is adjusted to ensure complete transmission. The coding layer is set between the application process side and the delivery layer, and the decoding layer is set between the delivery layer and the operation process side to ensure Parameter integrity.
It effectively avoids illegal memory addresses and parameter loss caused by long parameter lengths, and improves the integrity and efficiency of parameter transfer.
Smart Images

Figure CN118550722A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of electronic technology, and in particular to an ioctl parameter transmission method, device, equipment and medium based on a microkernel. Background Art
[0002] In the related art, ioctl (input / output control) is a function in the device driver that manages the I / O (Input / Output) channel of the device, such as controlling the transmission baud rate of the serial port, the speed of the motor, etc. At present, for the macro kernel, the ioctl operation is performed in the same process, but for the micro kernel, the ioctl calling process and the operation execution process are usually not the same process, and communication between processes is required. At this time, if the length of the passed parameter cannot be represented by a continuous memory, the memory address may become illegal after inter-process communication, resulting in the loss of the passed parameter. Summary of the invention
[0003] The present disclosure provides a microkernel-based ioctl parameter transmission method, device, equipment and medium to at least solve the problem of parameter loss in the related art. The technical solution of the present disclosure is as follows:
[0004] According to a first aspect of an embodiment of the present disclosure, a microkernel-based ioctl parameter transmission method is provided, comprising:
[0005] In the case where there is a target parameter that needs to be transmitted, determining a first parameter length based on the length of the target parameter; the target parameter includes a first sub-parameter segment and a second sub-parameter segment, and the first parameter length is the sum of the lengths of the first sub-parameter segment and the second sub-parameter segment;
[0006] Adjust the parameter length value of the coding layer in the ioctl parameter transmission link to the first parameter length; wherein the coding layer is arranged between the application process side and the transmission layer;
[0007] The target parameters are transferred based on the adjusted ioctl parameter transfer link.
[0008] In a possible implementation manner, before transmitting the target parameter based on the adjusted ioctl parameter transmission link, the method further includes:
[0009] Determine a second parameter length based on the length of the target parameter; wherein the second parameter length is the length of the first sub-parameter segment;
[0010] The parameter length value of the decoding layer in the ioctl parameter transmission link is adjusted to a second parameter length; wherein the decoding layer is arranged between the transmission layer and the operation process side.
[0011] In a possible implementation manner, adjusting the parameter length value of the coding layer in the ioctl parameter transmission link to the first parameter length includes:
[0012] The multiple blocks of memory are integrated to obtain an integrated memory having a length equal to the first parameter length, and the association relationship between the multiple blocks of memory is stored so that the encoding layer can call it when the target parameter is transmitted.
[0013] In a possible implementation manner, the parameter length value is a field marking the parameter length in the ioctl command word.
[0014] In a possible implementation, the transmitting the target parameter based on the adjusted ioctl parameter transmission link includes:
[0015] Passing the target parameter transmitted by the application process side to the encoding layer;
[0016] Calling the integrated memory through the encoding layer to encode the target parameter to obtain an encoded first parameter;
[0017] Passing the first parameter and the association relationship between the multiple memory blocks to the decoding layer;
[0018] Calling the integrated memory through the decoding layer to decode the first parameter to obtain a decoded second parameter, and integrating the association relationship between the multiple memories;
[0019] The association relationship between the second parameter and the plurality of memory blocks is transmitted to the operation process side.
[0020] According to a second aspect of an embodiment of the present disclosure, a microkernel-based ioctl parameter transmission link is provided, which is used to implement the microkernel-based ioctl parameter transmission method as described in any one of the first aspects, and the microkernel-based ioctl parameter transmission link includes an application process side, a coding layer, a transmission layer, a decoding layer and an operation process side; wherein the coding layer is arranged between the application process side and the transmission layer, the decoding layer is arranged between the transmission layer and the operation process side, the parameter length value of the coding layer is the sum of the lengths of the first sub-parameter segment and the second sub-parameter segment of the target parameter to be transmitted, and the parameter length value of the decoding layer is the length of the first sub-parameter segment of the target parameter.
[0021] According to a third aspect of an embodiment of the present disclosure, there is provided an ioctl parameter transmission device based on a microkernel, comprising:
[0022] a length determination module, configured to determine a first parameter length based on a length of a target parameter to be transmitted, when there is a target parameter to be transmitted; the target parameter includes a first sub-parameter segment and a second sub-parameter segment, and the first parameter length is the sum of the lengths of the first sub-parameter segment and the second sub-parameter segment;
[0023] A length adjustment module, used for adjusting the parameter length value of the coding layer in the ioctl parameter transmission link to the first parameter length; wherein the coding layer is arranged between the application process side and the transmission layer;
[0024] A parameter transfer module is used to transfer the target parameters based on the adjusted ioctl parameter transfer link.
[0025] In a possible implementation manner, the length determination module is further used to:
[0026] Determine a second parameter length based on the length of the target parameter; wherein the second parameter length is the length of the first sub-parameter segment;
[0027] The length adjustment module is also used for:
[0028] The parameter length value of the decoding layer in the ioctl parameter transmission link is adjusted to a second parameter length; wherein the decoding layer is arranged between the transmission layer and the operation process side.
[0029] In a possible implementation, the length adjustment module includes:
[0030] The parameter adjustment unit is used to integrate the multiple memory blocks to obtain an integrated memory block with a length equal to the first parameter length, and store the association relationship between the multiple memory blocks so that the encoding layer can call it when transferring the target parameter.
[0031] In a possible implementation manner, the parameter length value is a field marking the parameter length in the ioctl command word.
[0032] In a possible implementation, the parameter transfer module includes:
[0033] A first transmission unit, configured to transmit the target parameter transmitted by the application process side to the coding layer;
[0034] An encoding unit, configured to perform encoding processing on the target parameter by calling the integrated memory through the encoding layer to obtain an encoded first parameter;
[0035] A second transmission unit, used for transmitting the first parameter and the association relationship between the plurality of memory blocks to the decoding layer;
[0036] A decoding unit, configured to decode the first parameter by calling the integrated memory through the decoding layer, obtain a decoded second parameter, and integrate the association relationship between the multiple memories;
[0037] The third transmission unit is used to transmit the association relationship between the second parameter and the multiple memory blocks to the operation process side.
[0038] According to a fourth aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0039] processor;
[0040] a memory for storing instructions executable by the processor;
[0041] The processor is configured to execute the instructions to implement the method as described in any one of the first aspects.
[0042] According to a fifth aspect of an embodiment of the present disclosure, a storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute a method as described in any one of the first aspects.
[0043] According to a sixth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the method as described in any one of the first aspects is implemented.
[0044] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0045] In the disclosed embodiment, in the case of a target parameter that needs to be transmitted, the first parameter length is determined based on the length of the target parameter, wherein the target parameter includes a first sub-parameter segment and a second sub-parameter segment, and the first parameter length is the sum of the lengths of the first sub-parameter segment and the second sub-parameter segment; the parameter length value of the coding layer in the ioctl parameter transmission link is adjusted to the first parameter length, wherein the coding layer is arranged between the application process side and the transmission layer; the target parameter is transmitted based on the adjusted ioctl parameter transmission link. In this way, by adding a coding layer to the ioctl parameter transmission link and adjusting the parameter length of the coding layer to the sum of the total parameter lengths of the target parameters, the coding layer can encode the complete target parameters, avoiding the situation where the memory address becomes illegal and the parameters are lost due to the long parameter length that cannot be represented by a continuous memory block. In this way, the integrity of the parameters that need to be transmitted can be improved.
[0046] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0048] Figure 1 The figure is a schematic diagram of an ioctl parameter transmission link based on a microkernel according to an exemplary embodiment.
[0049] Figure 2 The present invention is a flowchart of a microkernel-based ioctl parameter transmission method according to an exemplary embodiment.
[0050] Figure 3 The figure is a schematic diagram of an ioctl command word according to an exemplary embodiment.
[0051] Figure 4 The invention is a block diagram of an ioctl parameter transmission device based on a microkernel according to an exemplary embodiment.
[0052] Figure 5 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0053] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0054] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure 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 disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0055] The following is a detailed description of the microkernel-based ioctl parameter passing method, device, equipment and medium provided by the embodiments of the present disclosure in conjunction with the accompanying drawings.
[0056] The microkernel-based ioctl parameter transmission method provided in the embodiment of the present disclosure can be applied to the microkernel-based ioctl parameter transmission link, such as Figure 1As shown, the ioctl parameter transmission link may include an application process side, a coding layer, a transmission layer, a decoding layer, and an operation process side, wherein the coding layer is arranged between the application process side and the transmission layer, the decoding layer is arranged between the transmission layer and the operation process side, the parameter length value of the coding layer is the sum of the lengths of the first sub-parameter segment and the second sub-parameter segment of the target parameter to be transmitted, and the parameter length value of the decoding layer is the length of the first sub-parameter segment of the target parameter. The microkernel-based ioctl parameter transmission link can implement the microkernel-based ioctl parameter transmission method provided by the embodiment of the present disclosure, and its specific implementation method will be described in the following method embodiment. Compared with the related art, the ioctl parameter transmission link provided by the embodiment of the present disclosure adds a coding layer on the calling side, that is, adds a coding layer between the application process side and the transmission layer, and adds a decoding layer on the operation side, that is, adds a decoding layer between the transmission layer and the operation process side. Figure 2 is a flowchart of a microkernel-based ioctl parameter transfer method according to an exemplary embodiment. Figure 2 The microkernel-based ioctl parameter passing method may include the following steps.
[0057] In step S201, when there is a target parameter that needs to be transferred, the first parameter length is determined based on the length of the target parameter.
[0058] In the embodiment of the present disclosure, when there are parameters that need to be passed on the application process side (i.e., target parameters), the parameter length of the target parameters can be determined, and then the parameter length, i.e., the first parameter length, can be determined based on the length of the target parameters. The first parameter length can be used to adjust the parameter length of the coding layer; the parameter length can also be understood as the memory length occupied by the parameter.
[0059] In a possible implementation, considering that the parameters that need to be transmitted on the application side are usually divided into two segments, that is, the target parameter may include a first sub-parameter segment and a second sub-parameter segment, the first sub-parameter segment may be the first parameter segment of the target parameter, and the second sub-parameter segment may be the second parameter segment of the target parameter. In order to enable the intermediate processing layer of the ioctl parameter transmission link to transparently transmit all target parameters to avoid omissions, the length of the first parameter may be set to the sum of the lengths of the first sub-parameter segment and the second sub-parameter segment. Exemplarily, taking the case where the parameter lengths of the first sub-parameter segment and the second sub-parameter segment included in the target parameter are a and b respectively, the length of the first parameter may be determined to be a+b.
[0060] In step S202, the parameter length value of the coding layer in the ioctl parameter transmission link is adjusted to the first parameter length.
[0061] Among them, Figure 1 As shown, the encoding layer is arranged between the application process side and the transmission side.
[0062] In the disclosed embodiment, after determining the first parameter length based on the length of the target parameter, the decoding layer can be adjusted based on the first parameter length. Exemplarily, the parameter length value of the encoding layer in the ioctl parameter transmission link can be adjusted to the first parameter length. For example, still taking the parameter lengths of the first sub-parameter segment and the second sub-parameter segment included in the target parameter as a and b respectively, the parameter length value of the encoding layer in the ioctl parameter transmission link can be adjusted to a+b.
[0063] In step S203, the target parameters are transferred based on the adjusted ioctl parameter transfer link.
[0064] In the disclosed embodiment, after adjusting the parameter length of the coding layer in the ioctl parameter transmission link, the target parameter can be transmitted based on the adjusted ioctl parameter transmission link. The specific implementation process of transmitting the target parameter based on the adjusted ioctl parameter transmission link will be described in the subsequent method embodiments, which will not be repeated here.
[0065] In the disclosed embodiment, in the case of a target parameter that needs to be transmitted, the first parameter length is determined based on the length of the target parameter, wherein the target parameter includes a first sub-parameter segment and a second sub-parameter segment, and the first parameter length is the sum of the lengths of the first sub-parameter segment and the second sub-parameter segment; the parameter length value of the coding layer in the ioctl parameter transmission link is adjusted to the first parameter length, wherein the coding layer is arranged between the application process side and the transmission layer; the target parameter is transmitted based on the adjusted ioctl parameter transmission link. In this way, by adding a coding layer to the ioctl parameter transmission link and adjusting the parameter length of the coding layer to the sum of the total parameter lengths of the target parameters, the coding layer can encode the complete target parameters, avoiding the situation where the memory address becomes illegal and the parameters are lost due to the long parameter length that cannot be represented by a continuous memory block. In this way, the integrity of the parameters that need to be transmitted can be improved.
[0066] In a possible implementation manner, before the above step of transmitting the target parameter based on the adjusted ioctl parameter transmission link, the following processing may also be performed:
[0067] determining a second parameter length based on the length of the target parameter;
[0068] Adjust the parameter length value of the decoding layer in the ioctl parameter transmission link to the second parameter length;
[0069] Among them, the second parameter length is the length of the first sub-parameter segment; the decoding layer is set between the transmission layer and the operation process side.
[0070] In the embodiment of the present disclosure, the parameter length for adjusting the decoding layer, i.e., the second parameter length, can also be determined based on the length of the target parameter. For example, the length of the first sub-parameter segment of the target parameter can be determined as the second parameter length. Afterwards, in order to allow the underlying operation to proceed normally without modification, the second parameter length can be set to the initial length, i.e., the length of the first sub-parameter segment. That is, the parameter length value of the decoding layer in the ioctl parameter transmission link can be adjusted to the second parameter length, such as Figure 1 As shown, the decoding layer can be set between the transmission side and the operation process side. Still taking the example that the parameter lengths of the first sub-parameter segment and the second sub-parameter segment included in the target parameter are a and b respectively, the second parameter length can be determined to be a, and the parameter length value of the decoding layer in the ioctl parameter transmission link is adjusted to a. In this way, the parameter length of the decoding layer is adjusted to the parameter length of the first sub-parameter segment, and the underlying operation can be carried out normally without modification on the basis of avoiding parameter loss, and related operations can be implemented normally in the operation process based on the target parameters without additional modification of the processing process. In this way, not only the integrity of the parameters to be transmitted can be improved, but also the transmission efficiency can be improved.
[0071] In a possible implementation manner, in the above step, the specific implementation manner of adjusting the parameter length value of the coding layer in the ioctl parameter transmission link to the first parameter length may be:
[0072] The multiple blocks of memory are integrated to obtain an integrated memory with a length equal to the length of the first parameter, and the association relationship between the multiple blocks of memory is stored so that the encoding layer can call it when passing the target parameter.
[0073] In the disclosed embodiment, considering that the memory is used to store parameters, the memory size is consistent with the parameter length. Therefore, in order to completely transmit the target parameter, multiple blocks of memory can be integrated to obtain an integrated memory, i.e., an integrated memory, the memory size of which is the same as the parameter length of the target parameter. At the same time, the association relationship between the integrated multiple blocks of memory can also be stored to further ensure the integrity of the target parameter and avoid the loss of the target parameter.
[0074] In a possible implementation, the parameter length value may be a field in the ioctl command word that indicates the parameter length. For example, a specific example of the ioctl command word may be as follows: Figure 3 As shown, Figure 3 Parameter Length is the parameter length field, and the parameter length value can be adjusted by adjusting this field. For example, taking the parameter length value of the coding layer as a+b, the value of the Parameter Length field in the ioctl command word corresponding to the coding layer can be adjusted to a+b.
[0075] In a further possible implementation, the specific implementation method of transmitting the target parameters based on the adjusted ioctl parameter transmission link in the above steps may include the following processing:
[0076] Pass the target parameters transmitted by the application process side to the encoding layer;
[0077] The target parameter is encoded by calling the integrated memory through the encoding layer to obtain the encoded first parameter;
[0078] Passing the first parameter and the association relationship between the multiple memory blocks to the decoding layer;
[0079] The first parameter is decoded by calling the integrated memory through the decoding layer to obtain the decoded second parameter, and the association relationship between the multiple blocks of memory is integrated;
[0080] The association relationship between the second parameter and the multiple memory blocks is transmitted to the operation process side.
[0081] In an embodiment of the present disclosure, when the target parameter is transmitted based on the adjusted ioctl parameter transmission link, the application process side can be controlled to transmit the target parameter to be transmitted to the encoding layer first. After receiving the target parameter, the encoding layer can call the integrated memory to encode the target parameter to obtain the encoded target parameter, i.e., the first parameter. Then, the encoding layer can be controlled to pass the association between the first parameter and the multiple blocks of memory of the integrated memory to the decoding layer through the transmission layer. After receiving the association between the first parameter and the multiple blocks of memory of the integrated memory, the decoding layer can call the integrated memory to decode the first parameter to obtain the decoded parameter (i.e., the second parameter), integrate the association between the aforementioned multiple blocks of memory, and pass the second parameter and the association between the aforementioned multiple blocks of memory to the operation process side, so that the operation process can perform related operations normally based on the association between the second parameter and the aforementioned multiple blocks of memory.
[0082] Based on the same inventive concept, the embodiment of the present disclosure also provides an ioctl parameter transmission device based on a microkernel, such as Figure 4 As shown, Figure 4 is a block diagram of an ioctl parameter transmission device based on a microkernel according to an exemplary embodiment. Figure 4 , the microkernel-based ioctl parameter transmission device 400 may include:
[0083] A length determination module 410 is used to determine a first parameter length based on the length of the target parameter when there is a target parameter to be transmitted; the target parameter includes a first sub-parameter segment and a second sub-parameter segment, and the first parameter length is the sum of the lengths of the first sub-parameter segment and the second sub-parameter segment;
[0084] The length adjustment module 420 is used to adjust the parameter length value of the coding layer in the ioctl parameter transmission link to the first parameter length; wherein the coding layer is arranged between the application process side and the transmission layer;
[0085] The parameter transfer module 430 is used to transfer the target parameters based on the adjusted ioctl parameter transfer link.
[0086] In a possible implementation manner, the length determination module 410 is further configured to:
[0087] Determine a second parameter length based on the length of the target parameter; wherein the second parameter length is the length of the first sub-parameter segment;
[0088] The length adjustment module 420 is also used for:
[0089] The parameter length value of the decoding layer in the ioctl parameter transmission link is adjusted to a second parameter length; wherein the decoding layer is arranged between the transmission layer and the operation process side.
[0090] In a possible implementation, the length adjustment module 420 includes:
[0091] The parameter adjustment unit is used to integrate the multiple memory blocks to obtain an integrated memory block with a length equal to the first parameter length, and store the association relationship between the multiple memory blocks so that the encoding layer can call it when transferring the target parameter.
[0092] In a possible implementation manner, the parameter length value is a field marking the parameter length in the ioctl command word.
[0093] In a possible implementation, the parameter transfer module 430 includes:
[0094] A first transmission unit, configured to transmit the target parameter transmitted by the application process side to the coding layer;
[0095] An encoding unit, configured to perform encoding processing on the target parameter by calling the integrated memory through the encoding layer to obtain an encoded first parameter;
[0096] A second transmission unit, used for transmitting the first parameter and the association relationship between the plurality of memory blocks to the decoding layer;
[0097] A decoding unit, configured to decode the first parameter by calling the integrated memory through the decoding layer, obtain a decoded second parameter, and integrate the association relationship between the multiple memories;
[0098] The third transmission unit is used to transmit the association relationship between the second parameter and the multiple memory blocks to the operation process side.
[0099] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0100] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a storage medium and a computer program product.
[0101] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device 500 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0102] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0103] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0104] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as the ioctl parameter passing method based on the microkernel. For example, in some embodiments, the ioctl parameter passing method based on the microkernel may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the ioctl parameter passing method based on the microkernel described above may be executed. Alternatively, in other embodiments, the computing unit 501 may be configured to execute the microkernel-based ioctl parameter passing method in any other appropriate manner (eg, by means of firmware).
[0105] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0106] The program code of the computer program product for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0107] In the context of the present disclosure, a storage medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A storage medium may be a machine-readable signal medium or a machine-readable storage medium. Storage media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. More specific examples of storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0108] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0109] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0110] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0111] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0112] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A microkernel-based ioctl parameter transfer method, It is characterized in that include: In the case where there is a target parameter that needs to be transmitted, determining the first parameter length based on the length of the target parameter; The target parameter includes a first sub-parameter segment and a second sub-parameter segment, and the first parameter length is the sum of the lengths of the first sub-parameter segment and the second sub-parameter segment; Adjust the parameter length value of the coding layer in the ioctl parameter transmission link to the first parameter length; wherein the coding layer is arranged between the application process side and the transmission layer; The target parameters are transferred based on the adjusted ioctl parameter transfer link.
2. The ioctl parameter transfer method based on microkernel according to claim 1, It is characterized in that Before transmitting the target parameter based on the adjusted ioctl parameter transmission link, the method further includes: Determine a second parameter length based on the length of the target parameter; wherein the second parameter length is the length of the first sub-parameter segment; Adjust the parameter length value of the decoding layer in the ioctl parameter transmission link to the second parameter length; wherein the decoding layer is arranged between the transmission layer and the operation process side.
3. The ioctl parameter transfer method based on microkernel according to claim 2, It is characterized in that The step of adjusting the parameter length value of the coding layer in the ioctl parameter transmission link to the first parameter length includes: The multiple blocks of memory are integrated to obtain an integrated memory having a length equal to the first parameter length, and the association relationship between the multiple blocks of memory is stored so that the encoding layer can call it when the target parameter is transmitted.
4. The ioctl parameter transfer method based on microkernel according to claim 2, It is characterized in that The parameter length value is a field in the ioctl command word that marks the parameter length.
5. The microkernel-based ioctl parameter transfer method according to claim 3, It is characterized in that The transferring of the target parameter based on the adjusted ioctl parameter transfer link includes: Passing the target parameter transmitted by the application process side to the encoding layer; Calling the integrated memory through the encoding layer to encode the target parameter to obtain an encoded first parameter; Passing the first parameter and the association relationship between the multiple memory blocks to the decoding layer; Calling the integrated memory through the decoding layer to decode the first parameter to obtain a decoded second parameter, and integrating the association relationship between the multiple memories; The association relationship between the second parameter and the plurality of memory blocks is transmitted to the operation process side.
6. A microkernel-based ioctl parameter transmission link, It is characterized in that Used to implement the microkernel-based ioctl parameter transmission method as described in any one of claims 1-5, the microkernel-based ioctl parameter transmission link includes an application process side, a coding layer, a transmission layer, a decoding layer and an operation process side; wherein the coding layer is arranged between the application process side and the transmission layer, the decoding layer is arranged between the transmission layer and the operation process side, the parameter length value of the coding layer is the sum of the lengths of the first sub-parameter segment and the second sub-parameter segment of the target parameter to be transmitted, and the parameter length value of the decoding layer is the length of the first sub-parameter segment of the target parameter.
7. A microkernel-based ioctl parameter transmission device, It is characterized in that include: A length determination module, configured to determine the length of the first parameter based on the length of the target parameter when there is a target parameter to be transmitted; The target parameter includes a first sub-parameter segment and a second sub-parameter segment, and the first parameter length is the sum of the lengths of the first sub-parameter segment and the second sub-parameter segment; A length adjustment module, used for adjusting the parameter length value of the coding layer in the ioctl parameter transmission link to the first parameter length; wherein the coding layer is arranged between the application process side and the transmission layer; A parameter transfer module is used to transfer the target parameters based on the adjusted ioctl parameter transfer link.
8. An electronic device, It is characterized in that include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instruction to implement the microkernel-based ioctl parameter passing method as described in any one of claims 1 to 5.
9. A storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the microkernel-based ioctl parameter passing method as described in any one of claims 1 to 5.
10. A computer program product, It is characterized in that It comprises a computer program, which, when executed by a processor, implements the microkernel-based ioctl parameter passing method as described in any one of claims 1 to 5.
