CN112597115A - Container mirror image compression method and device, terminal equipment and medium - Google Patents

Container mirror image compression method and device, terminal equipment and medium Download PDF

Info

Publication number
CN112597115A
CN112597115A CN202011509405.XA CN202011509405A CN112597115A CN 112597115 A CN112597115 A CN 112597115A CN 202011509405 A CN202011509405 A CN 202011509405A CN 112597115 A CN112597115 A CN 112597115A
Authority
CN
China
Prior art keywords
container
compressed
mirror image
directory
image
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.)
Pending
Application number
CN202011509405.XA
Other languages
Chinese (zh)
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.)
Electric Power Research Institute of State Grid Zhejiang Electric Power Co Ltd
Original Assignee
Electric Power Research Institute of State Grid Zhejiang Electric Power Co 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 Electric Power Research Institute of State Grid Zhejiang Electric Power Co Ltd filed Critical Electric Power Research Institute of State Grid Zhejiang Electric Power Co Ltd
Priority to CN202011509405.XA priority Critical patent/CN112597115A/en
Publication of CN112597115A publication Critical patent/CN112597115A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/188Virtual file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses a compression method and a device of a container mirror image, terminal equipment and a computer readable storage medium, wherein the invention acquires the mirror image construction file information of the container mirror image to be compressed, wherein the quantity of the mirror image construction file information is more than 1; determining a directory to be compressed in the mirror image of the container to be compressed according to the mirror image construction file information, and generating a replacement directory of the directory to be compressed; and calling a preset container engine, and compressing and combining the container mirror images to be compressed based on the replacement directory to obtain the compressed container mirror images. The invention determines the directory to be compressed in the container mirror image to be compressed based on the mirror image construction file information of the container mirror image, generates the replacement directory of the directory to be compressed, and calls the container engine to compress and combine the directory and the container mirror image to be compressed based on the replacement directory.

Description

