External device mounting method, device and computer readable storage medium

By setting configuration files and data structure matching, the stability and security problems of DVR data storage devices when loading on Android mobile terminals are solved, and efficient and secure data mounts and operations are achieved.

CN113934376BActive Publication Date: 2025-03-25ALLWINNER TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111237548.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-22
Publication Date
2025-03-25
Estimated Expiration
2041-10-22

AI Technical Summary

Technical Problem

In the prior art, DVR data storage devices have stability and security problems when loading terminals such as Android phones.

Method used

By setting the configuration file, the terminal device only responds to the specified mount device type to achieve hidden mount. At the same time, through the matching and formatting of data structures, the specified applications can directly read and write operations, ensuring the uniqueness and security of the file storage directory.

Benefits of technology

It improves the loading stability and security of DVR data storage devices on Android mobile terminals, ensuring the security and independence of mounted data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113934376B_ABST
    Figure CN113934376B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, device and computer-readable storage medium for mounting an external device, comprising: a kernel module 113 monitors an access message of a second port module 111, when a mounting end 100 is connected to a terminal 110, the kernel module 113 responds to the access event, reports the access message to a Vold module 115, the Vold module 115 parses the reported document and compares the parsed document with the configuration information of the Vold module 115, if they are consistent, the match is successful, the storage module 103 of the interface device is mounted to a specified path of the terminal 110, only the specified application is allowed to perform read and write operations, and the mounting end 100 is hidden from other applications of the terminal 110. The beneficial effects of the present invention are: by setting a configuration file, the terminal device only responds to the hidden mounting of the specified mounting device type, and by matching and formatting the data structure, the specified application can directly perform read and write operations, thereby ensuring the uniqueness and efficiency of the storage directory of the file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of device mounting, and in particular to a method, an apparatus and a computer-readable storage medium for mounting an external device. Background Art

[0002] With the development of information technology, digital video recorders (DVRs) are being used more and more widely. For example, effective driving evidence can be used by traffic police to determine whether drivers comply with traffic regulations. Especially in the field of security, when using mobile phones and other terminals to read data from DVR storage devices, there are higher requirements for security and stability. Therefore, how to improve the stability and security of DVR data storage devices when loaded on terminals such as Android phones is a problem to be solved. Summary of the invention

[0003] In view of this, the present invention provides a method for accelerating game running, aiming to solve at least one of the technical problems existing in the prior art.

[0004] In order to achieve the above objectives, the proposed solution is as follows:

[0005] The first aspect of the technical solution of the present invention is a method for mounting an external device, including: S100, reading a configuration file of a terminal device and listening to messages of the terminal device port; S200, responding to access of the terminal device port and reporting an access message; S300, determining whether the accessed mounted device matches the terminal device, and if the match is successful, executing step S400; S400, mounting the mounted device to a specified path of the terminal device, allowing specified applications to perform read and write operations, and the mounted device is hidden from other applications.

[0006] Optionally, in the method for mounting an external device, step S1 includes: reading a partition of the mounting device specified for mounting and / or reading a specified path mounted to the terminal device and / or reading a model of the mounting end.

[0007] Optionally, the method for mounting an external device, wherein the steps of reading a configuration file of a terminal device and monitoring messages of a port of the terminal device include: reading at least one of a mount partition, a mount path and a mount end model of the mounted device.

[0008] Optionally, in the method for mounting an external device, the access message includes: a path message and / or a device type message of the mounting-end device.

[0009] Optionally, the method for mounting an external device, wherein the judgment of whether the connected mounted device matches the terminal device includes: if the reporting message and / or the mounted device type in the reporting message is valid, the connected mounted device matches the terminal device successfully.

[0010] Optionally, in the method of mounting an external device, determining the validity of the reported message includes: reading path information from the reported message, and if the reported path message is consistent with the path in the configuration file, then the reported message is a valid message.

[0011] Optionally, the method for mounting an external device, wherein the judging of the validity of the mounted device in the reported message comprises: reading a device type of the mounted device from the reported message, and if the reported device type of the mounted device is consistent with the device type of the mounted device in the configuration file, then the mounted device is validly mounted.

[0012] Optionally, in the method for mounting an external device, step S300 further includes: searching for an application of the terminal device that is consistent with the storage content of the mounted device, reading the structure type of the data stored in the application, reading the structure type of the data stored in the mounted device, and if the data structure types of the two are inconsistent, formatting the storage data in the mounted device so that the data structure types of the two are consistent.

