CN116561019A - Cache updating method and device, storage medium and electronic device - Google Patents

Cache updating method and device, storage medium and electronic device Download PDF

Info

Publication number
CN116561019A
CN116561019A CN202310338572.XA CN202310338572A CN116561019A CN 116561019 A CN116561019 A CN 116561019A CN 202310338572 A CN202310338572 A CN 202310338572A CN 116561019 A CN116561019 A CN 116561019A
Authority
CN
China
Prior art keywords
cache
target
application program
single application
key value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310338572.XA
Other languages
Chinese (zh)
Inventor
乔冠东
孙能林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd, Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202310338572.XA priority Critical patent/CN116561019A/en
Publication of CN116561019A publication Critical patent/CN116561019A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The application discloses a cache updating method, a device, a storage medium and an electronic device, and relates to the technical field of smart families, wherein the cache updating method comprises the following steps: under the condition that a single application program is installed in a slave server, the single application program is sent to a memory resource corresponding to the mobile terminal by using a target program; under the condition that the single application program is successfully started in the memory resource, selecting a target buffer associated with the single application program, and setting a cleaning task for the target buffer; by executing the cleaning task to update the storage space of the target buffer, the technical scheme solves the technical problem that the cache effect can be effectively maintained only by ensuring the network or hardware of the cache architecture.

Description

