CN112231761A - Device mounting method, computing device and readable storage medium - Google Patents
Device mounting method, computing device and readable storage medium Download PDFInfo
- Publication number
- CN112231761A CN112231761A CN202011461868.3A CN202011461868A CN112231761A CN 112231761 A CN112231761 A CN 112231761A CN 202011461868 A CN202011461868 A CN 202011461868A CN 112231761 A CN112231761 A CN 112231761A
- Authority
- CN
- China
- Prior art keywords
- signal
- target
- equipment
- mounting
- information
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 69
- 238000005192 partition Methods 0.000 claims description 8
- 238000004891 communication Methods 0.000 description 17
- 230000008569 process Effects 0.000 description 13
- 238000007726 management method Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 7
- 238000004140 cleaning Methods 0.000 description 6
- 230000002093 peripheral effect Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000006243 chemical reaction Methods 0.000 description 3
- 238000003780 insertion Methods 0.000 description 3
- 230000037431 insertion Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000007723 transport mechanism Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000007667 floating Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/70—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
- G06F21/82—Protecting input, output or interconnection devices
- G06F21/85—Protecting input, output or interconnection devices interconnection devices, e.g. bus-connected or in-line devices
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Computer Security & Cryptography (AREA)
- Databases & Information Systems (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a device mounting method which is suitable for being executed in an operating system, wherein the operating system comprises a task bar manager, a file manager and a system bus, the task bar manager comprises a device mounting device, the system bus comprises a block device management interface, and the method comprises the following steps: the method comprises the steps that a first signal when a target device is accessed is monitored from a system bus by a block device management interface, wherein the first signal comprises an object path and hardware information of the target device; when the block device management interface determines that the target device is correctly identified based on the object path, the block device management interface sends the object path and the hardware information to the device loader through a second signal; the equipment mounting device mounts the target equipment according to the object path and the hardware information in the second signal and informs the task bar manager to display the target equipment information; and when the file manager detects that the mounting of the target equipment is completed, modifying the access control authority of the target equipment. The invention also discloses corresponding computing equipment and a readable storage medium.
Description
Technical Field
The present invention relates to the field of computers, and in particular, to a device mounting method, a computing device, and a readable storage medium.
Background
The U-disc is used as a very common peripheral storage device, and the application of the U-disc is very wide through the Plug-and-Play (PnP) usage mode of the USB interface, most users use the U-disc in the Windows system, and are accustomed to the Plug-and-Play usage mode, while for the Linux system, the operation is completely different, in the Linux system, all access devices are regarded as files, and the access to the access devices is the process of reading and writing the files.
All files, directories and devices under Linux have a path, the path always starts with "/", and is separated by "/", if a path is a prefix of another path, the two paths have logical parent-child relationships, but not all the logical parent-child relationships are necessarily the same device, and a mechanism for determining which device the different paths correspond to is called mount (mount). By mounting, the correspondence between the current path and the device can be set. Therefore, the essence of mounting is that for a certain device, the file system structure of the device is analyzed, a corresponding driver in Linux is called according to the file system type of the device, metadata in the Linux is processed, and the information is attached to a directory tree of the Linux to be presented.
At present, the most applied U disk mounting technology is realized by setting a udev rule, a corresponding rule file needs to be created in a/etc/udev/rule.d', an execution script is created in a/sbin directory, and automatic mounting can be realized after restarting.
Disclosure of Invention
To this end, the present invention provides a device mounting method, a computing device and a readable storage medium in an effort to solve or at least alleviate the above-identified problems.
According to one aspect of the present invention, there is provided a device mount method adapted to be executed in an operating system, the operating system including a taskbar manager, a file manager, and a system bus, the taskbar manager including a device mount, the system bus including a block device management interface, the method comprising: the method comprises the steps that a first signal when a target device is accessed is monitored from a system bus by a block device management interface, wherein the first signal comprises an object path and hardware information of the target device; when the block device management interface determines that the target device is correctly identified based on the object path, the block device management interface sends the object path and the hardware information to the device loader through a second signal; the equipment mounting device mounts the target equipment according to the object path and the hardware information in the second signal and informs the task bar manager to display the target equipment information in the task bar; and when the file manager detects that the target equipment is mounted, modifying the access control authority of the target equipment so as to realize that multiple users share the data in the target equipment.
Optionally, in the device mount method according to the present invention, the listening, by the block device management interface, to the first signal when the target device accesses from the system bus includes: when an operating system kernel detects a first signal accessed by target equipment, transmitting the first signal to a D-Bus system Bus by udev in an operating system; the block device management interface obtains a first signal from a system bus.
Optionally, in the device mount method according to the present invention, the hardware information of the target device includes file system information, partition information, and encryption information, and sending the object path and the hardware information to the device mount via a second signal includes: generating a diskDeviceAdded signal according to the object path; generating a hasFileSystemChanged signal according to the file system information; generating a hasPatitionChanged signal according to the partition information; an isencrypted channel signal is generated based on the encryption information.
Optionally, in the device mount method according to the present invention, the mounting, by the device mount device, the target device according to the object path and the hardware information in the second signal includes: when the equipment mounting device receives the second signal, mounting the target equipment according to the object path and the hardware information in the second signal; and when the target equipment is mounted, sending an equipment mounting completion signal to the file manager.
Optionally, in the device mount method according to the present invention, when the file manager detects that the mount of the target device is completed, modifying the access control permission of the target device includes: and when the file manager detects the device mounting completion signal, setting the access control authority of the mounting path corresponding to the target device.
Optionally, in the device mount method according to the present invention, the access control right of the mount path corresponding to the target device includes: read rights, write rights, and execution rights.
Optionally, in the device mount method according to the present invention, the user corresponding to the access control authority includes: owner, group of users, and other users.
Optionally, in the device mounting method according to the present invention, the method further includes: when the operating system is started, acquiring equipment inserted before the operating system is started, and recording the equipment as the inserted equipment; and mounting the inserted device and opening the access control authority of other users to the inserted device.
Optionally, in the device mount method according to the present invention, the target device and the inserted device are usb disks.
Optionally, in the device mount method according to the present invention, the operating system is a UOS system.
According to another aspect of the present invention, there is provided a computing device comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions comprising instructions for performing the device mounting method as above.
According to still another aspect of the present invention, there is provided a readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the device mounting method as above.
According to the equipment mounting method, the equipment mounting method is executed in an operating system, the operating system comprises a task bar manager, a file manager and a system bus, a first signal accessed by the equipment is obtained through a block equipment management interface in the system bus, object Liujing and hardware information in the first signal are sent to the equipment mounting device through a second signal, the equipment mounting device is used for mounting the equipment according to the information in the second signal, the process that a user learns Linux configuration and manually configures udev rules is avoided, after the equipment mounting is completed, the file manager is used for modifying access control authority, multi-user sharing of the mounting equipment can be achieved, the user does not need to carry out related modification through Linux commands, plug-and-play of a U disk in the Linux system is finally achieved, and the user can seamlessly transit to the Linux system in a familiar Windows system environment.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
FIG. 1 shows a block diagram of a computing device 100, according to one embodiment of the invention;
FIG. 2 shows a block diagram of a device mount system architecture 200 according to one embodiment of the invention;
FIG. 3 shows a flow diagram of a device mount method 300 according to one embodiment of the invention;
FIG. 4 illustrates a diagram of file permissions, according to one embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In this information age today, computers are highly popular, but people still apply to computers based on Windows operating system, which has an easy-to-operate desktop environment, and can plug and play peripheral storage devices (such as USB disks) through USB. For the Linux system, as is well known, all program operations are realized through a command line, recently, with the gradual popularization of the Linux system, a specific desktop environment and a task bar of the Linux system are also developed, the task bar supports infinite plug-in expansion, for example, a screen keyboard, time, a notification center and the like are realized in the task bar through a plug-in technology, and the invention also realizes the plug-and-play mounting function of the device and the multi-user sharing through the plug-in technology based on the characteristic of the plug-in expansion, and avoids the operation that a user needs to manually configure the device to mount files and modify file permissions after accessing an external device (for example, a usb disk).
A Linux operating system for performing the device mount method of the present invention runs in a computing device, and fig. 1 shows a schematic diagram of a computing device 100 according to one embodiment of the present invention. It should be noted that the computing device 100 shown in fig. 1 is only an example, in practice, the computing device may be any type of device, the hardware configuration of the computing device may be the same as that of the computing device 100 shown in fig. 1, or may be different from that of the computing device 100 shown in fig. 1, and hardware components of the computing device 100 shown in fig. 1 may be added or deleted, and the specific hardware configuration of the computing device is not limited in the present invention.
As shown in FIG. 1, in a basic configuration 102, a computing device 100 typically includes a system memory 106 and one or more processors 104. A memory bus 108 may be used for communication between the processor 104 and the system memory 106.
Depending on the desired configuration, the processor 104 may be any type of processing, including but not limited to: a microprocessor (μ P), a microcontroller (μ C), a digital information processor (DSP), or any combination thereof. The processor 104 may include one or more levels of cache, such as a level one cache 110 and a level two cache 112, a processor core 114, and registers 116. The example processor core 114 may include an Arithmetic Logic Unit (ALU), a Floating Point Unit (FPU), a digital signal processing core (DSP core), or any combination thereof. The example memory controller 118 may be used with the processor 104, or in some implementations the memory controller 118 may be an internal part of the processor 104.
Depending on the desired configuration, system memory 106 may be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. The physical memory in the computing device is usually referred to as a volatile memory RAM, and data in the disk needs to be loaded into the physical memory to be read by the processor 104. System memory 106 may include an operating system 120, one or more applications 122, and program data 124. In some implementations, the application 122 can be arranged to execute instructions on an operating system with program data 124 by one or more processors 104. Operating system 120 may be, for example, Linux, Unix, UOS, etc., which includes program instructions for handling basic system services and performing hardware-dependent tasks. The application 122 includes program instructions for implementing various user-desired functions, and the application 122 may be, for example, but not limited to, a browser, instant messenger, a software development tool (e.g., an integrated development environment IDE, a compiler, etc.), and the like. When the application 122 is installed into the computing device 100, a driver module may be added to the operating system 120.
When the computing device 100 is started, the processor 104 reads program instructions of the operating system 120 from the memory 106 and executes them. The application 122 runs on top of the operating system 120, utilizing the operating system 120 and interfaces provided by the underlying hardware to implement various user-desired functions. When the user starts the application 122, the application 122 is loaded into the memory 106, and the processor 104 reads the program instructions of the application 122 from the memory 106 and executes the program instructions.
The computing device 100 also includes a storage device 132, the storage device 132 including removable storage 136 and non-removable storage 138, the removable storage 136 and the non-removable storage 138 each connected to the storage interface bus 134.
Computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via the bus/interface controller 130. The example output device 142 includes a graphics processing unit 148 and an audio processing unit 150. They may be configured to facilitate communication with various external devices, such as a display or speakers, via one or more a/V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.) via one or more I/O ports 158. An example communication device 146 may include a network controller 160, which may be arranged to facilitate communications with one or more other computing devices 162 over a network communication link via one or more communication ports 164.
A network communication link may be one example of a communication medium. Communication media may typically be embodied by computer readable instructions, data structures, program modules, and may include any information delivery media, such as carrier waves or other transport mechanisms, in a modulated data signal. A "modulated data signal" may be a signal that has one or more of its data set or its changes made in such a manner as to encode information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or private-wired network, and various wireless media such as acoustic, Radio Frequency (RF), microwave, Infrared (IR), or other wireless media. The term computer readable media as used herein may include both storage media and communication media.
In the computing device 100 according to the present invention, the operating system 120 includes instructions for performing the device mount method 200 of the present invention, enabling automatic mounting of the device.
The device auto-mount program may be implemented in a desktop taskbar application of an operating system, for example, in a UOS system, a desktop taskbar application of dde-dock, and the desktop taskbar application, for example, dde-dock plug-in may implement various applications according to user requirements, for example, a device mount (i.e., a device loader) is implemented by a dde-dock plug-in, fig. 2 shows a schematic diagram of a device mount system architecture 200 according to an embodiment of the present invention, which is suitable for executing the device mount method of the present invention and resides in a UOS operating system of a computing device.
As shown in fig. 2, a system kernel 210 in an operating system is adapted to detect insertion of a hardware device, when a device (e.g., a usb disk) is inserted, the system kernel 210 detects a change of the hardware device, a device manager udev 220 in the operating system sends detected device information to a Hardware Abstraction Layer (HAL) 230, the hardware abstraction layer 230 sends a first signal containing the device information to a system Bus, the system Bus is implemented by a D-Bus 240 Bus and completes inter-process communication, the system Bus further includes a udicks service 250 (i.e., a block device management interface), and encapsulates a Wrapper module Udisks2-Qt 5260 based on the service by using Qt, and issues the Wrapper module Udisks2-Qt 5260 in a shared library form to facilitate other application calls, and the Udisks2-Qt 5260 provides a Qt signal for other processes to listen and process.
The device loader 270 binds the QT signal issued by the Udisks2-QT5, executes the device-mounted program when the QT signal is detected by the process executing the device loader program, and notifies the taskbar manager 280 to display the newly inserted device (e.g., a usb disk) in the taskbar.
When the device mount 270 completes the device mount, a device mount completion signal is sent to the file manager 290, the file manager 290 is implemented by a boot daemon, and when the device mount completion signal is detected, the access control permission setting of the target device is completed.
The taskbar manager is a taskbar of an operating system, for example, a desktop taskbar application of a UOS operating system, which supports specific functions in the form of plug-ins, and the device loader is a plug-in of dde-dock.
FIG. 3 illustrates a flow diagram of a method 300 for device mounting, the method 300 adapted to be performed in a computing device (such as the computing device shown in FIG. 1) having a Linux operating system installed therein, the operating system including a taskbar manager including a device mount, a file manager, and a system bus including a block device management interface, according to one embodiment of the present invention.
As shown in fig. 3, the method 300 begins at step S310, where the block device management interface listens for a first signal from the system bus when the target device accesses.
According to an embodiment of the present invention, taking the device loading system architecture shown in fig. 2 as an example, when the system kernel detects the target device insertion, the device manager (udev) sends a target device insertion signal (first signal) to the Hardware Abstraction Layer (HAL), and the hardware abstraction layer sends the first signal ("interfacesadd" signal) to the D-Bus. The first signal includes an object path and hardware information of the target device, wherein the hardware information includes file system information, partition information, and encryption information of the device.
Subsequently, step S320 is entered, and the block device management interface sends the object path and the hardware information to the device loader via a second signal when determining that the target device is correctly identified according to the object path.
Continuing with the example of the device mounting system architecture shown in fig. 2, after detecting the first signal, the module udisks2-QT5 encapsulated based on udisks service (i.e., block device management interface) parses out the object path and hardware information therein and sends the object path and hardware information to the device mount via the second signal, where the second signal is a QT signal. Analyzing the object path and the hardware information in the first signal mainly comprises a data cleaning process and an object path conversion process.
The essence of data cleaning is to detect whether a D-Bus hardware information interface exists, file system information corresponds to org.freedesktop.udisks2.filesystem interface, the existence of the interface indicates that a device has a file system, and a hasfilesystechanged signal is converted during data cleaning, partition information corresponds to org.freedesktop.udisks2.partition interface, the existence of the interface information indicates that the inserted device has been partitioned, the partition information is converted into a hasPartitionChanged signal during data cleaning, encryption information corresponds to org.freedesktop.udisks2.encrypted interface, the existence of the interface indicates that the device is encrypted, and the encryption information is converted into an isenciphered signal during data cleaning.
The object path conversion comprises the steps of obtaining a prefix of an object path, generating path information as a device ID into a second signal if the prefix is/org/freedesktop/UDisks 2/drivers/, and converting the prefix of the object path into the form of the above/org/freedesktop/UDisks 2/drivers/to regenerate the second signal if the prefix is/org/freedesktop/UDisks 2/block _ devices/.
After data cleaning and object path conversion, the second signal includes hasFileSystemChange, hasPartitionChange, isEncrypteddchanged, and disakDeviceAdded signals. The second signal of QT type is more easily recognized and processed by the device loader.
Then, the process proceeds to step S330, and the device mounter mounts the target device according to the object path and the hardware information in the second signal.
According to the device mount system architecture shown in fig. 2, the device mount device binds the disaddevice added signal in the second signal, and when the signal is sent in step S320, executes a method corresponding to the slot function "DiskControlWidget:: onDriveConnected" bound in this step, so as to mount the usb disk, and when the mounting is completed, sends a device mount complete signal to the file manager, where the device mount complete signal includes the path information of the device (e.g., the usb disk) mount point.
Subsequently, step S340 is proceeded to, and when the file manager detects that the mount of the target device is completed, the access control authority of the target device is modified.
The file manager runs through the second daemon process, and in step S330, the device mount completion signal is sent after the device mount is completed, and when the second daemon process (i.e., the file manager) receives the device mount completion signal, the authority of the target device (the usb disk) can be modified, so that multi-user sharing is achieved.
For the Linux system, all accessed devices exist in the form of files, Linux divides the access user identities of the files into three categories, namely an owner, a user group and other users (owner/group/others), the file owner identity (owner) refers to the user in a plurality of users, the user group (group) refers to the user in a group which can divide the users into one group, the information of the user group is recorded in/etc/group, and the other person identity (others) refers to identities except the owner and the group. Because Linux provides a multi-user environment, the situation that a plurality of people use the host to work at the same time often occurs, and in order to consider the privacy of each person and the favorite work environment of each person, the permission of other users to all files of the user can be limited.
The three identities have the right of reading, writing and executing respectively. Read permission (read) means that the actual content of the file can be read, such as reading the text content of a text file; write rights (write) mean that the contents of the file can be edited, added, or modified (but not deleted); executable rights (execute) means that the file has rights that can be executed by the system. Whether a file has execution under Windows is judged by extension, for example: exe,. bat,. com, etc., but under Linux, whether our file can be executed is determined according to whether we have the authority of "x".
According to an embodiment of the invention, the file manager acquires the path information of the USB flash disk mounting point from the device mounting completion signal, and calls a system function "chmod" to give read, write and execute rights to other users (others). And the Linux command line can check the authority of each identity corresponding to each file through ls-l.
The authority limit of the file or directory is controlled by 9 authority limits, each three bits are a Group, which are read, write and execute by the file owner (User), read, write and execute by the User Group (Group) and read, write and execute by Other users (Other), respectively, as shown in fig. 4. The chmod command may specify permissions using binary numbers, for example: the read-write rights of file1 are modified by chmod 765 file1, where the sum of the three digits of the authority limit (rwx) of the owner is 7, i.e. 4+2+1, the sum of the sums of the digits of the authority limit (rw-) of the user group is 6, i.e. 4+2+0, and the sum of the sums of the digits of the authority limit (r-x) of the other users is 5, i.e. 4+0+ 1.
The file manager can release the read permission of other users to the newly inserted device (U disk), so that multi-user sharing is realized.
According to one implementation of the invention, the file manager runs through a startup process, monitors the file system from the start of system startup, and when a new directory is generated under the/home directory, it means that a new user is created, at this time, a directory corresponding to the user name under the/home directory is created under the/media, and is a path of the USB flash disk mounting point, and opens the read, write and execution permission of other users to read the path of the USB flash disk mounting point.
According to an embodiment of the invention, when discovering that a new user a is created, the file manager creates a directory/media/a under/media, gives other users the right to read, write and execute through the system call function chmod, and puts its access control limit open through setfacl command.
At present, the most applied U disk mounting technology is realized by setting a udev rule, a corresponding rule file needs to be created in a/etc/udev/rule.d', an execution script is created in a/sbin directory, and automatic mounting can be realized after restarting.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U.S. disks, floppy disks, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the computing device will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to perform the device mounting method of the present invention according to instructions in the program code stored in the memory.
By way of example, and not limitation, readable media may comprise readable storage media and communication media. Readable storage media store information such as computer readable instructions, data structures, program modules or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with examples of this invention. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
It should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects.
Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into multiple sub-modules.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
Furthermore, some of the described embodiments are described herein as a method or combination of method elements that can be performed by a processor of a computer system or by other means of performing the described functions. A processor having the necessary instructions for carrying out the method or method elements thus forms a means for carrying out the method or method elements. Further, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is used to implement the functions performed by the elements for the purpose of carrying out the invention.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this description, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The present invention has been disclosed in an illustrative rather than a restrictive sense, and the scope of the present invention is defined by the appended claims.
Claims (10)
1. A device mount method adapted to be executed in an operating system, the operating system including a taskbar manager, a file manager, and a system bus, the taskbar manager including a device mount, the system bus including a block device management interface, the method comprising:
the block device management interface monitors a first signal when a target device is accessed from a system bus, wherein the first signal comprises an object path and hardware information of the target device;
when the block device management interface determines that the target device is correctly identified based on the object path, the block device management interface sends the object path and the hardware information to the device loader through a second signal;
the equipment mounting device mounts the target equipment according to the object path and the hardware information in the second signal and informs the task bar manager to display the target equipment information in the task bar;
and when detecting that the mounting of the target equipment is finished, the file manager modifies the access control authority of the target equipment so as to realize that multiple users share the data in the target equipment.
2. The method of claim 1, wherein the block device management interface listening for a first signal when a target device accesses from a system bus comprises:
when the kernel of the operating system detects a first signal accessed by target equipment, transmitting the first signal to a D-Bus system Bus by udev in the operating system;
the block device management interface obtains the first signal from the system bus.
3. The method of claim 1 or 2, wherein the hardware information of the target device includes file system information, partition information, and encryption information, and the sending the object path and hardware information to the device loader via a second signal comprises:
generating a diskDeviceAdded signal according to the object path;
generating a hasFileSystemChanged signal according to the file system information;
generating a hasPatitionChanged signal according to the partition information;
an isencrypted channel signal is generated based on the encryption information.
4. The method of claim 1 or 2, wherein the device loader mounting the target device according to the object path and hardware information in the second signal comprises:
when the equipment mounting device receives the second signal, mounting the target equipment according to the object path and the hardware information in the second signal;
and when the target equipment is mounted, sending an equipment mounting completion signal to the file manager.
5. The method of claim 1 or 2, wherein the file manager detecting that the mount of the target device is complete, modifying the access control rights of the target device comprises:
and when the file manager detects the device mounting completion signal, setting the access control authority of the mounting path corresponding to the target device.
6. The method of claim 1 or 2, wherein the access control authority of the mount path corresponding to the target device comprises: read rights, write rights, and execution rights.
7. The method of claim 1 or 2, wherein the user corresponding to the access control authority comprises: owner, group of users, and other users.
8. The method of claim 1 or 2, further comprising:
when the operating system is started, acquiring equipment inserted before the operating system is started, and recording the equipment as the inserted equipment;
and mounting the inserted device and opening the access control authority of other users to the inserted device.
9. A computing device, comprising:
at least one processor; and
a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions comprising instructions for performing the method of any of claims 1-8.
10. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method of any of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011461868.3A CN112231761B (en) | 2020-12-14 | 2020-12-14 | Device mounting method, computing device and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011461868.3A CN112231761B (en) | 2020-12-14 | 2020-12-14 | Device mounting method, computing device and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112231761A true CN112231761A (en) | 2021-01-15 |
CN112231761B CN112231761B (en) | 2021-07-30 |
Family
ID=74124896
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011461868.3A Active CN112231761B (en) | 2020-12-14 | 2020-12-14 | Device mounting method, computing device and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112231761B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI796631B (en) * | 2021-02-02 | 2023-03-21 | 宏碁股份有限公司 | Method for realizing plug-and-play function of external storage device in linux system and electronic device using the same |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150347173A1 (en) * | 2012-08-30 | 2015-12-03 | Zte Corporation | Method, system and device for managing software on virtual machine in cloud environment |
CN105589657A (en) * | 2014-10-23 | 2016-05-18 | 中兴通讯股份有限公司 | Method and device for realizing mounting of mobile storage |
CN105808299A (en) * | 2016-03-09 | 2016-07-27 | 深圳Tcl数字技术有限公司 | External device automatic mounting and informing control method and system |
CN106873921A (en) * | 2017-03-24 | 2017-06-20 | 努比亚技术有限公司 | A kind of hanging method and device of multi partition external storage |
-
2020
- 2020-12-14 CN CN202011461868.3A patent/CN112231761B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150347173A1 (en) * | 2012-08-30 | 2015-12-03 | Zte Corporation | Method, system and device for managing software on virtual machine in cloud environment |
CN105589657A (en) * | 2014-10-23 | 2016-05-18 | 中兴通讯股份有限公司 | Method and device for realizing mounting of mobile storage |
CN105808299A (en) * | 2016-03-09 | 2016-07-27 | 深圳Tcl数字技术有限公司 | External device automatic mounting and informing control method and system |
CN106873921A (en) * | 2017-03-24 | 2017-06-20 | 努比亚技术有限公司 | A kind of hanging method and device of multi partition external storage |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI796631B (en) * | 2021-02-02 | 2023-03-21 | 宏碁股份有限公司 | Method for realizing plug-and-play function of external storage device in linux system and electronic device using the same |
Also Published As
Publication number | Publication date |
---|---|
CN112231761B (en) | 2021-07-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102938039B (en) | For the selectivity file access of application | |
US7913252B2 (en) | Portable platform for executing software applications in a virtual environment | |
US10528735B2 (en) | Malicious code protection for computer systems based on process modification | |
CN101650660B (en) | Booting a computer system from central storage | |
US8327096B2 (en) | Method and system for efficient image customization for mass deployment | |
US20120054734A1 (en) | Device software upgrade using a dynamically sized partition | |
US8417969B2 (en) | Storage volume protection supporting legacy systems | |
US20090241110A1 (en) | Virtual environment system and method for operating the same | |
JP2008522279A (en) | Security transmission system for online data between virtual disks whose access is controlled, and security transmission method through the same | |
US20200371821A1 (en) | Method and apparatus for adapting handle device to third-party application, and storage medium | |
US9164919B2 (en) | Method and apparatus for inputting/outputting virtual operating system from removable storage device on a host using virtualization technique | |
US9542112B2 (en) | Secure cross-process memory sharing | |
CN111428241A (en) | Multi-security access policy control method and computing device | |
CN113791873B (en) | Virtual machine creating method, computing device and storage medium | |
CN112231761B (en) | Device mounting method, computing device and readable storage medium | |
US10956173B2 (en) | Capturing pre-fetch blocks of an operating system to improve boot performance in a cloud environment | |
CN113239390B (en) | Program access authority control method and device, computing device and storage medium | |
CN110955885B (en) | Data writing method and device | |
CN113254888B (en) | Method for acquiring hardware information, authorization control system and computing equipment | |
US8347387B1 (en) | Addressing security in writes to memory | |
CN114510706A (en) | Permission control method and device based on physical interface and computing equipment | |
CN113254917A (en) | Recording permission management method, computing device and storage medium | |
CN112580023B (en) | Shadow stack management method and device, medium and equipment | |
CN116974592A (en) | Software deployment method, device, computer equipment and storage medium | |
CN114416659A (en) | Interaction method and device with external equipment, computing equipment and storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |