CN111352730B - Caching method and device for application program upgrade, computer equipment and storage medium - Google Patents

Caching method and device for application program upgrade, computer equipment and storage medium Download PDF

Info

Publication number
CN111352730B
CN111352730B CN202010086619.4A CN202010086619A CN111352730B CN 111352730 B CN111352730 B CN 111352730B CN 202010086619 A CN202010086619 A CN 202010086619A CN 111352730 B CN111352730 B CN 111352730B
Authority
CN
China
Prior art keywords
memory
upgrade package
operating system
application program
cache
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010086619.4A
Other languages
Chinese (zh)
Other versions
CN111352730A (en
Inventor
吴惠敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202010086619.4A priority Critical patent/CN111352730B/en
Publication of CN111352730A publication Critical patent/CN111352730A/en
Application granted granted Critical
Publication of CN111352730B publication Critical patent/CN111352730B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a caching method, a caching device, computer equipment and a storage medium for application program upgrading, wherein an operating system analyzes meta information of an upgrading packet of an application program and obtains the transmission size of the upgrading packet; judging whether the memory or the external memory of the application program has enough cache space to cache the upgrade package according to the transmission size of the upgrade package; under the condition that the memory or the external memory of the application program does not have enough cache space to cache the upgrade package, the memory or the external memory of the operating system is applied to cache the upgrade package, so that the problem that the upgrade package of the application program APP cannot be effectively cached is solved, dynamic coordination and release of system resources are realized, and the cache of the upgrade package of the application program APP is effectively satisfied.

Description

Caching method and device for application program upgrade, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer software, and in particular, to a method and apparatus for caching application program upgrades, a computer device, and a storage medium.
Background
In the related art, the program running of the computer system only ensures enough cache in a certain aspect, and other aspects adopt a pre-cache method, so that effective utilization of the cache space cannot be realized, for example, when the cache space is put into the running of the service program, the content to be upgraded can only be cached by technical means when the application software APP is upgraded.
In the process of self-upgrading of the actual application program APP, the computer system already uses the cache resources for running the service program, and cannot release enough space to cache an upgrade package (AppPackage) to be upgraded of the application program APP.
Aiming at the problem that the upgrade package of the application program APP cannot be effectively cached in the related art, no effective solution is proposed at present.
Disclosure of Invention
Aiming at the problem that the upgrade package of the application program APP cannot be effectively cached in the related art, the embodiment of the invention at least solves the problem.
According to one aspect of the present invention, there is provided a caching method for application program upgrade, the method comprising:
the operating system analyzes the meta information of the upgrade package of the application program and obtains the transmission size of the upgrade package;
judging whether the memory or the external memory of the application program has enough cache space to cache the upgrade package according to the transmission size of the upgrade package;
and applying for the memory or the external memory of the operating system to cache the upgrade package under the condition that the memory or the external memory of the application program does not have enough cache space to cache the upgrade package.
In one embodiment, the applying for the memory of the operating system to cache the upgrade package includes:
judging whether the memory of the operating system has enough buffer space to buffer the upgrade package according to the transmission size of the upgrade package;
and under the condition that the memory of the operating system has enough cache space to cache the upgrade package, mapping the memory of the operating system to the application program, and caching the upgrade package into the mapped memory.
In one embodiment, after the determining whether the memory of the operating system has enough cache space to cache the upgrade package, the method includes:
judging whether the video cache distributed by the operating system has enough cache space to cache the upgrade package or not under the condition that the memory of the operating system does not have enough cache space to cache the upgrade package;
and intercepting video caches released by an application program in a preset time period, and mapping the video caches into the memory of the application program under the condition that enough cache space is reserved in the video caches distributed by the operating system to cache the upgrade package, wherein the upgrade package is cached in the video caches.
In one embodiment, the applying for the memory or the external memory of the operating system to cache the upgrade package includes:
judging whether the external memory of the operating system has enough buffer space to buffer the upgrade package according to the transmission size of the upgrade package under the condition that the memory of the operating system has insufficient buffer space to buffer the upgrade package;
under the condition that enough cache space exists outside the operating system to cache the upgrade package, pre-distributing files matched with the upgrade package in size on the external memory, mounting the files to a file system in a file format under a directory accessible by the application program, mapping the files into a memory of the application program, caching the upgrade package into the files, and setting the access authority of the files to be used by the application program.
In one embodiment, after the applying for the memory or the external memory of the operating system to cache the upgrade package, the method includes:
under the condition that the memory for caching the upgrade package is allocated by the operating system, the operating system upgrades according to the upgrade package;
when the Memory for caching the upgrade package is allocated by the application program, the operating system allocates a Virtual address Area (VMA) according to the size of the upgrade package, and copies a head page and a tail page of the Memory of the application program to the head and the tail of the VMA of the Virtual address Area respectively;
and remapping an intermediate page of the memory of the application program to the middle part of the virtual address area.
According to an aspect of the present invention, there is also provided a cache device for application program upgrade, the device including:
the acquisition module is used for analyzing the meta information of the upgrade package of the application program by the operating system and acquiring the transmission size of the upgrade package;
the judging module is used for judging whether the memory or the external memory of the application program has enough cache space to cache the upgrade package according to the transmission size of the upgrade package;
the application module is used for applying the memory or the external memory of the operating system to cache the upgrade package under the condition that the memory or the external memory of the application program does not have enough cache space to cache the upgrade package.
In one embodiment, the application module is further configured to determine, according to a transmission size of the upgrade package, whether a memory of the operating system has enough cache space to cache the upgrade package;
and under the condition that the memory of the operating system has enough cache space to cache the upgrade package, mapping the memory of the operating system to the application program, and caching the upgrade package into the mapped memory.
In one embodiment, the application module is further configured to determine whether the video cache allocated by the operating system has enough cache space to cache the upgrade package, if the memory of the operating system does not have enough cache space to cache the upgrade package, after the determining whether the memory of the operating system has enough cache space to cache the upgrade package;
and intercepting video caches released by an application program in a preset time period, and mapping the video caches into the memory of the application program under the condition that enough cache space is reserved in the video caches distributed by the operating system to cache the upgrade package, wherein the upgrade package is cached in the video caches.
In one embodiment, the application module is further configured to determine, according to a transmission size of the upgrade package, whether an external memory of the operating system has enough buffer space to buffer the upgrade package if the memory of the operating system does not have enough buffer space to buffer the upgrade package;
under the condition that enough cache space exists outside the operating system to cache the upgrade package, pre-distributing files matched with the upgrade package in size on the external memory, mounting the files to a file system in a file format under a directory accessible by the application program, mapping the files into a memory of the application program, caching the upgrade package into the files, and setting the access authority of the files to be used by the application program.
In one embodiment, the apparatus further comprises:
the upgrade module is used for applying for the memory or the external memory of the operating system to cache the upgrade package, and then, the operating system upgrades according to the upgrade package under the condition that the memory for caching the upgrade package is allocated by the operating system;
when the memory for caching the upgrade package is allocated by the application program, the operating system allocates a virtual address area VMA according to the size of the upgrade package, and copies a head page and a tail page of the memory of the application program to the head and the tail of the virtual address area VMA respectively;
and remapping an intermediate page of the memory of the application program to the middle part of the virtual address area.
According to another aspect of the present invention, there is also provided a computer device including a memory storing a computer program and a processor implementing the steps of a caching method of an application program upgrade when the processor executes the computer program.
According to another aspect of the present invention, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a caching method of an application upgrade.
According to the invention, the operating system analyzes the meta information of the upgrade package of the application program and obtains the transmission size of the upgrade package; judging whether the memory or the external memory of the application program has enough cache space to cache the upgrade package according to the transmission size of the upgrade package; under the condition that the memory or the external memory of the application program does not have enough cache space to cache the upgrade package, the memory or the external memory of the operating system is applied to cache the upgrade package, so that the problem that the upgrade package of the application program APP cannot be effectively cached is solved, dynamic coordination and release of system resources are realized, and the cache of the upgrade package of the application program APP is effectively satisfied.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
FIG. 1 is an application environment diagram of a caching method for application upgrades according to an embodiment of the present invention;
FIG. 2 is a flowchart I of a caching method for application upgrades according to an embodiment of the present invention;
FIG. 3 is a flow chart of a caching method for application upgrades according to an embodiment of the present invention;
FIG. 4 is a second flowchart of a caching method for application upgrades according to an embodiment of the present invention;
FIG. 5 is a flow chart of an operating system memory and external memory cache application upgrade package according to an embodiment of the present invention;
FIG. 6 is a flowchart III of a caching method for application upgrades according to an embodiment of the present invention;
FIG. 7 is a flow chart of an operating system upgrade to an application program according to an embodiment of the present invention;
FIG. 8 is a block diagram of a cache device for application upgrades according to an embodiment of the present invention;
FIG. 9 is a block diagram II of a cache device for application upgrades according to an embodiment of the present invention;
fig. 10 is a block diagram of the inside of a computer device according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the drawings in conjunction with embodiments. It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other.
Fig. 1 is an application environment diagram of an application program upgrade caching method according to an embodiment of the present invention, which can be applied to an application environment as shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The upgrading process of the application program in the terminal 102 includes: the operating system analyzes the meta information of the upgrade package of the application program and obtains the transmission size of the upgrade package; judging whether the memory or the external memory of the application program has enough cache space to cache the upgrade package according to the transmission size of the upgrade package; in the case that the application memory or the external memory does not have enough buffer space to buffer the upgrade package, the application memory or the external memory of the operating system is applied to buffer the upgrade package, the server 104 may implement an upgrade process of the application program similar to the terminal 102, and the server 104 may send the upgrade package of the application program to the terminal 102 to complete the upgrade process, where the terminal 102 may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers and portable wearable devices, and the server 104 may be implemented by a stand-alone server or a server cluster formed by a plurality of servers.
In an embodiment of the present invention, there is provided an application program upgrade caching method, fig. 2 is a flowchart of an application program upgrade caching method according to an embodiment of the present invention, fig. 3 is a flowchart of an application program upgrade caching method according to an embodiment of the present invention, and as shown in fig. 2 and 3, the method includes the following steps:
step S202, the Operating System analyzes the meta information of the upgrade package of the application program, obtains the transmission size of the upgrade package, after the application program APP starts to upgrade the application program, the application program communicates with the upgrade service, performs upgrade protocol (AppPrivateProtocol) interaction and upgrade package (AppPackage) data transmission, and finally submits the upgrade package to the Operating System (OS for short), the Operating System completes the upgrade operation of the APP, and the application program APP first obtains the meta information (AppPackage metainfo) of the upgrade package, transmits the meta information to the Operating System OS, and analyzes the parameters of two storage spaces of the upgrade package (AppPackage): size [ Transfer ]: the transmission size of the upgrade Package AppPackage, namely the compressed size of the upgrade Package; size [ Effective ]: the size of the storage space is occupied after the upgrade package AppPackage is upgraded.
Step S204, judging whether the Memory or the external Memory of the application program has enough buffer space to buffer the upgrade package according to the transmission size of the upgrade package, wherein the Memory comprises RAM or DDR, and the external Memory Storage comprises Flash or EMMC. After the transmission Size of the upgrade package is obtained, it may be preferably determined whether the Memory allocated by the application program itself is enough if the Memory allocated by the APP is enough, and if the Memory allocated by the application program itself has enough buffer space to buffer the upgrade package, then the transmitted upgrade package AppPackage is received into the Memory, then the address (Addr) and the Size (Size) corresponding to the upgrade package are transferred to the OS of the operating system, the OS enters the upgrade process (Memory Addr & Size for OS Updating) of the Memory of the application program, and if the allocated Memory of the application program APP does not have enough buffer space to buffer the upgrade package, the APP may further determine whether the allocated Memory Storage has enough buffer space to buffer the upgrade package, then the transferred upgrade package AppPackage is written into the Memory Storage, and then the file path (Filepath) is transferred to the OS of the operating system, and the operating system enters the upgrade process (Storage Filepath for OS Updating) of the external Memory of the application program;
in step S206, in the case that the Memory or the external Memory of the application program does not have enough buffer space to buffer the upgrade package, the Memory or the external Memory of the operating system is applied to buffer the upgrade package, where the application program may apply for the Memory or the external Memory (OS Allocate Memory/Storage) of the operating system to buffer the upgrade package AppPackage in the case that the Memory or the external Memory of the application program does not have enough buffer space to buffer the upgrade package.
Through the steps from S201 to S203, in the process of upgrading the application program, the upgrade package of the application program is cached, and whether the memory or the external memory of the application program has enough cache space or not is not only depended on whether the memory or the external memory of the application program has enough cache space for the upgrade package, but also whether the memory or the external memory of the operating system has cache space or not can be applied for caching the upgrade package of the application program.
Fig. 4 is a second flowchart of a method for caching an application program upgrade according to an embodiment of the present invention, and fig. 5 is a flowchart of an operating system memory and external memory caching application program upgrade package according to an embodiment of the present invention, as shown in fig. 4 and 5, the method includes the following steps:
step S402, judging whether the Memory of the operating system has enough buffer space to buffer the upgrade package according to the transmission Size of the upgrade package, when the Memory and the external Memory of the application program can not find the buffer resource to buffer the upgrade package, the application program sends the transmission Size [ Transfer ] of the upgrade package AppPackage to the operating system OS to request to obtain the buffer resource, and the operating system firstly judges whether the Memory of the operating system OS is enough to buffer the upgrade package according to the transmission Size [ Transfer ], and maps the Memory of the operating system to the application program to buffer the upgrade package into the mapped Memory when the Memory of the operating system has enough buffer space to buffer the upgrade package.
Step S404, if the Memory of the operating system does not have enough buffer space to buffer the upgrade packet, then determining whether the Memory of the video buffer allocated by the operating system has available borrowable space, where it is to be noted that the available borrowable Memory means that the video buffer has a threshold value, which indicates that the number of Memory memories required by the minimum service can be maintained within the threshold value range, and the other parts of the video buffer are mainly used in the service buffer, because the application APP is about to be upgraded, and the application APP is closed before the upgrade, the video buffer for the service is temporarily recovered, and can be used to receive the application package received by the application APP buffer;
in step S406, in a preset period of time, capturing the video buffer released by the application program, in the case that the video buffer allocated by the operating system has enough buffer space to buffer the upgrade packet, for example, in a time threshold range of 1 second, capturing the released video buffer, according to the Size of the upgrade packet Size [ Transfer ] until the video buffer is enough to buffer, if the video buffer cannot be captured enough after timeout, discarding the borrowing, if the borrowing is successful, mapping the Memory of the video buffer to the application program, and caching the upgrade packet to the mapped Memory.
In one embodiment, fig. 6 is a flowchart III of a caching method for application program upgrade according to an embodiment of the present invention, as shown in fig. 6, the method includes the following steps:
step S602, judging whether the external memory Storage of the OS has enough buffer space to buffer the upgrade package according to the transmission Size [ Transfer ] of the upgrade package under the condition that the memory of the OS has insufficient buffer space to buffer the upgrade package;
in step S604, in the case that there is enough cache space outside the operating system to cache the upgrade package, a file matching the upgrade package size is pre-allocated on the external memory, for example, a new file is created, and the file size is calculated by formula 1:
size [ Transfer ] (100+X)% equation 1 where the variable X is metadata reserved for the file system, typically 5-10, depending on the particular file system.
Step S606, the file format file system (mkfs), the file is mounted under the directory accessible by the application program APP, the upgrade package is cached in the file, the access authority of the file is set to be used by the application program, the file is mapped to an address usable by the application program APP, and the upgrade package is cached in the mapped memory.
The external memory Storage of the operating system adopts a technical scheme of pre-distributing files and creating a file system in the pre-distributing files, and caches the upgrade package of the application program, mainly considering that the Size of the file is ensured to be matched with the Size of the upgrade package [ Transfer ], and considering that the data on the external memory Storage of the operating system is not easy to tamper after being formatted into the file system.
In one embodiment, the application APP has received the upgrade package AppPackage data into the Memory, and then delivered the Memory to the operating system OS, and the operating system performs the subsequent actions of the upgrade, and fig. 7 is a schematic flow chart of the operating system upgrade to the application according to the embodiment of the present invention, as shown in fig. 7:
under the condition that the memory for caching the upgrade package is allocated by the operating system, the operating system upgrades according to the upgrade package;
when the Memory for caching the upgrade package is allocated by the application program, the operating system allocates a Virtual address Area (VMA) according to the size of the upgrade package transmitted, and copies a Head page (Head page) and a Tail page (Tail page) of the Memory of the application program to the Head (Head) and the Tail (Tail) of the VMA of the Virtual address Area respectively;
locking (Lock) the middle Page (Body Page) of the application APPMemail, where Lock refers to setting these pages as "read-only", ensuring that this part of data is completely valid during the subsequent process of upgrading, if the application APP subsequently "modifies" the content therein, the operating system OS will capture this behavior, try to reassign a new Page to it, if the assignment fails, the application APP will cause a memory-less failure handling flow, without affecting the upgrade data that the operating system OS has mapped
The middle Page (Body Page) of the application Memory is remapped (Remap) to the middle (Body) position of the VMA allocated by the operating system OS, so that when the Memory of the operating system OS is limited, the Memory of the application program APP can be used, and the situation is applicable to the situation that the application program APP needs a plurality of memories, the operating system OS only reserves a very limited Memory, the OS obtains accessible data consistent with the Memory allocated by the OS, and the subsequent upgrading action of the application program can be started.
In the above embodiment, the Memory and Storage of the system may be freely divided into the application program APP or the operating system OS, in some cases, even the APP may use all the Memory, the OS may use almost no Memory, or the Memory may be mostly divided into the video buffer, in the above special case, when the application program APP upgrades itself, the space for caching the upgrade package AppPackage may still be obtained by the above embodiment, so as to achieve the purpose of upgrading the APP.
In this embodiment, a device for caching an application program update is further provided, which is used to implement the foregoing embodiment and a preferred implementation, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware, are also possible and contemplated.
In one embodiment, there is further provided an application upgrade caching apparatus, and fig. 8 is a block diagram of an application upgrade caching apparatus according to an embodiment of the present invention, as shown in fig. 8, including:
an obtaining module 82, configured to parse meta information of an upgrade package of an application program by using an operating system, and obtain a transmission size of the upgrade package;
a judging module 84, configured to judge whether the memory or the external memory of the application program has enough buffer space to buffer the upgrade packet according to the transmission size of the upgrade packet;
the application module 86 is configured to apply for the memory or the external memory of the operating system to cache the upgrade package if the memory or the external memory of the application program does not have enough cache space to cache the upgrade package.
By the above device, the obtaining module 82 analyzes the meta information of the upgrade package of the application program through the operating system, and obtains the transmission size of the upgrade package; the judging module 84 judges whether the memory or the external memory of the application program has enough buffer space to buffer the upgrade package according to the transmission size of the upgrade package; the application module 86 applies for the memory or the external memory of the operating system to cache the upgrade package under the condition that the memory or the external memory of the application program does not have enough cache space to cache the upgrade package, thereby solving the problem that the upgrade package of the application program APP cannot be effectively cached, realizing dynamic coordination and release of part of resources among APP, OS, videoBuffer, memory, storage and other factors, and only releasing the minimum space, thereby meeting the requirement of caching the to-be-updated AppPackage.
In one embodiment, the application module 86 is further configured to determine, according to the transmission size of the upgrade package, whether the memory of the operating system has enough buffer space to buffer the upgrade package;
under the condition that the memory of the operating system has enough buffer space to buffer the upgrade package, mapping the memory of the operating system to the application program, and buffering the upgrade package into the mapped memory.
In one embodiment, the application module 86 is further configured to determine whether the video cache allocated by the operating system has enough cache space to cache the upgrade package if the memory of the operating system does not have enough cache space to cache the upgrade package after determining whether the memory of the operating system has enough cache space to cache the upgrade package;
and intercepting video cache released by the application program in a preset time period, and caching the upgrade package into the video cache under the condition that enough cache space is reserved in the video cache distributed by the operating system to cache the upgrade package.
In one embodiment, the application module 86 is further configured to determine, according to a transmission size of the upgrade package, whether the external memory of the operating system has enough buffer space to buffer the upgrade package if the memory of the operating system does not have enough buffer space to buffer the upgrade package;
under the condition that enough cache space exists outside the operating system to cache the upgrade package, pre-distributing a file matched with the upgrade package in size on the external memory, mounting the file into a file system in a file format, caching the upgrade package into the file under a directory accessible by the application program, and setting the access authority of the file to be used by the application program.
In an embodiment, there is further provided an application upgrade caching apparatus, and fig. 9 is a block diagram ii of an application upgrade caching apparatus according to an embodiment of the present invention, as shown in fig. 9, including:
the upgrade module 92 is configured to apply for a memory or an external memory of the operating system to cache the upgrade package, and then upgrade the operating system according to the upgrade package if the memory for caching the upgrade package is allocated by the operating system;
when the memory for caching the upgrade package is allocated by the application program, the operating system allocates a virtual address area VMA according to the size of the upgrade package, and copies a head page and a tail page of the memory of the application program to the head and the tail of the virtual address area VMA respectively;
the middle page of the application's memory is remapped to the middle of the virtual address area.
In one embodiment, a computer device is provided, which may be a server, and fig. 10 is a block diagram of the inside of a computer device according to an embodiment of the present invention, as shown in fig. 10. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing channel corresponding relation table data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a caching method for application upgrades.
According to another aspect of the present invention, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a caching method of an application upgrade.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples represent only a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. A method for caching an application upgrade, the method comprising:
the operating system analyzes the meta information of the upgrade package of the application program and obtains the transmission size of the upgrade package;
judging whether the memory or the external memory of the application program has enough cache space to cache the upgrade package according to the transmission size of the upgrade package;
under the condition that the memory or the external memory of the application program does not have enough cache space for caching the upgrade package, applying for the memory or the external memory of the operating system to cache the upgrade package;
after the judging whether the memory of the operating system has enough cache space to cache the upgrade package, the method comprises the following steps:
judging whether the video cache distributed by the operating system has enough cache space to cache the upgrade package or not under the condition that the memory of the operating system does not have enough cache space to cache the upgrade package;
and intercepting video caches released by an application program in a preset time period, and mapping the video caches into the memory of the application program under the condition that enough cache space is reserved in the video caches distributed by the operating system to cache the upgrade package, wherein the upgrade package is cached in the video caches.
2. The method of claim 1, wherein applying for the memory of the operating system to cache the upgrade package comprises:
judging whether the memory of the operating system has enough buffer space to buffer the upgrade package according to the transmission size of the upgrade package;
and under the condition that the memory of the operating system has enough cache space to cache the upgrade package, mapping the memory of the operating system to the application program, and caching the upgrade package into the mapped memory.
3. The method of claim 1, wherein applying for memory or external storage of the operating system to cache the upgrade package comprises:
judging whether the external memory of the operating system has enough buffer space to buffer the upgrade package according to the transmission size of the upgrade package under the condition that the memory of the operating system has insufficient buffer space to buffer the upgrade package;
under the condition that enough cache space exists outside the operating system to cache the upgrade package, pre-distributing files matched with the upgrade package in size on the external memory, mounting the files to a file system in a file format under a directory accessible by the application program, mapping the files into a memory of the application program, caching the upgrade package into the files, and setting the access authority of the files to be used by the application program.
4. The method of claim 1, wherein after the applying for the memory or the external memory of the operating system to cache the upgrade package, the method comprises:
under the condition that the memory for caching the upgrade package is allocated by the operating system, the operating system upgrades according to the upgrade package;
when the memory for caching the upgrade package is allocated by the application program, the operating system allocates a virtual address area VMA according to the size of the upgrade package, and copies a head page and a tail page of the memory of the application program to the head and the tail of the virtual address area VMA respectively;
and remapping an intermediate page of the memory of the application program to the middle part of the virtual address area.
5. A caching apparatus for application upgrades, the apparatus comprising:
the acquisition module is used for analyzing the meta information of the upgrade package of the application program by the operating system and acquiring the transmission size of the upgrade package;
the judging module is used for judging whether the memory or the external memory of the application program has enough cache space to cache the upgrade package according to the transmission size of the upgrade package;
the application module is used for applying the memory or the external memory of the operating system to cache the upgrade package under the condition that the memory or the external memory of the application program does not have enough cache space to cache the upgrade package;
the application module is further configured to determine whether a video buffer allocated by the operating system has enough buffer space to buffer the upgrade packet when the memory of the operating system does not have enough buffer space to buffer the upgrade packet after the determination is made as to whether the memory of the operating system has enough buffer space to buffer the upgrade packet;
and intercepting video caches released by an application program in a preset time period, and mapping the video caches into the memory of the application program under the condition that enough cache space is reserved in the video caches distributed by the operating system to cache the upgrade package, wherein the upgrade package is cached in the video caches.
6. The apparatus of claim 5, wherein the application module is further configured to determine, according to a transmission size of the upgrade package, whether a memory of the operating system has enough buffer space to buffer the upgrade package;
and under the condition that the memory of the operating system has enough cache space to cache the upgrade package, mapping the memory of the operating system to the application program, and caching the upgrade package into the mapped memory.
7. The apparatus of claim 5, wherein the application module is further configured to determine, according to a transmission size of the upgrade package, whether an external memory of the operating system has sufficient buffer space to buffer the upgrade package if a memory of the operating system does not have sufficient buffer space to buffer the upgrade package;
under the condition that enough cache space exists outside the operating system to cache the upgrade package, pre-distributing files matched with the upgrade package in size on the external memory, mounting the files to a file system in a file format under a directory accessible by the application program, mapping the files into a memory of the application program, caching the upgrade package into the files, and setting the access authority of the files to be used by the application program.
8. The apparatus of claim 5, wherein the apparatus further comprises:
the upgrade module is used for applying for the memory or the external memory of the operating system to cache the upgrade package, and then, the operating system upgrades according to the upgrade package under the condition that the memory for caching the upgrade package is allocated by the operating system;
when the memory for caching the upgrade package is allocated by the application program, the operating system allocates a virtual address area VMA according to the size of the upgrade package, and copies a head page and a tail page of the memory of the application program to the head and the tail of the virtual address area VMA respectively;
and remapping an intermediate page of the memory of the application program to the middle part of the virtual address area.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 4 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 4.
CN202010086619.4A 2020-02-11 2020-02-11 Caching method and device for application program upgrade, computer equipment and storage medium Active CN111352730B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010086619.4A CN111352730B (en) 2020-02-11 2020-02-11 Caching method and device for application program upgrade, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010086619.4A CN111352730B (en) 2020-02-11 2020-02-11 Caching method and device for application program upgrade, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111352730A CN111352730A (en) 2020-06-30
CN111352730B true CN111352730B (en) 2023-07-14

Family

ID=71195922

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010086619.4A Active CN111352730B (en) 2020-02-11 2020-02-11 Caching method and device for application program upgrade, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111352730B (en)

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101826027A (en) * 2010-05-28 2010-09-08 深圳市融创天下科技发展有限公司 Embedded system and updating method thereof
CN101930375A (en) * 2010-08-26 2010-12-29 深圳市共进电子有限公司 Self-adaptive program data updating method of memory space in single user optical network unit
CN102214113A (en) * 2011-06-08 2011-10-12 Tcl集团股份有限公司 Method, device and terminal for upgrading operating system
CN103777953A (en) * 2014-01-26 2014-05-07 宝龙计算机系统(湖南)有限公司 Method and device for manufacturing Unix-like operating system upgrade patch
CN106033364A (en) * 2015-03-19 2016-10-19 Tcl集团股份有限公司 Method and system for upgrading Web application programs
CN106708548A (en) * 2015-11-13 2017-05-24 阿里巴巴集团控股有限公司 Program upgrading method and terminal device
CN106970816A (en) * 2017-03-31 2017-07-21 广东欧珀移动通信有限公司 A kind of software upgrading processing method, device and audio-frequence player device
CN107025121A (en) * 2017-03-31 2017-08-08 广东欧珀移动通信有限公司 Method for upgrading software, device and electronic installation
CN107301056A (en) * 2017-07-27 2017-10-27 上海斐讯数据通信技术有限公司 A kind of AP online upgradings processing method and processing device
CN108845822A (en) * 2018-05-28 2018-11-20 烽火通信科技股份有限公司 Realize the EMS memory management process and system of the upgrading of software non-interrupting service
CN109347937A (en) * 2018-10-09 2019-02-15 深圳市亿联智能有限公司 A kind of intelligent remote upgrade method applied to video monitoring equipment
CN109992291A (en) * 2018-01-02 2019-07-09 中兴通讯股份有限公司 A kind of method for updating terminal software, device, system and storage medium
CN110058819A (en) * 2019-04-19 2019-07-26 深圳忆联信息系统有限公司 Host Command treating method and apparatus based on variable cache administrative mechanism
CN110221856A (en) * 2019-06-25 2019-09-10 努比亚技术有限公司 A kind of wearable device upgrade method, wearable device and storage medium
CN110337036A (en) * 2019-06-25 2019-10-15 深圳创维-Rgb电子有限公司 Upgrade method, device and the storage medium of set-top box
CN110704084A (en) * 2019-09-27 2020-01-17 深圳忆联信息系统有限公司 Method and device for dynamically allocating memory in firmware upgrade, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8495351B2 (en) * 2010-10-13 2013-07-23 International Business Machines Corporation Preparing and preserving a system configuration during a hot upgrade

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101826027A (en) * 2010-05-28 2010-09-08 深圳市融创天下科技发展有限公司 Embedded system and updating method thereof
CN101930375A (en) * 2010-08-26 2010-12-29 深圳市共进电子有限公司 Self-adaptive program data updating method of memory space in single user optical network unit
CN102214113A (en) * 2011-06-08 2011-10-12 Tcl集团股份有限公司 Method, device and terminal for upgrading operating system
CN103777953A (en) * 2014-01-26 2014-05-07 宝龙计算机系统(湖南)有限公司 Method and device for manufacturing Unix-like operating system upgrade patch
CN106033364A (en) * 2015-03-19 2016-10-19 Tcl集团股份有限公司 Method and system for upgrading Web application programs
CN106708548A (en) * 2015-11-13 2017-05-24 阿里巴巴集团控股有限公司 Program upgrading method and terminal device
CN106970816A (en) * 2017-03-31 2017-07-21 广东欧珀移动通信有限公司 A kind of software upgrading processing method, device and audio-frequence player device
CN107025121A (en) * 2017-03-31 2017-08-08 广东欧珀移动通信有限公司 Method for upgrading software, device and electronic installation
CN107301056A (en) * 2017-07-27 2017-10-27 上海斐讯数据通信技术有限公司 A kind of AP online upgradings processing method and processing device
CN109992291A (en) * 2018-01-02 2019-07-09 中兴通讯股份有限公司 A kind of method for updating terminal software, device, system and storage medium
CN108845822A (en) * 2018-05-28 2018-11-20 烽火通信科技股份有限公司 Realize the EMS memory management process and system of the upgrading of software non-interrupting service
CN109347937A (en) * 2018-10-09 2019-02-15 深圳市亿联智能有限公司 A kind of intelligent remote upgrade method applied to video monitoring equipment
CN110058819A (en) * 2019-04-19 2019-07-26 深圳忆联信息系统有限公司 Host Command treating method and apparatus based on variable cache administrative mechanism
CN110221856A (en) * 2019-06-25 2019-09-10 努比亚技术有限公司 A kind of wearable device upgrade method, wearable device and storage medium
CN110337036A (en) * 2019-06-25 2019-10-15 深圳创维-Rgb电子有限公司 Upgrade method, device and the storage medium of set-top box
CN110704084A (en) * 2019-09-27 2020-01-17 深圳忆联信息系统有限公司 Method and device for dynamically allocating memory in firmware upgrade, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111352730A (en) 2020-06-30

Similar Documents

Publication Publication Date Title
CN110297603B (en) Method and device for improving random writing performance based on solid state disk and computer equipment
CN108959119B (en) Method and system for garbage collection in storage system
KR20170010810A (en) Method, device and user equipment for reading/writing data in nand flash
KR20140146458A (en) Method for managing memory and apparatus thereof
CN113360077B (en) Data storage method, computing node and storage system
US12045513B2 (en) Memory system and method of controlling nonvolatile memory with checking a total size indicative of a sum of data length specified by a write command
CN112698789A (en) Data caching method, device, equipment and storage medium
CN111352730B (en) Caching method and device for application program upgrade, computer equipment and storage medium
US20240241644A1 (en) Storage device and storage system
US10067843B1 (en) Synchronizing control nodes and a recovery from a failure of a primary control node of a storage system
US11726681B2 (en) Method and system for converting electronic flash storage device to byte-addressable nonvolatile memory module
CN113704027B (en) File aggregation compatible method and device, computer equipment and storage medium
KR101744685B1 (en) Protection method and apparatus for metadata of file
CN114168225B (en) Method, device, computer equipment and storage medium for updating solid state disk mapping table in delayed mode
EP2270693A1 (en) Method for accessing a storage system with multiple file systems
CN115470155A (en) L2P table caching method and device supporting solid state disk multi-scene multiplexing
US10698626B2 (en) Method of managing integrated circuit cards, corresponding card and apparatus
CN115202892A (en) Memory expansion system and memory expansion method of cryptographic coprocessor
CN113157738A (en) In-pile data cache synchronization method and device, computer equipment and storage medium
KR102477775B1 (en) Garbage collection device having subunit and memory system having the same
CN112732316A (en) Firmware upgrading method and system of door lock module, computer and storage medium
CN113448517B (en) Solid state disk big data writing processing method, device, equipment and medium
CN111294786B (en) Card writing protection method and device for mobile terminal, mobile terminal and storage medium
CN115576865A (en) Method and device for realizing data zero copy, computer equipment and storage medium
CN113760195A (en) Embedded FATFS file system

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