Cache updating method and device, storage medium and electronic device
Technical Field
The application relates to the technical field of smart families, in particular to a cache updating method, a cache updating device, a storage medium and an electronic device.
Background
In the application of the single server, there is a need to use buffering, but the mainstream technical solution at present has the following drawbacks:
1) A distributed architecture is usually adopted, but this approach requires a network connection as a communication base for interaction with the buffer, and may be affected by network delay to reduce the buffer performance, i.e. there is a delay in the buffer speed due to the need of using network communication.
2) The buffer needs to be deployed separately as an example service, and the requirement on hardware cost is high, that is, the buffer service needs to be deployed separately often needs to be configured by high hardware to ensure the effective operation of the buffer, so that the hardware cost is greatly improved.
Aiming at the technical problem that the cache effect can be effectively maintained only by ensuring the network or hardware of the cache architecture in the related art, no effective solution is proposed yet.
Disclosure of Invention
The embodiment of the application provides a cache updating method, a cache updating device, a storage medium and an electronic device, which are used for at least solving the technical problem that a cache effect can be effectively maintained only by ensuring a network or hardware of a cache architecture in the related technology.
According to an embodiment of the present application, there is provided a cache updating method, including: under the condition that a single application program is installed in a slave server, the single application program is sent to a memory resource corresponding to the mobile terminal by using a target program; under the condition that the single application program is determined to be successfully started in the memory resource, selecting a target buffer associated with the single application program, and setting a cleaning task for the target buffer; and updating the storage space of the target buffer by executing the cleaning task.
In an exemplary embodiment, in a case that it is determined that the single application program is successfully started up in the memory resource, after selecting a target buffer associated with the single application program and setting a cleaning task for the target buffer, the method further includes: determining a plurality of cache items to be added in a target cache according to a cleaning task, and determining an index identifier corresponding to each cache item, wherein the index identifier is a unique key value; checking index identifiers corresponding to each cache item through an index list existing in the target cache at present; and determining whether the cleaning task is successfully added in the target buffer or not based on the verification result.
In an exemplary embodiment, verifying, by the index list currently existing in the target buffer, the index identifier corresponding to each buffer entry includes: under the condition that the index identifier is matched with an entry in the index list, determining that a target cache entry corresponding to the index identifier exists in the target cache; and under the condition that the index identifier is not matched with the table items in the index list, determining that the target cache item corresponding to the index identifier does not exist in the target cache.
In an exemplary embodiment, after determining that the target cache entry corresponding to the index identifier already exists in the target cache in the case that the index identifier matches the entry in the index list, the method further includes: acquiring a first key value corresponding to the index identifier and acquiring a second key value corresponding to an existing target cache item in the target cache; the first key value is compared with the second key value to determine whether delay adjustment of the target cache entry is required.
In one exemplary embodiment, comparing the first key value to the second key value to determine whether latency adjustment of the target cache item is required includes: under the condition that the first key value is larger than the second key value, determining that delay adjustment is required to be carried out on the target cache item, and replacing the character string corresponding to the second key value with the target character string corresponding to the first key value; and under the condition that the first key value is smaller than or equal to the second key value, determining that delay adjustment is not needed for the target cache item.
In an exemplary embodiment, after determining that the target cache entry corresponding to the index identifier does not exist in the target cache in the case that the index identifier does not match the entry in the index list, the method further includes: adding a target cache item corresponding to the index identifier into a target cache, and updating an index list; and under the condition that the index list is updated, sending prompt information to the use object of the single application program, wherein the prompt information is used for indicating that the target buffer corresponding to the single application program has normal buffer function.
In one exemplary embodiment, in the event that a determination is made that a monolithic application successfully started up a memory resource, selecting a destination buffer associated with the monolithic application includes: receiving a first configuration instruction sent by an object, wherein the first configuration instruction is used for indicating a target buffer from a plurality of buffers corresponding to the mobile terminal; and determining a target buffer according to the first configuration instruction, and performing association binding on the target buffer and the single application program.
According to another embodiment of the present application, there is further provided a cache updating apparatus, including: the mobile terminal comprises a transmitting module, a receiving module and a receiving module, wherein the transmitting module is used for transmitting a single application program to a memory resource corresponding to the mobile terminal by using a target program under the condition that the single application program is installed in a slave server; the setting module is used for selecting a target buffer associated with the single application program and setting a cleaning task for the target buffer under the condition that the single application program is determined to be successfully started in the memory resource; and the updating module is used for updating the storage space of the target buffer by executing the cleaning task.
In an exemplary embodiment, the apparatus further comprises: the verification module is used for determining a plurality of cache items to be added in the target cache according to the cleaning task, and determining an index identifier corresponding to each cache item, wherein the index identifier is a unique key value; checking index identifiers corresponding to each cache item through an index list existing in the target cache at present; and determining whether the cleaning task is successfully added in the target buffer or not based on the verification result.
In an exemplary embodiment, the above-mentioned inspection module is further configured to determine that, in a case where the index identifier matches an entry in the index list, a target cache entry corresponding to the index identifier already exists in the target cache; and under the condition that the index identifier is not matched with the table items in the index list, determining that the target cache item corresponding to the index identifier does not exist in the target cache.
In an exemplary embodiment, the inspection module further includes: the adjusting unit is used for acquiring a first key value corresponding to the index identifier and acquiring a second key value corresponding to an existing target cache item in the target cache; the first key value is compared with the second key value to determine whether delay adjustment of the target cache entry is required.
In an exemplary embodiment, the adjusting unit is further configured to determine that delay adjustment needs to be performed on the target cache item when the first key value is greater than the second key value, and replace the character string corresponding to the second key value with the target character string corresponding to the first key value; and under the condition that the first key value is smaller than or equal to the second key value, determining that delay adjustment is not needed for the target cache item.
In an exemplary embodiment, the inspection module further includes: the prompting unit is used for adding the target cache item corresponding to the index identifier into the target cache and updating the index list; and under the condition that the index list is updated, sending prompt information to the use object of the single application program, wherein the prompt information is used for indicating that the target buffer corresponding to the single application program has normal buffer function.
In an exemplary embodiment, the setting module is further configured to receive a first configuration instruction sent by the usage object, where the first configuration instruction is used to indicate a target buffer from a plurality of buffers corresponding to the mobile terminal; and determining a target buffer according to the first configuration instruction, and performing association binding on the target buffer and the single application program.
According to yet another aspect of the embodiments of the present application, there is also provided a computer readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the above-described cache update method when run.
According to still another aspect of the embodiments of the present application, there is further provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the above-mentioned cache updating method through the computer program.
In the embodiment of the application, under the condition that a single application program is installed in a slave server, the single application program is sent to a memory resource corresponding to the mobile terminal by using a target program; under the condition that the single application program is successfully started in the memory resource, selecting a target buffer associated with the single application program, and setting a cleaning task for the target buffer; updating the storage space of the target buffer by executing the cleaning task; the buffer corresponding to the single application program is arranged in the memory resource of the mobile terminal, and the buffer is updated in real time by arranging the cleaning task, so that the buffer can continuously provide buffer resources for the single application program in the use process, and the buffer effect is ensured on the basis of not changing the system architecture or increasing the hardware cost.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a hardware environment of a cache update method according to an embodiment of the present application;
FIG. 2 is a flow chart of a cache update method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a cache update method according to an embodiment of the present application;
FIG. 4 is a block diagram (I) of a cache update apparatus according to an embodiment of the present application;
fig. 5 is a block diagram (ii) of a cache updating apparatus according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to one aspect of the embodiments of the present application, a cache update method is provided. The cache updating method is widely applied to full-house intelligent digital control application scenes such as intelligent Home (Smart Home), intelligent Home equipment ecology, intelligent Home (Intelligence House) ecology and the like. Alternatively, in the present embodiment, the above-described cache update method may be applied to a hardware environment constituted by the terminal device 102 and the server 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to the terminal device 102 through a network, and may be used to provide services (such as application services and the like) for a terminal or a client installed on the terminal, a database may be set on the server or independent of the server, for providing data storage services for the server 104, and cloud computing and/or edge computing services may be configured on the server or independent of the server, for providing data computing services for the server 104.
The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: a wide area network, a metropolitan area network, a local area network, and the wireless network may include, but is not limited to, at least one of: WIFI (Wireless Fidelity ), bluetooth. The terminal device 102 may not be limited to a PC, a mobile phone, a tablet computer, an intelligent air conditioner, an intelligent smoke machine, an intelligent refrigerator, an intelligent oven, an intelligent cooking range, an intelligent washing machine, an intelligent water heater, an intelligent washing device, an intelligent dish washer, an intelligent projection device, an intelligent television, an intelligent clothes hanger, an intelligent curtain, an intelligent video, an intelligent socket, an intelligent sound box, an intelligent fresh air device, an intelligent kitchen and toilet device, an intelligent bathroom device, an intelligent sweeping robot, an intelligent window cleaning robot, an intelligent mopping robot, an intelligent air purifying device, an intelligent steam box, an intelligent microwave oven, an intelligent kitchen appliance, an intelligent purifier, an intelligent water dispenser, an intelligent door lock, and the like.
In this embodiment, a cache updating method is provided and applied to the terminal device, and fig. 2 is a flowchart of the cache updating method according to an embodiment of the present application, where the flowchart includes the following steps:
step S202, when a single application program is installed in a slave server, the single application program is sent to a memory resource corresponding to the mobile terminal by using a target program;
step S204, under the condition that the single application program is successfully started in the memory resource, selecting a target buffer associated with the single application program, and setting a cleaning task for the target buffer;
step S206, updating the storage space of the target buffer by executing the cleaning task.
Through the steps, under the condition that a single application program is installed in a slave server, the single application program is sent to a memory resource corresponding to the mobile terminal by using a target program; under the condition that the single application program is successfully started in the memory resource, selecting a target buffer associated with the single application program, and setting a cleaning task for the target buffer; updating the storage space of the target buffer by executing the cleaning task; the buffer corresponding to the single application program is arranged in the memory resource of the mobile terminal, and the buffer is updated in real time by arranging the cleaning task, so that the buffer can continuously provide buffer resources for the single application program in the use process, and the buffer effect is ensured on the basis of not changing the system architecture or increasing the hardware cost.
In an exemplary embodiment, in a case that it is determined that the single application program is successfully started up in the memory resource, after selecting a target buffer associated with the single application program and setting a cleaning task for the target buffer, the method further includes: determining a plurality of cache items to be added in a target cache according to a cleaning task, and determining an index identifier corresponding to each cache item, wherein the index identifier is a unique key value; checking index identifiers corresponding to each cache item through an index list existing in the target cache at present; and determining whether the cleaning task is successfully added in the target buffer or not based on the verification result.
It can be understood that, in order to ensure the caching effect, when it is determined that the target cache corresponding to the single application program is successfully set on the memory resource corresponding to the mobile terminal, the cache item to be updated in the target cache is adjusted according to the cleaning task, and when the cache item is adjusted, whether the current cache item exists in the target cache is determined by determining the index identifier corresponding to the cache item, if the current cache item does not exist, the adding is performed, if the current cache item does not exist, the adding is stopped, and prompt information is sent to the object for starting the single application program, so that the current target cache has a plurality of cache items required after the single application program operates, and the operation effect of the single application program is not limited by the cache resource.
By the method, the target buffer is determined, and the buffer items in the buffer are set at the same time, so that the buffer resource provided by the buffer can be mutually adapted to the single application program, and the buffer efficiency is high.
In an exemplary embodiment, verifying, by the index list currently existing in the target buffer, the index identifier corresponding to each buffer entry includes: under the condition that the index identifier is matched with an entry in the index list, determining that a target cache entry corresponding to the index identifier exists in the target cache; and under the condition that the index identifier is not matched with the table items in the index list, determining that the target cache item corresponding to the index identifier does not exist in the target cache.
In an exemplary embodiment, after determining that the target cache entry corresponding to the index identifier already exists in the target cache in the case that the index identifier matches the entry in the index list, the method further includes: acquiring a first key value corresponding to the index identifier and acquiring a second key value corresponding to an existing target cache item in the target cache; the first key value is compared with the second key value to determine whether delay adjustment of the target cache entry is required.
It can be understood that, when determining whether to update the cache item through the index identifier, in order to ensure the cache effect, the cache time corresponding to the cache item is adjusted by adjusting the key value corresponding to the cache item, so that the cache resource corresponding to the cache item can be updated according to actual needs, and the waste of the cache resource is avoided.
In one exemplary embodiment, comparing the first key value to the second key value to determine whether latency adjustment of the target cache item is required includes: under the condition that the first key value is larger than the second key value, determining that delay adjustment is required to be carried out on the target cache item, and replacing the character string corresponding to the second key value with the target character string corresponding to the first key value; and under the condition that the first key value is smaller than or equal to the second key value, determining that delay adjustment is not needed for the target cache item.
In an exemplary embodiment, after determining that the target cache entry corresponding to the index identifier does not exist in the target cache in the case that the index identifier does not match the entry in the index list, the method further includes: adding a target cache item corresponding to the index identifier into a target cache, and updating an index list; and under the condition that the index list is updated, sending prompt information to the use object of the single application program, wherein the prompt information is used for indicating that the target buffer corresponding to the single application program has normal buffer function.
In one exemplary embodiment, in the event that a determination is made that a monolithic application successfully started up a memory resource, selecting a destination buffer associated with the monolithic application includes: receiving a first configuration instruction sent by an object, wherein the first configuration instruction is used for indicating a target buffer from a plurality of buffers corresponding to the mobile terminal; and determining a target buffer according to the first configuration instruction, and performing association binding on the target buffer and the single application program.
In order to better understand the process of the above-mentioned cache update method, the following description is provided with reference to an optional embodiment to describe the flow of the implementation method of the above-mentioned cache update, but the method is not limited to the technical solution of the embodiment of the present application.
In this embodiment, a cache update method is provided, and fig. 3 is a schematic diagram of a corresponding architecture of the cache update method according to an embodiment of the present application, as shown in fig. 3, including:
a single application 32, a buffer 34, a C# run time program 36, a computer running memory 38;
in order to ensure smooth implementation of the above-mentioned cache updating method, a precondition for implementation of the method is described, where the precondition includes:
1. monomer application: c# applications that require a monolithic architecture that uses caching; furthermore, the single application may specifically be an application in which the archive package contains all functions. An archive package (which may be JAR, WAR, EAR or other archive format) contains all functional applications, commonly referred to as monolithic applications. The methodology of architecture monomer application is monomer application architecture. And placing the presentation layer, the business logic layer and the data access layer of all business scenes in one project, and finally compiling, packaging and deploying the projects on one server. Often a single application framework is used. For example, the front end and the back end of a project are simply developed by using django, and the application of the developed project, namely django+uwsgi+mysqhl+nginx, deployed on a server is a single application.
2. C# run time: when the C# application program runs, the application program can run by using the computing resource through the running time. Wherein, C# (read as "See Sharp") is a new programming language, not only object-oriented, but also type-safe. The developer can generate a variety of secure and reliable applications running in the NET using c#.
3. Computer running memory (corresponding to the memory resources corresponding to the mobile terminal in the above embodiment): the core of one of the basic computing resources, the above method of the present application, is to store the cache content based on the same;
optionally, the architecture has the following scenario functions when in use:
1. buffer self-cleaning function: and when the program is started, a timing task is automatically started, and the expired cache is cleaned regularly, so that unnecessary storage occupation is reduced.
2. Adding a cache: a cache entry is added to the cache means with a unique key value as a tag for this cache entry.
3. Adding a cache if the cache does not exist: and (3) on the basis of adding the cache in the step (2), adding a check of whether the current key value exists, and if so, not successfully adding the key value.
4. Removing the cache: and deleting the corresponding cache item from the cache according to the given key value.
5. Delay removal cache: and deleting the corresponding cache item from the cache after delaying for a certain time according to the given key value and the time length value needing to delay.
6. All caches are removed: all current cache values are deleted from the cache.
7. And (3) obtaining a cache: and returning the corresponding cache item from the cache according to the given key value.
8. Checking whether a cache exists: and returning an identification of whether a corresponding cache item exists in the cache according to the given key value.
Optionally, the implementation code corresponding to the above architecture may be as follows:
/>
it should be noted that, since the architecture described above may be applied to run on one terminal, there may be no difference in distributed operation.
Through the embodiment, the high-performance lightweight buffer is realized by using C#, so that a single application program needing to use a buffer function can obtain higher buffer performance realization on the premise of minimum hardware cost. Under the architecture of a single application program, a cache function is obtained through an integrated cache; on the premise of realizing integrated caching, the caching has higher performance; the cache service does not need to be deployed independently, so that the hardware cost is effectively reduced; namely, the scheme has the following characteristics: 1) Belongs to memory level cache, and directly interacts with the current computing resource, thereby greatly improving the response speed. 2) The method does not need independent deployment, can be directly integrated in the application of the single server, and saves the hardware cost. Furthermore, through the integrated arrangement, the high efficiency of using the buffer for the single application program is improved.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the embodiments of the present application.
FIG. 4 is a block diagram (I) of a cache update apparatus according to an embodiment of the present application; as shown in fig. 4, includes:
a sending module 40, configured to send, when a single application program is installed in a slave server, the single application program to a memory resource corresponding to the mobile terminal using a target program;
a setting module 42, configured to select a target buffer associated with the single application program and set a cleaning task for the target buffer if it is determined that the single application program is successfully started in the memory resource;
an updating module 44, configured to update the storage space of the target buffer by performing the cleaning task.
By the device, when the single application program is installed in the slave server, the single application program is sent to the memory resource corresponding to the mobile terminal by using the target program; under the condition that the single application program is successfully started in the memory resource, selecting a target buffer associated with the single application program, and setting a cleaning task for the target buffer; updating the storage space of the target buffer by executing the cleaning task; the buffer corresponding to the single application program is arranged in the memory resource of the mobile terminal, and the buffer is updated in real time by arranging the cleaning task, so that the buffer can continuously provide buffer resources for the single application program in the use process, and the buffer effect is ensured on the basis of not changing the system architecture or increasing the hardware cost.
According to another embodiment of the present application, there is further provided another cache updating apparatus, as shown in fig. 5, fig. 5 is a block diagram (two) of a cache updating apparatus according to an embodiment of the present application, including, in addition to all the modules in fig. 4: a verification module 52;
in an exemplary embodiment, the apparatus further comprises: the verification module 52 is configured to determine a plurality of cache entries to be added in the target cache according to the cleaning task, and determine an index identifier corresponding to each cache entry, where the index identifier is a unique key value; checking index identifiers corresponding to each cache item through an index list existing in the target cache at present; and determining whether the cleaning task is successfully added in the target buffer or not based on the verification result.
It can be understood that, in order to ensure the caching effect, when it is determined that the target cache corresponding to the single application program is successfully set on the memory resource corresponding to the mobile terminal, the cache item to be updated in the target cache is adjusted according to the cleaning task, and when the cache item is adjusted, whether the current cache item exists in the target cache is determined by determining the index identifier corresponding to the cache item, if the current cache item does not exist, the adding is performed, if the current cache item does not exist, the adding is stopped, and prompt information is sent to the object for starting the single application program, so that the current target cache has a plurality of cache items required after the single application program operates, and the operation effect of the single application program is not limited by the cache resource.
By the method, the target buffer is determined, and the buffer items in the buffer are set at the same time, so that the buffer resource provided by the buffer can be mutually adapted to the single application program, and the buffer efficiency is high.
In an exemplary embodiment, the above-mentioned inspection module 52 is further configured to determine that, in a case where the index identifier matches an entry in the index list, a target cache entry corresponding to the index identifier already exists in the target cache; and under the condition that the index identifier is not matched with the table items in the index list, determining that the target cache item corresponding to the index identifier does not exist in the target cache.
In one exemplary embodiment, the inspection module 52 further includes: the adjusting unit is used for acquiring a first key value corresponding to the index identifier and acquiring a second key value corresponding to an existing target cache item in the target cache; the first key value is compared with the second key value to determine whether delay adjustment of the target cache entry is required.
In an exemplary embodiment, the adjusting unit is further configured to determine that delay adjustment needs to be performed on the target cache item when the first key value is greater than the second key value, and replace the character string corresponding to the second key value with the target character string corresponding to the first key value; and under the condition that the first key value is smaller than or equal to the second key value, determining that delay adjustment is not needed for the target cache item.
It can be understood that, when determining whether to update the cache item through the index identifier, in order to ensure the cache effect, the cache time corresponding to the cache item is adjusted by adjusting the key value corresponding to the cache item, so that the cache resource corresponding to the cache item can be updated according to actual needs, and the waste of the cache resource is avoided.
In one exemplary embodiment, the inspection module 52 further includes: the prompting unit is used for adding the target cache item corresponding to the index identifier into the target cache and updating the index list; and under the condition that the index list is updated, sending prompt information to the use object of the single application program, wherein the prompt information is used for indicating that the target buffer corresponding to the single application program has normal buffer function.
In an exemplary embodiment, the setting module is further configured to receive a first configuration instruction sent by the usage object, where the first configuration instruction is used to indicate a target buffer from a plurality of buffers corresponding to the mobile terminal; and determining a target buffer according to the first configuration instruction, and performing association binding on the target buffer and the single application program.
Embodiments of the present application also provide a storage medium including a stored program, wherein the program performs the method of any one of the above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store program code for performing the steps of:
s1, under the condition that a single application program is installed in a slave server, sending the single application program to a memory resource corresponding to the mobile terminal by using a target program;
s2, under the condition that the single application program is determined to be successfully started in the memory resource, selecting a target buffer associated with the single application program, and setting a cleaning task for the target buffer;
s3, updating the storage space of the target buffer by executing the cleaning task.
Embodiments of the present application also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, under the condition that a single application program is installed in a slave server, sending the single application program to a memory resource corresponding to the mobile terminal by using a target program;
s2, under the condition that the single application program is determined to be successfully started in the memory resource, selecting a target buffer associated with the single application program, and setting a cleaning task for the target buffer;
s3, updating the storage space of the target buffer by executing the cleaning task.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be centralized on a single computing device, or distributed across a network of computing devices, or they may alternatively be implemented in program code executable by computing devices, such that they may be stored in a memory device for execution by the computing devices and, in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be implemented as individual integrated circuit modules, or as individual integrated circuit modules. Thus, the present application is not limited to any specific combination of hardware and software.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (10)

