Program object caching method and device, equipment and medium

By reading and saving the information collection of cached objects when the program is started and closed, the automatic reuse of cached objects is solved, and the difficulties in preloading strategy maintenance and performance degradation in complex business scenarios are solved, reducing labor costs and computing consumption.

CN119311608APending Publication Date: 2025-01-14FACE CUTE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310847649.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-11
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

The prior art can easily lead to excessive or incorrect preloading of program objects in complex business scenarios, resulting in performance degradation, and requires a lot of manpower to maintain the preloading strategy, increasing computing consumption and labor costs.

Method used

When the target program is started, the information set of cache objects is read from the storage device, and the cache objects are preloaded to the cache pool according to the information set, and the information set is saved to the storage device when it is closed, so as to realize the automatic multiplexing of cache objects. Reduce manual maintenance and calculation consumption.

Benefits of technology

By automatically reusing cache objects, overload or misloading problems are avoided, program performance is improved, and labor costs for maintaining preload strategies are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311608A_ABST
    Figure CN119311608A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a program object caching method and device, equipment and a medium. A specific embodiment of the method comprises the following steps: in response to starting of a target program, reading an information set of a cache object from a storage device, and pre-loading the cache object to a cache pool of the target program according to the information set; and in response to closing of the target program, storing the information set of the cache object in the cache pool into a storage device. Through the method, the preloading object does not need to be re-determined according to a manually maintained preloading strategy when the program is started each time, so that the calculation consumption is reduced, and the problem that the program performance is reduced due to over-loading or wrong loading of the cache object is prevented. In addition, the labor cost for maintaining the preloading strategy is also reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the technical field of data caching, and in particular to a method, apparatus, device and medium for caching a program object. Background Art

[0002] Software programs, especially complex software programs, often call a large number of program objects during operation, and the process consumes a lot of time resources. At present, in order to reduce the time consumed in calling objects, preloading solutions and cache pool solutions for program objects can be used to reduce the time consumed in the first and non-first calls of program objects. However, in some scenarios, the use of cache pool technology and preloading technology still has the following problems: On the one hand, in complex business scenarios, the program is prone to excessive preloading or incorrect preloading into the cache, resulting in performance degradation. On the other hand, as the business content changes, a lot of manpower is required to maintain the preloading strategy. Summary of the invention

[0003] The embodiments of the present disclosure describe a method, apparatus, device and medium for caching program objects.

[0004] According to a first aspect, a method for caching a program object is provided, comprising:

[0005] In response to the start of the target program, reading an information set of a cache object from a storage device, and preloading the cache object into a cache pool of the target program according to the information set;

[0006] In response to closing the target program, the information set of cache objects in the cache pool is saved to the storage device.

[0007] According to a second aspect, a caching device for a program object is provided, comprising:

[0008] A program startup unit is configured to read an information set of a cache object from a storage device, and preload the cache object into a cache pool of the target program according to the information set;

[0009] The program closing unit is configured to save the information set of cache objects in the cache pool to the storage device in response to the closing of the target program.

[0010] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method described in the first aspect.

[0011] According to a fourth aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method described in the first aspect is implemented.

[0012] According to an embodiment of the present disclosure, a method, apparatus, device and medium for caching a program object are provided. First, in response to the startup of a target program, an information set of a cache object can be read from a storage device, and the cache object can be preloaded into a cache pool of the target program according to the information set. Then, in response to the closing of the target program, the information set of the cache object in the cache pool is saved to the storage device. By utilizing any one of the above methods, apparatuses, storage media and electronic devices, it is not necessary to redetermine the preloaded objects according to a manually maintained preloading strategy each time the program is started, thereby reducing computing consumption and preventing the problem of program performance degradation due to overloading or misloading of cache objects. In addition, the manpower cost for maintaining the preloading strategy is also reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 A schematic diagram showing a method for caching a program object according to an embodiment of the present disclosure is shown;

