A hot updating method and device and electronic equipment

By leveraging the independent memory caching of different processes during application updates, the problem of data errors caused by write operation conflicts was resolved, enabling hot updates and online services for the application.

CN115080097BActive Publication Date: 2026-02-03BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110271502.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-12
Publication Date
2026-02-03
Estimated Expiration
2041-03-12

AI Technical Summary

Technical Problem

During application updates, when new and old processes coexist, write operation conflicts can lead to data errors, causing service interruptions and preventing the normal provision of business logic.

Method used

By starting a second process that reuses the same disk as the first process, synchronizing metadata and writing data to the memory cache, write operation conflicts are avoided, ensuring that the processes can perform write operations during coexistence.

Benefits of technology

It enables hot updates of the application, avoids data errors, ensures that the service remains online during the update process, and provides business logic that depends on write operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115080097B_ABST
    Figure CN115080097B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a hot updating method, device and electronic equipment. The method comprises: starting a second process, the second process executing a preset program of a different version from a first process that has been running, the first process and the second process sharing the same disk; synchronizing metadata of the first process to the second process, so that the second process recovers a cache according to the metadata; assigning a request corresponding to the preset program received after the second process recovers the cache to the second process for processing; until exiting the first process, when any one of the first process and the second process performs a write operation, controlling the any one to write data required by the write operation into a memory cache corresponding to the any one; and exiting the first process, the first process and the second process corresponding to different memory caches respectively. The hot updating of an application program can be implemented.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of cloud storage, and in particular to a hot updating method and device and electronic equipment. BACKGROUND

[0002] An electronic device can execute a specified application program through a process, thereby providing a function corresponding to the application program. For example, a node device in a cloud storage system can execute an application program for source return through a process, thereby providing a source return service.

[0003] For actual needs, the application program executed by the process may need to be updated, such as application program upgrading, rollback, and the like. In the related art, a new process for executing the updated application program can be started, and the metadata of the old process for executing the application program is exported to the new process, and the old process is exited after the new process recovers the cache according to the metadata.

[0004] There are two processes, the new process and the old process, between starting the new process and exiting the old process, and the new process and the old process will share the disk in the electronic device, so as to avoid data errors caused by write operation conflicts between the new process and the old process. In the related art, the new process and the old process are not allowed to perform write operations before the old process is exited.

[0005] However, the implementation of some business logic depends on write operations, so the new process and the old process cannot implement these business logics during the coexistence of the new process and the old process, that is, the new process and the old process cannot normally provide services during this period, resulting in service interruption. SUMMARY

[0006] The purpose of the embodiments of the present application is to provide a hot updating method to implement hot updating of an application program. The specific technical solutions are as follows.

[0007] In a first aspect of the embodiments of the present application, a hot updating method is provided, and the method comprises:

[0008] starting a second process, the second process executing a preset program of a different version from a first process that has been running, and the first process and the second process sharing the same disk;

[0009] synchronizing metadata of the first process to the second process, so that the second process recovers the cache according to the metadata;

[0010] allocating a request corresponding to the preset program received after the second process recovers the cache to the second process for processing;

[0011] When either the first process or the second process performs a write operation, the process is controlled to write the data required for the write operation into the memory cache corresponding to the process until the first process exits. The first process and the second process correspond to different memory caches.

[0012] In one possible embodiment, after exiting the first process, the method further includes:

[0013] When the second process performs a write operation, it controls the second process to write the data required for the write operation to the disk or the memory cache corresponding to the second process.

[0014] In one possible embodiment, exiting the first process includes:

[0015] The first process exits after a preset time after the second process restores the cache.

[0016] In one possible embodiment, the method further includes:

[0017] When either the first process or the second process performs a deletion operation on the disk data managed by the first process, the first process is controlled to delete the data targeted by the deletion operation until it exits the first process.

[0018] In one possible embodiment, the method further includes:

[0019] When the memory cache occupancy rate of either the first process or the second process reaches a preset threshold, the data stored in the memory cache corresponding to that process is deleted according to a preset deletion strategy.

[0020] In one possible embodiment, deleting the data stored in the memory cache corresponding to any process according to a preset deletion strategy includes:

[0021] Delete the least accessed data in the memory cache corresponding to any of the processes.

[0022] In a second aspect of the present invention, a hot-renewal apparatus is provided, the apparatus comprising:

[0023] The startup module is used to start a second process, which executes a different version of a preset program than the already running first process. The first and second processes share the same disk.

[0024] A synchronization module is used to synchronize the metadata of the first process to the second process, so that the second process can restore the cache based on the metadata;