1. The cache updating method is characterized by being applied to the mobile terminal and comprising the following steps of:
under the condition that a single application program is installed in a slave server, the single application program is sent to a memory resource corresponding to the mobile terminal by using a target program;
under the condition that the single application program is successfully started in the memory resource, selecting a target buffer associated with the single application program, and setting a cleaning task for the target buffer;
and updating the storage space of the target buffer by executing the cleaning task.
2. The cache update method according to claim 1, wherein, in the case where it is determined that the single application program is successfully started up in the memory resource, selecting a target cache associated with the single application program, and setting a cleaning task for the target cache, the method further comprises:
determining a plurality of cache items to be added in the target cache according to the cleaning task, and determining an index identifier corresponding to each cache item, wherein the index identifier is a unique key value;
checking index identifiers corresponding to each cache item through an index list existing in the target cache at present;
and determining whether the cleaning task is successfully added in the target buffer or not based on a verification result.
3. The cache updating method according to claim 2, wherein verifying the index identifier corresponding to each cache entry through the index list currently existing in the target cache includes:
under the condition that the index identifier is matched with an entry in the index list, determining that a target cache entry corresponding to the index identifier exists in the target cache;
and under the condition that the index identifier is not matched with an entry in the index list, determining that a target cache entry corresponding to the index identifier does not exist in the target cache.
4. The cache update method according to claim 3, wherein, in a case where the index identifier matches an entry in the index list, after determining that a target cache entry corresponding to the index identifier already exists in the target cache, the method further comprises:
acquiring a first key value corresponding to the index identifier and acquiring a second key value corresponding to an existing target cache item in the target cache;
comparing the first key value with the second key value to determine whether delay adjustment of the target cache item is required.
5. The cache update method of claim 4, wherein comparing the first key value with the second key value to determine whether a delay adjustment is required for the target cache entry comprises:
when the first key value is larger than the second key value, determining that delay adjustment is required to be performed on the target cache item, and replacing the character string corresponding to the second key value with the target character string corresponding to the first key value;
and under the condition that the first key value is smaller than or equal to the second key value, determining that delay adjustment is not needed for the target cache item.
6. The cache update method of claim 3, wherein, in the case where the index identifier does not match an entry in the index list, after determining that a target cache entry corresponding to the index identifier does not exist in the target cache, the method further comprises:
adding a target cache item corresponding to the index identifier into the target cache, and updating the index list;
and under the condition that the index list is updated, sending prompt information to the use object of the single application program, wherein the prompt information is used for indicating that the target buffer corresponding to the single application program has normal buffer function.
7. The cache update method according to claim 1, wherein selecting a target cache associated with the monolithic application if it is determined that the monolithic application was successfully started up at the memory resource comprises:
receiving a first configuration instruction sent by a use object, wherein the first configuration instruction is used for indicating a target buffer from a plurality of buffers corresponding to a mobile terminal;
and determining a target buffer according to the first configuration instruction, and performing association binding on the target buffer and the single application program.
8. The cache updating device is characterized by being applied to a mobile terminal and comprising the following components:
the mobile terminal comprises a transmitting module, a receiving module and a receiving module, wherein the transmitting module is used for transmitting a single application program to a memory resource corresponding to the mobile terminal by using a target program under the condition that the single application program is installed in a slave server;
the setting module is used for selecting a target buffer associated with the single application program and setting a cleaning task for the target buffer under the condition that the single application program is determined to be successfully started in the memory resource;
and the updating module is used for updating the storage space of the target buffer by executing the cleaning task.
9. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program when run performs the method of any of the preceding claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1 to 7 by means of the computer program.
CN202310338572.XA 2023-03-30 2023-03-30 Cache updating method and device, storage medium and electronic device Pending CN116561019A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310338572.XA CN116561019A (en) 2023-03-30 2023-03-30 Cache updating method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310338572.XA CN116561019A (en) 2023-03-30 2023-03-30 Cache updating method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN116561019A true CN116561019A (en) 2023-08-08

Family

ID=87492292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310338572.XA Pending CN116561019A (en) 2023-03-30 2023-03-30 Cache updating method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN116561019A (en)

Similar Documents

Publication Publication Date Title
CN111371696A (en) Method for realizing Pod network flow control in Kubernetes
CN105765533B (en) Method and apparatus for firmware virtualization
CN110392882A (en) It is created in batches in the network for including virtualization network function by pipe function
CN103595566A (en) Method and device for detecting idle IP addresses
CN111083180A (en) Internet of things system and Internet of things equipment linkage method and device
CN104866339A (en) Distributed persistent management method, system and device of FOTA data
CN106886452B (en) Method for simplifying task scheduling of cloud system
CN114938365B (en) Function module updating method and device, storage medium and electronic device
CN116561019A (en) Cache updating method and device, storage medium and electronic device
CN110955460B (en) Service process starting method and device, electronic equipment and storage medium
CN116107975A (en) Control method and device of equipment, storage medium and electronic device
CN114884975B (en) Service message processing method and device, storage medium and electronic device
CN107968812A (en) The method and device of synchronous local resource and Internet resources
CN114911535B (en) Application program component configuration method, storage medium and electronic device
CN104836708B (en) The binding method and device of information
CN106357735A (en) Method and device for operating infrastructure layer of cloud computing architecture
CN106210120A (en) A kind of recommendation method of server and device thereof
CN115277412B (en) Edge gateway upgrading method and device, storage medium and electronic device
CN116366671A (en) Data synchronization method and device, storage medium and electronic device
CN115174296B (en) Equipment function access method and device, storage medium and electronic device
CN110661892A (en) Domain name configuration information processing method and device
CN116248647A (en) Method and device for sending resource package, storage medium and electronic device
CN115296948B (en) Scene information updating method and device, storage medium and electronic device
CN117857416A (en) Data packet sending method and device, storage medium and electronic device
CN116541012A (en) Basic parameter modification method and device, storage medium and electronic device

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