Container mirror image compression method and device, terminal equipment and medium
Technical Field
The invention relates to the technical field of big data, in particular to a compression method and device of container mirror images, terminal equipment and a computer readable storage medium.
Background
With the rapid development of big data technologies, more and more enterprises begin to choose to perform data processing processes such as data calculation and analysis through a cloud service platform, so as to improve the data processing efficiency and optimize the business development of the enterprises. With the increasing demand of enterprises for data cloud service efficiency, container technology is also receiving more and more attention from a plurality of enterprises.
The container technology enables the container to provide operation support for different applications by starting different operation environments through excellent isolation technology. However, in practical applications, the number of container images will increase and the volume of each container image will also increase at a very fast rate, so that the distribution of images in the entire container environment will be disturbed and the disturbance will be increased, and in case of serious disturbance, the container will not support the normal operation of the application.
In summary, how to efficiently compress a container image with a fast growth so as to avoid disturbing the image distribution in the entire container environment is an urgent technical problem in the industry.
Disclosure of Invention
The invention mainly aims to provide a compression method, a compression device, terminal equipment and a computer readable storage medium for container images, aiming at efficiently compressing rapidly-growing container images, avoiding interference on image distribution in the whole container environment and supporting normal operation of applications.
In order to achieve the above object, one of the objects of the present invention is to provide a method for compressing a container image, the method comprising:
acquiring mirror image construction file information of a mirror image of a container to be compressed, wherein the number of the mirror image construction file information is more than 1;
determining a directory to be compressed in the mirror image of the container to be compressed according to the mirror image construction file information, and generating a replacement directory of the directory to be compressed;
and calling a preset container engine, and compressing and combining the container mirror images to be compressed based on the replacement directory to obtain the compressed container mirror images.
Further, the image construction file information of the container image to be compressed is stored in the block chain, and the step of obtaining the image construction file information of the container image to be compressed includes:
and according to the identification information of the mirror image of the container to be compressed, matching the mirror image of the container to be compressed from the block chain to construct file information.
Further, the step of determining the directory to be compressed in the mirror image of the container to be compressed according to the mirror image construction file information includes:
detecting a container space occupied by each image construction file information, and screening out the image construction file information which is greater than or equal to a preset space threshold value according to the container space;
and determining the installation directory of the screened mirror image construction file information corresponding to the mirror image of the container to be compressed as the directory to be compressed.
Further, the step of generating the replacement directory of the directory to be compressed includes:
adding a mirror image layer in the mirror image of the container to be compressed, wherein the data volume of the newly added mirror image layer meets the preset initial capacity;
and taking the newly added mirror image layer as a replacement directory of the directory to be compressed.
Further, the step of calling the preset container engine to compress and merge the container mirror image to be compressed based on the replacement directory to obtain a compressed container mirror image includes:
receiving a compression instruction for compressing and merging the mirror images of the containers to be compressed;
and triggering a compression mechanism of the preset container engine according to the compression instruction, and compressing and combining the replacement directory and the container mirror image to be compressed to obtain the compressed container mirror image.
Further, the compression method of the container mirror image further comprises the following steps:
and constructing a container mirror image according to preset mirror image construction file information, and determining the mirror image of the container to be compressed according to the compression instruction.
Further, after the step of determining the directory to be compressed in the container image to be compressed according to the image construction file information, the method further includes:
and generating the mounting content of the directory to be compressed and mounting the mounting content.
In addition, to achieve the above object, the present invention provides a compression apparatus for a container mirror image, including:
the device comprises an acquisition module, a compression module and a compression module, wherein the acquisition module is used for acquiring mirror image construction file information of a mirror image of a container to be compressed, and the number of the mirror image construction file information is more than 1;
the determining module is used for determining a to-be-compressed directory in the mirror image of the to-be-compressed container according to the mirror image construction file information and generating a replacement directory of the to-be-compressed directory;
and the compression module is used for calling a preset container engine, and compressing and combining the container mirror image to be compressed based on the replacement directory to obtain a compressed container mirror image.
It is a further object of the present invention to provide a compression device for mirror images of containers.
The second purpose of the invention is realized by adopting the following technical scheme:
a container mirror image compression device, comprising:
the device comprises an acquisition module, a compression module and a compression module, wherein the acquisition module is used for acquiring mirror image construction file information of a mirror image of a container to be compressed, and the number of the mirror image construction file information is more than 1;
the determining module is used for determining a to-be-compressed directory in the mirror image of the to-be-compressed container according to the mirror image construction file information and generating a replacement directory of the to-be-compressed directory;
and the compression module is used for calling a preset container engine, and compressing and combining the container mirror image to be compressed based on the replacement directory to obtain a compressed container mirror image.
It is a further object of the present invention to provide a terminal device for performing one of the above objects, comprising a memory, a processor and a container image compression program stored on the memory and executable on the processor, wherein the computer program is stored in a storage medium, and the container image compression program implements the above container image compression method when executed by the processor.
It is a further object of the present invention to provide a storage medium storing one of the objects of the invention, on which a computer program is stored, which computer program, when executed by a processor, implements the above-described container image compression method.
According to the compression method, the compression device, the compression terminal device and the compression computer-readable storage medium for the container mirror image, the mirror image construction file information of the container mirror image to be compressed is obtained, wherein the number of the mirror image construction file information is larger than 1; determining a directory to be compressed in the mirror image of the container to be compressed according to the mirror image construction file information, and generating a replacement directory of the directory to be compressed; and calling a preset container engine, and compressing and combining the container mirror image to be compressed based on the replacement directory to obtain a compressed container mirror image.
The invention establishes file information based on the mirror image of the container mirror image to determine the directory to be compressed in the mirror image of the container to be compressed, then generates the replacement directory of the directory to be compressed, and finally calls the container engine to perform compression and combination based on the replacement directory and the mirror image of the container to be compressed, thereby completing the high-efficiency and rapid compression of the container and reducing the volume of the container. The invention can efficiently compress the rapidly-growing container mirror image, avoids the interference of the rapidly-growing container mirror image on the mirror image distribution in the whole container environment, and provides support for the normal operation of the application.
Drawings
FIG. 1 is a schematic flow chart of a compression method for container images according to an embodiment of the present invention;
FIG. 2 is a functional block diagram of an embodiment of a second container mirroring compression device according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of the hardware operation according to the fourth embodiment of the present invention;
fig. 4 is a diagram of a wireless communication device of the mobile terminal in fig. 3.
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.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal device may be implemented in various forms. For example, the terminal device described in the present invention may include wearable mobile terminals such as a smart watch, a smart bracelet, smart glasses, and various flexible screens, and may even be mobile terminals such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart bracelet, a pedometer, and fixed terminals such as a Digital TV, a desktop computer, and the like.
While the following description will be made taking a mobile terminal device as an example, those skilled in the art will appreciate that the configuration according to the embodiment of the present invention can be applied to a fixed type terminal device in addition to elements particularly used for mobile purposes.
Example one
The embodiment I provides a compression method of container mirror images, which aims to efficiently compress the container mirror images so as to avoid the interference of the rapidly-growing container mirror images on the mirror image distribution in the whole container environment.
While a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different than that shown.
Referring to fig. 1, a method for compressing a container image includes:
s100, acquiring mirror image construction file information of a mirror image of a container to be compressed, wherein the number of the mirror image construction file information is more than 1;
the terminal equipment obtains a plurality of mirror image construction file information of the mirror image of the container to be compressed, which is pointed by the compression instruction, through the received compression instruction for compressing the container mirror image.
It should be noted that, in this embodiment, the image construction file information is file information of a construction file required for constructing a container image of any application program, and the image construction file information may specifically be one or more package information of the application program. It should be understood that, based on different design requirements of practical applications, in other possible embodiments, the image construction file information may also be other information different from the package information listed in this embodiment, and the compression method of the container image of the present invention is not specifically limited to the number and type of the image construction file information.
Further, in a possible embodiment, the image build file information of the container image to be compressed is stored in a block chain, and the step S100 may include:
and according to the identification information of the mirror image of the container to be compressed, matching the mirror image of the container to be compressed from the block chain to construct file information.
After a compression instruction for compressing the container mirror image is received, the identification information of the container mirror image to be compressed pointed by the compression instruction can be analyzed from the compression instruction, and then the mirror image construction file information of the container mirror image to be compressed is matched and obtained from the pre-developed block connection nodes according to the identification information.
It should be noted that, in this embodiment, a block chain link point dedicated to storing image construction file information may be developed in the block chain based on a block chain technology and based on configuration of a worker, an index may be established according to identification information of each container image (for example, a program name of an application program of the container image), and then the index and the image construction file information of each container image are stored in the block chain link point in association with each other.
In this embodiment, by developing a block chain node in advance and storing the mirror image construction file of the container mirror image, which needs to be acquired when compressing the container mirror image, in the block chain node, not only is the stability of the mirror image construction file information extracted when compressing the container mirror image with compression ensured, but also the reading speed of the mirror image file information can be increased, and the efficiency of compressing the container mirror image is further increased.
Step S200, determining a directory to be compressed in the mirror image of the container to be compressed according to the mirror image construction file information, and generating a replacement directory of the directory to be compressed;
after obtaining a plurality of mirror image construction file information of the mirror image of the container to be compressed pointed by the received compression instruction, determining a directory to be compressed in the mirror image of the container to be compressed according to the space size of the container occupied by the mirror image construction file information, and generating a replacement directory of the directory to be compressed.
Further, in a possible embodiment, in the step S200, the "determining the directory to be compressed in the container image to be compressed according to the image construction file information" may include:
step S201, detecting a container space occupied by each mirror image construction file information, and screening out the mirror image construction file information which is greater than or equal to a preset space threshold value according to the container space;
it should be noted that, in this embodiment, the preset space threshold is a container space size used for determining image construction file information corresponding to a to-be-compressed directory that needs to be compressed in a to-be-compressed container image, and specifically, the preset space threshold may be set to be 100 MB. It should be understood that the preset spatial threshold may be set to different container space sizes in other possible embodiments based on different design requirements of practical applications, and the compression method of the container image of the present invention is not specifically limited to the size of the preset spatial threshold.
After obtaining a plurality of mirror image construction file information of a container mirror image to be compressed, container spaces occupied by the mirror image construction file information need to be detected respectively, and then the container spaces are compared with a preset space threshold value to determine one or more target container spaces which are larger than or equal to the preset space threshold value in the container spaces.
Step S202, determining the installation directory of the screened mirror image construction file information corresponding to the mirror image of the container to be compressed as a directory to be compressed.
After determining that one or more target container spaces which are larger than or equal to a preset space threshold value in container spaces corresponding to a plurality of mirror image construction file information of a container mirror image to be compressed are determined, determining mirror image construction file information corresponding to the one or more target container spaces as a target mirror image construction file, and further detecting an installation directory of the target mirror image construction file in the container mirror image to be compressed so as to determine the installation directory as a directory to be compressed which needs to be compressed in the container mirror image to be compressed.
Further, in a possible embodiment, in the step S200, the step of "generating a replacement directory of the directory to be compressed" may include:
step S203, adding a mirror image layer in the mirror image of the container to be compressed, wherein the data volume of the newly added mirror image layer meets the preset initial capacity;
and step S204, taking the newly added mirror image layer as a replacement directory of the directory to be compressed.
It should be noted that, in this embodiment, the initial capacity is preset to be the data capacity of the newly added mirror layer in the container mirror. It should be understood that, based on different design requirements of practical applications, in other possible embodiments, the preset initial capacity may be set to other specific data capacities, and the compression method of the container image of the present invention is not specifically limited to the capacity size of the preset initial capacity.
After determining the directory to be compressed which needs to be compressed in the container mirror image to be compressed, newly adding a new mirror image layer with the preset initial capacity of the container mirror image to be compressed based on the condition that the default directory to be compressed is empty of the container mirror image to be compressed, and then directly taking the new mirror image layer as a replacement directory of the directory to be compressed.
Further, in another possible embodiment, after the step of "determining the directory to be compressed in the container image to be compressed according to the image construction file information" in the step S200, the method for compressing the container image may further include:
and generating the mounting content of the directory to be compressed and mounting the mounting content.
After determining a to-be-compressed directory which needs to be compressed in a to-be-compressed container mirror image, acquiring directory content of the to-be-compressed directory, generating mounting content of the to-be-compressed directory based on the directory content, and then storing and mounting the mounting content.
It should be noted that, in this embodiment, specifically, the mount content of the generated directory to be compressed may be stored in a preset storage device, then after the compressed container mirror image is obtained, a mount point is set in the compressed container mirror image, and the compressed container mirror image is mounted in the storage device through the mount point, so that the mount content also stored in the storage device may be automatically mounted when the compressed container mirror image is started.
In the embodiment, the directory to be compressed determined in the container mirror image to be compressed is mounted in the preset storage device, so that the problem of network delay caused by a traditional network file mounting system can be effectively avoided, and the speed of calling the program function in the container mirror image is increased.
Step S300, calling a preset container engine, and compressing and combining the container mirror images to be compressed by the engine based on the replacement catalog to obtain the compressed container mirror images.
After generating a replacement directory of a directory to be compressed which is determined in the container mirror image to be compressed and needs to be compressed, a preset container engine needs to be called, and the replacement directory and the container mirror image to be compressed which does not contain the directory to be compressed are directly compressed and combined together to obtain the compressed container mirror image.
It should be noted that, in this embodiment, the preset container engine may be a container engine of the mirror image of the container to be compressed, or the preset container engine may also be a preset general container engine dedicated to performing the compression operation. It should be understood that, in other possible embodiments, the preset container engine may of course be other tools for performing the compressing operation than those listed in the present embodiment, and the compressing method of the container image of the present invention is not specifically limited to the kind of the preset container engine.
Further, in a possible embodiment, the step S300 may include:
step S301, receiving a compression instruction for compressing and merging the mirror images of the containers to be compressed;
in S301, a compression instruction triggered by a user and used for compressing and merging the mirror images of the containers to be compressed may be received through a user graphical interface visually output by a front-end screen.
Further, in another possible embodiment, the compression instruction may also be automatically generated, for example, by setting a timing task to automatically trigger the compression instruction.
Step S302, triggering a compression mechanism of the preset container engine according to the compression instruction, compressing and combining the replacement directory and the container mirror image to be compressed, and obtaining the compressed container mirror image.
After receiving a compression instruction, transmitting the container mirror image to be compressed pointed by the compression instruction and a replacement directory of the directory to be compressed in the generated container mirror image to a preset container engine together and synchronously triggering a compression mechanism of the preset container engine, so that the preset container engine directly compresses and merges the replacement directory and the container mirror image to be compressed without the directory to be compressed into a layer of mirror image serving as a compressed container mirror image together.
Example two
The second embodiment mainly explains and explains another compression method of the container mirror image.
Further, in a possible embodiment, the method for compressing a container image according to the present invention may further include:
and constructing a container mirror image according to preset mirror image construction file information, and determining the mirror image of the container to be compressed according to the compression instruction.
In the above steps, before receiving a compression instruction for compressing and merging a container mirror image to be compressed, mirror image construction file information may be obtained from block link points developed in advance, and then a corresponding container mirror image may be constructed and obtained based on the mirror image construction file information, so that, after receiving the compression instruction for compressing and merging the container mirror image to be compressed, a container mirror image to be compressed, which is pointed by the compression instruction and currently needs to be compressed and merged, may be determined based on identification information carried in the compression instruction.
It should be noted that, in this embodiment, specifically, when an image file of any one application program is generated, image construction file information of the image file constituting the application program may be acquired, so that a corresponding complete container image is constructed based on the image construction file information.
The invention realizes that the file information is constructed based on the mirror image of the container mirror image to determine the directory to be compressed in the container mirror image to be compressed, then the replacement directory of the directory to be compressed is generated, and finally the container engine is called to compress and combine the directory based on the replacement directory and the container mirror image to be compressed.
In this embodiment, based on a compression instruction received by a terminal device and used for compressing a container mirror image, information of a plurality of mirror image construction files of the container mirror image to be compressed, which is pointed by the compression instruction, can be acquired; after acquiring a plurality of mirror image construction file information of a mirror image of a container to be compressed pointed by a received compression instruction, the terminal equipment determines a directory to be compressed in the mirror image of the container to be compressed according to the space size of the container occupied by the mirror image construction file information respectively and generates a replacement directory of the directory to be compressed; after the terminal device generates a replacement directory of the determined directory to be compressed which needs to be compressed in the container mirror image to be compressed, the terminal device immediately calls a preset container engine to directly compress and combine the replacement directory and the container mirror image to be compressed which does not contain the directory to be compressed together to obtain the compressed container mirror image.
For the detailed explanation and explanation of the terminal device, please refer to the fourth embodiment.
EXAMPLE III
The third embodiment discloses a device corresponding to the compression method of the container image in the foregoing embodiment, which is a virtual device structure in the foregoing embodiment, and as shown in fig. 2, the device includes:
the device comprises an acquisition module, a compression module and a compression module, wherein the acquisition module is used for acquiring mirror image construction file information of a mirror image of a container to be compressed, and the number of the mirror image construction file information is more than one;
the determining module is used for determining a to-be-compressed directory in the mirror image of the to-be-compressed container according to the mirror image construction file information and generating a replacement directory of the to-be-compressed directory;
and the compression module is used for calling a preset container engine, and compressing and combining the container mirror image to be compressed based on the replacement directory to obtain a compressed container mirror image.
Optionally, the determining module of the compression apparatus of the container image of the present invention includes:
the detection unit is used for detecting the container space occupied by each piece of image file information and determining a target container space which is larger than or equal to a preset space threshold value in the container space;
and the determining unit is used for determining the installation directory of the target image construction file information corresponding to the target container space in the container image to be compressed as the directory to be compressed.
Optionally, the determining module of the compression apparatus of the container image further includes:
the device comprises a new adding unit, a compressing unit and a compressing unit, wherein the new adding unit is used for adding a mirror image layer in the mirror image of the container to be compressed, and the data volume of the new adding mirror image layer is preset initial capacity;
and the marking unit is used for taking the newly added mirror image layer as a replacement directory of the directory to be compressed.
Optionally, the image construction file information of the container image to be compressed is stored in a block chain, and the obtaining module of the compression device of the container image is further configured to index the image construction file information of the container image to be compressed from the block chain according to the identification information of the container image to be compressed.
Optionally, the compression module of the container mirrored compression apparatus of the present invention comprises:
the instruction receiving unit is used for receiving a compression instruction for compressing and merging the mirror images of the containers to be compressed;
and the compression unit is used for triggering a compression mechanism of the preset container engine according to the compression instruction, compressing and combining the replacement directory and the container mirror image to be compressed to obtain the compressed container mirror image.
Optionally, the compression device for container mirroring of the present invention further comprises:
and the mirror image construction module is used for constructing a container mirror image according to preset mirror image construction file information and determining the container mirror image to be compressed based on the compression instruction.
Optionally, the compression device for container mirroring of the present invention further comprises:
and the mounting module is used for generating mounting content of the directory to be compressed and mounting the mounting content.
The steps implemented by each functional module of the compression apparatus for container mirror image of the present invention may refer to the above-described embodiments of the compression method for container mirror image of the present invention, and are not described herein again.
Example four
Referring to fig. 3, which is a schematic diagram of a hardware structure of a terminal device for implementing various embodiments of the present invention, the terminal device 100 may include: RF (Radio Frequency) unit 101, WiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 3 is not intended to be limiting of mobile terminals, and that a mobile terminal may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the terminal device in detail with reference to fig. 3:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000 ), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division duplex Long Term Evolution), and TDD-LTE (Time Division duplex Long Term Evolution).
WiFi belongs to short-distance wireless transmission technology, and terminal equipment can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 3 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the terminal device, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the terminal device 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the terminal device 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The terminal device 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or the backlight when the terminal device 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and tapping), and other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are also configurable to the mobile phone, and are not described herein again.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the terminal apparatus 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the terminal apparatus 100 or may be used to transmit data between the terminal apparatus 100 and the external device.
The memory 109 may be used to store software programs and various data, and the memory 109 may be a computer storage medium, and the memory 109 stores the compression program of the container image of the present invention. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the terminal device, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the terminal device and processes data by running or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the terminal device. Such as processor 110, executes a container image compression program in memory 109 to perform the steps of the container image compression method embodiments of the present invention.
Processor 110 may include one or more processing units; alternatively, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The terminal device 100 may further include a power supply 111 (such as a battery) for supplying power to each component, and optionally, the power supply 111 may be logically connected to the processor 110 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
Although not shown in fig. 3, the terminal device 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the terminal device of the present invention is based is described below.
Referring to fig. 4, fig. 4 is an architecture diagram of a communication Network system according to an embodiment of the present invention, where the communication Network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal device 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving gateway) 2034, a PGW (PDN gateway) 2035, and a PCRF (Policy and Charging Rules Function) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
The present invention also provides a mobile terminal, comprising: a memory, a processor, a communication bus, and a container image compression program stored on the memory:
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is used for executing the compression program of the container image to realize the following steps:
acquiring mirror image construction file information of a mirror image of a container to be compressed, wherein the number of the mirror image construction file information is more than one;
determining a directory to be compressed in the mirror image of the container to be compressed according to the mirror image construction file information, and generating a replacement directory of the directory to be compressed;
and calling a preset container engine to compress and combine the container mirror image to be compressed based on the replacement directory to obtain the compressed container mirror image.
Preferably, the processor is configured to execute the container image compression program, and further implement:
detecting container spaces occupied by the mirror image file information respectively, and determining a target container space which is larger than or equal to a preset space threshold value in the container spaces;
and determining the installation directory of the target image construction file information corresponding to the target container space in the container image to be compressed as the directory to be compressed.
Preferably, the processor is configured to execute the container image compression program, and further implement:
adding a mirror image layer in the mirror image of the container to be compressed, wherein the data volume of the newly added mirror image layer is a preset initial volume;
and taking the newly added mirror image layer as a replacement directory of the directory to be compressed.
Preferably, the image construction file information of the container image to be compressed is stored in a block chain, and the processor is configured to execute the container image compression program, and further implement:
and according to the identification information of the mirror image of the container to be compressed, matching the mirror image of the container to be compressed from the block chain to construct file information.
Preferably, the processor is configured to execute the container image compression program, and further implement:
receiving a compression instruction for compressing and merging the mirror images of the containers to be compressed;
and triggering a compression mechanism of the preset container engine according to the compression instruction, and compressing and combining the replacement directory and the container mirror image to be compressed to obtain a compressed container mirror image.
Preferably, the processor is configured to execute the container image compression program, and further implement:
and constructing a container mirror image according to preset mirror image construction file information, and determining the mirror image of the container to be compressed based on the compression instruction.
Preferably, the processor is configured to execute a compression program of the container image, and after the step of determining the directory to be compressed in the container image to be compressed according to the image construction file information is implemented, further implement:
and generating the mounting content of the directory to be compressed and mounting the mounting content.
The method for compressing the mirror image of the container in the first embodiment and the second embodiment of the present invention needs to be implemented by a terminal device, and the terminal device refers to the terminal device and the mobile terminal described in this embodiment.
EXAMPLE five
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, which is applied to a computer and may be a non-volatile computer-readable storage medium, where a container image compression program is stored on the computer-readable storage medium, and when the container image compression program is executed by a processor, the steps of the container image compression method described above are implemented.
The steps implemented when the compression program of the container image running on the processor is executed may refer to various embodiments of the compression method of the container image of the present invention, and are not described herein again.
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 solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as 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 for the preferred embodiment of the present invention and is not intended to limit the scope of the present invention, and all equivalent structures or equivalent flow transformations that may be applied to the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method of compressing a mirror image of a container, comprising:
acquiring mirror image construction file information of a mirror image of a container to be compressed, wherein the number of the mirror image construction file information is more than 1;
determining a directory to be compressed in the mirror image of the container to be compressed according to the mirror image construction file information, and generating a replacement directory of the directory to be compressed;
and calling a preset container engine, and compressing and combining the container mirror images to be compressed based on the replacement directory to obtain the compressed container mirror images.
2. The method for compressing a container image according to claim 1, wherein the image construction file information of the container image to be compressed is stored in a block chain, and the step of obtaining the image construction file information of the container image to be compressed includes:
and according to the identification information of the mirror image of the container to be compressed, matching the mirror image of the container to be compressed from the block chain to construct file information.
3. The method for compressing a container image according to claim 1, wherein the step of determining the directory to be compressed in the container image to be compressed according to the image construction file information comprises:
detecting a container space occupied by each image construction file information, and screening out the image construction file information which is greater than or equal to a preset space threshold value according to the container space;
and determining the installation directory of the screened mirror image construction file information corresponding to the mirror image of the container to be compressed as the directory to be compressed.
4. The method for compressing a container image according to claim 1 or 3, wherein the step of generating the replacement directory for the directory to be compressed comprises:
adding a mirror image layer in the mirror image of the container to be compressed, wherein the data volume of the newly added mirror image layer meets the preset initial capacity;
and taking the newly added mirror image layer as a replacement directory of the directory to be compressed.
5. The method for compressing a container image according to claim 1, wherein the step of calling a preset container engine to compress and merge the container image to be compressed based on the replacement directory to obtain the compressed container image comprises:
receiving a compression instruction for compressing and merging the mirror images of the containers to be compressed;
and triggering a compression mechanism of the preset container engine according to the compression instruction, and compressing and combining the replacement directory and the container mirror image to be compressed to obtain the compressed container mirror image.
6. The method of compressing a container image of claim 5, further comprising:
and constructing a container mirror image according to preset mirror image construction file information, and determining the mirror image of the container to be compressed according to the compression instruction.
7. The method for compressing a container image according to claim 1, wherein after the step of determining the directory to be compressed in the container image to be compressed according to the image construction file information, the method further comprises:
and generating the mounting content of the directory to be compressed and mounting the mounting content.
8. A compression device for a container image, the compression device comprising:
the device comprises an acquisition module, a compression module and a compression module, wherein the acquisition module is used for acquiring mirror image construction file information of a mirror image of a container to be compressed, and the number of the mirror image construction file information is more than 1;
the determining module is used for determining a to-be-compressed directory in the mirror image of the to-be-compressed container according to the mirror image construction file information and generating a replacement directory of the to-be-compressed directory;
and the compression module is used for calling a preset container engine, and compressing and combining the container mirror image to be compressed based on the replacement directory to obtain a compressed container mirror image.
9. A terminal device, characterized in that the terminal device comprises: memory, a processor and a container image compression program stored on the memory and executable on the processor, the container image compression program when executed by the processor implementing the steps of the container image compression method according to any one of claims 1 to 7.
10. A storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of compression of a container image according to any one of claims 1 to 7.
CN202011509405.XA 2020-12-18 2020-12-18 Container mirror image compression method and device, terminal equipment and medium Pending CN112597115A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011509405.XA CN112597115A (en) 2020-12-18 2020-12-18 Container mirror image compression method and device, terminal equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011509405.XA CN112597115A (en) 2020-12-18 2020-12-18 Container mirror image compression method and device, terminal equipment and medium