[0013] Optionally, in the method for mounting an external device, step S400 includes: the storage space of the mounting device adopts partition storage, and the partition is specified to be mounted to a specified path of the terminal device.

[0014] In the second aspect, an embodiment of the present invention also provides an apparatus for mounting an external device, comprising an external plug-in terminal 100 and a terminal 110, wherein the external plug-in terminal 100 comprises a first port module 101 and a storage module 103, and the terminal 110 comprises a second port module 111, a kernel module 133, a Vold module 115 and an application module 117; the external plug-in terminal 100 and the terminal 110 are respectively communicated and connected through the first port module 101 and the second port module 111; the storage module 103 is used to perform at least one of mounting, unmounting, formatting and storage space partitioning on the external plug-in terminal 100; the kernel module 113 is used to schedule resources; the Vold module 115 is used to manage and control the external storage device of the terminal 110; the application module 117 includes an upper-layer application software for interaction.

[0015] According to a third aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, storing instructions, and when the instructions are executed by a processor, the method for mounting an external device according to the first aspect is executed.

[0016] The beneficial effects of the present invention are as follows: by setting a configuration file, the terminal device only responds to the hidden mount of the specified mount device type, and by matching and formatting the data structure, the specified application can directly perform read and write operations, ensuring the uniqueness and efficiency of the file storage directory, only allowing the specified application to perform read and write operations, and the mount end is hidden from other applications, ensuring the security and independence of the mounted data. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The present invention is further described below in conjunction with the accompanying drawings and embodiments;

[0018] Figure 1 The block diagram is a software architecture of mounting between a terminal and an external device according to the present invention.

[0019] Figure 2 The figure is an overall flow chart of a method for mounting an external device according to the present invention.

[0020] Figure 3 The figure is a detailed flow chart of a method for mounting an external device according to the present invention. DETAILED DESCRIPTION

[0021] The concept, specific structure and technical effects of the present invention will be clearly and completely described below in combination with the embodiments and drawings to fully understand the purpose, scheme and effect of the present invention.

[0022] It should be noted that, unless otherwise specified, when a feature is referred to as being "fixed" or "connected" to another feature, it may be directly fixed or connected to another feature, or it may be indirectly fixed or connected to another feature. The singular forms "a", "said" and "the" used herein are also intended to include the plural forms, unless the context clearly indicates otherwise. In addition, unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art. The terms used in this specification are intended only to describe specific embodiments and are not intended to limit the invention. The term "and / or" used herein includes any combination of one or more of the related listed items.

[0023] It should be understood that, although the term first, second, third etc. may be adopted to describe various elements in the present disclosure, these elements should not be limited to these terms. These terms are only used to distinguish the same type of elements from each other. For example, without departing from the scope of the present disclosure, the first element may also be referred to as the second element, and similarly, the second element may also be referred to as the first element. The use of any and all examples or exemplary language ("for example", "such as" etc.) provided herein is only intended to better illustrate embodiments of the present invention, and unless otherwise required, the scope of the present invention will not be limited.

[0024] Figure 1 It is a block diagram of the software architecture of the mounting between the terminal and the external device according to the present invention.

[0025] Figure 1 Taking the external plug-in terminal 100 and the terminal 110 as examples, the software architecture of the terminal 110 and the external plug-in terminal 100 according to the present invention are respectively shown. Figure 1 As shown, the mounting end 100 includes a first port module 101 and a storage module 103, and the terminal 110 includes a second port module 111, a kernel module 113, a Vold module 115 and an application module 117. The external end includes devices such as DVR, USB flash drive, and mobile phone including the first port module 101 and the storage module 103, and the terminal includes devices such as mobile phone and tablet computer including the second port module 111, the kernel module 113, the Vold module 115 and the application module 117.

[0026] The first port module 101 and the second port module 111 are interfaces for interacting with the external environment, including visible ports, such as Universal Serial Bus (USB), Secure Digital Memory Card (SD) and TF Card (T-Flash) and invisible ports, such as Bluetooth and IP ports. In one embodiment, when the plug-in terminal 100 is mounted on the terminal 110, the first port module 101 and the second port module 111 are connected, wherein the connection of the visible ports is that the storage data of the plug-in terminal 100 is transmitted to the terminal 110 through the port.

