CN112506819B - Dual-system-based external equipment control method, device, equipment and storage medium - Google Patents

Dual-system-based external equipment control method, device, equipment and storage medium Download PDF

Info

Publication number
CN112506819B
CN112506819B CN201910789008.3A CN201910789008A CN112506819B CN 112506819 B CN112506819 B CN 112506819B CN 201910789008 A CN201910789008 A CN 201910789008A CN 112506819 B CN112506819 B CN 112506819B
Authority
CN
China
Prior art keywords
service
external device
layer
mounting
message
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.)
Active
Application number
CN201910789008.3A
Other languages
Chinese (zh)
Other versions
CN112506819A (en
Inventor
廖红卫
蒋兴
董庆民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu TD Tech Ltd
Original Assignee
Chengdu TD Tech Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu TD Tech Ltd filed Critical Chengdu TD Tech Ltd
Priority to CN201910789008.3A priority Critical patent/CN112506819B/en
Publication of CN112506819A publication Critical patent/CN112506819A/en
Application granted granted Critical
Publication of CN112506819B publication Critical patent/CN112506819B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/12Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor
    • G06F13/124Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/545Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides an external device control method, device, equipment and storage medium based on a dual system, wherein the method comprises the following steps: the electronic equipment is provided with a kernel, a first system and a second system, wherein the first system comprises a first vold layer, a first socket and a first mounting service, and the second system comprises a second vold layer, a second socket and a second mounting service; the method comprises the steps that a kernel obtains an insertion message of an external device; the kernel sends the insertion message to a first vold layer and a second vold layer respectively; the first vold layer sends the insertion message to a first mounting service through a first socket, and the second vold layer sends the insertion message to a second mounting service through a second socket; the first mounting service mounts the external device onto the first system according to the insertion message, and the second mounting service mounts the external device onto the second system according to the insertion message. And realizing the access of the first system and the second system to the external equipment.

Description

Dual-system-based external equipment control method, device, equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of terminal equipment, in particular to a dual-system-based external equipment control method, device, equipment and storage medium.
Background
With the development of electronic devices, a dual system, that is, a dual container may be installed in the electronic device. The dual system is mainly an operating system of the electronic device. An external device may be connected to the electronic device, for example, a usb disk may be inserted into the electronic device, or a Secure Digital Memory (SD) card may be inserted into the electronic device.
In the prior art, one of the dual systems of the electronic device operates in the foreground of the electronic device, the other of the dual systems operates in the background of the electronic device, and when the external device is connected to the electronic device, the external device is mounted on the system operating in the foreground, so that the system operating in the foreground can access the external device.
However, in the prior art, with the requirements of the electronic device on the storage space and the access space, the prior art method only has one system to access the external device, and two systems of the electronic device cannot both access the external device, thereby limiting the external access space and the external storage space of the electronic device.
Disclosure of Invention
The embodiment of the application provides a dual-system-based external device control method, a dual-system-based external device control device and a dual-system-based external device storage medium, and is used for solving the problem that in the prior art, two systems of an electronic device cannot access the external device, so that the external access space and the external storage space of the electronic device are limited.
The first aspect of the application provides an external device control method based on dual systems, which is applied to an electronic device, wherein the electronic device is provided with a kernel, a first system and a second system, the first system comprises a first vold layer, a first socket and a first mounting service, and the second system comprises a second vold layer, a second socket and a second mounting service; the method comprises the following steps:
the method comprises the steps that the inner core obtains an insertion message of an external device, wherein the insertion message represents that the external device is inserted into an external interface of the electronic device;
the kernel sends the insertion message to the first vold layer and the second vold layer respectively;
the first vold layer sends the insert message to the first mounting service through a first socket, and the second vold layer sends the insert message to the second mounting service through a second socket;
the first mounting service mounts the external device onto the first system according to the insertion message, and the second mounting service mounts the external device onto the second system according to the insertion message.
Further, the first system further comprises a first application service layer; the second system further comprises a second application service layer; after the second mounting service mounts the external device onto the second system according to the insertion message, the method further includes:
the first application service layer sends a first access instruction to the external equipment through the inner core so that the external equipment completes data processing according to the first access instruction;
and/or the second application service layer sends a second access instruction to the external equipment through the kernel, so that the external equipment completes data processing according to the second access instruction.
Further, after the second mounting service mounts the external device onto the second system according to the insertion message, the method further includes:
the method comprises the steps that a kernel acquires a pulling-out message of an external device, wherein the pulling-out message represents that the external device is separated from an external interface of the electronic device;
the pull-out message is sent to the first vold layer and the second vold layer by the kernel respectively;
the first vold layer sends the pull-out message to the first mounting service through a first socket, and the second vold layer sends the pull-out message to the second mounting service through a second socket;
the first mounting service unloads the external equipment from the first system according to the pull-out message, and the second mounting service unloads the external equipment from the second system according to the pull-out message.
Further, the first system further comprises a first application service layer; after the second mounting service mounts the external device onto the second system according to the insertion message, the method further includes:
the first application service layer acquires a first uninstalling instruction triggered by a user;
the first application service layer generates a first unloading event according to the first unloading instruction, and calls the first mounting service;
and the first mounting service acquires the first unloading event and unloads the external equipment from the first system according to the first unloading event.
Further, the first system further comprises a first application service layer and a first monitoring service, and the second system further comprises a second application service layer and a second monitoring service; the method further comprises the following steps:
the first application service layer acquires a formatting instruction triggered by a user;
the first application service layer generates a formatting event according to the formatting instruction, and sends the formatting event to the second monitoring service through the first monitoring service;
when the second monitoring service determines that the second system mounts the external device, the second system unloads the external device;
and the first mounting service carries out formatting processing on the external equipment.
Further, when the second listening service determines that the second system mounts the external device, the second system uninstalls the external device, including:
when the second monitoring service determines that the second system mounts the external device, the second monitoring service returns a first response message to the first application service layer through the first monitoring service, wherein the first response message is used for indicating that the second system mounts the external device;
the first application service layer generates and displays first prompt information according to the first response message so that the user triggers a second uninstalling instruction, wherein the first prompt information represents that the second system installs the external device;
the second application service layer acquires the second unloading instruction;
the second application service layer generates a second unloading event according to the second unloading instruction, and calls the second mounting service;
and the second mounting service acquires the second unloading event and unloads the external equipment from the second system according to the second unloading event.
Further, the formatting the external device by the first mount service includes:
the first application service layer acquires a reformatting instruction triggered by a user and calls the first mounting service;
and the first mounting service carries out formatting treatment on the external equipment according to the reformatting event.
Further, the formatting the external device by the first mount service includes:
when the second monitoring service monitors that the external device is unloaded from the second system, the second monitoring service sends a second response message to the first application service layer through the first monitoring service, wherein the second response message is used for indicating that the external device is unloaded from the second system;
the first application service layer calls the first mounting service;
and the first mounting service carries out formatting treatment on the external equipment according to the formatting event.
Further, after the first mount service formats the external device, the method further includes:
the first mounting service sends a third response message to the first application service layer, wherein the third response message is used for indicating that the external device completes formatting;
and the first application service layer generates and displays second prompt information, wherein the second prompt information represents that the external equipment completes formatting.
Further, the method further comprises:
when the second monitoring service determines that the second system does not mount the external device, the second monitoring service returns a fourth response message to the first application service layer through the first monitoring service, wherein the fourth response message is used for indicating that the second system does not mount the external device;
the first application service layer calls the first mounting service;
and the first mounting service carries out formatting treatment on the external equipment according to the formatting event.
Further, the external device is a U disk, or the external device is a secure digital SD card.
A second aspect of the present application provides an electronic device, where the electronic device is provided with a kernel, a first system and a second system, where the first system includes a first vold layer, a first socket and a first mounting service, and the second system includes a second vold layer, a second socket and a second mounting service;
the kernel is configured to obtain an insertion message of an external device, where the insertion message represents that the external device is inserted into an external interface of the electronic device;
the kernel is further configured to send the insert message to the first vold layer and the second vold layer respectively;
the first vold layer is used for sending the insertion message to the first mounting service through a first socket; the second vold layer is configured to send the insert message to the second mount service through a second socket;
the first mounting service is used for mounting the external equipment to the first system according to the insertion message; and the second mounting service is used for mounting the external equipment to the second system according to the insertion message.
Further, the first system further comprises a first application service layer; the second system further comprises a second application service layer;
the first application service layer is configured to send a first access instruction to the external device through the kernel after the second mounting service mounts the external device onto the second system according to the insertion message, so that the external device completes data processing according to the first access instruction;
and/or the second application service layer is configured to send a second access instruction to the external device through the kernel after the second mounting service mounts the external device onto the second system according to the insertion message, so that the external device completes data processing according to the second access instruction.
Further, the kernel is further configured to obtain a pull-out message of the external device after the second mounting service mounts the external device onto the second system according to the insertion message, where the pull-out message represents that the external device is detached from an external interface of the electronic device; sending the pull-out message to the first vold layer and the second vold layer respectively;
the first vold layer is further configured to send the pull-out message to the first mount service through a first socket; the second vold layer is further configured to send the pull-out message to the second mount service through a second socket;
the first mounting service is further used for unloading the external device from the first system according to the pull-out message; and the second mounting service is also used for mounting the external equipment on the second system according to the pull-out message.
Further, the first system further comprises a first application service layer;
the first application service layer is used for acquiring a first uninstalling instruction triggered by a user after the second mounting service mounts the external device onto the second system according to the insertion message;
the first application service layer is further used for generating a first uninstalling event according to the first uninstalling instruction, and the first application service layer calls the first mounting service;
the first mounting service is configured to acquire the first uninstalling event and uninstall the external device from the first system according to the first uninstalling event.
Further, the first system further comprises a first application service layer and a first monitoring service, and the second system further comprises a second application service layer and a second monitoring service;
the first application service layer is used for acquiring a formatting instruction triggered by a user;
the first application service layer is further configured to generate a formatting event according to the formatting instruction, and send the formatting event to the second monitoring service through the first monitoring service;
the second monitoring service is used for unloading the external device by the second system when the second system is determined to mount the external device;
the first mounting service is further used for formatting the external device.
Further, the second monitoring service is specifically configured to return a first response message to the first application service layer through the first monitoring service when it is determined that the second system mounts the external device, where the first response message is used to indicate that the second system mounts the external device;
the first application service layer is specifically configured to generate and display first prompt information according to the first response message, so that the user triggers a second uninstalling instruction, where the first prompt information represents that the second system mounts the external device;
the second application service layer is specifically configured to obtain the second uninstalling instruction; generating a second unloading event according to the second unloading instruction, and calling the second mounting service;
the second mount service is specifically configured to acquire the second uninstall event, and uninstall the external device from the second system according to the second uninstall event.
Further, the first application service layer is specifically configured to obtain a reformatting instruction triggered by a user, and call the first mounting service;
the first mounting service is specifically configured to format the external device according to the reformatting event.
Further, the second monitoring service is specifically configured to send a second response message to the first application service layer through the first monitoring service when it is monitored that the external device is unloaded from the second system, where the second response message is used to indicate that the external device is unloaded from the second system;
the first application service layer is specifically used for calling the first mounting service;
the first mounting service is specifically configured to format the external device according to the formatting event.
Further, the first mounting service is further configured to send a third response message to the first application service layer after the first mounting service formats the external device, where the third response message is used to indicate that the external device completes formatting;
the first application service layer is further configured to generate and display second prompt information, where the second prompt information indicates that the external device completes formatting.
Further, the second monitoring service is further configured to return a fourth response message to the first application service layer through the first monitoring service when it is determined that the external device is not mounted on the second system, where the fourth response message is used to indicate that the external device is not mounted on the second system;
the first application service layer is also used for calling the first mounting service;
and the first mounting service is also used for formatting the external equipment according to the formatting event.
Further, the external device is a U disk, or the external device is a secure digital SD card.
A third aspect of the present application provides an electronic device comprising: a transmitter, a receiver, a memory, and a processor;
the memory is to store computer instructions; the processor is configured to execute the computer instructions stored by the memory to implement the method provided by any implementation manner of the first aspect.
A fourth aspect of the present application provides a storage medium comprising: a readable storage medium and computer instructions stored in the readable storage medium; the computer instructions are used for realizing the method provided by any implementation manner of the first aspect.
According to the external device control method, the device, the equipment and the storage medium based on the dual systems, a kernel, a first system and a second system are arranged in the electronic equipment, wherein the first system comprises a first vold layer, a first socket and a first mounting service, and the second system comprises a second vold layer, a second socket and a second mounting service; the method comprises the steps that a kernel obtains an insertion message of the external equipment, wherein the insertion message represents that the external equipment is inserted into an external interface of the electronic equipment; the kernel sends the insertion message to a first vold layer and a second vold layer respectively; the first vold layer sends the insertion message to a first mounting service through a first socket, and the second vold layer sends the insertion message to a second mounting service through a second socket; the first mounting service mounts the external device onto the first system according to the insertion message, and the second mounting service mounts the external device onto the second system according to the insertion message. Thus, the kernel may send the insert message to a first mount service of the first system through a first vold layer of the first system; meanwhile, the kernel can send the insertion message of the external device to a second mount service of the second system through a second vold layer of the second system; therefore, the first mounting service can mount the external equipment on the first system, and the second mounting service can mount the external equipment on the second system; therefore, the first system can access the external equipment, and the second system can also access the external equipment. And the dual-system is convenient for accessing and storing the external equipment, and the access authority and the storage authority are increased.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a schematic view of an application scenario provided in the present application;
fig. 2 is a flowchart of a dual-system-based external device control method according to an embodiment of the present disclosure;
FIG. 3 is an architecture diagram of a first system provided herein;
FIG. 4 is an architecture diagram of a second system provided herein;
fig. 5 is a flowchart of another dual-system-based external device control method according to an embodiment of the present disclosure;
fig. 6 is a flowchart of another dual-system-based external device control method according to an embodiment of the present application;
fig. 7 is a flowchart of another external device control method based on dual systems according to an embodiment of the present disclosure;
fig. 8 is a flowchart of another external device control method based on dual systems according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of another electronic device provided in an embodiment of the present application;
fig. 11 is a schematic structural diagram of another electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a schematic view of an application scenario provided by the present application, and as shown in fig. 1, the dual-system-based external device control method may be applied to an electronic device, where the electronic device includes but is not limited to a terminal device, a network device, a mobile device, a vehicle-mounted device, and the like.
A dual system, that is, a dual container is installed in the electronic device. The dual system is mainly an operating system of the electronic device. An external device may be connected to the electronic device, for example, a usb disk may be inserted into the electronic device, or an SD card may be inserted into the electronic device.
For example, a usb disk is inserted into an interface of the electronic device, or an SD card may be inserted into the mobile terminal device.
In the prior art, one of the dual systems of the electronic device operates in the foreground of the electronic device, the other of the dual systems operates in the background of the electronic device, and when the external device is connected to the electronic device, the external device is mounted on the system operating in the foreground, so that the system operating in the foreground can access the external device. Or, the external equipment connected with the electronic equipment is fixed as one of the two systems to be accessible; for example, the electronic device is installed with a system a and a system B, and as long as the electronic device is connected to the external device, it is determined that only the system B can access the external device.
However, in the prior art, with the requirements of the electronic device on the storage space and the access space, the prior art method only has one system to access the external device, and two systems of the electronic device cannot both access the external device, thereby limiting the external access space and the external storage space of the electronic device.
In order to solve the above problems, the dual-system-based external device control method, apparatus, device and storage medium provided by the present application may enable a first system to access an external device, and a second system to access the external device; and the dual-system is convenient for accessing and storing the external equipment, and the access authority and the storage authority are increased.
Fig. 2 is a flowchart of a dual-system-based external device control method provided in an embodiment of the present application, and as shown in fig. 2, the method is applied to an electronic device, where the electronic device is provided with a kernel, a first system and a second system, where the first system includes a first vold (Volume Daemon, for short) layer, a first socket and a first mount service, and the second system includes a second vold layer, a second socket and a second mount service; the method comprises the following steps:
s101, the inner core obtains an insertion message of the external device, wherein the insertion message represents that the external device is inserted into an external interface of the electronic device.
In this step, the electronic device is configured with two systems, which are a first system and a second system respectively; the first system may also be referred to as a first operating system or a first control system, and the second system may also be referred to as a second operating system or a second control system; in addition, the electronic device is also configured with a kernel.
The first system comprises a first vold layer, a first socket and a first mounting service, wherein messages and instructions can be transmitted between the first vold layer and the first socket, and messages and instructions can be transmitted between the first socket and the first mounting service. The second system comprises a second vold layer, a second socket and a second mounting service, wherein messages and instructions can be transmitted between the second vold layer and the second socket, and messages and instructions can be transmitted between the second socket and the second mounting service.
In one example, the vold layer includes a network link management (Netlinkmanager) service, a command listening (Comandlistener) service, a volume management (Volumemanager) service, and a network link processing (netlinkmandler) service; the command monitoring service and the volume management service can transmit messages and instructions, and the volume management service and the network link processing service can transmit messages and instructions.
In one example, the service layer in the system includes a storage management (Storagemanager) service, a mount service (mount service), and an NDC (native data element, NDC) service; the storage management service and the mounting service can transmit messages and instructions, and the mounting service and the NDC service can transmit messages and instructions.
In one example, a driver service is configured in the kernel.
In an example, fig. 3 is an architecture diagram of a first system provided in the present application, and as shown in fig. 3, a first vold layer includes a first network link management service, a first command monitoring service, a first volume management service, and a first network link processing service; the first command monitoring service and the first volume management service can transmit messages and instructions, and the first volume management service and the first network link processing service can transmit messages and instructions. The first service layer of the first system comprises a first storage management service, the first mounting service and a first NDC service; the first storage management service and the first mounting service can transmit messages and instructions, and the first mounting service and the first NDC service can transmit messages and instructions. The first mount service can transmit messages and instructions with the first command monitoring service of the first vold layer through the first NDC service, that is, the first mount service can transmit messages and instructions with the first vold layer through the first NDC service; the first NDC service can transmit messages and instructions with the first command monitoring service through the first socket; the first network link processing service of the first vold layer can transfer messages and instructions with the kernel, that is, the first vold layer can transfer messages and instructions with the kernel. The driver service of the kernel and the first network link processing service can transfer messages and instructions, that is, the kernel and the first vold layer can transfer messages and instructions.
In an example, fig. 4 is an architecture diagram of a second system provided in the present application, and as shown in fig. 4, the second vold layer includes a second network link management service, a second command monitoring service, a second volume management service, and a second network link processing service; the second command monitoring service and the second volume management service can transmit messages and instructions, and the second volume management service and the second network link processing service can transmit messages and instructions. The second service layer of the second system comprises a second storage management service, the second mounting service and a second NDC service; the second storage management service and the second mounting service can transmit messages and instructions, and the second mounting service and the second NDC service can transmit messages and instructions. The second mount service can transmit messages and instructions with the second command monitoring service of the second vold layer through the second NDC service, that is, the second mount service can transmit messages and instructions with the second vold layer through the second NDC service; the second NDC service can transmit messages and instructions with the second command monitoring service through the second socket; the second network link processing service of the second vold layer can transfer messages and instructions with the kernel, that is, the second vold layer can transfer messages and instructions with the kernel. The driver service of the kernel and the second network link processing service can transfer messages and instructions, that is, the kernel and the second vold layer can transfer messages and instructions.
The method comprises the steps that an external interface is arranged on the electronic equipment, and when a user inserts the external equipment into the external interface of the electronic equipment, the inner core can detect that the external equipment is inserted into the external interface of the electronic equipment; thus, the kernel may generate an insertion message that characterizes the insertion of the external device onto the external interface of the electronic device.
In one example, an electronic device is configured with a first system and a second system, the first system running in a foreground of the electronic device, the second system running in a background of the electronic device; a user inserts an external device into an external interface of the electronic device; the kernel of the electronic device can detect that the external device is inserted into the external interface of the electronic device.
S102, the kernel sends the insert message to the first vold layer and the second vold layer respectively.
In this step, the driver service of the kernel sends the insertion message generated by the kernel to the first vold layer of the first system and the second vold layer of the second system, respectively.
In one example, the driver service of the kernel sends an insert message to a first network link processing service of a first vold layer; meanwhile, the drive service of the kernel inserts the message and sends the message to the second network link processing service of the second vold layer.
S103, the first vold layer sends the insert message to the first mounting service through the first socket, and the second vold layer sends the insert message to the second mounting service through the second socket.
In this step, since the first socket may communicate the first vold layer with the first mount service of the first service layer, the first vold layer of the first system may send the insert message to the first mount service of the first service layer through the first socket.
In one example, a first mount service may transmit messages and instructions with a first command monitoring service of a first vold layer through a first NDC service, the first NDC service may transmit messages and instructions with the first command monitoring service through a first socket, the first command monitoring service may transmit messages and instructions with a first volume management service, and the first volume management service may transmit messages and instructions with a first network link processing service, so that the first network link processing service of the first vold layer of the first system sends an insert message to the first command monitoring service of the first vold layer through the first volume management service; then, the first command listening service sends the insertion message to a first NDC service of the first service layer through a first socket; then, the first NDC service transmits the insert message to a first mount service of the first service layer.
Since the second socket can communicate the second vold layer with the second mount service of the second service layer, the second vold layer of the second system can send the insertion message to the second mount service of the second service layer through the second socket.
In one example, the second mount service may transmit the message and the instruction with the second command monitoring service of the second vold layer through the second NDC service, the second NDC service may transmit the message and the instruction with the second command monitoring service through the second socket, the second command monitoring service may transmit the message and the instruction with the second volume management service, and the second volume management service may transmit the message and the instruction with the second network link processing service, so that the second network link processing service of the second vold layer of the second system sends the insert message to the second command monitoring service of the second vold layer through the second volume management service; then, the second command listening service sends the insert message to a second NDC service of the second service layer through a second socket; the second NDC service then sends an insert message to a second mount service of the second service layer.
S104, the first mounting service mounts the external device onto the first system according to the insertion message, and the second mounting service mounts the external device onto the second system according to the insertion message.
In this step, the first mounting service of the first system processes mounting, uninstalling and formatting of the external device; after receiving the insertion message, the first mounting service may mount the external device to the first system, and the first system may access the external device.
Meanwhile, the second mounting service of the second system is used for processing mounting, unloading and formatting of the external equipment; after receiving the insertion message, the second mounting service may mount the external device to the second system, and the second system may access the external device.
For example, the external device may be a usb disk, and after the kernel obtains the insertion message of the usb disk, the method provided in this embodiment is executed, so that both the first system and the second system of the electronic device may access the usb disk.
For example, the external device may be an SD card, and after the kernel obtains the insertion message of the SD card, the method provided in this embodiment is executed, so that both the first system and the second system of the electronic device can access the SD card.
In this embodiment, a kernel, a first system and a second system are arranged in an electronic device, where the first system includes a first vold layer, a first socket and a first mount service, and the second system includes a second vold layer, a second socket and a second mount service; the method comprises the steps that a kernel obtains an insertion message of the external equipment, wherein the insertion message represents that the external equipment is inserted into an external interface of the electronic equipment; the kernel sends the insertion message to a first vold layer and a second vold layer respectively; the first vold layer sends the insertion message to a first mounting service through a first socket, and the second vold layer sends the insertion message to a second mounting service through a second socket; the first mounting service mounts the external device onto the first system according to the insertion message, and the second mounting service mounts the external device onto the second system according to the insertion message. Thus, the kernel may send the insert message to a first mount service of the first system through a first vold layer of the first system; meanwhile, the kernel can send the insertion message of the external device to a second mount service of the second system through a second vold layer of the second system; therefore, the first mounting service can mount the external equipment on the first system, and the second mounting service can mount the external equipment on the second system; therefore, the first system can access the external equipment, and the second system can also access the external equipment. And the dual-system is convenient for accessing and storing the external equipment, and the access authority and the storage authority are increased.
Fig. 5 is a flowchart of another external device control method based on dual systems according to an embodiment of the present disclosure, and as shown in fig. 5, the method is applied to an electronic device, where the electronic device is provided with a kernel, a first system and a second system, where the first system includes a first vold layer, a first socket and a first mount service, and the second system includes a second vold layer, a second socket and a second mount service; the method comprises the following steps:
s201, the inner core obtains an insertion message of the external device, wherein the insertion message represents that the external device is inserted into an external interface of the electronic device.
In this step, the electronic device is configured with two systems, which are a first system and a second system respectively; the first system may also be referred to as a first operating system or a first control system, and the second system may also be referred to as a second operating system or a second control system; in addition, the electronic device is also configured with a kernel.
This step can be referred to as step S101 shown in fig. 2, and is not described again.
S202, the kernel sends the insert message to the first vold layer and the second vold layer respectively.
In this step, the step may refer to step S102 shown in fig. 2, and is not described again.
S203, the first vold layer sends the insert message to the first mounting service through the first socket, and the second vold layer sends the insert message to the second mounting service through the second socket.
In this step, the step may refer to step S103 shown in fig. 2, and is not described again.
S204, the first mounting service mounts the external device onto the first system according to the insertion message, and the second mounting service mounts the external device onto the second system according to the insertion message.
In this step, the step may refer to step S104 shown in fig. 2, and is not described again.
The first system further comprises a first application service layer; the second system further comprises a second application service layer; after step S204, the following steps may be further included:
s205, the first application service layer sends a first access instruction to the external equipment through the kernel, so that the external equipment completes data processing according to the first access instruction; and/or the second application service layer sends a second access instruction to the external equipment through the kernel, so that the external equipment completes data processing according to the second access instruction.
In this step, after the external device is mounted on the first system and the second system of the electronic device, the first system may access the external device, and the second system may also access the external device.
Also included in the first system is a first application service layer; the first application service layer can directly transmit information and instructions with the kernel, or the first application service layer can transmit information and instructions with the kernel through the first mount service and the first vold layer. Therefore, when the first application service layer needs to access the external equipment according to the triggering of the user or the triggering of other application programs, the first application service layer can send a first access instruction to the external equipment through the inner core; then, the external device completes the processing of the data according to the first access instruction, for example, the external device copies, deletes, copies the data stored in the external device, or the external device stores the data in the electronic device.
A second application service layer is also included in the second system; the second application service layer can directly transmit information and instructions with the kernel, or the second application service layer can transmit information and instructions with the kernel through the second mount service and the second vold layer. Therefore, when the second application service layer needs to access the external device according to the triggering of the user or the triggering of other application programs, the second application service layer can send a second access instruction to the external device through the kernel; then, the external device completes the processing of the data according to the second access instruction, for example, the external device copies, deletes, copies the data stored in the external device, or the external device stores the data in the electronic device.
And the first system accesses the external equipment, and simultaneously, the second system accesses the external equipment.
In this embodiment, on the basis of the above embodiment, a first application service layer of a first system sends a first access instruction to an external device through a kernel, and a second application service layer of a second system sends a second access instruction to the external device through the kernel; therefore, after the external device is mounted on the first system and the second system of the electronic device, the first system can access the external device, and the second system can also access the external device. And realizing the access of the dual system to the external equipment.
Fig. 6 is a flowchart of another external device control method based on dual systems according to an embodiment of the present disclosure, and as shown in fig. 6, the method is applied to an electronic device, where the electronic device is provided with a kernel, a first system and a second system, where the first system includes a first vold layer, a first socket and a first mount service, and the second system includes a second vold layer, a second socket and a second mount service; the method comprises the following steps:
s301, the inner core obtains an insertion message of the external device, wherein the insertion message represents that the external device is inserted into an external interface of the electronic device.
In this step, the electronic device is configured with two systems, which are a first system and a second system respectively; the first system may also be referred to as a first operating system or a first control system, and the second system may also be referred to as a second operating system or a second control system; in addition, the electronic device is also configured with a kernel.
This step can be referred to as step S101 shown in fig. 2, and is not described again.
S302, the kernel sends the insert message to the first vold layer and the second vold layer respectively.
In this step, the step may refer to step S102 shown in fig. 2, and is not described again.
S303, the first vold layer sends the insert message to the first mounting service through the first socket, and the second vold layer sends the insert message to the second mounting service through the second socket.
In this step, the step may refer to step S103 shown in fig. 2, and is not described again.
S304, the first mounting service mounts the external device onto the first system according to the insertion message, and the second mounting service mounts the external device onto the second system according to the insertion message.
In this step, the step may refer to step S104 shown in fig. 2, and is not described again.
After step S304, the following steps may be further included:
s305, the inner core obtains the pulling-out message of the external device, wherein the pulling-out message represents that the external device is separated from the external interface of the electronic device.
In this step, when the user pulls the external device out of the external interface of the electronic device, the kernel may detect that the external device is pulled out of the external interface of the electronic device; thus, the kernel may generate an unplug message that characterizes the removal of the external device from the external interface of the electronic device.
In one example, an electronic device is configured with a first system and a second system, the first system running in a foreground of the electronic device, the second system running in a background of the electronic device; when a user pulls an external device out of an external interface of the electronic device; the kernel of the electronic device can detect that the external device is separated from the external interface of the electronic device, and then the kernel of the electronic device generates the pull-out message.
S306, the kernel sends the pull-out message to the first vold layer and the second vold layer respectively.
In this step, the driver service of the kernel sends the pull-out message generated by the kernel to the first vold layer of the first system and the second vold layer of the second system, respectively.
In one example, the driver service of the kernel sends an unplugging message to a first network link processing service of a first vold layer; meanwhile, the drive service of the kernel extracts the message and sends the message to a second network link processing service of a second vold layer.
S307, the first vold layer sends the pull message to the first mounting service through the first socket, and the second vold layer sends the pull message to the second mounting service through the second socket.
In this step, since the first socket may communicate the first vold layer with the first mount service of the first service layer, the first vold layer of the first system may send the pull message to the first mount service of the first service layer through the first socket.
In one example, a first mount service may transmit a message and an instruction with a first command monitoring service of a first vold layer through a first NDC service, the first NDC service may transmit the message and the instruction with the first command monitoring service through a first socket, the first command monitoring service may transmit the message and the instruction with a first volume management service, and the first volume management service may transmit the message and the instruction with a first network link processing service, so that the first network link processing service of the first vold layer of the first system sends a pull-out message to the first command monitoring service of the first vold layer through the first volume management service; then, the first command monitoring service sends the pulling message to a first NDC service of the first service layer through a first socket; then, the first NDC service sends the pull-out message to the first mount service of the first service layer.
The second socket can communicate the second vold layer with the second mount service of the second service layer, so that the second vold layer of the second system can send the pull-out message to the second mount service of the second service layer through the second socket.
In one example, the second mount service may transmit the message and the instruction with the second command monitoring service of the second vold layer through the second NDC service, the second NDC service may transmit the message and the instruction with the second command monitoring service through the second socket, the second command monitoring service may transmit the message and the instruction with the second volume management service, and the second volume management service may transmit the message and the instruction with the second network link processing service, so that the second network link processing service of the second vold layer of the second system sends the extracted message to the second command monitoring service of the second vold layer through the second volume management service; then, the second command monitoring service sends the pulling message to a second NDC service of a second service layer through a second socket; then, the second NDC service will pull the message and send it to the second mount service of the second service layer.
S308, the first mounting service unloads the external device from the first system according to the pull-out message, and the second mounting service unloads the external device from the second system according to the pull-out message.
In this step, the first mounting service of the first system processes mounting, uninstalling and formatting of the external device; after receiving the pull-out message, the first mount service can uninstall the external device from the first system, and further, the first system does not access the external device any more.
Meanwhile, the second mounting service of the second system is used for processing mounting, unloading and formatting of the external equipment; after receiving the pull-out message, the second mounting service can uninstall the external device from the second system, and the second system does not access the external device any more.
For example, the external device may be a usb disk, and after the kernel obtains the pull-out message of the usb disk, the method provided in this embodiment is executed, so that neither the first system nor the second system of the electronic device accesses the usb disk.
For example, the external device may be an SD card, and after the kernel obtains the pull-out message of the SD card, the method provided in this embodiment is executed, so that neither the first system nor the second system of the electronic device can access the SD card.
In this embodiment, on the basis of the above embodiment, the kernel may send the pull message to the first mount service of the first system through the first vold layer of the first system; meanwhile, the kernel can send the pull-out message of the external device to a second mount service of the second system through a second vold layer of the second system; therefore, the first mounting service can unload the external device from the first system, and the second mounting service can unload the external device from the second system; therefore, the first system and the second system can not access the external equipment any more. The first system and the second system in the dual-system-based electronic equipment can unload the pulled-out external equipment.
Fig. 7 is a flowchart of another external device control method based on dual systems according to an embodiment of the present disclosure, and as shown in fig. 7, the method is applied to an electronic device, where the electronic device is provided with a kernel, a first system and a second system, where the first system includes a first vold layer, a first socket and a first mount service, and the second system includes a second vold layer, a second socket and a second mount service; the method comprises the following steps:
s401, the inner core obtains an insertion message of the external device, wherein the insertion message represents that the external device is inserted into an external interface of the electronic device.
In this step, the electronic device is configured with two systems, which are a first system and a second system respectively; the first system may also be referred to as a first operating system or a first control system, and the second system may also be referred to as a second operating system or a second control system; in addition, the electronic device is also configured with a kernel.
This step can be referred to as step S101 shown in fig. 2, and is not described again.
S402, the kernel sends the insert message to the first vold layer and the second vold layer respectively.
In this step, the step may refer to step S102 shown in fig. 2, and is not described again.
S403, the first vold layer sends the insert message to the first mounting service through the first socket, and the second vold layer sends the insert message to the second mounting service through the second socket.
In this step, the step may refer to step S103 shown in fig. 2, and is not described again.
S404, the first mounting service mounts the external device onto the first system according to the insertion message, and the second mounting service mounts the external device onto the second system according to the insertion message.
In this step, the step may refer to step S104 shown in fig. 2, and is not described again.
The first system further comprises a first application service layer; the second system further comprises a second application service layer; after step S404, the following steps may be further included:
s405, the first application service layer obtains a first unloading instruction triggered by the user.
In this step, when the external device needs to be unloaded from one of the dual systems, the user may send a first unloading instruction to the electronic device, at this time, the first system of the electronic device is running in the foreground, and the user may send the first unloading instruction to the electronic device through a keyboard, a touch, and the like.
Thus, the first application service layer of the first system can directly acquire the first uninstalling instruction.
The first application service layer can directly transmit information and instructions with the kernel, or the first application service layer can transmit information and instructions with the kernel through the first mount service and the first vold layer.
S406, the first application service layer generates a first uninstalling event according to the first uninstalling instruction, and the first application service layer calls the first mounting service.
In this step, the first application service layer generates a first uninstalling event according to a first uninstalling instruction triggered by the user, and meanwhile, the first application service layer may invoke a first mounting service of the first system.
In one example, the first application service layer may directly perform information and instruction transfer with the first mounting service, so that the first application service layer may directly invoke the first mounting service of the first system.
In another example, the first application service layer may perform information and instruction transfer with the first storage management service, and the first application service layer may invoke the first mount service of the first system through the first storage management service due to the information and instruction transfer between the first storage management service and the first mount service.
S407, the first mounting service acquires a first unloading event and unloads the external device from the first system according to the first unloading event.
In this step, since the first mount service layer invokes the first mount service, the first mount service layer may transmit the first uninstall event to the first mount service, and the first mount service acquires the first uninstall event.
The first mount service may then offload the peripheral device from the first system.
In one example, after the first mounting service uninstalls the external device from the first system, the first mounting service may return a response message to the first application service layer, where the response message indicates that the external device is uninstalled from the first system; then, the first application service layer displays the response message to make the user know that the external device is uninstalled from the first system.
After the external devices are mounted on the first system and the second system, the unloading process in the steps S405 to S407 is to unload the external device from the first system, and the information and instruction transmission in the steps S405 to S407 is only performed in the first system, and is not applied to the second system to mount the external device, and the external device is not unloaded from the second system, so that the second system can still normally access the external device.
In an example, when the external device needs to be unloaded from the second system, refer to the process in the above steps S405 to S407, except that the transmission of the information and the instruction in the steps S405 to S407 is only executed in the second system, and is not applied to the first system to mount the external device, and the external device is not unloaded from the first system, so that the first system can still normally access the external device.
In this embodiment, on the basis of the above embodiment, after the external device is mounted on the first system and the second system, when it is necessary to unload one of the external device dual systems, an event may be unloaded in the system, so that the mounting service of the system may unload the external device from the system; the transmission of information and instructions only runs in a system needing to unload the external equipment, and the transmission of information and instructions cannot be applied to another system to mount the external equipment, and the external equipment cannot be unloaded from another system, so that the other system can still normally access the external equipment.
Fig. 8 is a flowchart of another external device control method based on dual systems according to an embodiment of the present disclosure, and as shown in fig. 8, the method is applied to an electronic device, where the electronic device is provided with a kernel, a first system and a second system, where the first system includes a first vold layer, a first socket and a first mount service, and the second system includes a second vold layer, a second socket and a second mount service; the method comprises the following steps:
s501, the inner core obtains an insertion message of the external device, wherein the insertion message represents that the external device is inserted into an external interface of the electronic device.
In this step, the electronic device is configured with two systems, which are a first system and a second system respectively; the first system may also be referred to as a first operating system or a first control system, and the second system may also be referred to as a second operating system or a second control system; in addition, the electronic device is also configured with a kernel.
This step can be referred to as step S101 shown in fig. 2, and is not described again.
S502, the kernel sends the insert message to the first vold layer and the second vold layer respectively.
In this step, the step may refer to step S102 shown in fig. 2, and is not described again.
S503, the first vold layer sends the insert message to the first mounting service through the first socket, and the second vold layer sends the insert message to the second mounting service through the second socket.
In this step, the step may refer to step S103 shown in fig. 2, and is not described again.
S504, the first mounting service mounts the external device onto the first system according to the insertion message, and the second mounting service mounts the external device onto the second system according to the insertion message.
In this step, the step may refer to step S104 shown in fig. 2, and is not described again.
In one example, the first system further comprises a first application service layer and a first listening service, and the second system further comprises a second application service layer and a second listening service; after step S504, the following steps may be further included:
and S505, the first application service layer acquires a formatting instruction triggered by a user.
In this step, a first application service layer is also included in the first system; the first application service layer can directly transmit information and instructions with the kernel, or the first application service layer can transmit information and instructions with the kernel through the first mount service and the first vold layer. Also included in the first system is a first listening service; the first listening service can directly transmit information and instructions with the kernel, or the first listening service can transmit information and instructions with the kernel through the first mounting service and the first vold layer.
A second application service layer is also included in the second system; the second application service layer can directly transmit information and instructions with the kernel, or the second application service layer can transmit information and instructions with the kernel through the second mount service and the second vold layer. Also included in the second system is a second listening service; the second listening service may directly transfer information and instructions with the kernel, or the second listening service may transfer information and instructions with the kernel through the second mount service and the second vold layer.
In addition, the first listening service of the first system can directly transmit information and instructions with the second listening service of the second system.
The first system runs in the foreground of the electronic equipment, and the second system runs in the background of the electronic equipment; when the external device needs to be formatted, a user triggers at a first application service layer of a first system, and then the first application service layer acquires a formatting instruction triggered by the user.
S506, the first application service layer generates a formatting event according to the formatting instruction, and sends the formatting event to the second monitoring service through the first monitoring service.
In the step, the first application service layer generates a formatting event according to the formatting instruction, and then the first application service layer sends the formatting event to a first monitoring service of a first system; the first listening service of the first system sends the formatted event to the second listening service of the second system.
S507, when the second monitoring service determines that the second system mounts the external equipment, the second system unloads the external equipment.
In one example, step S507 specifically includes the following steps:
when the second monitoring service determines that the second system mounts the external device, the second monitoring service returns a first response message to the first application service layer through the first monitoring service, wherein the first response message is used for indicating the second system to mount the external device.
And the first application service layer generates and displays first prompt information according to the first response message so as to enable a user to trigger a second uninstalling instruction, wherein the first prompt information represents that the second system mounts the external equipment.
And the second application service layer acquires a second unloading instruction.
And the second application service layer generates a second unloading event according to the second unloading instruction, and calls a second mounting service.
And the second mounting service acquires a second unloading event and unloads the external equipment from the second system according to the second unloading event.
In this step, after step S506, the second monitoring service of the second system may send an inquiry instruction to the second mounting service of the second system to inquire whether the second mounting service mounts the external device on the second system; and the second mounting service determines that the external device is mounted on the second system according to the query instruction, and then the second mounting service sends a response message to the second monitoring service, wherein the response message represents that the second mounting service mounts the external device on the second system. Then, the second system can unload the external device from the second system; in one example, the second mounting service of the second system unloads the external device from the second system after receiving the message returned by the second mounting service.
In one example, when the second monitoring service determines that the second system mounts the external device, the second monitoring service sends a first response message to the first monitoring service of the first system, where the first response message indicates that the second system mounts the external device; then, the first listening service of the first system sends the first response message to the first application service layer of the first system. Therefore, the first application service layer of the first system can generate first prompt information according to the first response message, wherein the first prompt information is used for indicating that the second system mounts the external device; then, the first application service layer of the first system displays first prompt information to a user, and the user can know that the second system mounts the external equipment; therefore, the user needs to manually trigger the second system to firstly uninstall the external device, and then the first system can perform formatting processing on the external device, at this time, the user triggers the second application service layer of the second system to input a second uninstalling instruction to the second application service layer. Further, a second application service layer of the second system can acquire a second unloading instruction; then, the second application service layer generates a second unloading event according to the second unloading instruction, and meanwhile, the second application service layer calls a second mounting service of a second system; furthermore, a second mount service of the second system can acquire a second uninstall event; then, the second mount service of the second system can uninstall the external device from the second system.
S508, the first mounting service carries out formatting processing on the external device.
In one example, step S508 specifically includes the following implementation manners:
in the first implementation manner of step S508, the first application service layer obtains a reformatting instruction triggered by the user, and invokes a first mounting service; and the first mounting service carries out formatting treatment on the external equipment according to the reformatting event.
In the second implementation manner of step S508, when it is monitored that the external device is unloaded from the second system, the second monitoring service sends a second response message to the first application service layer through the first monitoring service, where the second response message is used to indicate that the external device is unloaded from the second system; the first application service layer calls a first mounting service; and the first mounting service carries out formatting treatment on the external equipment according to the formatting event.
In this step, after the second mount service of the second system unloads the external device from the second system, the first mount service may format the external device.
In one example, after the second mount service of the second system unloads the external device from the second system, the user is further required to manually trigger the formatting process again; at the moment, the user manually switches to the first system, namely, the first system runs in a foreground, the second system switches to a background to run, and the user manually inputs a reformatting instruction into a first application service layer of the first system; then, the first application service layer can obtain a reformatting instruction, and then the first application service layer calls a first mounting service of the first system; and then, the first mounting service carries out formatting processing on the external equipment according to the reformatting event.
In one example, after the external device is uninstalled from the second system by the second mount service of the second system, the electronic device may automatically trigger completion of the formatting process of the external device; at this time, the second mounting service of the second system unloads the external device from the second system, and then the second monitoring service of the second system can monitor that the external device is unloaded from the second system; then, the second monitoring service of the second system sends a second response message to the first monitoring service of the first system, wherein the second response message indicates that the external equipment is unloaded from the second system; then, the first monitoring service of the first system sends the second response message to the first application service layer of the first system; then, a first application service layer of the first system can call a first mounting service of the first system; and then the first mounting service of the first system can format the external device mounted on the first system according to the previous formatting event.
In one example, after step S508, the following steps may be further included:
s509, the first mount service sends a third response message to the first application service layer, where the third response message is used to indicate that the external device completes formatting.
In this step, after the first mount service of the first system formats the external device, the first mount service sends a third response message to the first application service layer, where the third response message indicates that the external device completes formatting. Furthermore, the first application service layer can know that the first system completes the formatting process of the external device.
And S510, generating and displaying second prompt information by the first application service layer, wherein the second prompt information represents that the external equipment completes formatting.
In this step, the first application service layer generates second prompt information and displays the second prompt information to the user, so that the user knows that the first system has formatted the external device.
In one example, after step S506, the following steps may also be performed:
and S511, when the second monitoring service determines that the second system does not mount the external device, the second monitoring service returns a fourth response message to the first application service layer through the first monitoring service, wherein the fourth response message is used for indicating that the second system does not mount the external device.
In this step, after step S506, if the second monitoring service determines that the second system does not mount the external device, the first system may directly perform formatting processing on the external device mounted by the first system. At this time, if the second monitoring service determines that the second system does not mount the external device, the second monitoring service sends a fourth response message to the first monitoring service of the first system, and the fourth response message indicates that the second system does not mount the external device; and then, the first monitoring service of the first system returns the fourth response message to the first application service layer of the first system, so that the first application service layer knows that the second system does not mount the external device.
S512, the first application service layer calls the first mounting service.
In this step, after the first application service layer learns that the second system is not equipped with the external device, the first application service layer may directly invoke the first mounting service of the first system.
And S513, the first mounting service carries out formatting processing on the external equipment according to the formatting event.
In this step, the first mount service of the first system may know that the second system does not mount the external device, and further, the first mount service of the first system may format the external device according to the formatting event in step S506.
In this embodiment, on the basis of the above embodiment, when the external device needs to be formatted, the first application service layer of the first system sends the formatting event to the second monitoring service of the second system through the first monitoring service of the first system; furthermore, when the second monitoring service of the second system determines that the second system mounts the external device, the second system can unload the external device, so that the first mounting service of the first system formats the external device; when the second monitoring service of the second system determines that the second system does not mount the external device, the first mounting service of the first system can directly format the external device. Therefore, when the external device is mounted on the first system and the second system, the formatting process of the external device can be completed in one system.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, and as shown in fig. 9, a core 31, a first system 32, and a second system 33 are disposed in the electronic device, where the first system 32 includes a first vold layer 321, a first socket 322, and a first mounting service 323, and the second system 33 includes a second vold layer 331, a second socket 332, and a second mounting service 333.
The kernel 31 is configured to obtain an insertion message of the external device, where the insertion message indicates that the external device is inserted into an external interface of the electronic device.
The kernel 31 is further configured to send the insert message to the first vold layer 321 and the second vold layer 331, respectively.
A first vold layer 321 for sending the insert message to the first mount service 323 through the first socket 322; and, the second vold layer 331 is configured to send the insert message to the second mount service 333 through the second socket 332.
A first mounting service 323 for mounting the external device to the first system 32 according to the insertion message; and, the second mounting service 333 is configured to mount the external device onto the second system 33 according to the insertion message.
The electronic device provided in this embodiment is the same as the method for implementing the dual-system-based external device control method provided in any of the foregoing embodiments, and the implementation principle and technical effect thereof are similar and will not be described again.
Fig. 10 is a schematic structural diagram of another electronic device according to an embodiment of the present application, and based on the embodiment shown in fig. 9, as shown in fig. 10, the first system 32 further includes a first application service layer 324; the second system 33 further includes a second application service layer 334;
the first application service layer 324 is configured to send, by the kernel 31, a first access instruction to the external device after the second mounting service 333 mounts the external device onto the second system 33 according to the insertion message, so that the external device completes data processing according to the first access instruction.
And/or the second application service layer 334 is configured to send, by the kernel 31, a second access instruction to the external device after the second mounting service 333 mounts the external device onto the second system 33 according to the insertion message, so that the external device completes processing of data according to the second access instruction.
In an example, the kernel 31 is further configured to obtain an unplugging message of the external device after the second mounting service 333 mounts the external device onto the second system 33 according to the plug-in message, where the unplugging message represents that the external device is detached from the external interface of the electronic device; the pull message is sent to the first vold layer 321 and the second vold layer 331, respectively.
The first vold layer 321 is further configured to send the pull message to the first mount service 323 through the first socket 322; the second vold layer 331 is also configured to send the pull message to the second mount service 333 through the second socket 332.
The first mounting service 323 is also used for unloading the external device from the first system 32 according to the pull-out message; and, the second mounting service 333 is also configured to uninstall the external device mounting from the second system 33 according to the unplug message.
In an example, the first application service layer 324 is configured to obtain a first uninstalling instruction triggered by the user after the second mounting service 333 mounts the external device onto the second system 33 according to the insertion message;
the first application service layer 324 is further configured to generate a first uninstall event according to the first uninstall instruction, and the first application service layer 324 invokes the first mount service 323;
the first mount service 323 is configured to obtain a first uninstall event, and uninstall the external device from the first system 32 according to the first uninstall event.
In one example, the first system 32 further includes a first listening service 325 and the second system 33 further includes a second listening service 335.
The first application service layer 324 is used for acquiring a formatting instruction triggered by a user.
The first application service layer 324 is further configured to generate a formatting event according to the formatting instruction, and send the formatting event to the second listening service 335 through the first listening service 325.
And a second listening service 335, configured to unload the external device by the second system 33 when it is determined that the external device is mounted by the second system 33.
The first mounting service 323 is further configured to format the external device.
In one example, the second listening service 335 is specifically configured to return a first response message to the first application service layer 324 through the first listening service 325 when it is determined that the second system 33 mounts the external device, where the first response message is used to indicate that the second system 33 mounts the external device.
The first application service layer 324 is specifically configured to generate and display first prompt information according to the first response message, so that the user triggers the second uninstalling instruction, where the first prompt information indicates that the second system 33 mounts the external device.
A second application service layer 334, configured to obtain a second uninstall instruction; a second offload event is generated according to the second offload instruction and second mount service 333 is invoked.
The second mount service 333 is specifically configured to obtain a second uninstall event, and uninstall the external device from the second system 33 according to the second uninstall event.
In an example, the first application service layer 324 is specifically configured to obtain a reformatting instruction triggered by a user, and invoke the first mounting service 323.
The first mounting service 323 is specifically configured to format the external device according to the reformatting event.
In one example, the second listening service 335 is specifically configured to send a second response message to the first application service layer 324 through the first listening service 325 when it is listened that the external device is uninstalled from the second system 33, where the second response message is used to indicate that the external device is uninstalled from the second system 33.
The first application service layer 324 is specifically configured to invoke the first mounting service 323.
The first mounting service 323 is specifically configured to format the external device according to the format event.
In one example, the first mounting service 323 is further configured to send a third response message to the first application service layer 324 after the first mounting service 323 formats the external device, where the third response message is used to indicate that the external device completes formatting.
The first application service layer 324 is further configured to generate and display second prompt information, where the second prompt information indicates that the external device completes formatting.
In one example, the second listening service 335 is further configured to return a fourth response message to the first application service layer 324 through the first listening service 325 when it is determined that the second system 33 does not mount the external device, where the fourth response message is used to indicate that the second system 33 does not mount the external device.
The first application service layer 324 is further configured to invoke a first mounting service 323.
The first mounting service 323 is further configured to format the external device according to the format event.
In one example, the external device is a usb disk, or the external device is a secure digital SD card.
The electronic device provided in this embodiment is the same as the method for implementing the dual-system-based external device control method provided in any of the foregoing embodiments, and the implementation principle and technical effect thereof are similar and will not be described again.
Fig. 11 is a schematic structural diagram of another electronic device provided in the embodiment of the present application, and as shown in fig. 11, the smart speaker device includes: a transmitter 71, a receiver 72, a memory 73 and a processor 74.
The memory 73 is used to store computer instructions; the processor 74 is configured to execute the computer instructions stored in the memory 73 to implement the technical solution of the dual-system-based external device control method provided in any implementation manner in the foregoing embodiments.
The present application also provides a storage medium comprising: readable storage media and computer instructions, the computer instructions stored in the readable storage media; the computer instructions are used to implement the technical solution of the dual-system-based external device control method in any implementation manner provided by the foregoing example.
In the above Specific implementation of the smart speaker device, it should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in a processor.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: read-only memory (ROM), RAM, flash memory, hard disk, solid state disk, magnetic tape (magnetic tape), floppy disk (flexible disk), optical disk (optical disk), and any combination thereof.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (24)

1. The external device control method based on the dual systems is characterized by being applied to electronic equipment, wherein a kernel, a first system and a second system are arranged in the electronic equipment, the first system comprises a first vold layer, a first socket and a first mounting service, and the second system comprises a second vold layer, a second socket and a second mounting service; the method comprises the following steps:
the method comprises the steps that the inner core obtains an insertion message of an external device, wherein the insertion message represents that the external device is inserted into an external interface of the electronic device;
the kernel sends the insertion message to the first vold layer and the second vold layer respectively;
the first vold layer sends the insert message to the first mounting service through a first socket, and the second vold layer sends the insert message to the second mounting service through a second socket;
the first mounting service mounts the external device onto the first system according to the insertion message, and the second mounting service mounts the external device onto the second system according to the insertion message.
2. The method of claim 1, wherein the first system further comprises a first application service layer; the second system further comprises a second application service layer; after the second mounting service mounts the external device onto the second system according to the insertion message, the method further includes:
the first application service layer sends a first access instruction to the external equipment through the inner core so that the external equipment completes data processing according to the first access instruction;
and/or the second application service layer sends a second access instruction to the external equipment through the kernel, so that the external equipment completes data processing according to the second access instruction.
3. The method according to claim 1, wherein after the second mounting service mounts the external device onto the second system according to the insertion message, the method further comprises:
the method comprises the steps that a kernel acquires a pulling-out message of an external device, wherein the pulling-out message represents that the external device is separated from an external interface of the electronic device;
the pull-out message is sent to the first vold layer and the second vold layer by the kernel respectively;
the first vold layer sends the pull-out message to the first mounting service through a first socket, and the second vold layer sends the pull-out message to the second mounting service through a second socket;
the first mounting service unloads the external equipment from the first system according to the pull-out message, and the second mounting service unloads the external equipment from the second system according to the pull-out message.
4. The method of claim 1, wherein the first system further comprises a first application service layer; after the second mounting service mounts the external device onto the second system according to the insertion message, the method further includes:
the first application service layer acquires a first uninstalling instruction triggered by a user;
the first application service layer generates a first unloading event according to the first unloading instruction, and calls the first mounting service;
and the first mounting service acquires the first unloading event and unloads the external equipment from the first system according to the first unloading event.
5. The method of any of claims 1-4, wherein the first system further comprises a first application service layer and a first listening service, and wherein the second system further comprises a second application service layer and a second listening service; the method further comprises the following steps:
the first application service layer acquires a formatting instruction triggered by a user;
the first application service layer generates a formatting event according to the formatting instruction, and sends the formatting event to the second monitoring service through the first monitoring service;
when the second monitoring service determines that the second system mounts the external device, the second system unloads the external device;
and the first mounting service carries out formatting processing on the external equipment.
6. The method of claim 5, wherein the second listening service, when determining that the second system mounts the external device, the second system uninstalls the external device, comprising:
when the second monitoring service determines that the second system mounts the external device, the second monitoring service returns a first response message to the first application service layer through the first monitoring service, wherein the first response message is used for indicating that the second system mounts the external device;
the first application service layer generates and displays first prompt information according to the first response message so that the user triggers a second uninstalling instruction, wherein the first prompt information represents that the second system installs the external device;
the second application service layer acquires the second unloading instruction;
the second application service layer generates a second unloading event according to the second unloading instruction, and calls the second mounting service;
and the second mounting service acquires the second unloading event and unloads the external equipment from the second system according to the second unloading event.
7. The method of claim 5, wherein the first mounting service formats the external device, and comprises:
the first application service layer acquires a reformatting instruction triggered by a user and calls the first mounting service;
and the first mounting service carries out formatting treatment on the external equipment according to the reformatting event.
8. The method of claim 5, wherein the first mounting service formats the external device, and comprises:
when the second monitoring service monitors that the external device is unloaded from the second system, the second monitoring service sends a second response message to the first application service layer through the first monitoring service, wherein the second response message is used for indicating that the external device is unloaded from the second system;
the first application service layer calls the first mounting service;
and the first mounting service carries out formatting treatment on the external equipment according to the formatting event.
9. The method according to claim 5, wherein after the first mount service formats the external device, further comprising:
the first mounting service sends a third response message to the first application service layer, wherein the third response message is used for indicating that the external device completes formatting;
and the first application service layer generates and displays second prompt information, wherein the second prompt information represents that the external equipment completes formatting.
10. The method of claim 5, further comprising:
when the second monitoring service determines that the second system does not mount the external device, the second monitoring service returns a fourth response message to the first application service layer through the first monitoring service, wherein the fourth response message is used for indicating that the second system does not mount the external device;
the first application service layer calls the first mounting service;
and the first mounting service carries out formatting treatment on the external equipment according to the formatting event.
11. The method according to any one of claims 1 to 4, wherein the external device is a USB flash disk, or the external device is a secure digital SD card.
12. An electronic device is characterized in that a kernel, a first system and a second system are arranged in the electronic device, wherein the first system comprises a first vold layer, a first socket and a first mounting service, and the second system comprises a second vold layer, a second socket and a second mounting service;
the kernel is configured to obtain an insertion message of an external device, where the insertion message represents that the external device is inserted into an external interface of the electronic device;
the kernel is further configured to send the insert message to the first vold layer and the second vold layer respectively;
the first vold layer is used for sending the insertion message to the first mounting service through a first socket; the second vold layer is configured to send the insert message to the second mount service through a second socket;
the first mounting service is used for mounting the external equipment to the first system according to the insertion message; and the second mounting service is used for mounting the external equipment to the second system according to the insertion message.
13. The electronic device of claim 12, wherein the first system further comprises a first application service layer; the second system further comprises a second application service layer;
the first application service layer is configured to send a first access instruction to the external device through the kernel after the second mounting service mounts the external device onto the second system according to the insertion message, so that the external device completes data processing according to the first access instruction;
and/or the second application service layer is configured to send a second access instruction to the external device through the kernel after the second mounting service mounts the external device onto the second system according to the insertion message, so that the external device completes data processing according to the second access instruction.
14. The electronic device according to claim 12, wherein the kernel is further configured to obtain a pull-out message of an external device after the second mounting service mounts the external device onto the second system according to the insertion message, wherein the pull-out message indicates that the external device is detached from an external interface of the electronic device; sending the pull-out message to the first vold layer and the second vold layer respectively;
the first vold layer is further configured to send the pull-out message to the first mount service through a first socket; the second vold layer is further configured to send the pull-out message to the second mount service through a second socket;
the first mounting service is further used for unloading the external device from the first system according to the pull-out message; and the second mounting service is also used for mounting the external equipment on the second system according to the pull-out message.
15. The electronic device of claim 12, wherein the first system further comprises a first application service layer;
the first application service layer is used for acquiring a first uninstalling instruction triggered by a user after the second mounting service mounts the external device onto the second system according to the insertion message;
the first application service layer is further used for generating a first uninstalling event according to the first uninstalling instruction, and the first application service layer calls the first mounting service;
the first mounting service is configured to acquire the first uninstalling event and uninstall the external device from the first system according to the first uninstalling event.
16. The electronic device of any of claims 12-15, wherein the first system further comprises a first application service layer and a first listening service, and wherein the second system further comprises a second application service layer and a second listening service;
the first application service layer is used for acquiring a formatting instruction triggered by a user;
the first application service layer is further configured to generate a formatting event according to the formatting instruction, and send the formatting event to the second monitoring service through the first monitoring service;
the second monitoring service is used for unloading the external device by the second system when the second system is determined to mount the external device;
the first mounting service is further used for formatting the external device.
17. The electronic device according to claim 16, wherein the second listening service is specifically configured to return a first response message to the first application service layer through the first listening service when it is determined that the second system mounts the external device, where the first response message is used to instruct the second system to mount the external device;
the first application service layer is specifically configured to generate and display first prompt information according to the first response message, so that the user triggers a second uninstalling instruction, where the first prompt information represents that the second system mounts the external device;
the second application service layer is specifically configured to obtain the second uninstalling instruction; generating a second unloading event according to the second unloading instruction, and calling the second mounting service;
the second mount service is specifically configured to acquire the second uninstall event, and uninstall the external device from the second system according to the second uninstall event.
18. The electronic device according to claim 16, wherein the first application service layer is specifically configured to obtain a reformatting instruction triggered by a user, and invoke the first mounting service;
the first mounting service is specifically configured to format the external device according to the reformatting event.
19. The electronic device according to claim 16, wherein the second listening service is specifically configured to send a second response message to the first application service layer through the first listening service when it is monitored that the external device is uninstalled from the second system, where the second response message is used to instruct the external device to uninstall from the second system;
the first application service layer is specifically used for calling the first mounting service;
the first mounting service is specifically configured to format the external device according to the formatting event.
20. The electronic device of claim 16, wherein the first mounting service is further configured to send a third response message to the first application service layer after the external device is formatted by the first mounting service, wherein the third response message is used to indicate that the external device completes formatting;
the first application service layer is further configured to generate and display second prompt information, where the second prompt information indicates that the external device completes formatting.
21. The electronic device of claim 16, wherein the second listening service is further configured to return a fourth response message to the first application service layer through the first listening service when it is determined that the external device is not mounted on the second system, wherein the fourth response message is used to indicate that the external device is not mounted on the second system;
the first application service layer is also used for calling the first mounting service;
and the first mounting service is also used for formatting the external equipment according to the formatting event.
22. The electronic device according to any of claims 12-15, wherein the external device is a usb disk, or wherein the external device is a secure digital SD card.
23. An electronic device, comprising: a transmitter, a receiver, a memory, and a processor;
the memory is to store computer instructions; the processor is configured to execute the computer instructions stored by the memory to implement the method of any of claims 1-11.
24. A storage medium, comprising: a readable storage medium and computer instructions stored in the readable storage medium; the computer instructions are for implementing the method of any one of claims 1-11.
CN201910789008.3A 2019-08-26 2019-08-26 Dual-system-based external equipment control method, device, equipment and storage medium Active CN112506819B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910789008.3A CN112506819B (en) 2019-08-26 2019-08-26 Dual-system-based external equipment control method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910789008.3A CN112506819B (en) 2019-08-26 2019-08-26 Dual-system-based external equipment control method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112506819A CN112506819A (en) 2021-03-16
CN112506819B true CN112506819B (en) 2022-04-15

Family

ID=74923801

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910789008.3A Active CN112506819B (en) 2019-08-26 2019-08-26 Dual-system-based external equipment control method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112506819B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101493786A (en) * 2008-01-22 2009-07-29 联想(北京)有限公司 Computer and equipment accessing method
CN103618780A (en) * 2013-11-22 2014-03-05 华为技术有限公司 Method and device for realizing multiple virtual machine mounted externally-arranged components
CN104571964A (en) * 2015-01-15 2015-04-29 宇龙计算机通信科技(深圳)有限公司 Dual system based external storage device mounting method and system
CN105577904A (en) * 2015-03-27 2016-05-11 酷派软件技术(深圳)有限公司 File sharing method and mobile terminal
KR20170011071A (en) * 2015-07-21 2017-02-02 삼성전자주식회사 Method and device for sharing a disk image between operating systems
CN107562373A (en) * 2017-08-07 2018-01-09 广州视源电子科技股份有限公司 Multisystem USB flash disk read method, device, readable storage medium storing program for executing and computer equipment
CN110119222A (en) * 2019-04-29 2019-08-13 深圳汇茂科技股份有限公司 Touch-control module switching method, device, equipment and readable medium based on dual system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101493786A (en) * 2008-01-22 2009-07-29 联想(北京)有限公司 Computer and equipment accessing method
CN103618780A (en) * 2013-11-22 2014-03-05 华为技术有限公司 Method and device for realizing multiple virtual machine mounted externally-arranged components
CN104571964A (en) * 2015-01-15 2015-04-29 宇龙计算机通信科技(深圳)有限公司 Dual system based external storage device mounting method and system
CN105577904A (en) * 2015-03-27 2016-05-11 酷派软件技术(深圳)有限公司 File sharing method and mobile terminal
KR20170011071A (en) * 2015-07-21 2017-02-02 삼성전자주식회사 Method and device for sharing a disk image between operating systems
CN107562373A (en) * 2017-08-07 2018-01-09 广州视源电子科技股份有限公司 Multisystem USB flash disk read method, device, readable storage medium storing program for executing and computer equipment
CN110119222A (en) * 2019-04-29 2019-08-13 深圳汇茂科技股份有限公司 Touch-control module switching method, device, equipment and readable medium based on dual system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于容器技术的多OS的研究与实现;武琼;《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》;20180215;I138-1032 *

Also Published As

Publication number Publication date
CN112506819A (en) 2021-03-16

Similar Documents

Publication Publication Date Title
KR102147088B1 (en) Method and apparatus for offering received information to user in a electronic device
CN110659046B (en) Firmware upgrading method, terminal, charging box, earphone and storage medium
EP4145286A1 (en) Memory management method and electronic device
CN108710515B (en) Application preloading method and device, storage medium and terminal
US20150156300A1 (en) Method for filtering spam in electronic device and the electronic device
CN110278543B (en) Method and device for updating control system of automobile and storage medium
US10002528B2 (en) IR communication method and electronic device thereof
CN109857506B (en) Method and device for realizing guide information, electronic equipment and storage medium
CN110377341B (en) Method, device, medium and electronic equipment for monitoring no-response exception
KR20150026635A (en) Electronic device and method for transmitting notification information
US9948732B2 (en) Method for providing status messaging service in electronic device and the electronic device thereof
JP2003076651A (en) Computer system and method of indicating operating states of peripheral devices thereof
CN111198859A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN110881224B (en) Network long connection method, device, equipment and storage medium
KR20140142116A (en) Electronic device and method for providing text transformaation service
CN111061448A (en) Log information display method and device, electronic equipment and storage medium
CN112506819B (en) Dual-system-based external equipment control method, device, equipment and storage medium
CN110275701B (en) Data processing method, device, medium and computing equipment
CN115562735A (en) External storage device mounting method and device, electronic device and storage medium
CN115396990A (en) Power consumption control method and device
CN108848182B (en) Updating method of BMC firmware, related equipment and system
CN112818336A (en) Data access method, data access device and computer readable storage medium
CN115858206B (en) Data processing method, device, electronic equipment and storage medium
CN111209058B (en) Method, device, medium and equipment for acquiring process name
KR102154324B1 (en) Apparatas and method for improving a quality of telephone call for charging in an electronic device

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