[0025] The service management module is used to allocate requests corresponding to the preset program received by the second process after the second process restores the cache to the second process for processing;

[0026] The write module is used to control the write operation to write the data required by the write operation to the memory cache of the corresponding process when either the first process or the second process performs a write operation, until the first process exits.

[0027] In one possible embodiment, the write module is further configured to, after the first process exits, when the second process performs a write operation, control the second process to write the data required for the write operation to the disk or the memory cache corresponding to the second process.

[0028] In one possible embodiment, the device further includes an exit module for exiting the first process after a preset time period following the second process restoring the cache.

[0029] In one possible embodiment, the device further includes a deletion module, configured to control the first process to delete the data targeted by the deletion operation when either the first process or the second process performs a deletion operation on disk data managed by the first process, until the first process exits.

[0030] In one possible embodiment, the device further includes a memory release module, which is used to delete the data stored in the memory cache corresponding to any one of the first process and the second process according to a preset deletion strategy when the memory cache occupancy rate of either process reaches a preset threshold.

[0031] In one possible embodiment, the memory release module is specifically used to delete the least accessed data in the memory cache corresponding to any of the processes.

[0032] In a third aspect of the present invention, an electronic device is provided, comprising:

[0033] A computer-readable storage medium for storing computer programs;

[0034] A processor, when executing a program stored on the computer-readable storage medium, implements the steps of any of the methods described in the first aspect above.

[0035] In a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when executed by a processor, the computer program implements the steps of any of the methods described in the first aspect above.

[0036] Beneficial effects of the embodiments of the present invention:

[0037] The hot update method, apparatus, and electronic device provided in this invention can utilize the characteristic that different processes each have independent memory caches to write the data to be written into the memory cache, avoiding data errors caused by the first process and the second process performing write operations at the same time. At the same time, since both the first process and the second process can perform write operations, business logic that depends on write operations can be implemented. That is, the first process and the second process can still provide services during coexistence. Therefore, keeping the device online during the application update process can realize the hot update of the application.

[0038] Of course, implementing any product or method of the present invention does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.

[0040] Figure 1 A schematic flowchart of a hot update method provided in an embodiment of the present invention;

[0041] Figure 2 This is another schematic flowchart of the hot update method provided in an embodiment of the present invention;

[0042] Figure 3 This is a schematic diagram of a thermal renewal device provided in an embodiment of the present invention;

[0043] Figure 4 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0044] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0045] To more clearly illustrate the hot update method provided in the embodiments of the present invention, a possible application scenario of the hot update method provided in the embodiments of the present invention will be described below by way of example. It is understood that the following example is only one possible application scenario of the hot update method provided in the embodiments of the present invention. In other possible embodiments, the hot update method provided in the embodiments of the present invention can also be applied to other possible application scenarios, and the following example does not limit this in any way.

[0046] In a cloud storage system, node devices can process received origin pull requests through a process that executes an application used for origin pull, thereby providing origin pull services. If it is necessary to upgrade this application for origin pull due to practical needs, a new process can be started on the node device, and the upgraded application can be run using this new process. For ease of description, the process on the node device used to run the application before the upgrade will be referred to as the old process below.

[0047] The old process sends the data structure containing application-related data stored on disk as metadata to the new process, enabling the new process to identify the application-related data on disk and restore the cache. After the new process restores the cache, it can provide the corresponding services, at which point the old process can exit.

[0048] During the period between the start of a new process and the exit of an old process (hereinafter referred to as the coexistence period), both the new process and the old process exist simultaneously on the node device. Therefore, the new process and the old process will reuse the node device's disk during the coexistence period. If write operations are allowed for both the new process and the old process, data errors may occur. For example, suppose the old process writes data 1 to a specified location on the disk, and the new process writes data 2 to the same specified location on the disk. This would cause data 1 to be overwritten by data 2, and when the old process reads data 1, it will incorrectly read data 2.

[0049] Therefore, write operations can be prohibited for both new and old processes. However, some business logic implemented by the new and old processes when providing services depends on write operations. Therefore, if write operations are prohibited for the new and old processes, they will be unable to provide services normally during coexistence. Therefore, node devices should be prevented from receiving new origin requests during coexistence, i.e., the node devices should be taken offline.