[0027] The storage module 103 is used for mounting, unmounting, formatting or partitioning the storage space in the plug-in terminal 100. In one embodiment, when the plug-in terminal 100 is mounted on the terminal 110, the storage module 103 starts the mounting program; when the plug-in terminal 100 ends the mounting of the terminal 110, the storage module 103 starts the unloading program; when data needs to be stored in the plug-in terminal 100, the storage space partitioning program is started to store the data; when the stored data needs to be formatted, the formatting program is started to format the data.

[0028] The kernel module 113 is used for resource scheduling, and provides system software with functions such as storage management, CPU and process management, file system, device management and driver, network communication, as well as system initialization, system call, etc. Among them, the kernel module 113 monitors the messages of the second port module 111, and the monitored messages are divided into three categories, namely device access, disconnection, and status change.

[0029] The Vold module 115 is used to manage and control the external storage device of the terminal 110, for example, SD plug-in, mounting, unmounting, formatting, etc. The Vold module 115 receives kernel events from the kernel module 113. For example, when the mounting end 100 is an SD / USB device, the mounting end 100 is inserted into the terminal 110, and the kernel module 113 will automatically detect and load the corresponding driver. At the same time, the kernel module 113 will send a corresponding event to the application module 117 when a new driver is loaded and pass it to the Vold module 115.

[0030] The application module 117 is an upper-layer application software used to interact with the terminal 110 user, including an application program for a mobile terminal. For example, the mounting end 100 is a DVR, and the terminal 110 is an Android-based mobile phone. When the DVR is successfully mounted on the mobile phone, the DVR data can be read on the mobile phone and displayed and played in the application module 117.

[0031] In a first aspect, an embodiment of the present invention further provides a method for mounting an external device, such as Figure 2 As shown, taking the terminal 110 and the mounting end 100 as an example, a method for mounting an external device includes the following steps:

[0032] S100 , port monitoring: the kernel module 113 monitors the access message of the second port module 111 , wherein the access message includes the attribute information of the mounting end 100 .

[0033] S200, reporting of information: the kernel module 113 responds to the access event and reports the access message to the Vold module 115, wherein the kernel module 113 generates a document with the basic information of the associated port device and places the document under the corresponding monitoring path of the Vold module 115.

[0034] S300, whether the access device matches the terminal setting condition: determine whether the access device matches, if the match is successful, execute step S4, otherwise, execute step S5, determine whether the match includes, Vold module 115 parses the reported document and compares the parsed document with the configuration information of Vold module 115, if they are consistent, the match is successful.

[0035] S400, mounting in hidden mode: mounting the storage module 103 of the interface device to a specified path of the terminal 110, wherein the storage module 103 of the mounting end 100 adopts partition storage, the specified partition is mounted to the specified path of the terminal 110, and the specified application is allowed to perform read and write operations, and the mounting end 100 is hidden from other applications;

[0036] S500, ordinary mounting: mounting the mounting end 100 to the terminal 110 is no longer based on the Vold module 115, and is visible to all applications, and all applications can perform read and write operations.

[0037] In the above embodiment, by setting the configuration file of the Vold module, the Vold module only responds to the specified mount device type, and by matching and formatting the data structure, the specified application can directly perform read and write operations, thereby ensuring the uniqueness and efficiency of the file storage directory, and only allowing the specified application to perform read and write operations. The mount end 100 is hidden from other applications, thereby ensuring the security and independence of the mounted data.

[0038] Combine the following Figure 3 The flowchart shown describes the detailed implementation of the above steps in multiple embodiments.

[0039] Step S100 specifically includes:

[0040] S101, reading of configuration file: When the terminal 110 is turned on, the Vold module 115 reads the initialization configuration file, which includes configuration information such as the specified partition, the specified path mounted to the terminal 110, and the mounting terminal model, and is used to describe the mounting action of the Vold module 115. For example:

[0041] dev_mount

[0042] sdcard

[0043] / mnt / sdcard

[0044] auto

[0045] voldmanaged

[0046] / devices / platform / mmci-omap-hs.0 / mmc_host / mmc.0

[0047] / devices / platform / mmci-omap-hs.0 / mmc_host / mmc.1

[0048] / devices / platform / msm_sdcc.2 / mmc_host / mmc1