Publications (1)

Publication Number Publication Date
CN112597115A true CN112597115A (en) 2021-04-02

Family

ID=75200065

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011509405.XA Pending CN112597115A (en) 2020-12-18 2020-12-18 Container mirror image compression method and device, terminal equipment and medium

Country Status (1)

Country Link
CN (1) CN112597115A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113209633A (en) * 2021-06-09 2021-08-06 腾讯科技(深圳)有限公司 Mirror image processing method and device, electronic equipment and readable storage medium
CN113821488A (en) * 2021-09-29 2021-12-21 重庆紫光华山智安科技有限公司 Container mirror image migration compression method, device, equipment and medium
CN114756333A (en) * 2022-05-23 2022-07-15 龙芯中科技术股份有限公司 Mirror image processing method and device, electronic equipment and readable medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107819802A (en) * 2016-09-13 2018-03-20 华为软件技术有限公司 A kind of mirror image acquisition methods, node device and server in node cluster
CN110413455A (en) * 2019-07-11 2019-11-05 北京百度网讯科技有限公司 Container mirror processing method, device, computer equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107819802A (en) * 2016-09-13 2018-03-20 华为软件技术有限公司 A kind of mirror image acquisition methods, node device and server in node cluster
CN110413455A (en) * 2019-07-11 2019-11-05 北京百度网讯科技有限公司 Container mirror processing method, device, computer equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113209633A (en) * 2021-06-09 2021-08-06 腾讯科技(深圳)有限公司 Mirror image processing method and device, electronic equipment and readable storage medium
CN113821488A (en) * 2021-09-29 2021-12-21 重庆紫光华山智安科技有限公司 Container mirror image migration compression method, device, equipment and medium
CN113821488B (en) * 2021-09-29 2022-07-08 重庆紫光华山智安科技有限公司 Container mirror image migration compression method, device, equipment and medium
CN114756333A (en) * 2022-05-23 2022-07-15 龙芯中科技术股份有限公司 Mirror image processing method and device, electronic equipment and readable medium