[0050] On the one hand, when a node device goes offline, the data cached on that node device cannot be used for origin server requests, causing an increase in the origin server request rate during the period the node device is offline. For example, suppose the upper-layer nodes of an edge node include three node devices, denoted as node devices 1-3. Assume node device 1 caches resource 1, node device 2 caches resource 2, and node device 3 caches resource 3. If a user device sends an origin server request for resource 1, the edge node can forward the request to its upper-layer node. Since node device 1 caches resource 1, no further origin server request is needed. However, if node device 1 goes offline, since node devices 2 and 3 do not have resource 1 in their caches, further origin server requests are required.

[0051] On the other hand, the total number of node devices in a node is often limited. Therefore, if a node device goes offline, the back-to-source load that was originally borne by that node device will be borne by the other active node devices in that node. For example, suppose a node includes 20 node devices, and each node device can bear a maximum back-to-source load of 1.2 units. If the total back-to-source load of the node is 20 units, when all node devices are online, each node device can bear 1 unit of back-to-source load, and there is no device overload. However, if 4 node devices go offline, each node device will need to bear an average of 1.25 units of back-to-source load, thus causing node device overload.

[0052] Based on this, embodiments of the present invention provide a hot update method, which can be found in [reference needed]. Figure 1 , Figure 1 The diagram shown is a flowchart of a hot update method provided by an embodiment of the present invention, which may include:

[0053] S101, start the second process.

[0054] S102, synchronize the metadata of the first process to the second process so that the second process can restore the cache based on the metadata.

[0055] S103, after the second process restores the cache, the request corresponding to the preset program will be assigned to the second process for processing.

[0056] S104: When either the first process or the second process performs a write operation, control that process to write the data required for the write operation to the memory cache corresponding to that process, until the first process exits.

[0057] By using this embodiment, the characteristic that different processes have independent memory caches can be utilized to write the data to be written into the memory cache, avoiding data errors caused by the first process and the second process performing write operations at the same time. At the same time, since both the first process and the second process can perform write operations, business logic that depends on write operations can be implemented. That is, the first process and the second process can still provide services during coexistence. Therefore, keeping the device online during application updates can achieve hot updates of the application.

[0058] In step S101, the second process executes a different version of the preset program than the already running first process, and the first and second processes share the same disk. In this embodiment, either the first process executes an older version of the preset program and the second process executes a newer version of the preset program, or the first process executes a newer version of the preset program and the second process executes an older version of the preset program.

[0059] In this article, the preset programs can be programs that provide different services depending on the application scenario. For example, they can be applications that provide origin server services. The program version indicates the degree of modification to the program. Preset programs with the same version are theoretically based on the same programming language, while preset programs with different versions are based on different programming languages.

[0060] In S102, metadata is used to represent the data format of the data stored on the disk corresponding to the preset program. The first process can synchronize the metadata to the second process through any inter-process communication method, such as pipes, sockets, files, etc.

[0061] The method for restoring the cache in the second process is not a major improvement of this invention, so it will not be elaborated here.

[0062] In S103, after the second process restores the cache, the port listening function of the first process can be disabled, so that the first process no longer listens on the port used to receive requests corresponding to the preset program. Then, the port listening function of the second process can be enabled, so that the second process starts listening on the port used to receive requests corresponding to the preset program. When the interface receives a request corresponding to the preset program, the second process obtains the request and processes it.

[0063] For requests corresponding to preset programs received before the second process restores the cache, they are assigned to the first process for processing. A request corresponding to a preset program refers to a request that the preset program is configured to handle. For example, if the preset program is a program used to provide origin server services, then the corresponding request is an origin server request.

[0064] In S104, it can be understood that different processes have their own corresponding memory caches, that is, the first process and the second process correspond to different memory caches. Therefore, the first process and the second process will not cause data errors by writing the data required for the write operation into their respective corresponding memory caches.

[0065] Since two processes performing read operations simultaneously will not cause data errors, in this embodiment of the invention, the first process and the second process can perform read operations on the data in the disk. However, before exiting the first process, the first process and the second process will not perform write operations on the disk. That is, the first process and the second process will not write data to the disk, so data errors will not occur.

[0066] The timing for exiting the first process can vary depending on the application scenario. Understandably, since requests for pre-defined programs received before the second process restores its cache are assigned to the first process for processing, and processing these requests takes time, if there are still unprocessed requests assigned to the first process when exiting, the first process can exit after all assigned requests have been processed.

[0067] For example, the first process could exit after a preset time period following the second process's cache recovery. It's understood that since requests corresponding to preset programs received after the second process recovers its cache will be assigned to the second process for processing, theoretically, the first process will not be assigned any new requests after the second process recovers its cache. Therefore, within the preset time period following the second process's cache recovery, the first process can theoretically complete processing the requests already assigned to it. The preset time period can be set based on actual needs or user experience; for example, it could be set to 1 minute.