[0049] Wherein, dev_mount represents the mount format, sdcard represents the mount label, / mnt / sdcard represents the mount point, auto is a custom option and can be any non-zero integer. By default, the first partition of the storage module 103 is mounted. The voldmanaged flag indicates that the device is managed by vold. The data of the storage module 103 are mounted in the two directories mmc.0 and / or mmc.1. mmc1 is the monitoring path of the Vold module 115. When the mounting end 100 is a DVR device and voldmanaged=DVR, it indicates that the Vold module 115 only mounts and manages the DVR device, specifically including: mounting the data of the storage module 103 under the mmc.0 path. If the path is occupied, the mmc.1 path can be selected. A file containing the DVR model, ID number, production date and other related information will appear under the mmc1 monitoring path.

[0050] S102, port monitoring: initializing the monitoring program of the kernel module 113, monitoring the changes of the second port module 111, reading the configuration file, and identifying the address and type of the mounting end 100 by parsing the configuration file.

[0051] Step S300 specifically includes:

[0052] S301, judgment of message validity: read the path from the reported message, match the reported path message with the path in the configuration file, if the match is successful, the reported message is a valid message, and execute step S302, otherwise continue monitoring.

[0053] S302, determine the validity of the mounted device: read the device type of the mount end 100 from the reported message, match the reported device type message of the mount end 100 with the device type message of the mount end 100 in the configuration file, if the match is successful, the device of the mount end 100 is a valid device, and execute step S303.

[0054] S303, matching and formatting of data structure: reading the structure type of the data stored in the storage module 103, searching the application module 117 for the application that is consistent with the content of the mounting end 100, reading the structure type of the data stored in the application, and if the data structure types of the two are inconsistent, formatting the data stored in the storage module 103.

[0055] In one embodiment, the mounting end 100 is a DVR device, wherein the file system partition structure of the storage module 103 is FAT32, the storage module 103 uses the reserved reserved area 0x04-0x1E3 to save the camera data, code stream and other information, stores the DVR structure data, and records the structure type of the DVR data as para_DVR, searches for the application module 117 corresponding to the DVR device, for example, the "DVR" APP, and records that the image and / or recording data structure type in the "DVR" APP is para_TE, if the para_DVR and para_TE data structure types are consistent, then the mounting end 100 is hidden mounted, if the para_DVR and para_TE data structure types are inconsistent, based on the para_TE data structure type, the storage data in the storage module 103 is formatted, and the mounting end 100 is hidden mounted;

[0056] In one embodiment, if the para_DVR and para_TE data structure types are inconsistent, a prompt is given at the terminal 110 and / or the mounting end 100, wherein the prompt includes popping up a prompt box in the form of text, the prompt box includes two options of agreeing and disagreeing to formatting, and can be in the form of a button or a selection box. If the user agrees, the storage data in the storage module 103 is formatted based on the para_TE data structure type, and hidden mounting is performed on the mounting end 100; if the user disagrees, normal mounting is performed on the mounting end 100.

[0057] In one embodiment, the mounting end 100 is a DVR device, and the application matched by the terminal 110 is "DVR". The data of the storage module 103 is loaded in the extended function of "DVR". The partitions of the storage module 103 can be displayed hierarchically in a tree structure, and the user can directly read and edit them.

[0058] In one embodiment, the mounting end 100 is a DVR device. If there is no application consistent with the content of the mounting end 100 in the application module 117, the application module 117 searches for applications in the application provider based on the keyword "DVR". If the relevant description of the application is related to "DVR", it can be included in the recommended download list, and the user is recommended to download the corresponding one or more applications based on the recommended download list.

[0059] In the above embodiment, by setting the configuration file of the Vold module, the Vold module only responds to the specified mount device type, and by matching and formatting the data structure, the specified application can directly perform read and write operations, thereby ensuring the uniqueness and efficiency of the file storage directory, and only allowing the specified application to perform read and write operations. The mount end 100 is hidden from other applications, thereby ensuring the security and independence of the mounted data.

[0060] In the second aspect, an embodiment of the present invention also provides an apparatus for mounting an external device, specifically comprising an external plug-in terminal 100 and a terminal 110, wherein the external plug-in terminal 100 comprises a first port module 101 and a storage module 103, and the terminal 110 comprises a second port module 111, a kernel module 133, a Vold module 115 and an application module 117; the external plug-in terminal 100 and the terminal 110 are respectively communicated and connected through the first port module 101 and the second port module 111; the storage module 103 is used to perform at least one of mounting, unmounting, formatting and storage space partitioning on the external plug-in terminal 100; the kernel module 113 is used to schedule resources; the Vold module 115 is used to manage and control the external storage device of the terminal 110; the application module 117 includes an upper-layer application software for interaction.