Similar Documents

Publication Publication Date Title
CN107967322B (en) File classification display method, mobile terminal and computer readable storage medium
CN107562705B (en) Data export method, server and computer readable storage medium
CN112597115A (en) Container mirror image compression method and device, terminal equipment and medium
CN108449513B (en) Interactive regulation and control method, equipment and computer readable storage medium
CN107862217B (en) Position information acquisition method, mobile terminal and computer storage medium
CN112822538A (en) Screen projection display method, screen projection device, terminal and storage medium
CN109522276B (en) Application icon management method, terminal and computer-readable storage medium
CN111158617A (en) Screen-casting content synchronization method, mobile terminal and computer-readable storage medium
CN111381762A (en) Double-screen switching method and device and computer readable storage medium
CN112423211A (en) Multi-audio transmission control method, equipment and computer readable storage medium
CN112395106A (en) Process management method, mobile terminal, and computer-readable storage medium
CN109683796B (en) Interaction control method, equipment and computer readable storage medium
CN111970738A (en) Network switching control method, equipment and computer readable storage medium
CN109062688B (en) Memory allocation method, server and mobile terminal
CN110955397A (en) Method for setting frame rate of game terminal, game terminal and storage medium
CN108183833B (en) Response processing method and device and computer readable storage medium
CN107404568B (en) Control switch management method and mobile terminal
CN113900559A (en) Information processing method, mobile terminal and storage medium
CN109379719B (en) Application program broadcast processing method and device and computer readable storage medium
CN109144747B (en) Data processing method, terminal and computer readable storage medium
CN108037959B (en) Intelligent interface merging method, mobile terminal and computer readable storage medium
CN113419698A (en) Method and device for setting screen projection display parameters and computer-readable storage medium
CN108279985B (en) Interface request protocol transformation method, equipment and computer readable storage medium
CN108304268B (en) Memory optimization method, mobile terminal and computer readable storage medium
CN112882676A (en) Screen projection method, mobile terminal and computer 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