Disclosure of Invention
The main purpose of the application is to provide a local cache management method, device, equipment and medium for APP, which aims to solve the technical problems that the APP local cache in the prior art can be displayed first when triggered every time, then the latest number is requested asynchronously, and the back-end service is requested frequently and the display is refreshed.
In order to achieve the above object, the present application proposes a local cache management method for APP, the method comprising:
acquiring a local data storage request sent by a target service model, wherein the local data storage request carries service data to be stored, a service data identifier to be stored and a target service characteristic identifier of the target service model;
Searching a service data life cycle management model identifier from a life cycle management model library according to the target service characteristic identifier of the target service model to obtain a service data life cycle management model identifier corresponding to the service data identifier to be stored;
storing the service data identifier to be stored, the service data lifecycle management model identifier corresponding to the service data identifier to be stored and the service data to be stored in a local cache;
acquiring a service data operation request, wherein the service data operation request carries a service data identifier to be operated;
searching the service data life cycle management model identification from the local cache according to the service data identification to be operated to obtain a target service data life cycle management model identification;
acquiring a service data life cycle management model according to the target service data life cycle management model identification to obtain a target service data life cycle management model;
responding to the service data operation request, and operating the service data corresponding to the service data identifier to be operated based on the target service data life cycle management model.
Further, before the step of searching the service data lifecycle management model identifier from the lifecycle management model library according to the target service feature identifier of the target service model to obtain the service data lifecycle management model identifier corresponding to the service data identifier to be stored, the method further includes:
acquiring a life cycle management model association request;
responding to the request for acquiring the lifecycle management model association, acquiring a service model identifier of the lifecycle management model to be generated, a service feature identifier of the lifecycle management model to be generated and a service data lifecycle management model identifier to be associated;
and correlating the service data life cycle management model identifier to be correlated, the service model identifier of the life cycle management model to be generated and the service feature identifier of the life cycle management model to be generated, and updating the correlated service data life cycle management model identifier to be correlated, the service model identifier of the life cycle management model to be generated and the service feature identifier of the life cycle management model to be generated into a model information corresponding table of the life cycle management model library.
Further, before the step of obtaining the lifecycle management model association request, the method includes:
acquiring a life cycle management model generation request;
responding to the life cycle management model generation request, and acquiring a service data life cycle management model to be stored;
determining a service data life cycle management model identification to be stored according to the service data life cycle management model to be stored;
and updating the service data life cycle management model to be stored and the service data life cycle management model identification to be stored into service data life cycle management model data of the life cycle management model library.
Further, before the step of obtaining the lifecycle management model association request, the method further includes:
the method comprises the steps that a model client is called to obtain a life cycle management model updating request sent by a model server;
invoking the model client to respond to the life cycle management model updating request, and downloading a service data life cycle management model to be stored from the model server, wherein the service data life cycle management model to be stored carries a service data life cycle management model identifier to be stored;
And updating the service data life cycle management model to be stored and the service data life cycle management model identification to be stored into service data life cycle management model data of the life cycle management model library of the model client.
Further, the step of downloading the service data lifecycle management model to be stored from the model server includes:
calling the model client to acquire account number levels;
and calling the model client to download the service data life cycle management model to be stored from the model server by adopting the account number level.
Further, the step of calling the model client to download the service data lifecycle management model to be stored from the model server by adopting the account level further includes:
invoking the model client to acquire a network type;
and calling the model client to download the service data life cycle management model to be stored from the model server by adopting the account number level and the network type.
Further, the step of storing the service data identifier to be stored, the service data lifecycle management model identifier corresponding to the service data identifier to be stored, and the service data to be stored in a local cache includes:
Acquiring a service data life cycle management model from a server according to the service data life cycle management model identification corresponding to the service data identification to be stored, and obtaining the service data life cycle management model corresponding to the service data identification to be stored;
and storing the service data identifier to be stored, the service data life cycle management model identifier corresponding to the service data identifier to be stored, the service data life cycle management model corresponding to the service data identifier to be stored and the service data to be stored in the local cache.
The application also provides a local cache management device for APP, the device includes:
the local data storage request acquisition module is used for acquiring a local data storage request sent by a target service model, wherein the local data storage request carries service data to be stored, a service data identifier to be stored and a target service characteristic identifier of the target service model;
the service data life cycle management model identification determining module is used for searching a service data life cycle management model identification from a life cycle management model library according to the target service characteristic identification of the target service model to obtain a service data life cycle management model identification corresponding to the service data identification to be stored;
The data caching module is used for storing the service data identifier to be stored, the service data life cycle management model identifier corresponding to the service data identifier to be stored and the service data to be stored in a local cache;
the service data operation request determining module is used for acquiring a service data operation request, wherein the service data operation request carries a service data identifier to be operated;
the target service data life cycle management model identification determining module is used for searching the service data life cycle management model identification from the local cache according to the service data identification to be operated to obtain a target service data life cycle management model identification;
the target service data life cycle management model determining module is used for obtaining a service data life cycle management model according to the target service data life cycle management model identification to obtain a target service data life cycle management model;
and the service data operation module is used for responding to the service data operation request and operating the service data corresponding to the service data identifier to be operated based on the target service data life cycle management model.
The present application also proposes a computer device comprising a memory storing a computer program and a processor implementing the steps of any of the methods described above when the processor executes the computer program.
The present application also proposes a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method of any of the above.
According to the local cache management method, device, equipment and medium for the APP, through acquiring a local data storage request, firstly determining a service data lifecycle management model identifier from a lifecycle management model library according to a target service characteristic identifier of a target service model, obtaining the service data lifecycle management model identifier corresponding to the service data identifier to be stored, storing the service data identifier to be stored, the service data lifecycle management model identifier corresponding to the service data identifier to be stored and the service data to be stored in a local cache, when acquiring a service data operation request, searching the service data lifecycle management model identifier from the local cache according to the service data identifier to be operated, and obtaining the target service data lifecycle management model identifier, and operating the service data corresponding to the service data identifier to be operated based on the target service data lifecycle management model identifier, so that the service data is classified and managed through the service data lifecycle management model, the service request of a back end is not required to be triggered each time, the service request of the back end is displayed, and the service refreshing pressure of the back end server is reduced.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
In order to solve the technical problems that in the prior art, an APP local cache can be displayed firstly when triggered every time and then the latest number is requested asynchronously, so that the back-end service is frequently requested and the display is refreshed, the application provides a local cache management method for the APP, and the method is applied to the technical field of artificial intelligence. According to the local cache management method for the APP, the business data corresponding to the business data identification to be operated is operated based on the target business data lifecycle management model corresponding to the target business data lifecycle management model identification, so that the classification management of the lifecycle of the business data through the business data lifecycle management model is realized, the back-end service is not required to be requested and the display is not required to be refreshed when the back-end service is triggered each time, the request amount for requesting the back-end service is reduced, and the service pressure of the back-end server is lightened.
Referring to fig. 1, in an embodiment of the present application, a local cache management method for an APP is provided, where the method includes:
s1: acquiring a local data storage request sent by a target service model, wherein the local data storage request carries service data to be stored, a service data identifier to be stored and a target service characteristic identifier of the target service model;
s2: searching a service data life cycle management model identifier from a life cycle management model library according to the target service characteristic identifier of the target service model to obtain a service data life cycle management model identifier corresponding to the service data identifier to be stored;
s3: storing the service data identifier to be stored, the service data lifecycle management model identifier corresponding to the service data identifier to be stored and the service data to be stored in a local cache;
s4: acquiring a service data operation request, wherein the service data operation request carries a service data identifier to be operated;
s5: searching the service data life cycle management model identification from the local cache according to the service data identification to be operated to obtain a target service data life cycle management model identification;
S6: acquiring a service data life cycle management model according to the target service data life cycle management model identification to obtain a target service data life cycle management model;
s7: responding to the service data operation request, and operating the service data corresponding to the service data identifier to be operated based on the target service data life cycle management model.
According to the embodiment, when a local data storage request is acquired, a service data life cycle management model identification is firstly determined and searched from a life cycle management model library according to a target service characteristic identification of a target service model, a service data life cycle management model identification corresponding to the service data identification to be stored is obtained, the service data identification to be stored, the service data life cycle management model identification corresponding to the service data identification to be stored and the service data to be stored are stored in a local cache, when a service data operation request is acquired, the service data life cycle management model identification is searched from the local cache according to the service data identification to be operated, the target service data life cycle management model identification is obtained, and service data corresponding to the service data life cycle management model to be operated is operated based on the service data life cycle management model identification corresponding to the target service data life cycle management model identification, so that the service data is subjected to life cycle classification management through the service data life cycle management model, the back-end service is not required to be triggered and refreshed each time, the request quantity of the back-end service is reduced, and the service pressure of the back-end server is lightened.
The S1 may be a local data storage request sent by the user through the target service model of the target APP, or a local data storage request triggered by the program file of the target APP.
The target APP, i.e. APP. APP refers to mobile phone software, and software installed on a smart phone, so that the defects and individuation of an original system are perfected, the functions of the mobile phone are perfected, and a main means for richer use experience is provided for users. It can be appreciated that the target APP can also be software on a tablet computer, smart wearable device.
The target APP obtains the back-end service through sending a request through communication connection with the server.
The service data to be stored refers to the service data which the local data storage request wants to store. Traffic data includes, but is not limited to: basic information of a user, contact information of the user, reservation information of the user, application information of the user and repayment information of the user.
The service data identifier to be stored refers to the service data identifier of the service data which the local data storage request wants to store.
The service data identifier may be an identifier that uniquely identifies a service data such as a service data name, a service data ID, etc.
The target business model, i.e., the business model that sent the local data storage request. The business model is used for meeting business requirements of users and is implemented as a business process. The business process includes one or more process nodes.
The target service feature identifier is the service feature identifier of the service feature when the target service model sends the local data storage request. The service characteristics refer to characteristic information of the current flow node.
The service feature identifier may be an identifier that uniquely identifies a service feature, such as a service feature name, a service feature ID, etc.
The local data storage request refers to a request for storing data in the electronic device where the target APP is located.
It can be appreciated that the service data to be stored may be service data uploaded by the user, or may be service data downloaded by the back-end service provided by the request server.
And S2, searching a service data life cycle management model identifier from a life cycle management model library by the target service characteristic, and taking the service data life cycle management model identifier corresponding to the service characteristic searched in the life cycle management model library as the service data identifier to be stored.
Optionally, the lifecycle management model library is stored in a local cache.
The local cache refers to the cache of the target APP in the electronic equipment loaded with the target APP.
Optionally, the lifecycle management model library is stored in a server.
The service data lifecycle management model identifier may be an identifier that uniquely identifies a service data lifecycle management model, such as a service data lifecycle management model name, a service data lifecycle management model ID, etc.
The lifecycle management model library includes: the model information corresponds to a table and the service data life cycle manages model data. The model information correspondence table includes: service data life cycle management model identification, service model identification and service characteristic identification, wherein each service model identification corresponds to at least one service characteristic identification, and each service characteristic identification corresponds to one service data life cycle management model identification. The business data lifecycle management model data includes one or more business data lifecycle management models.
The service model identifier may be an identifier that uniquely identifies a service model, such as a service model name, a service model ID, etc.
The service data life cycle management model is used for managing the life cycle of service data. Managing the lifecycle of the business data includes, but is not limited to: creating service data, displaying the service data, refreshing the service data and destroying the service data.
For example, the lifecycle management policy of the service data lifecycle management model A1 for the service data S1 includes: the method includes asynchronous refreshing and locally comparing refreshing strategies (namely, background asynchronous version comparison is carried out on the service data S1 when a user logs in, refreshing is not carried out if the versions are consistent, refreshing is carried out if the versions are inconsistent) when logging in, directly using the local data when not first logging in, directly using the local data when not logging in a page to apply for operation of the service data, and destroying the service data from a local cache after reservation is completed, and the method is not limited in detail in this example.
For S3, storing the service data identifier to be stored and the service data life cycle management model identifier corresponding to the service data identifier to be stored in a locally cached service data corresponding relation table; and storing the service data to be stored in a locally cached service database.
S4, a service data operation request sent by a user through the target APP can be adopted, and the service data operation request automatically triggered by the program file of the target APP can be adopted.
The service data operation request refers to a request for operating the service data in the local cache.
The service data identifier to be operated refers to the service data identifier of the service data which is expected to be operated by the service data operation request.
And S5, searching the service data identifier to be operated in the locally cached service data corresponding relation table, and taking the service data life cycle management model identifier corresponding to the service data identifier searched in the service data corresponding relation table as a target service data life cycle management model identifier.
And S6, acquiring a service data life cycle management model from the local cache according to the target service data life cycle management model identifier, and taking the acquired service data life cycle management model as a target service data life cycle management model.
For S7, for example, the lifecycle management policy of the service data lifecycle management model A1 for the service data S1 includes: the method comprises the steps of performing background asynchronous version comparison on service data S1 after asynchronous refreshing when logging in (namely, performing background asynchronous version comparison on the service data S1 when a user logs in, not refreshing if the versions are consistent, refreshing if the versions are inconsistent), directly using the service data in a local cache when the user logs in for the first time, directly using the service data in the local cache when the user applies for operating the service data on a non-login page, destroying the service data from the local cache after reservation is completed, submitting contact information L1 (namely, the service data S1) in an application link by the user, storing the contact information L1 in the local cache by triggering, generating a service data life cycle management model A1, storing the corresponding relation between the contact information L1 and A1 in a service data corresponding relation table in the local cache, adopting the refreshing strategy between the contact information L1 after asynchronous refreshing and the local comparison only when the user triggers the contact information L1 for the first time when the user logs in, otherwise directly using the contact information L1 in the local cache, destroying the corresponding relation between the contact information L1 and A1 in the local cache when the user applies for the application, and not limiting the specific loan from the local cache.
In one embodiment, before the step of searching the service data lifecycle management model identifier from the lifecycle management model library according to the target service feature identifier of the target service model to obtain the service data lifecycle management model identifier corresponding to the service data identifier to be stored, the method further includes:
s21: acquiring a life cycle management model association request;
s22: responding to the request for acquiring the lifecycle management model association, acquiring a service model identifier of the lifecycle management model to be generated, a service feature identifier of the lifecycle management model to be generated and a service data lifecycle management model identifier to be associated;
s23: and correlating the service data life cycle management model identifier to be correlated, the service model identifier of the life cycle management model to be generated and the service feature identifier of the life cycle management model to be generated, and updating the correlated service data life cycle management model identifier to be correlated, the service model identifier of the life cycle management model to be generated and the service feature identifier of the life cycle management model to be generated into a model information corresponding table of the life cycle management model library.
The embodiment realizes that the life cycle management model library is updated before the life cycle management model identification of the service data is searched from the life cycle management model library according to the target service characteristic identification of the target service model, thereby providing a foundation for classifying and managing the life cycle of the service data through the life cycle management model of the service data.
The S21 may be a lifecycle management model association request sent by the user through the target APP, or may be a lifecycle management model association request of the third party application system.
The lifecycle management model association request is a request for associating a lifecycle management model with a business model and business features.
And S22, responding to the request for acquiring the lifecycle management model association, and acquiring a service model identifier of the lifecycle management model to be generated, a service feature identifier of the lifecycle management model to be generated and a service data lifecycle management model identifier to be associated, which are input by a user.
The service model identifier to be generated into the life cycle management model is the service model identifier which the life cycle management model association request hopes to associate.
The service characteristic identifier of the life cycle management model to be generated is the service characteristic identifier which the life cycle management model association request hopes to associate.
The service data life cycle management model identification to be associated is a service data life cycle management model identification which is hoped to be associated by a life cycle management model association request.
And S23, associating the service data life cycle management model identification to be associated, the service model identification of the life cycle management model to be generated and the service characteristic identification of the life cycle management model to be generated into a piece of corresponding relation data, and updating the corresponding relation data into a model information corresponding table of the life cycle management model library.
In one embodiment, before the step of obtaining the lifecycle management model association request, the method includes:
s2111: acquiring a life cycle management model generation request;
s2112: responding to the life cycle management model generation request, and acquiring a service data life cycle management model to be stored;
s2113: determining a service data life cycle management model identification to be stored according to the service data life cycle management model to be stored;
s2114: and updating the service data life cycle management model to be stored and the service data life cycle management model identification to be stored into service data life cycle management model data of the life cycle management model library.
The embodiment realizes that the service data lifecycle management model is added in the service data lifecycle management model data of the lifecycle management model library before the step of acquiring the lifecycle management model association request, and provides a basis for the subsequent response to the lifecycle management model association request.
The S2111 may be a lifecycle management model generation request sent by the user through the target APP, or may be a lifecycle management model generation request of the third party application system.
The lifecycle management model generation request refers to a request for generating a business data lifecycle management model.
And for S2112, responding to the life cycle management model generation request, and acquiring a business data life cycle management model to be stored, which is input by a user.
The service data life cycle management model to be stored is a service data life cycle management model (which can be newly generated or modified based on the existing service data life cycle management model) in the service data life cycle management model data to be stored in the life cycle management model library.
And for S2113, generating the service data life cycle management model identification to be stored corresponding to the service data life cycle management model to be stored according to a preset identification generation rule according to the service data life cycle management model identification in the life cycle management model library and the service data life cycle management model to be stored.
Preset identity generation rules include, but are not limited to: the whole adopts a set of serial numbers, and different business models respectively adopt a set of serial numbers.
And for S2114, associating the service data life cycle management model to be stored and the service data life cycle management model identification to be stored, and updating the associated service data life cycle management model to be stored and the service data life cycle management model identification to be stored into service data life cycle management model data of the life cycle management model library.
In one embodiment, before the step of obtaining the lifecycle management model association request, the method further includes:
s2121: the method comprises the steps that a model client is called to obtain a life cycle management model updating request sent by a model server;
s2122: invoking the model client to respond to the life cycle management model updating request, and downloading a service data life cycle management model to be stored from the model server, wherein the service data life cycle management model to be stored carries a service data life cycle management model identifier to be stored;
s2123: and updating the service data life cycle management model to be stored and the service data life cycle management model identification to be stored into service data life cycle management model data of the life cycle management model library of the model client.
Before the step of acquiring the lifecycle management model association request, the embodiment updates the business data lifecycle management model data of the lifecycle management model library of the model client through the model client and the model server, and provides a basis for the subsequent response of the lifecycle management model association request; the service data life cycle management model is managed uniformly through the model client and the model server, so that the updating efficiency of the service data life cycle management model is improved, and the accuracy of the service data life cycle management model in the APP is improved.
For S2121, the calling model client obtains a lifecycle management model update request sent by the user through the server.
The lifecycle management model update request is a request for updating the business data lifecycle management model from the model server to the model client.
And the model server is arranged on the server. The model server can be developed by adopting Java language. The user can add, refresh, delete and modify the service data life cycle management model through the model service end.
The model client is used for communicating with the model server and managing and executing the service data life cycle management model of the target APP. The model client is installed in the electronic equipment where the target APP is located, and can be an independent module or a plug-in unit or a program module of the target APP. When the electronic equipment where the model client is located is an android system, the model client is developed by adopting Java language; when the electronic device where the model client is located is an IOS system, the model client is developed using the object C language.
And S2122, calling the model client to respond to the life cycle management model updating request, downloading a service data life cycle management model from the model server, and taking the downloaded service data life cycle management model as a service data life cycle management model to be stored.
For S2123, when a service data lifecycle management model identifier exists in the service data lifecycle management model data and the service data lifecycle management model identifier to be stored, replacing the service data lifecycle management model identifier in the service data lifecycle management model data with the service data lifecycle management model identifier identical to the service data lifecycle management model identifier to be stored with the service data lifecycle management model identifier to be stored; and when the service data lifecycle management model identification and the service data lifecycle management model identification to be stored do not exist in the service data lifecycle management model data, adding the service data lifecycle management model to be stored and the service data lifecycle management model identification to be stored into the service data lifecycle management model data of the lifecycle management model library of the model client.
In one embodiment, the step of downloading the service data lifecycle management model to be stored from the model server includes:
s21221: calling the model client to acquire account number levels;
s21222: and calling the model client to download the service data life cycle management model to be stored from the model server by adopting the account number level.
According to the embodiment, the service data life cycle management model to be stored is downloaded through the account number level, so that grading service according to the account number level is facilitated, and the personalized requirement of a user is met.
For S21221, the model client is invoked to obtain the account level of the login account of the APP where the model client is located.
It can be understood that when the APP corresponding to the model client is not logged in, the model client is called to acquire a preset guest level as an account level.
The account number level, namely the account number level, different account number levels have different rights and service ranges of using the APP and are used for carrying out hierarchical service on clients.
And for S21222, invoking the model client to download a service data life cycle management model corresponding to the account number level from the model server, and taking the downloaded service data life cycle management model corresponding to the account number level as the service data life cycle management model to be stored.
In one embodiment, the step of calling the model client to download the service data lifecycle management model to be stored from the model server by using the account number level further includes:
s212221: invoking the model client to acquire a network type;
s212222: and calling the model client to download the service data life cycle management model to be stored from the model server by adopting the account number level and the network type.
In this embodiment, the service data lifecycle management model to be stored is downloaded through the account level and the network type, so that hierarchical service is facilitated according to the account level and the network type, and the personalized requirement of the user is further satisfied.
And for S212221, calling the model client to acquire the network type of the electronic equipment connection network where the model client is located.
Network types include, but are not limited to: mobile network, WIFI.
And for S212222, the model client is called to download a service data life cycle management model corresponding to the account number level and the network type from the model server, and the downloaded service data life cycle management model corresponding to the account number level is used as the service data life cycle management model to be stored.
In one embodiment, the step of storing the service data identifier to be stored, the service data lifecycle management model identifier corresponding to the service data identifier to be stored, and the service data to be stored in a local cache includes:
s31: acquiring a service data life cycle management model from a server according to the service data life cycle management model identification corresponding to the service data identification to be stored, and obtaining the service data life cycle management model corresponding to the service data identification to be stored;
s32: and storing the service data identifier to be stored, the service data life cycle management model identifier corresponding to the service data identifier to be stored, the service data life cycle management model corresponding to the service data identifier to be stored and the service data to be stored in the local cache.
The embodiment realizes that the required service data life cycle management model is stored in the local cache, thereby reducing the data volume stored by the App and improving the response speed.
S31, sending a service data life cycle management model identifier corresponding to the service data identifier to be stored to a server to request to download the service data life cycle management model; and acquiring a service data life cycle management model sent by a server, and taking the received service data life cycle management model as a service data life cycle management model corresponding to the service data identifier to be stored.
For S32, storing the service data identifier to be stored and the service data lifecycle management model identifier corresponding to the service data identifier to be stored in a locally cached service data correspondence table; storing the service data to be stored in a locally cached service database; and storing the service data life cycle management model corresponding to the service data identifier to be stored in locally cached model data.
Referring to fig. 2, the present application further proposes a local cache management device for APP, the device comprising:
a local data storage request acquiring module 100, configured to acquire a local data storage request sent by a target service model, where the local data storage request carries service data to be stored, a service data identifier to be stored, and a target service feature identifier of the target service model;
the service data lifecycle management model identification determining module 200 is configured to search a service data lifecycle management model identification from a lifecycle management model library according to the target service feature identification of the target service model, to obtain a service data lifecycle management model identification corresponding to the service data identification to be stored;
The data caching module 300 is configured to store the service data identifier to be stored, a service data lifecycle management model identifier corresponding to the service data identifier to be stored, and the service data to be stored in a local cache;
a service data operation request determining module 400, configured to obtain a service data operation request, where the service data operation request carries a service data identifier to be operated;
the target service data life cycle management model identification determining module 500 is configured to search for a service data life cycle management model identification from the local cache according to the service data identification to be operated, so as to obtain a target service data life cycle management model identification;
the target service data lifecycle management model determining module 600 is configured to obtain a service data lifecycle management model according to the target service data lifecycle management model identifier, and obtain a target service data lifecycle management model;
and the service data operation module 700 is configured to respond to the service data operation request, and operate the service data corresponding to the service data identifier to be operated based on the target service data lifecycle management model.
According to the embodiment, when a local data storage request is acquired, a service data life cycle management model identification is firstly determined and searched from a life cycle management model library according to a target service characteristic identification of a target service model, a service data life cycle management model identification corresponding to the service data identification to be stored is obtained, the service data identification to be stored, the service data life cycle management model identification corresponding to the service data identification to be stored and the service data to be stored are stored in a local cache, when a service data operation request is acquired, the service data life cycle management model identification is searched from the local cache according to the service data identification to be operated, the target service data life cycle management model identification is obtained, and service data corresponding to the service data life cycle management model to be operated is operated based on the service data life cycle management model identification corresponding to the target service data life cycle management model identification, so that the service data is subjected to life cycle classification management through the service data life cycle management model, the back-end service is not required to be triggered and refreshed each time, the request quantity of the back-end service is reduced, and the service pressure of the back-end server is lightened.
Referring to fig. 3, a computer device is further provided in the embodiment of the present application, where the computer device may be a server, and the internal structure of the computer device may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing data such as a local cache management method for the APP. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a local cache management method for an APP. The local cache management method for the APP comprises the following steps: acquiring a local data storage request sent by a target service model, wherein the local data storage request carries service data to be stored, a service data identifier to be stored and a target service characteristic identifier of the target service model; searching a service data life cycle management model identifier from a life cycle management model library according to the target service characteristic identifier of the target service model to obtain a service data life cycle management model identifier corresponding to the service data identifier to be stored; storing the service data identifier to be stored, the service data lifecycle management model identifier corresponding to the service data identifier to be stored and the service data to be stored in a local cache; acquiring a service data operation request, wherein the service data operation request carries a service data identifier to be operated; searching the service data life cycle management model identification from the local cache according to the service data identification to be operated to obtain a target service data life cycle management model identification; acquiring a service data life cycle management model according to the target service data life cycle management model identification to obtain a target service data life cycle management model; responding to the service data operation request, and operating the service data corresponding to the service data identifier to be operated based on the target service data life cycle management model.
According to the embodiment, when a local data storage request is acquired, a service data life cycle management model identification is firstly determined and searched from a life cycle management model library according to a target service characteristic identification of a target service model, a service data life cycle management model identification corresponding to the service data identification to be stored is obtained, the service data identification to be stored, the service data life cycle management model identification corresponding to the service data identification to be stored and the service data to be stored are stored in a local cache, when a service data operation request is acquired, the service data life cycle management model identification is searched from the local cache according to the service data identification to be operated, the target service data life cycle management model identification is obtained, and service data corresponding to the service data life cycle management model to be operated is operated based on the service data life cycle management model identification corresponding to the target service data life cycle management model identification, so that the service data is subjected to life cycle classification management through the service data life cycle management model, the back-end service is not required to be triggered and refreshed each time, the request quantity of the back-end service is reduced, and the service pressure of the back-end server is lightened.
An embodiment of the present application further provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a local cache management method for an APP, including the steps of: acquiring a local data storage request sent by a target service model, wherein the local data storage request carries service data to be stored, a service data identifier to be stored and a target service characteristic identifier of the target service model; searching a service data life cycle management model identifier from a life cycle management model library according to the target service characteristic identifier of the target service model to obtain a service data life cycle management model identifier corresponding to the service data identifier to be stored; storing the service data identifier to be stored, the service data lifecycle management model identifier corresponding to the service data identifier to be stored and the service data to be stored in a local cache; acquiring a service data operation request, wherein the service data operation request carries a service data identifier to be operated; searching the service data life cycle management model identification from the local cache according to the service data identification to be operated to obtain a target service data life cycle management model identification; acquiring a service data life cycle management model according to the target service data life cycle management model identification to obtain a target service data life cycle management model; responding to the service data operation request, and operating the service data corresponding to the service data identifier to be operated based on the target service data life cycle management model.
According to the executing local cache management method for the APP, the service data lifecycle management model identification is firstly determined from the lifecycle management model library according to the target service characteristic identification of the target service model to obtain the service data lifecycle management model identification corresponding to the service data identification to be stored, the service data lifecycle management model identification corresponding to the service data identification to be stored and the service data to be stored are stored in the local cache, when the service data operation request is obtained, the service data lifecycle management model identification is searched from the local cache according to the service data identification to be operated to obtain the target service data lifecycle management model identification, and the service data corresponding to the service data identification to be operated is operated based on the target service data lifecycle management model identification, so that the service data is subjected to the classification management of the lifecycle through the service data lifecycle management model, the service of the back end is not required to be requested and refreshed each time when the service is triggered, the service request quantity of the back end server is reduced, and the service pressure of the back end server is lightened.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in embodiments may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, apparatus, article or method that comprises the element.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims of the present application.