[0061] In the above embodiment, the second port module 111 is used to monitor the changes of the terminal 110 port and respond to the changes, and the configuration information is obtained by parsing the configuration file, including: the mount device type and the mount path. The kernel module 113 responds to the access message of the mount end 100 accessing the terminal 110, and the Vold module 115 determines the validity of the reported path message. If the path is a valid path, the uploaded message is a valid message. The Vold module 115 determines the validity of the mount device type. If the mount device type is a valid mount device type, data matching is performed to mount the device in a hidden manner to achieve a safe and independent mount device.

[0062] It should be appreciated that the method steps in the embodiments of the present invention can be implemented or implemented by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer readable memory. The method can use standard programming techniques. Each program can be implemented in a high-level process or object-oriented programming language to communicate with a computer system. However, if necessary, the program can be implemented in an assembly or machine language. In any case, the language can be a compiled or interpreted language. In addition, the program can be run on a programmed ASIC for this purpose.

[0063] Furthermore, the operations of the processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) that is executed collectively on one or more processors, by hardware, or a combination thereof. The computer program includes a plurality of instructions that may be executed by one or more processors.

[0064] Further, the method can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Various aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, a RAM, a ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the process described herein. In addition, the machine-readable code, or portions thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor, the invention described herein includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques of the present invention, the present invention can also include the computer itself.

[0065] The computer program can be applied to input data to perform the functions described herein, thereby converting the input data to generate output data stored in a non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the present invention, the converted data represents physical and tangible objects, including specific visual depictions of physical and tangible objects produced on the display.

[0066] The above is only a preferred embodiment of the present invention. The present invention is not limited to the above implementation. As long as the technical effect of the present invention is achieved by the same means, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of protection of the present invention. Within the scope of protection of the present invention, its technical scheme and / or implementation method may have various modifications and changes.

Claims

1. A method for mounting an external device, characterized in that: The following steps are involved: S100, reading a configuration file of a terminal device and monitoring a message on a port of the terminal device; S200, responding to the access of the terminal device port and reporting an access message; S300, determining whether the connected mounted device matches the terminal device, if the match is successful, executing step S400; S400, mounting the mount device to a specified path of the terminal device, allowing a specified application to perform read and write operations, and hiding the mount device from other applications; The step S300 further includes: Search for an application of the terminal device that is consistent with the storage content of the mounted device, read the structure type of the data stored in the application, and read the structure type of the data stored in the mounted device. If the data structure types of the application and the mounted device are inconsistent, format the stored data in the mounted device so that the data structure types remain consistent.

2. The method for mounting an external device according to claim 1, characterized in that: The reading of the configuration file of the terminal device and monitoring of the message of the port of the terminal device comprises: Read at least one of the mount partition, mount path and mount end model of the mount device.

3. The method for mounting an external device according to claim 1, characterized in that: The access message includes: a path message and at least one of a device type message of the mounting end device.

4. The method for mounting an external device according to claim 1, characterized in that: The determining whether the connected mounted device matches the terminal device includes: If the reporting message and / or the device type of the mounted device in the reporting message is valid, the connected mounted device is matched with the terminal device.

5. The method for mounting an external device according to claim 4, characterized in that: The determining the validity of the reported message includes: The path information is read from the reported message. If the reported path information is consistent with the path in the configuration file, the reported message is a valid message.

6. The method for mounting an external device according to claim 4, characterized in that: The determining the validity of the mounted device in the reporting message includes: The device type of the mounted device is read from the report message. If the reported device type of the mounted device is consistent with the device type of the mounted device in the configuration file, the mounted device is effectively mounted.

7. The method for mounting an external device according to claim 1, characterized in that: The step S400 includes: the storage space of the mounting device adopts partition storage, and the partition is designated to be mounted to a designated path of the terminal device.

8. A computer-readable storage medium having computer instructions stored thereon, characterized in that When the computer instructions are executed by a processor, the method steps according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Mounting method and device of external multi-partition storage device

    CN106873921A