[0014] Figure 2 A schematic diagram showing a cross-program lifecycle storage object according to an embodiment of the present disclosure is shown;

[0015] Figure 3 A schematic diagram showing a flow chart of a method for caching a program object according to an embodiment of the present disclosure;

[0016] Figure 4 A schematic diagram showing an information set of a cache object according to an embodiment of the present disclosure is shown;

[0017] Figure 5 A schematic diagram showing a method for caching a program object according to another embodiment of the present disclosure is shown;

[0018] Figure 6 A schematic block diagram of a program object cache device according to an embodiment of the present disclosure is shown;

[0019] Figure 7 A schematic diagram of the structure of an electronic device suitable for implementing an embodiment of the present disclosure is shown;

[0020] Figure 8 A schematic diagram of the structure of a storage medium suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0021] The technical solution provided in this specification is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant inventions, rather than to limit the inventions. It should also be noted that, for ease of description, only the parts related to the relevant inventions are shown in the accompanying drawings. It should be noted that, in the absence of conflict, the embodiments of the present disclosure and the features in the embodiments can be combined with each other.

[0022] In the description of the implementations of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one / kind of implementation" or "the implementation" should be understood as "at least one / kind of implementation". The term "some implementations" should be understood as "at least some implementations". Other explicit and implicit definitions may also be included below.

[0023] As mentioned above, software programs, especially complex software programs, often call a large number of program objects (Object, or simply objects) during operation, which consumes a lot of time resources. In order to reduce the time consumption of calling objects, preloading solutions and cache pool solutions for program objects are often used to reduce the time consumption of program objects when they are called for the first time and non-first time. Specifically, for example, a cache pool solution may include: saving the object created for the first time during program operation to a cache pool (Cache Pool), so that when the cached program object is called again, the object cached in the cache pool can be directly called, reducing the time consumption of creating the object again, thereby improving the performance of program operation. Using only the cache pool solution can only reduce the time consumption when the object is not called for the first time, but cannot reduce the time consumption when the object is not called for the first time. In order to reduce the time consumption when the object is not called for the first time, a preloading solution includes: when the program starts, the program object is preloaded, so that when the program object is actually called, the preloaded program object can be directly called, reducing the time consumption when the program object is called for the first time.

[0024] However, the existing preloading solutions and cache pool solutions still have the following problems: On the one hand, since each program startup needs to determine the preloading object based on the preloading strategy, and the time resources available for preloading at program startup are usually limited, if too many objects are preloaded, or rarely used objects are loaded into the cache pool, it may lead to a decrease in program performance or a waste of cache resources. On the other hand, according to the existing preloading solutions, it is usually necessary to manually set and maintain the preloading strategy for determining which objects can be preloaded, and the engineers who set and maintain the preloading objects often need to obtain, for example, business status iteration information or user habit information from different business teams to determine how to set and update the preloading strategy. In complex business scenarios with rapid iterations, these tasks require a lot of manpower costs.

[0025] In order to solve the above technical problems, an embodiment of the present disclosure provides a method for caching program objects. Figure 1 A schematic diagram of a method for caching a program object according to an embodiment of the present disclosure is shown. Figure 1 As shown, when the target program is started, the information set of its cache objects can be read from the storage device, and the cache objects can be preloaded into the cache pool of the target program according to the information set. In addition, when the target program is closed, the information set of the cache objects in the cache pool can be saved to the storage device. This method has the following advantages: on the one hand, by saving the information set of the cache objects of the target program to the storage device, and reloading the cache objects by reading the information set of the cache objects from the storage device, the cache objects can be automatically reused in different life cycles of the target program, that is, when the target program is started multiple times, one of the starts can essentially reuse the cache objects when the program was closed the last time. There is no need to redetermine which objects to preload according to the manually maintained preloading strategy each time the program is started, thereby reducing computing consumption. Figure 2 FIG. 2 shows a schematic diagram of storing objects across program lifecycles according to an embodiment of the present disclosure. Figure 2As shown, for example, in the i-th startup of multiple program startups, the cache object when the previous program (n-1th time) was closed can be reused by directly reading the information set of the cache object (or simply the cache set) from the storage device. When the program is closed after this startup, the current cache object can be converted into a corresponding information set and saved to the storage device for reuse when the program is started next time (for example, the n+1th time). On the second aspect, the cache object is automatically reused in different life cycles of the target program. In essence, the next cache load object is determined based on the actual running status of the program last time. It has high accuracy and can prevent the problem of excessive loading of cache objects or loading of wrong cache objects (invalid cache objects), which leads to a decrease in program performance. On the third aspect, the use of this method greatly reduces the dependence of the preloading strategy on manual maintenance and reduces the manpower cost for maintaining the preloading strategy.

[0026] The detailed process of this method is further described below.

[0027] Figure 3 FIG. 1 is a flow chart showing a method for caching a program object according to an embodiment of the present disclosure. Figure 3 As shown, the method comprises at least the following steps:

[0028] Step S301, in response to the start of the target program, reading the information set of the cache object from the storage device, and preloading the cache object into the cache pool of the target program according to the information set;

[0029] Step S303, in response to the closing of the target program, the information set of the cache objects in the cache pool is saved to the storage device.

[0030] First, in step S301, in response to the start of the target program, the information set of the cache object is read from the storage device, and the cache object is preloaded into the cache pool of the target program according to the information set. In this step, the information set of the cache object can be read from the storage device when the target program is started, and the cache object can be preloaded into the cache pool of the target program according to the information set. In different embodiments, the target program can be a different software (Software) product or application, or a program for different specific purposes or businesses, and this specification does not limit this. In different embodiments, the storage device can also be a storage device of different specific types. In one embodiment, the storage device can be a persistent storage device, such as a disk or a flash memory. In different embodiments, the specific method of reading the information set of the cache object from the storage device can also be different. In one embodiment, for example, the information set of the cache object can be read from a storage file stored in the storage device. In another embodiment, for example, the information set of the cache object can also be read from the storage device by accessing a database.

[0031] Figure 4 FIG. 1 is a schematic diagram showing an information set of a cache object according to an embodiment of the present disclosure. Figure 4 As shown, in one embodiment, the information set of the cache object may include the object information and cache weight of the cache object (information set 1). Among them, the cache weight can be used to indicate the importance of the cache object. In different embodiments, the cache weight can be determined according to different weight parameters. Specifically, the weight parameters may include one or more of the number of calls, call order, and construction resource consumption of the cache object. During the operation after the program is started, its weight parameters can be updated as the cache object is called. Therefore, in one embodiment, during the operation after the target program is started, the cache weight of the cache object can be updated according to the call of the cache object in the cache pool; according to the cache weight of the cache object, it is determined whether to retain or remove the cache object from the cache pool. In the above manner, when the program is running, cache objects with high importance can be retained in the cache pool, thereby improving the cache hit rate and improving the program running performance.

[0032] In different embodiments, the object information of the cache object may be different. In one embodiment, the object information may include serialization information of the cache object, such as Figure 4 As shown in the information set 2 in . Furthermore, the serialization information of the cache object can be read from the storage device, and the cache object can be preloaded into the cache pool of the target program by deserializing the serialization information. Serialization is the process of converting the state information of an object into a form that can be stored or transmitted, that is, into the serialization information of the object. By serializing the cache object, the current state of the cache object can be easily written to the persistent storage device. It is also possible to read the serialization information from the persistent storage device and deserialize it to regain the cache object that maintains the state before serialization.

[0033] In some scenarios, if it is difficult to serialize a specific object, the cache object can be preloaded into the cache pool through other object information. For example, in some embodiments, the object for caching can be obtained from the operating system through the object identifier, such as the image can be obtained from the operating system through the image identifier (Identity, ID), and the image is usually difficult to serialize. Therefore, in one embodiment, the object information can also include the identifier of the cache object, such as Figure 4 As shown in the information set 3 in . Further, the identifier of the cache object can be read from the storage device, the cache object can be obtained from the operating system through the identifier, and the cache object can be preloaded into the cache pool of the target program.

[0034] In some scenarios, such as when the target program is started for the first time, the cache object binding information may not exist in the storage device. In order to establish a cache pool and load cache objects into it in this case, Figure 5 FIG. 2 is a schematic diagram showing a method for caching a program object according to another embodiment of the present disclosure. Figure 5 As shown, therefore, in Figure 5 In one embodiment shown, after the program is started, it is also possible to determine whether the information set of the cache object exists in the storage device. If the information set of the cache object exists in the storage device, the information set of the cache object is read from the storage device. If the information set does not exist in the storage device, the cache object is determined from the program object according to the call information of the program object during program operation and is placed in the cache pool. In the above manner, when the target program is started for the first time, a cache pool can be initially established and cache objects can be loaded into it during program operation.

[0035] Then, in step S303, in response to the closing of the target program, the information set of the cache objects in the cache pool is saved to the storage device. In this step, the information set of the cache objects in the cache pool can be saved to the storage device when the target program is closed. In an embodiment in which the above object information includes serialization information of the cache object, the cache objects in the cache pool can be serialized to obtain the serialization information, and the serialization information can be saved to the storage device. In an embodiment in which the above object information includes an identifier of the cache object, the identifier of the cache object can be saved to the storage device.

[0036] In order to prevent, for example, the program from exiting unexpectedly, which may result in the information set of the cached object not being updated normally to the storage device. In one embodiment, the information set of the cached objects in the cache pool may also be saved to the storage device in response to a predetermined event. In different specific embodiments, the predetermined event may be different. In a specific embodiment, the predetermined event may include the target program exiting to the background or reaching a preset time node. In the above manner, the loss of the information set of the cached object caused by, for example, the program exiting unexpectedly may be prevented or reduced.

[0037] Another embodiment of the present disclosure further provides a code repair device. Figure 5 A schematic block diagram of a program object cache device according to an embodiment of the present disclosure is shown. The device is used to execute Figure 3 The method shown, such as Figure 5 As shown, the device 500 includes:

[0038] The program startup unit 501 is configured to read an information set of a cache object from a storage device, and preload the cache object into a cache pool of the target program according to the information set;

[0039] The program closing unit 502 is configured to save the information set of cache objects in the cache pool to the storage device in response to the closing of the target program.

[0040] The present disclosure also provides an electronic device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the following is achieved: Figure 3 The method shown.

[0041] You can also refer to the following Figure 7 , which shows a structural schematic diagram of an electronic device 800 suitable for implementing an embodiment of the present application. Figure 7 The electronic device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0042] like Figure 7 As shown, the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701. The above-mentioned processing device 701 may be a general-purpose processor, a digital signal processor (Digital Signal Processing, DSP), a microprocessor or a microcontroller, and may further include an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage device 708 to the random access memory (RAM) 703. In RAM703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, ROM702 and RAM703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0043] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Figure 7 The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 7 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0044] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a communication device 709, or installed from a storage device 708, or installed from a ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the caching method of the program object provided in the embodiment of the present application are executed.

[0045] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed in a computer, the computer is caused to execute the following steps provided in the present disclosure: Figure 1 The cache method of the program object shown in . Figure 8 A schematic diagram of a storage medium for implementing an embodiment of the present application. Figure 8As shown, the storage medium 800 may be a non-transitory computer-readable storage medium for storing non-transitory computer-executable instructions 801. When the non-transitory computer-executable instructions 801 are executed by the processor, the caching method for the program object provided in the embodiment of the present application may be implemented. For example, when the non-transitory computer-executable instructions 801 are executed by the processor, one or more steps in the caching method for the program object provided in the embodiment of the present application may be executed. For example, the storage medium 800 may be applied to the above-mentioned electronic device. For example, the storage medium 800 may include a memory in the electronic device. For the description of the storage medium 800, reference may be made to the description of the memory in the embodiment of the electronic device, and the repeated parts will not be repeated. The specific functions and technical effects of the storage medium 800 may refer to the description of the caching method for the program object provided in the embodiment of the present application, and will not be repeated here.

[0046] It should be noted that the computer-readable medium described in the embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a memory card of a smart phone, a storage component of a tablet computer, a portable computer disk, a hard disk of a personal computer, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In an embodiment of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In an embodiment of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0047] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the server, the electronic device implements the program object caching method provided in the embodiment of the present application.

[0048] Computer program code for performing the operations of the disclosed embodiments may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0049] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions. The units involved in the embodiments described in the present disclosure can be implemented by software or by hardware. Among them, the name of the unit does not constitute a limitation on the unit itself under certain circumstances. The functions described above in this article can be performed at least in part by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0050] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the storage medium and computing device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0051] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solution formed by the specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned public concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) to form a technical solution. In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Certain features described in the context of a single embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination.

[0052] The specific implementation methods described above further describe in detail the purpose, technical solutions and beneficial effects of the embodiments of the present invention. Although the subject matter has been described in a language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. It should be understood that the above is only a specific implementation method of the embodiments 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 on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for caching a program object, comprising: In response to the start of the target program, reading an information set of a cache object from a storage device, and preloading the cache object into a cache pool of the target program according to the information set; In response to closing the target program, the information set of cache objects in the cache pool is saved to the storage device.

2. The method according to claim 1, wherein: The information set of the cache object includes object information and a cache weight of the cache object, where the cache weight is used to indicate the importance of the cache object.

3. The method according to claim 2, wherein: The object information includes serialization information of the cache object; The step of reading the information set of the cache object from the storage device and preloading the cache object into the cache pool of the target program according to the information set includes: Reading serialization information of a cache object from a storage device, and preloading the cache object into a cache pool of the target program by deserializing the serialization information; The step of saving the information set of the cache objects in the cache pool to the storage device includes: The cache objects of the cache pool are serialized to obtain the serialization information, and the serialization information is saved to the storage device.

4. The method according to claim 2, wherein: The object information includes an identifier of the cache object; The step of reading the information set of the cache object from the storage device and preloading the cache object into the cache pool of the target program according to the information set includes: Reading an identifier of a cache object from a storage device, obtaining a cache object from a specific operating system through the identifier, and preloading the cache object into a cache pool of the target program; The step of saving the information set of the cache objects in the cache pool to the storage device includes: saving the identifiers of the cache objects to the storage device.

5. The method according to claim 2, wherein: The cache weight is determined according to one or more of the number of calls, the order of calls, and the construction resource consumption of the cache object.

6. The method according to claim 2, further comprising: During the operation of the target program, according to the call of the cache object in the cache pool, the cache weight of the cache object is updated; According to the cache weight of the cache object, it is determined whether to retain or remove the cache object from the cache pool.

7. The method according to claim 1, further comprising: In response to a predetermined event, a set of information about cache objects in the cache pool is saved to the storage device.

8. The method according to claim 7, wherein the predetermined event includes the target program retreating to the background or reaching a preset time node.

9. The method according to claim 1, wherein: Read the cache object information set from the storage device, including: Determine whether the information set of the cache object exists in the storage device, and if the information set of the cache object exists in the storage device, read the information set of the cache object from the storage device; The method further comprises: If the information set does not exist in the storage device, a cache object is determined from the program object according to the calling information of the program object during program running and is put into the cache pool.

10. A cache device for a program object, comprising: A program startup unit is configured to read an information set of a cache object from a storage device, and preload the cache object into a cache pool of the target program according to the information set; The program closing unit is configured to save the information set of cache objects in the cache pool to the storage device in response to the closing of the target program.

11. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 9.

12. An electronic device comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 9 is implemented.