[0068] The longer the preset duration is set, the less likely the request will not be processed. The shorter the preset duration is set, the sooner the first process will exit, thus releasing the system resources occupied by the first process and improving the utilization of system resources.

[0069] After exiting the first process, embodiments of the present invention can also be as follows: Figure 2 As shown, it includes the following steps:

[0070] S105, when the second process performs a write operation, control the second process to write the data required for the write operation to the disk or the memory cache corresponding to the second process.

[0071] Understandably, the coexistence period ends after the first process exits. At this point, even if the second process writes data to the disk, it will not cause data errors, and the second process can continue to write data to its corresponding memory cache.

[0072] The criterion for determining whether the second process writes data to disk or its corresponding memory cache can be set according to actual needs. For example, it could be based on the remaining space in the second process's memory cache. When the remaining space is greater than a preset capacity, the second process writes the data to the memory cache; when the remaining space is less than the preset capacity, the second process writes the data to disk. Alternatively, it could be based on the size of the data to be written in the write operation. When the size of the data to be written in the write operation is greater than a preset data size threshold, the second process writes the data to disk; when the size of the data to be written in the write operation is less than the preset data size threshold, the second process writes the data to its corresponding memory cache.

[0073] In this embodiment, since the two processes will not cause write errors due to data deletion on the disk, the deletion operation can be controlled to delete the data targeted by the deletion operation when either the first process or the second process performs a deletion operation on the disk data managed by that process until the first process exits.

[0074] Before exiting the first process, the first and second processes can perform write, read, and delete operations on their respective memory caches. However, the first and second processes cannot perform write operations on the disk, but they can perform read and delete operations on the disk.

[0075] Understandably, the memory cache space corresponding to a process is often smaller than the hard drive's storage space. Therefore, for either the first or second process, as write operations proceed, the memory cache corresponding to that process may become full. At this point, it will be impossible to continue writing new data, i.e., write operations cannot continue, causing either process to be unable to provide normal service.

[0076] Based on this, in one possible embodiment, when the memory cache occupancy rate of either the first process or the second process reaches a preset threshold, the data stored in the memory cache corresponding to that process is deleted according to a preset deletion strategy.

[0077] The utilization rate can refer to the ratio of the amount of data stored in the memory cache to the maximum amount of data that the memory cache corresponding to any process can store. The preset threshold can be set according to actual needs, such as 100%, 95%, 90%, etc.

[0078] The preset deletion strategy can vary depending on the application scenario. For example, in one possible embodiment, it could be deleting the earliest written data in the memory cache; in another possible embodiment, it could be deleting the least accessed data in the memory cache corresponding to any process. It is understood that the longer data has not been accessed, the lower the likelihood that any process will use that data when providing services later. Therefore, deleting the least accessed data can reduce the possibility that any process will be unable to provide services normally due to data deletion, thus improving the stability of the process's service provision.

[0079] See Figure 3 , Figure 3 The diagram shown is a structural schematic of a hot-renewal device provided in an embodiment of the present invention, which may include:

[0080] The startup module 301 is used to start a second process, which executes a different version of a preset program than the already running first process. The first process and the second process share the same disk.

[0081] Synchronization module 302 is used to synchronize the metadata of the first process to the second process, so that the second process can restore the cache according to the metadata;

[0082] Service management module 303 is used to allocate the requests corresponding to the preset program received by the second process after the second process restores the cache to the second process for processing;

[0083] The write module 304 is used to control the write module to write the data required for the write operation to the memory cache of the write module when either the first process or the second process performs a write operation, until the first process exits.

[0084] In one possible embodiment, the write module 304 is further configured to, after the first process exits, when the second process performs a write operation, control the second process to write the data required for the write operation to the disk or the memory cache corresponding to the second process.

[0085] In one possible embodiment, the device further includes an exit module for exiting the first process after a preset time period following the second process restoring the cache.

[0086] In one possible embodiment, the device further includes a deletion module for controlling the first process to delete the data targeted by the deletion operation when either the first process or the second process performs a deletion operation on disk data managed by the first process until the first process exits.

[0087] In one possible embodiment, the device further includes a memory release module, which is used to delete the data stored in the memory cache corresponding to any one of the first process and the second process according to a preset deletion strategy when the memory cache occupancy rate of either process reaches a preset threshold.

[0088] In one possible embodiment, the memory release module is specifically used to delete the least accessed data in the memory cache corresponding to any of the processes.

[0089] This invention also provides an electronic device, such as... Figure 4 As shown, it includes:

[0090] Machine-readable storage medium 401 is used to store computer programs;

[0091] When the processor 402 executes the program stored on the machine-readable storage medium 401, it performs the following steps:

[0092] Start a second process. The second process executes a different version of the preset program than the already running first process. The first process and the second process share the same disk.

[0093] The metadata of the first process is synchronized to the second process so that the second process can restore the cache based on the metadata;

[0094] The request corresponding to the preset program received after the second process restores the cache will be assigned to the second process for processing;

[0095] Until the first process exits, when either the first process or the second process performs a write operation, control the process to write the data required for the write operation into the memory cache corresponding to the process.

[0096] Exit the first process.

[0097] In one possible embodiment, after exiting the first process, the method further includes:

[0098] When the second process performs a write operation, it controls the second process to write the data required for the write operation to the disk or the memory cache corresponding to the second process.

[0099] In one possible embodiment, exiting the first process includes:

[0100] The first process exits after a preset time after the second process restores the cache.

[0101] In one possible embodiment, the method further includes:

[0102] Until the first process exits, when either the first process or the second process performs a deletion operation on the disk data managed by that process, the process is controlled to delete the data targeted by the deletion operation.

[0103] The aforementioned electronic device mentions that the machine-readable storage medium may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0104] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0105] In another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the steps of any of the above-described hot update methods.

[0106] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the hot update methods described above.

[0107] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0108] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0109] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, embodiments of devices, electronic devices, computer-readable storage media, and computer program products are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0110] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.

Claims

1. A hot update method, characterized in that, The method includes: Start a second process. The second process executes a different version of the preset program than the already running first process. The first process and the second process share the same disk. The metadata of the first process is synchronized to the second process so that the second process can restore the cache based on the metadata; the metadata is used to represent the data format of the data stored on the disk corresponding to the preset program; The request corresponding to the preset program received after the second process restores the cache will be assigned to the second process for processing; When either the first process or the second process performs a write operation, the process is controlled to write the data required for the write operation into its corresponding memory cache until it exits the first process. The first process and the second process each correspond to different memory caches. Before exiting the first process, the first process and the second process can perform write, read, and delete operations on their respective memory caches, as well as read and delete operations on the disk, but cannot perform write operations on the disk. When the memory cache occupancy rate of either the first process or the second process reaches a preset threshold, the data stored in the memory cache corresponding to that process is deleted according to a preset deletion strategy. After the first process exits, when the second process performs a write operation, it controls the second process to write the data required for the write operation to the disk.

2. The method according to claim 1, characterized in that, The step of exiting the first process includes: The first process exits after a preset time after the second process restores the cache.

3. The method according to claim 1, characterized in that, The method further includes: When either the first process or the second process performs a deletion operation on the disk data managed by the first process, the first process is controlled to delete the data targeted by the deletion operation until it exits the first process.

4. The method according to claim 1, characterized in that, Deleting the data stored in the memory cache corresponding to any process according to a preset deletion strategy includes: Delete the least accessed data in the memory cache corresponding to any of the processes.

5. A thermal renewal device, characterized in that, The device includes: The startup module is used to start a second process, which executes a different version of a preset program than the already running first process. The first and second processes share the same disk. A synchronization module is used to synchronize the metadata of the first process to the second process, so that the second process can restore the cache according to the metadata; the metadata is used to represent the data format of the data stored on the disk corresponding to the preset program; The service management module is used to allocate requests corresponding to the preset program received by the second process after the second process restores the cache to the second process for processing; The write module is used to control the first process and the second process to write the data required for the write operation to the memory cache of the first process when either the first process or the second process performs a write operation, until the first process exits; wherein, before exiting the first process, the first process and the second process can perform write operations, read operations, and delete operations on their respective memory caches, as well as read operations and delete operations on the disk, but cannot perform write operations on the disk; The memory release module is used to delete the data stored in the memory cache corresponding to any of the first and second processes according to a preset deletion strategy when the memory cache occupancy rate of either process reaches a preset threshold. The write module is further configured to, after the first process exits, when the second process performs a write operation, control the second process to write the data required for the write operation to the disk.

6. An electronic device, characterized in that, include: A computer-readable storage medium for storing computer programs; A processor, when executing a program stored on the computer-readable storage medium, implements the steps of the method according to any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-4.

Citation Information

Patent Citations

  • Application program running method and device

    CN108334404A

  • Network upgrading method, device and equipment and medium

    CN109921929A

  • Caching method and device, electronic equipment and computer readable storage medium

    CN112035529A