CN111125007A - Application packaging method, device and readable storage medium - Google Patents
Application packaging method, device and readable storage medium Download PDFInfo
- Publication number
- CN111125007A CN111125007A CN201911323655.1A CN201911323655A CN111125007A CN 111125007 A CN111125007 A CN 111125007A CN 201911323655 A CN201911323655 A CN 201911323655A CN 111125007 A CN111125007 A CN 111125007A
- Authority
- CN
- China
- Prior art keywords
- file
- file system
- virtual stack
- request
- virtual
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/13—File access structures, e.g. distributed indices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/11—File system administration, e.g. details of archiving or snapshots
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/02—Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses an application packaging method, equipment and a readable storage medium, wherein the application packaging method can provide a data storage directory unified with a universal file system for overtravel by establishing a virtual stack file system based on a universal file system service framework; the virtual stacking file system can forward the file access request as required by calling the virtual stacking system to perform corresponding operation according to different file access types, so that the target file can be accessed according to a conventional access mode; and uploading the access result of the file access request by the preset overtravel control module, so that when the process list of the virtual system environment where the overtravel is located is inquired, the returned result only contains the process information belonging to the corresponding overtravel. According to the invention, when the overtravel is started, the root file system is dynamically switched to the virtual stack system, and the file access requests of all processes in the overtravel are redirected to the virtual stack system, so that the system-level isolation of the files is realized.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an application encapsulation method, an application encapsulation device, and a readable storage medium.
Background
In a conventional operating system, an application is composed of a group of closely coupled, interdependent and cooperative programs, and each program is linked by a group of code libraries and is scheduled to run in units of processes. In a traditional operating system, a large number of code libraries which are shared are existed, so that once the code library upgrading brought by application upgrading improvement involves the shared libraries, the generated influence can spread to other applications on the whole dependency chain, and even other applications which depend on the shared libraries before upgrading cannot normally run, so that the application upgrading is difficult. Meanwhile, due to the limitation of the dynamic link technology, the communication between the code libraries is in a tight coupling mode, and the system support libraries are shared. Tightly coupled interprocess communication means that failure of one application can easily lead to failure of other applications running on the same system. Thereby causing the technical problem of too large an influence field caused by applying tight coupling.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide an application packaging method, aiming at solving the technical problem of overlarge influence domain caused by tight coupling of applications.
In order to achieve the above object, the present invention provides an application packaging method, which is applied to an application packaging device, and includes the following steps:
receiving a file access request for accessing a preset virtual stack file system, and judging the request type of the file access request, wherein the virtual stack file system stacks files in the overtravel and manages the files based on a virtual system environment and a general file system service framework;
calling the virtual stack file system to perform corresponding operation based on the request type, and acquiring a return result of the file access request;
and sending the return result to an upper-layer application based on a preset overtravel control module so as to redirect the file access operation of all processes in the overtravel to the virtual stack file system.
Optionally, the step of receiving a file access request for accessing a preset virtual stack file system includes:
receiving a file access request sent based on a preset aggregation directory view, wherein the preset aggregation directory view is a visual logic view corresponding to the virtual stack file system.
Optionally, before the step of receiving a file access request for accessing a preset virtual stack file system and determining a request type of the file access request, the method further includes:
and adding a virtual network card and a virtual network card bridge required by the virtual stack file system to provide network connection for over travel.
Optionally, the step of invoking the virtual stack file system to perform corresponding operations based on the request type, and obtaining a return result of the file access request includes:
when the request type is a file retrieval type, calling file retrieval operation records of the virtual stack file system layer by layer from back to front;
obtaining a return result of the file access request based on the file retrieval operation record to determine a target file;
and when the request type is an editing request type, calling the virtual stacking file system to perform corresponding operation on the target file determined based on the file retrieval request, and acquiring a return result of the file access request of the editing request type, wherein the editing request type comprises a file reading type, a file writing type and a file deleting type.
Optionally, the step of obtaining the returned result of the file access request based on the file retrieval operation record includes:
judging whether the target file exists in the virtual stack file system or not based on the file retrieval operation record;
if the target file exists in the virtual stack file system, taking the label information corresponding to the target file as the return result to determine the target file;
and if the target file does not exist in the virtual stack file system, generating state information without file existence as the return information.
Optionally, when the request type is an edit request type, the step of invoking the virtual stack file system to perform a corresponding operation on the target file determined based on the file retrieval request, and obtaining a return result of the file access request of the edit request type includes:
when the request type is the file writing type or the file deleting type, judging whether the target file exists in the last layer in the virtual stack file system;
if the target file exists in the last layer of the virtual stack file system, transmitting the file access request to the target file;
and calling the virtual stack file system to write or delete the target file and generating a corresponding return result.
Optionally, when the request type is an edit request type, the step of invoking the virtual stack file system to perform a corresponding operation on the target file determined based on the file retrieval request, and obtaining a return result of the file access request of the edit request type includes:
and when the request type is the file reading type, transmitting the file access request to the target file, and calling the virtual stack file system to execute reading operation on the target file.
Optionally, the step of invoking the virtual stack file system to perform corresponding operations based on the request type, and obtaining a return result of the file access request includes:
when the request type is a file traversal type, calling file traversal operation of the virtual stack file system layer by layer from back to front according to the stacking sequence of the virtual stack file system;
and aggregating the file traversal results of all layers based on the file deletion operation records of all layers, and taking the aggregated traversal results as the return results.
In addition, to achieve the above object, the present invention also provides an application packaging apparatus, including: the application packaging method comprises the following steps of a memory, a processor and an application packaging program which is stored on the memory and can run on the processor, wherein when the application packaging program is executed by the processor, the steps of the application packaging method are realized.
In addition, to achieve the above object, the present invention also provides a computer readable storage medium, on which an application wrapper program is stored, and the application wrapper program, when executed by a processor, implements the steps of the application wrapper method as described above.
The invention provides an application packaging method, application packaging equipment and a computer readable storage medium. The application packaging method comprises the steps of receiving a file access request for accessing a preset virtual stack file system and judging the request type of the file access request, wherein the virtual stack file system is managed after overlapping files in the overtravel based on a virtual system environment and a universal file system service framework; calling the virtual stack file system to perform corresponding operation based on the request type, and acquiring a return result of the file access request; and sending the return result to an upper-layer application based on a preset overtravel control module so as to redirect the file access operation of all processes in the overtravel to the virtual stack file system. Through the mode, the virtual stack file system is established based on the universal file system service framework, and a data storage directory unified with the universal file system can be provided for overtravel; the virtual stacking file system can forward the file access request as required by calling the virtual stacking system to perform corresponding operation according to different file access types, so that the target file can be accessed according to a conventional access mode; and uploading the access result of the file access request by the preset overtravel control module, so that when the process list of the virtual system environment where the overtravel is located is inquired, the returned result only contains the process information belonging to the corresponding overtravel. According to the invention, when the overtravel is started, the root file system is dynamically switched to the virtual stack system, and the file access requests of all processes in the overtravel are redirected to the virtual stack system, so that the system-level isolation of files is realized, and the technical problem of overlarge influence domain caused by tight coupling of applications is solved.
Drawings
FIG. 1 is a schematic diagram of an apparatus architecture of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of an application packaging method according to the present invention;
FIG. 3 is a schematic diagram of an aggregation directory oriented to an over-the-range package according to the encapsulation method of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
The terminal of the embodiment of the invention can be a PC, and can also be a mobile terminal device with a display function, such as a smart phone, a tablet computer, an electronic book reader, an MP3(Moving Picture Experts Group Audio Layer III, dynamic video Experts compress standard Audio Layer 3) player, an MP4(Moving Picture Experts Group Audio Layer IV, dynamic video Experts compress standard Audio Layer 3) player, a portable computer, and the like.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a memory device separate from the processor 1001 described above.
Optionally, the terminal may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display screen according to the brightness of ambient light, and a proximity sensor that may turn off the display screen and/or the backlight when the mobile terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile terminal is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer and tapping) and the like for recognizing the attitude of the mobile terminal; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and an application wrapper.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to invoke an application wrapper program stored in the memory 1005 and perform the following operations:
receiving a file access request for accessing a preset virtual stack file system, and judging the request type of the file access request, wherein the virtual stack file system stacks files in the overtravel and manages the files based on a virtual system environment and a general file system service framework;
calling the virtual stack file system to perform corresponding operation based on the request type, and acquiring a return result of the file access request;
and sending the return result to an upper-layer application based on a preset overtravel control module so as to redirect the file access operation of all processes in the overtravel to the virtual stack file system.
Further, the processor 1001 may call the application wrapper program stored in the memory 1005, and also perform the following operations:
receiving a file access request sent based on a preset aggregation directory view, wherein the preset aggregation directory view is a visual logic view corresponding to the virtual stack file system.
Further, the processor 1001 may call the application wrapper program stored in the memory 1005, and also perform the following operations:
and adding a virtual network card and a virtual network card bridge required by the virtual stack file system to provide network connection for over travel.
Further, the processor 1001 may call the application wrapper program stored in the memory 1005, and also perform the following operations:
when the request type is a file retrieval type, calling file retrieval operation records of the virtual stack file system layer by layer from back to front;
obtaining a return result of the file access request based on the file retrieval operation record to determine a target file;
and when the request type is an editing request type, calling the virtual stacking file system to perform corresponding operation on the target file determined based on the file retrieval request, and acquiring a return result of the file access request of the editing request type, wherein the editing request type comprises a file reading type, a file writing type and a file deleting type.
Further, the processor 1001 may call the application wrapper program stored in the memory 1005, and also perform the following operations:
judging whether the target file exists in the virtual stack file system or not based on the file retrieval operation record;
if the target file exists in the virtual stack file system, taking the label information corresponding to the target file as the return result to determine the target file;
and if the target file does not exist in the virtual stack file system, generating state information without file existence as the return information.
Further, the processor 1001 may call the application wrapper program stored in the memory 1005, and also perform the following operations:
when the request type is the file writing type or the file deleting type, judging whether the target file exists in the last layer in the virtual stack file system;
if the target file exists in the last layer of the virtual stack file system, transmitting the file access request to the target file;
and calling the virtual stack file system to write or delete the target file and generating a corresponding return result.
Further, the processor 1001 may call the application wrapper program stored in the memory 1005, and also perform the following operations:
and when the request type is the file reading type, transmitting the file access request to the target file, and calling the virtual stack file system to execute reading operation on the target file.
Further, the processor 1001 may call the application wrapper program stored in the memory 1005, and also perform the following operations:
when the request type is a file traversal type, calling file traversal operation of the virtual stack file system layer by layer from back to front according to the stacking sequence of the virtual stack file system;
and aggregating the file traversal results of all layers based on the file deletion operation records of all layers, and taking the aggregated traversal results as the return results.
Based on the hardware structure, various embodiments of the application packaging method of the invention are provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of an application encapsulation method.
A first embodiment of the present invention provides an application packaging method, including the steps of:
in a conventional operating system, an application is composed of a group of closely coupled, interdependent and cooperative programs, and each program is linked by a group of code libraries and is scheduled to run in units of processes. In a traditional operating system, a large number of code libraries which are shared are existed, so that once the code library upgrading brought by application upgrading improvement involves the shared libraries, the generated influence can spread to other applications on the whole dependency chain, and even other applications which depend on the shared libraries before upgrading cannot normally run, so that the application upgrading is difficult. Meanwhile, due to the limitation of the dynamic link technology, the communication between the code libraries is in a tight coupling mode, and the system support libraries are shared. Tightly coupled interprocess communication means that failure of one application can easily lead to failure of other applications running on the same system. Thereby causing the technical problem of too large an influence field caused by applying tight coupling.
In this embodiment, to solve the above problems, the present invention provides an application encapsulation method, that is, a virtual stack file system is established based on a universal file system service framework, and a data storage directory unified with the universal file system can be provided for overrun; the virtual stacking file system can forward the file access request as required by calling the virtual stacking system to perform corresponding operation according to different file access types, so that the target file can be accessed according to a conventional access mode; and uploading the access result of the file access request by the preset overtravel control module, so that when the process list of the virtual system environment where the overtravel is located is inquired, the returned result only contains the process information belonging to the corresponding overtravel. According to the invention, when the overtravel is started, the root file system is dynamically switched to the virtual stack system, and the file access requests of all processes in the overtravel are redirected to the virtual stack system, so that the system-level isolation of files is realized, and the technical problem of overlarge influence domain caused by tight coupling of applications is solved. The application packaging method is applied to the terminal.
Step S10, receiving a file access request for accessing a preset virtual stack file system, and determining the request type of the file access request, wherein the virtual stack file system stacks files in the overtravel and manages the files based on a virtual system environment and a universal file system service framework;
in this embodiment, it should be noted that, in order to solve the problem of an excessively large impact domain caused by tight coupling of applications based on a conventional virtualization technology, generally, the applications are encapsulated in virtual machines, the applications are scheduled to run in the virtual machines by using the virtualization technology, and isolation between the virtual machines is used to implement isolation of the applications. However, the design goal of the conventional virtualization technology is to virtualize the whole hardware environment for the virtual machine, and multiple operating systems such as Windows, Mac OSX, and Linux can be supported in the virtual machine. In order to achieve good universality, the performance and resource overhead of the conventional virtualization technology are relatively high, so that the performance loss of applications running in the virtual machines is relatively high, and the number of the virtual machines which can be simultaneously run and supported by the system is limited. The invention provides an overtravel-based application encapsulation method in a virtual system environment, which considers that an application running on a customized operating system does not have the requirement of running other operating systems, and the main requirement is to realize the isolation of the application. The overtravel is a dynamic execution process of an application with a certain independent function on a resource set, is a minimum unit when an operating system schedules and runs the application, and consists of the application, a supporting library on which the application depends, and other necessary running environments and system resources.
The terminal can establish a virtual stack file system in a virtual system environment based on a general file system service framework to store data in the overtravel package in a layered mode. When a user sends a file access request for accessing a file in the overtravel currently, a virtual stack file system on the terminal receives the file access request and identifies the type of the file access request.
Step S20, calling the virtual stack file system to perform corresponding operation based on the request type, and obtaining the return result of the file access request;
the request type can be file traversal, file retrieval, file creation, file deletion, file reading, file writing and the like.
In this embodiment, according to the specific access type of the current file access request, the terminal invokes the virtual stack file system to perform a corresponding operation, and obtains a corresponding return result. In a specific embodiment, if the access type is file traversal, the file traversal operation of the file system is called layer by layer from back to front according to the corresponding stacking sequence in the virtual stack file system, the file deletion operation records of each layer are combined, the traversal results of each layer are aggregated, and the aggregated traversal result is used as the return result of the file access request. And if the access type of the current file access request is a file traversal type, the terminal calls the file retrieval operation of the file system layer by layer from back to front according to the corresponding stacking sequence in the virtual stacking file system. And the terminal further judges whether the target file exists in the virtual stack file system by judging whether the file name of the target file exists in the file retrieval record according to the file retrieval operation record called layer by layer. And if the target file exists in a certain layer of the virtual stack file system, taking the target file as a return result of the file retrieval operation. If the file deletion operation record of a certain layer in the virtual stack file system includes a deletion operation for the target file name, or the file name of the target file is not searched out in each layer, the state that the file does not exist is taken as the return result of the file search operation. And if the terminal judges that the current request type is the file writing type, further judging whether the target file exists in the last layer of the virtual stack file system. And if the target file exists in the last layer, directly transmitting the file access request to the target file, calling the virtual stack file system to execute file writing operation on the target file, and taking the information of whether the file writing operation is successfully executed as a return result of the file writing request. It should be noted that, in a specific implementation code, if a write operation is successful, a return value is provided, and if the write operation is unsuccessful, exception information is returned. If the target file does not exist in the last layer, the target file is copied to the last layer, the file retrieval result is replaced and points to the target file in the last layer, the file access request is directly transmitted to the target file in the last layer, the virtual stack file system is called to execute the file writing operation, and the information of whether the file writing operation is successfully executed is used as the return result of the file writing request. If the terminal judges that the current request type is the file deletion type, the file name in the file deletion request is recorded into the file deletion operation record of the last layer, and whether the target file determined by file retrieval is also located in the last layer is judged. If the target file determined by the file retrieval is also located in the last layer, the virtual stack file system is called to synchronously delete the target file, and the information of whether the file deletion operation is successfully executed is used as the return result of the file deletion request. In a specific implementation code, if the write operation is successful, a return value is provided, and if the write operation is unsuccessful, exception information is returned. If the target file determined by the file retrieval does not exist in the last layer, the deletion request is directly transmitted to the target file, a file system is called to execute file deletion operation on the target file, and information about whether the file deletion operation is successfully executed is used as a return result of the file deletion request.
And step S30, sending the return result to the upper application based on the preset over-range control module so as to redirect the file access operation of all the processes in the over-range to the virtual stack file system.
The preset overtravel control module is used for describing overtravel of the process.
In this embodiment, a group of references of the over-travel control module may be added to the process control module of the terminal in advance, so that when the process list of the virtual system environment where the over-travel is located is queried, the returned result only includes the process belonging to the corresponding over-travel. And when the terminal acquires the return result of the file access request, uploading the return result only containing the process information of the overtravel to an upper application based on a preset overtravel control module.
The invention provides an application packaging method. The application packaging method comprises the steps of receiving a file access request for accessing a preset virtual stack file system and judging the request type of the file access request, wherein the virtual stack file system is managed after overlapping files in the overtravel based on a virtual system environment and a universal file system service framework; calling the virtual stack file system to perform corresponding operation based on the request type, and acquiring a return result of the file access request; and sending the return result to an upper-layer application based on a preset overtravel control module so as to redirect the file access operation of all processes in the overtravel to the virtual stack file system. Through the mode, the virtual stack file system is established based on the universal file system service framework, and a data storage directory unified with the universal file system can be provided for overtravel; the virtual stacking file system can forward the file access request as required by calling the virtual stacking system to perform corresponding operation according to different file access types, so that the target file can be accessed according to a conventional access mode; and uploading the access result of the file access request by the preset overtravel control module, so that when the process list of the virtual system environment where the overtravel is located is inquired, the returned result only contains the process information belonging to the corresponding overtravel. According to the invention, when the overtravel is started, the root file system is dynamically switched to the virtual stack system, and the file access requests of all processes in the overtravel are redirected to the virtual stack system, so that the system-level isolation of files is realized, and the technical problem of overlarge influence domain caused by tight coupling of applications is solved.
Not shown, a second embodiment of the encapsulation method applied in the present invention is provided based on the first embodiment shown in fig. 2. In the present embodiment, step S10 includes:
step a, receiving a file access request sent based on a preset aggregation directory view, wherein the preset aggregation directory view is a visual logic view corresponding to the virtual stacked file system.
In the present embodiment, it can be understood. Before step a, a user may sequentially stack multiple directory views of the original enterprise-level file system together, aggregating to form a single directory view through which the user may access file data. As shown in fig. 3, the aggregated directory view can be divided into a read-only layer and a read-write layer, wherein the read-only layer is a system resource bound to the over-travel, such as a CPU, a memory, a disk, a network, and the like, and a dynamic link shared library required by the running of the application program, and the read-write layer is a supporting library on which the application depends. The aggregated directory view is a visual logical representation of a directory-granular virtual stacked file system. Based on this logical representation, the user may send a file access request to the virtual stack file system.
Further, in this embodiment, before step S10, the method further includes:
and b, adding a virtual network card and a virtual network card bridge required by the virtual stack file system to provide network connection for over travel.
In this embodiment, different virtual network cards can be allocated for the over-travel by adding the virtual network card in the kernel of the operating system of the terminal, so that it is ensured that different over-travel can only operate different network interfaces. Meanwhile, by designing a virtual network card bridge, the virtual network card in the overtravel is connected to the physical network of the node as required, so that actual network connection is provided for the overtravel.
The invention provides an application packaging method. The application packaging method further provides a visual logic representation, namely an aggregated directory view, corresponding to the virtual stacking system for the user, so that the sight line operates the virtual directory according to the access mode of the common directory, and the user experience is improved; the virtual network card and the virtual network card bridge corresponding to the overtravel are independently arranged, so that different network interfaces can be operated only by different overtravels, and actual network connection is provided for the overtravel.
Not shown, a third embodiment of the encapsulation method applied in the present invention is proposed based on the first embodiment shown in fig. 2. In the present embodiment, step S20 includes:
step c, when the request type is a file retrieval type, calling file retrieval operation records of the virtual stack file system layer by layer from back to front;
in this embodiment, if it is determined that the access type of the current file access request is a file traversal type, the terminal will call the file retrieval operation of the file system layer by layer from back to front according to the corresponding stacking sequence in the virtual stack file system.
D, acquiring a return result of the file access request based on the file retrieval operation record to determine a target file;
in this embodiment, the terminal determines whether the identification information of the target file exists in the currently obtained file retrieval operation record. And when the identification information of the target file exists in the file retrieval operation record, acquiring the identification information so as to determine the target file of the pair according to the identification information.
And e, when the request type is an editing request type, calling the virtual stacking file system to perform corresponding operation on the target file determined based on the file retrieval request, and acquiring a return result of the file access request of the editing request type, wherein the editing request type comprises a file reading type, a file writing type and a file deleting type.
In this embodiment, if the terminal determines that the current request type is the file reading type, the access request is directly transmitted to the target file determined during file retrieval. And the terminal calls the virtual stack file system to execute reading operation on the target file and takes the content of the target file as a return result of the file access request. And if the terminal judges that the target file to be written or deleted exists in the last layer of the readable and writable layer in the virtual stack file system, calling the virtual stack file system to write or delete the target file, and taking the information of whether the operation is successful as the return result of the request.
Further, in this embodiment, step d includes:
f, judging whether the target file exists in the virtual stack file system or not based on the file retrieval operation record;
in this embodiment, the terminal further determines whether the target file exists in the virtual stack file system by determining whether the file name of the target file exists in the file retrieval record according to the file retrieval operation record called layer by layer.
Step g, if the target file exists in the virtual stack file system, taking the label information corresponding to the target file as the return result to determine the target file;
the tag information may be information such as a file name and a physical address of the target file.
In this embodiment, if the terminal determines that the tag information of the target file exists in a certain layer of the virtual stack file system, it may further determine that the target file exists, and use the tag information of the target file as a return result of the file retrieval operation.
And h, if the target file does not exist in the virtual stack file system, generating state information without a file as the return information.
In this embodiment, if the terminal determines that the file deletion operation record of a certain layer in the virtual stack file system includes a deletion operation for the target file name, or that the file name of the target file is not retrieved for each layer, the file is not present and the result of the file retrieval operation is returned.
Further, in this embodiment, step e includes:
step i, when the request type is the file writing type or the file deleting type, judging whether the target file exists in the last layer in the virtual stack file system;
in this embodiment, when the terminal determines that the request type of the current file access request is a file write type or a file delete type, it is determined whether a target file corresponding to the request exists in a last layer of a readable and writable layer in the virtual stack file system.
Step j, if the target file exists in the last layer of the virtual stack file system, transmitting the file access request to the target file;
and step k, calling the virtual stacking file system to write or delete the target file and generating a corresponding return result.
In this embodiment, if the terminal determines that the current request type is a file write type, it further determines whether the target file exists in the last layer of the virtual stack file system. And if the target file exists in the last layer, directly transmitting the file access request to the target file, calling the virtual stack file system to execute file writing operation on the target file, and taking the information of whether the file writing operation is successfully executed as a return result of the file writing request. It should be noted that, in a specific implementation code, if a write operation is successful, a return value is provided, and if the write operation is unsuccessful, exception information is returned. If the target file does not exist in the last layer, the target file is copied to the last layer, the file retrieval result is replaced and points to the target file in the last layer, the file access request is directly transmitted to the target file in the last layer, the virtual stack file system is called to execute the file writing operation, and the information of whether the file writing operation is successfully executed is used as the return result of the file writing request.
If the terminal judges that the current request type is the file deletion type, the file name in the file deletion request is recorded into the file deletion operation record of the last layer, and whether the target file determined by file retrieval is also located in the last layer is judged. If the target file determined by the file retrieval is also located in the last layer, the virtual stack file system is called to synchronously delete the target file, and the information of whether the file deletion operation is successfully executed is used as the return result of the file deletion request. In a specific implementation code, if the write operation is successful, a return value is provided, and if the write operation is unsuccessful, exception information is returned. If the target file determined by the file retrieval does not exist in the last layer, the deletion request is directly transmitted to the target file, a file system is called to execute file deletion operation on the target file, and information about whether the file deletion operation is successfully executed is used as a return result of the file deletion request.
Further, in this embodiment, step e further includes:
and step l, when the request type is the file reading type, transmitting the file access request to the target file, and calling the virtual stack file system to execute reading operation on the target file.
In this embodiment, if the terminal determines that the current request type is a file reading type, the terminal directly transmits the access request to the target file determined during file retrieval. And the terminal calls the virtual stack file system to execute reading operation on the target file and takes the content of the target file as a return result of the file access request.
Further, step S20 further includes:
step m, when the request type is a file traversal type, calling file traversal operation of the virtual stack file system layer by layer from back to front according to the stacking sequence of the virtual stack file system;
in this embodiment, if the terminal determines that the access type is file traversal, the file traversal operation of the file system is called layer by layer from back to front according to the visual logical representation corresponding to the virtual stacked file system, that is, the stacking order of the aggregated directory view.
And n, aggregating the file traversal results of all layers based on the file deletion operation records of all layers, and taking the aggregated traversal results as the return results.
In this embodiment, the terminal aggregates the traversal results of each layer in combination with the file deletion operation record of each layer, and uses the aggregated traversal result as the return result of the file access request.
The invention provides an application packaging method. The application packaging method further enables the virtual stacking system to realize processing functions of file traversal, retrieval, deletion, reading and writing again based on a general file system service framework through a processing mode of request types of file traversal, file retrieval, file deletion, file reading and file writing, and can forward file access requests as required, so that the virtual directory can be operated according to an access mode of a common directory.
The invention also provides application packaging equipment.
The application packaging device comprises a processor, a memory and an application packaging program stored on the memory and capable of running on the processor, wherein the application packaging program realizes the steps of the application packaging method when being executed by the processor.
The method implemented when the application packaging program is executed may refer to each embodiment of the application packaging method of the present invention, and details are not described herein.
The invention also provides a computer readable storage medium.
The computer readable storage medium of the present invention has stored thereon an application wrapper program, which when executed by a processor implements the steps of the application wrapper method as described above.
The method implemented when the application packaging program is executed may refer to each embodiment of the application packaging method of the present invention, and details are not described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. An application encapsulation method, characterized in that the application encapsulation method comprises:
receiving a file access request for accessing a preset virtual stack file system, and judging the request type of the file access request, wherein the virtual stack file system stacks files in the overtravel and manages the files based on a virtual system environment and a general file system service framework;
calling the virtual stack file system to perform corresponding operation based on the request type, and acquiring a return result of the file access request;
and sending the return result to an upper-layer application based on a preset overtravel control module so as to redirect the file access operation of all processes in the overtravel to the virtual stack file system.
2. The application packaging method of claim 1, wherein the step of receiving a file access request for accessing a preset virtual stack file system comprises:
receiving a file access request sent based on a preset aggregation directory view, wherein the preset aggregation directory view is a visual logic view corresponding to the virtual stack file system.
3. The application packaging method of claim 1, wherein the step of receiving a file access request for accessing a predetermined virtual stack file system and determining a request type of the file access request is preceded by the step of:
and adding a virtual network card and a virtual network card bridge required by the virtual stack file system to provide network connection for over travel.
4. The application encapsulation method of claim 1, wherein the invoking the virtual stack file system performs a corresponding operation based on the request type, and the step of obtaining the returned result of the file access request comprises:
when the request type is a file retrieval type, calling file retrieval operation records of the virtual stack file system layer by layer from back to front;
obtaining a return result of the file access request based on the file retrieval operation record to determine a target file;
and when the request type is an editing request type, calling the virtual stacking file system to perform corresponding operation on the target file determined based on the file retrieval request, and acquiring a return result of the file access request of the editing request type, wherein the editing request type comprises a file reading type, a file writing type and a file deleting type.
5. The application packaging method of claim 4, wherein the step of obtaining the returned result of the file access request based on the file retrieval operation record comprises:
judging whether the target file exists in the virtual stack file system or not based on the file retrieval operation record;
if the target file exists in the virtual stack file system, taking the label information corresponding to the target file as the return result to determine the target file;
and if the target file does not exist in the virtual stack file system, generating state information without file existence as the return information.
6. The application encapsulation method of claim 5, wherein the step of invoking the virtual stack file system to perform corresponding operations on the target file determined based on the file retrieval request and obtaining the returned result of the file access request of the edit request type when the request type is the edit request type comprises:
when the request type is the file writing type or the file deleting type, judging whether the target file exists in the last layer in the virtual stack file system;
if the target file exists in the last layer of the virtual stack file system, transmitting the file access request to the target file;
and calling the virtual stack file system to write or delete the target file and generating a corresponding return result.
7. The application packaging method of claim 6, wherein the step of calling the virtual stack file system to perform corresponding operation on the target file determined based on the file retrieval request and obtaining the returned result of the file access request of the edit request type when the request type is the edit request type comprises:
and when the request type is the file reading type, transmitting the file access request to the target file, and calling the virtual stack file system to execute reading operation on the target file.
8. The application encapsulation method of claim 1, wherein the invoking the virtual stack file system performs a corresponding operation based on the request type, and the step of obtaining the returned result of the file access request comprises:
when the request type is a file traversal type, calling file traversal operation of the virtual stack file system layer by layer from back to front according to the stacking sequence of the virtual stack file system;
and aggregating the file traversal results of all layers based on the file deletion operation records of all layers, and taking the aggregated traversal results as the return results.
9. An application encapsulation device, characterized in that the application encapsulation device comprises: memory, a processor and an application wrapper program stored on the memory and executable on the processor, the application wrapper program when executed by the processor implementing the steps of the application wrapper method as claimed in any one of claims 1 to 8.
10. A computer-readable storage medium, having an application wrapper program stored thereon, which when executed by a processor implements the steps of the application wrapper method of any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911323655.1A CN111125007B (en) | 2019-12-18 | 2019-12-18 | Application packaging method, device and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911323655.1A CN111125007B (en) | 2019-12-18 | 2019-12-18 | Application packaging method, device and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111125007A true CN111125007A (en) | 2020-05-08 |
CN111125007B CN111125007B (en) | 2023-06-20 |
Family
ID=70500501
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911323655.1A Active CN111125007B (en) | 2019-12-18 | 2019-12-18 | Application packaging method, device and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111125007B (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1436333A (en) * | 2000-06-09 | 2003-08-13 | 摩托罗拉公司 | Integrated processor platform supporting wireless handheld multimedia devices |
US20100042719A1 (en) * | 2008-08-12 | 2010-02-18 | Junji Kinoshita | Content access to virtual machine resource |
CN102520994A (en) * | 2011-12-06 | 2012-06-27 | 北京航空航天大学 | Method and system for steaming loading virtual files |
CN103067507A (en) * | 2012-12-28 | 2013-04-24 | 国家计算机网络与信息安全管理中心 | Internet cloud computing resource virtualization packaging system and method |
CN103150402A (en) * | 2013-03-27 | 2013-06-12 | 网宿科技股份有限公司 | Index-code-based virtual file system, establishment method and access method |
CN105573801A (en) * | 2015-12-23 | 2016-05-11 | 迈普通信技术股份有限公司 | Method for realizing software upgrading in stacking system as well as device and system |
CN105579950A (en) * | 2013-07-02 | 2016-05-11 | 日立数据系统工程英国有限公司 | Method and apparatus for migration of a virtualized file system, data storage system for migration of a virtualized file system, and file server for use in a data storage system |
CN105593804A (en) * | 2013-07-02 | 2016-05-18 | 日立数据系统工程英国有限公司 | Method and apparatus for virtualization of file system, data storage system for virtualization of file system, and file server for use in data storage system |
CN105830059A (en) * | 2014-11-28 | 2016-08-03 | 华为技术有限公司 | Fine pitch connector socket |
CN110018859A (en) * | 2019-04-15 | 2019-07-16 | 珠海全志科技股份有限公司 | Equipment starting method, device, computer equipment and storage medium |
-
2019
- 2019-12-18 CN CN201911323655.1A patent/CN111125007B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1436333A (en) * | 2000-06-09 | 2003-08-13 | 摩托罗拉公司 | Integrated processor platform supporting wireless handheld multimedia devices |
US20100042719A1 (en) * | 2008-08-12 | 2010-02-18 | Junji Kinoshita | Content access to virtual machine resource |
CN102520994A (en) * | 2011-12-06 | 2012-06-27 | 北京航空航天大学 | Method and system for steaming loading virtual files |
CN103067507A (en) * | 2012-12-28 | 2013-04-24 | 国家计算机网络与信息安全管理中心 | Internet cloud computing resource virtualization packaging system and method |
CN103150402A (en) * | 2013-03-27 | 2013-06-12 | 网宿科技股份有限公司 | Index-code-based virtual file system, establishment method and access method |
CN105579950A (en) * | 2013-07-02 | 2016-05-11 | 日立数据系统工程英国有限公司 | Method and apparatus for migration of a virtualized file system, data storage system for migration of a virtualized file system, and file server for use in a data storage system |
CN105593804A (en) * | 2013-07-02 | 2016-05-18 | 日立数据系统工程英国有限公司 | Method and apparatus for virtualization of file system, data storage system for virtualization of file system, and file server for use in data storage system |
CN105830059A (en) * | 2014-11-28 | 2016-08-03 | 华为技术有限公司 | Fine pitch connector socket |
CN105573801A (en) * | 2015-12-23 | 2016-05-11 | 迈普通信技术股份有限公司 | Method for realizing software upgrading in stacking system as well as device and system |
CN110018859A (en) * | 2019-04-15 | 2019-07-16 | 珠海全志科技股份有限公司 | Equipment starting method, device, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111125007B (en) | 2023-06-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11868785B2 (en) | Application program page processing method and device | |
CN107291497B (en) | Multi-firmware upgrading method and system and readable storage medium | |
CN110019081B (en) | Data persistence processing method, device and system and readable storage medium | |
CN107276789B (en) | Log uploading method and device and computer readable storage medium | |
WO2023124967A1 (en) | Method for calling android hidl interface by software operating system, and device and medium | |
US9032423B2 (en) | Dependency based configuration package activation | |
US20130227085A1 (en) | Terminal and method for using cloud services | |
US20120236012A1 (en) | Method and Device for Displaying Application Image | |
CN107291759B (en) | Method and device for processing browser page resources | |
CN112100552B (en) | Page rendering method, device, equipment and computer readable storage medium | |
CN104516885A (en) | Implementation method and device of browse program double-kernel assembly | |
CN107577472B (en) | Software installation method and device and computer readable storage medium | |
CN114443189B (en) | Image processing method and electronic equipment | |
CN117724852A (en) | Cloud computer computing resource allocation method and device | |
CN111382136B (en) | File system mirror image and file request method | |
US10931737B2 (en) | Personal cloud system and related localization method | |
CN111125007B (en) | Application packaging method, device and readable storage medium | |
CN111857959A (en) | Method, system, equipment and medium for Docker mirror image synchronization of cross-local area network | |
US20210026807A1 (en) | Method for managing data associated with application and electronic device therefor | |
WO2022227997A1 (en) | Memory request method and related device | |
CN112052377A (en) | Resource recommendation method, device, server and storage medium | |
CN114090083B (en) | Visual component configuration method, device, equipment and storage medium | |
CN113222174B (en) | Model management method and device | |
CN114676372A (en) | Data processing method and device for web game, electronic equipment and storage medium | |
CN113672311A (en) | Structure assignment method, assigner and computer-readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |