CN115657949A - Method and device for clearing local storage data, storage medium and electronic equipment - Google Patents

Method and device for clearing local storage data, storage medium and electronic equipment Download PDF

Info

Publication number
CN115657949A
CN115657949A CN202211328085.7A CN202211328085A CN115657949A CN 115657949 A CN115657949 A CN 115657949A CN 202211328085 A CN202211328085 A CN 202211328085A CN 115657949 A CN115657949 A CN 115657949A
Authority
CN
China
Prior art keywords
clearing
target
rule
application program
client
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
CN202211328085.7A
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.)
Guangzhou Boguan Information Technology Co Ltd
Original Assignee
Guangzhou Boguan Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Boguan Information Technology Co Ltd filed Critical Guangzhou Boguan Information Technology Co Ltd
Priority to CN202211328085.7A priority Critical patent/CN115657949A/en
Publication of CN115657949A publication Critical patent/CN115657949A/en
Pending legal-status Critical Current

Links

Images

Abstract

The disclosure relates to the technical field of computers, and provides a method and a device for clearing local storage data, a computer readable storage medium and electronic equipment. Wherein, the method comprises the following steps: responding to the received target clearing rule, and determining clearing logic corresponding to the target clearing rule in an application program; and executing a clearing logic corresponding to the target clearing rule to clear the local storage data of the application program client. According to the method and the device, the clearing logic corresponding to the target clearing rule is configured in the application program in advance, so that the local storage data of the browser can be deleted actively, and the clearing efficiency and the clearing accuracy of the local storage data of the browser are improved.

Description

Method and device for clearing local storage data, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method for clearing locally stored data, an apparatus for clearing locally stored data, a computer-readable storage medium, and an electronic device.
Background
Storing data locally in an application is an important dependent credential for the function to be turned on or off. Taking a browser application as an example, the locally stored data of the browser in the browser application includes a cookie (data stored on the user local terminal), a sessionStorage (session storage), a localStorage (local storage), an indexDB (object oriented database), and the like, and particularly, the localStorage is data persistently stored locally in the browser.
In the related art, for some functions depending on local storage data, when the local storage data needs to be offline or closed emergently in the later period, a new version needs to be released temporarily to clean the local storage data of a user, and the cleaning efficiency is low.
It is noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure and therefore may include information that does not constitute prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
The present disclosure provides a method and an apparatus for clearing locally stored data, a computer-readable storage medium, and an electronic device, so as to improve the problem of low efficiency of clearing locally stored data at least to a certain extent.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, there is provided a method for clearing locally stored data, including: responding to the received target clearing rule, and determining clearing logic corresponding to the target clearing rule in an application program; and executing a clearing logic corresponding to the target clearing rule to clear the local storage data of the application program client.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the method further includes: and configuring clearing logics corresponding to candidate clearing rules in an application program in advance, wherein the target clearing rules comprise one or more of the candidate clearing rules.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the candidate clearing rule includes one or more of clearing locally stored data of all users, clearing locally stored data of a target user, clearing locally all stored data, clearing target key value data in a local storage, and clearing target field data of a target key value in the local storage.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the determining, in the application program, a clearing logic corresponding to the target clearing rule in response to receiving the target clearing rule includes: responding to and monitoring a transmission control protocol sent by an application program server, and obtaining the target clearing rule according to the clearing rule in the transmission control protocol; and determining the clearing logic corresponding to the target clearing rule in the application program.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the determining, in the application, a clearing logic corresponding to the target clearing rule in response to receiving the target clearing rule includes: determining a target application program client indicated by a target clearing rule in response to receiving the target clearing rule; determining a clearing logic corresponding to the target clearing rule in an application program under the condition that the target application program client comprises a current application program client; the executing the clearing logic corresponding to the target clearing rule to clear the local storage data of the application client includes: and executing a clearing logic corresponding to the target clearing rule to clear the local storage data of the current application program client.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the application includes a browser application and/or a native application, and the application client includes a browser application client and/or a native application client.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the method further includes: and recording log information of an operation instruction for executing the clearing logic corresponding to the target clearing rule so as to send the log information to an application program server.
According to a second aspect of the present disclosure, there is provided a clearing apparatus for locally stored data, including: the target clearing rule receiving module is configured to respond to the received target clearing rule and determine clearing logic corresponding to the target clearing rule in an application program; and the data clearing module is configured to execute clearing logic corresponding to the target clearing rule so as to clear the local storage data of the application client.
According to a third aspect of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method of clearing locally stored data as described in the first aspect of the embodiments above.
According to a fourth aspect of an embodiment of the present disclosure, there is provided an electronic apparatus including: a processor; and a storage device for storing one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the method of clearing locally stored data as described in the first aspect of the embodiments above.
As can be seen from the foregoing technical solutions, the method and the apparatus for clearing local storage data, and the computer-readable storage medium and the electronic device for implementing the method for clearing local storage data in the exemplary embodiment of the present disclosure have at least the following advantages and positive effects:
in the technical solutions provided in some embodiments of the present disclosure, in response to receiving a target removal rule, a removal logic corresponding to the target removal rule is determined in an application program, and the removal logic corresponding to the target removal rule is executed to remove local storage data of an application program client. Compared with the prior art, on one hand, the clearing logic of the target clearing rule is configured in the application program in advance, when the local storage data is required to be cleared, the target clearing rule is directly sent to the application program client side through remote, the application program client side can determine the clearing logic corresponding to the target clearing rule in the application program so as to clear the local storage data, repeated development and version sending are not needed, and the clearing efficiency of the local storage data can be improved; on the other hand, the passive situation of user side local data management can be improved through an active deletion mode, and user side local storage data can be effectively and timely managed.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
Fig. 1 is a schematic diagram illustrating a system architecture of an exemplary application environment to which a method and apparatus for clearing local storage data according to an embodiment of the present disclosure may be applied;
FIG. 2 illustrates a flow diagram of a method of purging locally stored data in an exemplary embodiment of the disclosure;
fig. 3 is a flowchart illustrating a method for determining a clearing logic corresponding to a target clearing rule in an application program in an exemplary embodiment of the disclosure;
fig. 4 is a flowchart illustrating another method for determining a clearing logic corresponding to a target clearing rule in an application program according to an exemplary embodiment of the disclosure;
FIG. 5 illustrates a flow diagram of another method of purging locally stored data in an exemplary embodiment of the present disclosure;
FIG. 6 shows a flow diagram of yet another method of purging locally stored data in an exemplary embodiment of the present disclosure;
FIG. 7 is a block diagram illustrating a method for clearing locally stored data in an exemplary embodiment of the present disclosure;
fig. 8 shows a schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
The terms "a", "an", "the" and "said" are used in this specification to denote the presence of one or more elements/components/parts/etc.; the terms "comprising" and "having" are intended to be inclusive and mean that there may be additional elements/components/etc. other than the listed elements/components/etc.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities.
Storing data locally in an application is an important dependent credential for the function to be turned on or off. Taking a browser application as an example, the locally stored data of the browser in the browser application includes a cookie (data stored on the user local terminal), a sessionStorage (session storage), a localStorage (local storage), an indexDB (object oriented database), and the like, and particularly, the localStorage is data persistently stored locally in the browser.
In the related art, for some functions depending on local storage data, when the local storage data needs to be offline or closed emergently in the later period, a new version needs to be released temporarily to clean the local storage data of a user, and the cleaning efficiency is low.
In addition, for the local storage data of the application program, the size of the local storage data is also limited, some historical data may be abandoned, and if the historical data is not cleaned in time, the local storage space of a user is seriously occupied, so that new data cannot be written in, and the normal use of functions is influenced.
In order to solve the above problem, the present disclosure provides a method and an apparatus for clearing local storage data, which may be applied to a system architecture of the exemplary application environment shown in fig. 1.
As shown in fig. 1, the system architecture 100 may include one or more of terminal devices 101, 102, 103, 104, a network 105, and a server 106. The network 105 serves as a medium for providing communication links between the terminal devices 101, 102, 103, 104 and the server 106. Network 105 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few. The terminal devices 101, 102, 103, 104 may be, but are not limited to, smart phones, tablet computers, notebook computers, desktop computers, and the like.
A certain application may be installed in the terminal devices 101, 102, 103, and 104, and accordingly, the terminal devices 101, 102, 103, and 104 may be understood as local application clients. The browser application may be run in a browser, and the browser displays the content in the browser application through the graphical user program group in the terminal equipment 101, 102, 103, and 104, and accordingly, the browser in the terminal equipment 101, 102, 103, and 104 may be understood as a browser application client.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for an implementation. For example, the server 106 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a CDN, a big data and artificial intelligence platform, and the like.
The clearing method of the local storage data provided by the embodiment of the present disclosure may be executed in the terminal devices 101, 102, 103, and 104, and accordingly, the clearing device of the local storage data may be disposed in the terminal devices 101, 102, 103, and 104.
The method for clearing locally stored data provided by the embodiment of the present disclosure may also be executed in the terminal devices 101, 102, 103, and 104 through part of the steps, and executed in the server 106 through part of the steps, and accordingly, the device for clearing locally stored data may be set in part of the modules in the terminal devices 101, 102, 103, and 104, and in part of the modules in the server 106.
The method for clearing the local storage data provided by the embodiment of the present disclosure may also be executed in the server 106, and accordingly, the device for clearing the local storage data may be disposed in the server 106.
Taking the application program as a browser application program, and displaying the content of the browser application program through the graphical user interface of the terminal devices 101, 102, 103, and 104 as an example, a clearing logic corresponding to a candidate clearing rule may be configured in the browser application program in advance, when an application program developer needs to clear locally stored data of a browser application program client, the application program developer may send the clearing rule to the browser application program client through a Transmission Control Protocol (TCP) based on a browser application program server, and after receiving the clearing rule, the browser application program client may determine the clearing logic corresponding to the clearing rule sent by the browser application program server from the clearing logic corresponding to the candidate clearing rule, and execute the clearing logic, so as to clear the locally stored browser application data of the browser application program client. Meanwhile, the browser application program client can also record a clearing log corresponding to the clearing operation and report the clearing log to the browser application program server.
Those skilled in the art will readily appreciate that the above application scenarios are for example only, and the present exemplary embodiment is not limited thereto.
Fig. 2 is a schematic flowchart illustrating a method for clearing local storage data in an exemplary embodiment of the present disclosure, where the method for clearing local storage data provided in this embodiment may be applied to a client where an application program is located. Referring to fig. 1, the method includes:
step S210, responding to the received target clearing rule, and determining a clearing logic corresponding to the target clearing rule in the application program;
step S220, executing the clearing logic corresponding to the target clearing rule to clear the local storage data of the application client.
In the technical solution provided in the embodiment shown in fig. 1, in response to receiving the target removal rule, a removal logic corresponding to the target removal rule is determined in the application program, and the removal logic corresponding to the target removal rule is executed to remove the local storage data of the application program client. Compared with the prior art, on one hand, the clearing logic of the target clearing rule is configured in the application program in advance, when the local storage data is required to be cleared, the target clearing rule is directly sent to the application program client side through remote, the application program client side can determine the clearing logic corresponding to the target clearing rule in the application program so as to clear the local storage data, repeated development and version sending are not needed, and the clearing efficiency of the local storage data can be improved; on the other hand, the passive situation of user side local data management can be improved through an active deletion mode, and user side local storage data can be effectively and timely managed.
The following detailed description of the various steps in the example shown in fig. 1:
in step S210, in response to receiving the target clearing rule, a clearing logic corresponding to the target clearing rule is determined in the application program.
In an exemplary embodiment, the application programs in the present disclosure may include one or more of a browser application program and a native application program.
A browser application, such as a Web (World Wide Web, also called World Wide Web) application, may access a Web application through a Web browser of a terminal device, where the Web application is based on an Internet-enabled application. Access is achieved without downloading and installing an application on the terminal device. Browser applications may be developed as web pages using HTML (Hyper Text Markup Language) and CSS (Cascading Style Sheets). The browser application may be applied to any internet-enabled device, independent of the operating system used by the device.
The local application can be understood as an application program which needs to be installed on the terminal device, and is developed for a specific mobile operating system. These applications may be installed in an application store. That is, the local application needs to be installed and downloaded to the terminal device to be run and used.
In an exemplary embodiment, the clearing logic corresponding to the candidate clearing rule may be configured in the application program in advance. And the target purge rule includes one or more of the candidate purge rules.
For example, an application developer may configure, in advance, a purging logic corresponding to a candidate purging rule of locally stored data of an application client in an application at an application development stage. The candidate clearing rule can be customized according to requirements, and for example, the clearing rule corresponding to the clearing mode possibly used in the later period can be used as the candidate clearing rule.
In an exemplary embodiment, the candidate clearing rules include one or more of clearing locally stored data of all users, clearing locally stored data of target users, clearing locally total stored data, clearing target key value data in local storage, and clearing target field data of target key values in local storage.
By way of example, in the user dimension, the candidate purge rule may include purging locally stored data for all users (i.e., all application clients) and purging locally stored data for target users (i.e., target application clients). Wherein the target user may be one or more of all users. In the data dimension, the candidate purge rule may include purging all locally stored data of the application client, purging locally stored data indicated by a specified key value of the application client, purging a field or item of locally stored data indicated by a specified key value of the application client.
In other words, the candidate purging rules may include one or more of purging all locally stored data of all users, purging target key value data in the local storage of all users, purging target field data of target key values in the local storage of all users, purging all locally stored data of target users, purging target key value data in the local storage of target users, purging target field data of target key values in the local storage of target users.
Of course, the candidate clearing rule may also be customized according to the requirement of the application developer, and may also be other clearing rules that may need to be used for the locally stored data in the application client in the following process.
After the application developer determines the candidate removal rule, the removal logic corresponding to the candidate removal rule can be implemented in the application when the application is developed, that is, the application program is configured with the program code corresponding to the candidate removal rule.
Because the clearing logic corresponding to the candidate clearing rule is configured in the application program in advance, when an application program developer wants to delete locally stored data of the application program client, the target clearing rule can be determined from the candidate clearing rule according to own requirements, then the target clearing rule can be sent to the application program client based on the application program server, after the application program client receives the target clearing rule, the clearing logic corresponding to the target clearing rule can be determined from the application program of the application program client, and then the locally stored data of the application program in the application program client is deleted based on the clearing logic corresponding to the target clearing rule.
For example, fig. 3 is a flowchart illustrating a method for determining a clearing logic corresponding to a target clearing rule in an application program according to an exemplary embodiment of the present disclosure. Referring to fig. 3, the method may include steps S310 to S320. Wherein:
in step S310, in response to monitoring the transmission control protocol sent by the application server, a target clearing rule is obtained according to a clearing rule in the transmission control protocol.
For example, an application developer may configure a monitoring function in an application for monitoring a target removal rule sent by an application server.
When the local storage data of the application program client needs to be cleared, the application program server can broadcast a transmission control protocol to the application program client, and the clearing rule and the user identifier are carried in the transmission control protocol.
After monitoring the transmission control protocol sent by the application program server, the application program can acquire the clearing rule in the transmission control protocol and determine the rule as the target clearing rule.
The clearing rule carried in the transmission control protocol is used for indicating which data in the local storage is cleared, and the user identifier is used for indicating which application program client side local storage data is cleared.
Next, in step S320, a clearing logic corresponding to the target clearing rule is determined in the application program.
As described above, the clearing logic corresponding to each candidate clearing rule is configured in the application program in advance, and after the application program client monitors the target clearing rule sent by the application program server, the clearing logic code corresponding to the target clearing rule can be determined from the clearing logic code corresponding to the candidate clearing rule configured in the application program.
In an exemplary embodiment, the deletion of the local storage data related to the application program in all the application program clients may be performed, or the deletion of the local storage data related to the application program in the specific application program client may be performed.
The clearing rule is sent to the application program client in a broadcast mode through the transmission control protocol, so that the application program client can determine whether to clear the locally stored application program data according to the clearing rule in the transmission control protocol after receiving the transmission control protocol sent by the application program server.
Based on this, fig. 4 shows a flowchart of another method for determining a clearing logic corresponding to a target clearing rule in an exemplary embodiment of the disclosure. Referring to fig. 4, the method may include steps S410 to S440.
In step S410, in response to receiving the target removal rule, a target application client indicated by the target removal rule is determined;
in step S420, it is determined whether the target application client includes the current application client, if so, go to step S430, otherwise go to step S440;
in step S430, determining a removal logic corresponding to the target removal rule in the application program of the current application program client;
in step S440, no processing is performed.
For example, the target clearing rule may include a clearing type and a user identifier, and from the user dimension, in the case that the clearing type is to clear locally stored data of all application clients, the user identifier may be null, and at this time, any application client that receives the target clearing rule may be understood as a target application client. In terms of the user dimension, in the case that the removal type is to remove the locally stored data of the specified application client, the value corresponding to the user identifier may be an identifier corresponding to the application client from which the locally stored data is to be removed.
Based on this, after the application client receives the target removal rule, the target application client indicated by the target removal rule can be determined according to the removal type. Specifically, in the case that the removal type is to remove the locally stored data of all the application clients, it may determine that the current application client receiving the target removal rule may determine that the target application client includes itself; under the condition that the target clearing rule is to clear the local storage data of the specified application program client, each application program client receiving the target clearing rule can continuously acquire the user identification in the target clearing rule, match the user identification in the target clearing rule with the user identification of the application program client, if the matching is successful, the target application program client is determined to comprise the user identification, otherwise, the target application program client is determined not to comprise the user identification.
And if the application program client receiving the target clearing rule determines that the target application program client comprises the application program client, the application program client can determine clearing logic corresponding to the target clearing rule in the application program, otherwise, the application program client can continue to monitor the transmission control protocol sent by the application program server without any processing.
Through the steps S410 to S420, the local storage data in the specified application program client can be actively deleted, so that the accuracy of clearing the local storage data is improved.
Next, in step S220, a clearing logic corresponding to the target clearing rule is executed to clear the locally stored data of the application client.
For example, when the application client that receives the target clearing rule determines that the target application client includes itself, the application client may execute a clearing logic corresponding to the target clearing rule included in the application program, so as to clear data of the application program locally stored by the application client. That is, under the condition that the current application program client is the target application program client, the current application program client executes the clearing logic corresponding to the target clearing rule so as to clear the local storage data of the current application program client.
In an exemplary embodiment, where the application comprises a browser application, the application client comprises a browser application client, as the name implies, that the application has a browser as the client. Where the application comprises a local application, the application client may comprise a local application client, as the name implies, that a download needs to be installed to the terminal device, with the terminal device acting as the client.
In an exemplary embodiment, the application client records log information of an operation instruction for executing the clearing logic corresponding to the target clearing rule so as to send the log information to the application server.
For example, when the application client executes the operation of the clearing logic corresponding to the target clearing rule, the application client may record log information corresponding to the operation, and then report the log information to the application server. Therefore, the compliance and the safety of the clearing process of the local storage data of the application program client can be ensured, and the follow-up is facilitated.
Fig. 5 is a flow chart illustrating another method for clearing locally stored data in an exemplary embodiment of the disclosure. The method for clearing the local storage data can be applied to an application program server side. Referring to fig. 5, the method may include steps S510 to S520.
In step S510, sending the target clearing rule to the application client, so that the application client executes a clearing logic corresponding to the target clearing rule;
in step S520, log information corresponding to a clearing operation of the locally stored data sent by the target application client is received.
For example, when an application developer needs to perform local storage data removal of an application client, a transmission control protocol may be broadcast to the application client through an application server, where the transmission control protocol carries a target removal rule. After monitoring the transmission control protocol sent by the application program server, the application program client can determine the target clearing rule, further determine the clearing logic corresponding to the target clearing rule according to the clearing logic corresponding to the candidate clearing rule which is pre-configured in the application program, and then execute the clearing logic to clear the relevant data of the application program locally stored by the application program client. When the application program client clears the locally stored data, the log information corresponding to the clearing operation can be recorded, and the log information is reported to the application program server.
For specific details in the method for clearing local storage data shown in fig. 5, reference may be made to the method for clearing local storage data shown in fig. 2, which is not described herein again.
In the following, taking an example that the application program is a browser web application, fig. 6 shows a flowchart of a method for clearing locally stored data in another exemplary embodiment of the present disclosure. Referring to fig. 6, the method may include steps S610 to S640. Wherein: in step S610, a purging logic corresponding to the candidate purging rule is configured in the browser application in advance; in step S620, the browser application server sends a transmission control protocol to the browser application client; in step S630, the browser application client executes a clearing logic corresponding to a clearing rule in the transmission control protocol when monitoring the transmission control protocol, so as to clear the locally stored data; in step S640, the browser application client records log information corresponding to the purge processing, and sends the log information to the browser application server.
For example, the purging logic code corresponding to the candidate purging rules may be configured at the time of developing the web application. When the data stored in the browser locally needs to be cleared, the server can issue a TCP (transmission control protocol) to the client, and the protocol content can comprise clearing rules and user information to be cleared. After monitoring the TCP protocol, the client may execute a clearing logic corresponding to a clearing rule in the TCP protocol to clear the local current stored data, and meanwhile, the client may record and report log information in the clearing process.
According to the method for clearing the local storage data, the clearing logic code corresponding to each clearing rule is configured in the application program client only during development, remote clearing of the local storage data of the application program client can be achieved subsequently, a new version does not need to be released again, repeated development is not needed, and the efficiency of clearing the local storage data can be improved. And the passive situation of the management of the local storage data of the user side can be improved, and the local storage data of the user side can be effectively and actively managed accurately.
Those skilled in the art will appreciate that all or part of the steps implementing the above embodiments are implemented as computer programs executed by a CPU. When executed by the CPU, performs the functions defined by the method provided by the present invention. The program may be stored in a computer readable storage medium, which may be a read-only memory, a magnetic or optical disk, or the like.
Furthermore, it should be noted that the above-mentioned figures are only schematic illustrations of the processes involved in the method according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Fig. 7 is a schematic structural diagram of a clearing apparatus for locally storing data in an exemplary embodiment of the present disclosure. Referring to fig. 7, the apparatus 700 may include a target clearing rule receiving module 710 and a data clearing module 720. Wherein:
a target removal rule receiving module 710 configured to determine, in response to receiving a target removal rule, a removal logic corresponding to the target removal rule in an application;
and the data clearing module 720 is configured to execute clearing logic corresponding to the target clearing rule so as to clear the locally stored data of the application client.
In some exemplary embodiments of the present disclosure, based on the foregoing embodiments, the apparatus 700 may further include a provisioning module, which may be configured to: and configuring clearing logics corresponding to candidate clearing rules in an application program in advance, wherein the target clearing rules comprise one or more of the candidate clearing rules.
In some exemplary embodiments of the present disclosure, based on the foregoing embodiments, the candidate clearing rule includes one or more of clearing locally stored data of all users, clearing locally stored data of a target user, clearing locally all stored data, clearing target key value data in a local storage, and clearing target field data of a target key value in a local storage.
In some exemplary embodiments of the present disclosure, based on the foregoing embodiments, the target clearing rule receiving module 710 described above may be specifically configured to: responding to and monitoring a transmission control protocol sent by an application program server, and obtaining the target clearing rule according to the clearing rule in the transmission control protocol; and determining the clearing logic corresponding to the target clearing rule in the application program.
In some exemplary embodiments of the present disclosure, based on the foregoing embodiments, the target clearing rule receiving module 710 may be further specifically configured to: responding to the received target clearing rule, and determining a target application program client indicated by the target clearing rule; determining a clearing logic corresponding to the target clearing rule in an application program under the condition that the target application program client comprises a current application program client;
in some exemplary embodiments of the present disclosure, based on the foregoing embodiments, the foregoing clearing module 720 may be specifically configured to: and executing a clearing logic corresponding to the target clearing rule to clear the local storage data of the current application program client.
In some exemplary embodiments of the present disclosure, based on the foregoing embodiments, the application includes a browser application and/or a native application, and the application client includes a browser application client and/or a native application client.
In some exemplary embodiments of the present disclosure, based on the foregoing embodiments, the apparatus 700 may further include a reporting module, where the reporting module may be configured to: and recording log information of an operation instruction for executing the clearing logic corresponding to the target clearing rule so as to send the log information to an application program server.
The specific details of each unit in the above device for clearing local storage data have been described in detail in the method for clearing local storage data, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, and may also be implemented by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer storage medium capable of implementing the above method. On which a program product capable of implementing the method described above in this specification is stored. In some possible embodiments, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the disclosure described in the above section "exemplary method" of this specification, when the program product is run on the terminal device, such as: responding to the received target clearing rule, and determining clearing logic corresponding to the target clearing rule in an application program; and executing a clearing logic corresponding to the target clearing rule to clear the local storage data of the application program client.
Optionally, a clearing logic corresponding to the candidate clearing rule may be configured in the application program in advance, where the target clearing rule includes one or more of the candidate clearing rules.
Optionally, the candidate removal rule includes one or more of removing local storage data of all users, removing local storage data of a target user, removing all local storage data, removing target key value data in a local storage, and removing target field data of a target key value in a local storage.
Optionally, the determining, in the application program, a clearing logic corresponding to the target clearing rule in response to receiving the target clearing rule includes: responding to and monitoring a transmission control protocol sent by an application program server, and obtaining the target clearing rule according to the clearing rule in the transmission control protocol; and determining the clearing logic corresponding to the target clearing rule in the application program.
Optionally, the determining, in response to receiving the target clearing rule, a clearing logic corresponding to the target clearing rule in the application includes: determining a target application program client indicated by a target clearing rule in response to receiving the target clearing rule; determining a clearing logic corresponding to the target clearing rule in an application program under the condition that the target application program client comprises a current application program client; the executing the clearing logic corresponding to the target clearing rule to clear the local storage data of the application client includes: and executing a clearing logic corresponding to the target clearing rule to clear the local storage data of the current application program client.
Optionally, the application includes a browser application and/or a native application, and the application client includes a browser application client and/or a native application client.
Optionally, log information of an operation instruction for executing the clearing logic corresponding to the target clearing rule may be recorded, so as to send the log information to an application server.
Through the implementation mode of the disclosure, on one hand, the clearing logic of the target clearing rule is configured in the application program in advance, when the local storage data needs to be cleared, the target clearing rule is directly sent to the application program client side through remote, and the application program client side can determine the clearing logic corresponding to the target clearing rule in the application program so as to clear the local storage data, so that repeated development and edition are not needed, and the clearing efficiency of the local storage data can be improved; on the other hand, the passive situation of local data management of the user side can be improved and local storage data of the user side can be effectively and timely managed in an active deleting mode.
Embodiments of the present disclosure may also include a program product for implementing the above method, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 800 according to this embodiment of the disclosure is described below with reference to fig. 8. The electronic device 800 shown in fig. 8 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present disclosure.
As shown in fig. 8, electronic device 800 is in the form of a general purpose computing device. The components of the electronic device 800 may include, but are not limited to: the at least one processing unit 810, the at least one memory unit 820, a bus 830 connecting various system components (including the memory unit 820 and the processing unit 810), and a display unit 840.
Wherein the storage unit stores program code that is executable by the processing unit 810 to cause the processing unit 810 to perform steps according to various exemplary embodiments of the present disclosure as described in the "exemplary methods" section above in this specification. For example, the processing unit 810 may perform the steps shown as follows:
responding to the received target clearing rule, and determining a clearing logic corresponding to the target clearing rule in an application program; and executing a clearing logic corresponding to the target clearing rule to clear the local storage data of the application program client.
Optionally, a clearing logic corresponding to the candidate clearing rule may be configured in the application program in advance, where the target clearing rule includes one or more of the candidate clearing rules.
Optionally, the candidate removal rule includes one or more of removing local storage data of all users, removing local storage data of a target user, removing all local storage data, removing target key value data in a local storage, and removing target field data of a target key value in a local storage.
Optionally, the determining, in the application program, a clearing logic corresponding to the target clearing rule in response to receiving the target clearing rule includes: responding to and monitoring a transmission control protocol sent by an application program server, and obtaining the target clearing rule according to the clearing rule in the transmission control protocol; and determining the clearing logic corresponding to the target clearing rule in the application program.
Optionally, the determining, in response to receiving the target clearing rule, a clearing logic corresponding to the target clearing rule in the application includes: responding to the received target clearing rule, and determining a target application program client indicated by the target clearing rule; determining a clearing logic corresponding to the target clearing rule in an application program under the condition that the target application program client comprises a current application program client; the executing the clearing logic corresponding to the target clearing rule to clear the locally stored data of the application client includes: and executing a clearing logic corresponding to the target clearing rule to clear the local storage data of the current application program client.
Optionally, the application includes a browser application and/or a native application, and the application client includes a browser application client and/or a native application client.
Optionally, log information of an operation instruction for executing the clearing logic corresponding to the target clearing rule may be recorded, so as to send the log information to an application server.
Through the implementation mode of the disclosure, on one hand, the clearing logic of the target clearing rule is configured in the application program in advance, when the local storage data needs to be cleared, the target clearing rule is directly sent to the application program client side through remote, and the application program client side can determine the clearing logic corresponding to the target clearing rule in the application program so as to clear the local storage data, so that repeated development and edition are not needed, and the clearing efficiency of the local storage data can be improved; on the other hand, the passive situation of user side local data management can be improved through an active deletion mode, and user side local storage data can be effectively and timely managed.
The storage unit 820 may include readable media in the form of volatile memory units such as a random access memory unit (RAM) 8201 and/or a cache memory unit 8202, and may further include a read only memory unit (ROM) 8203.
The storage unit 820 may also include a program/utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 830 may be any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 800 may also communicate with one or more external devices 900 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 800, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 800 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 850. Also, the electronic device 800 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 860. As shown, the network adapter 860 communicates with the other modules of the electronic device 800 via the bus 830. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, and may also be implemented by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Furthermore, the above-described drawings are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A method for clearing locally stored data, comprising:
responding to the received target clearing rule, and determining clearing logic corresponding to the target clearing rule in an application program;
and executing a clearing logic corresponding to the target clearing rule to clear the local storage data of the application program client.
2. A method of clearing locally stored data according to claim 1, further comprising:
and configuring clearing logics corresponding to candidate clearing rules in an application program in advance, wherein the target clearing rules comprise one or more of the candidate clearing rules.
3. A method for clearing local storage data according to claim 2, wherein the candidate clearing rules include one or more of clearing local storage data of all users, clearing local storage data of target users, clearing local all storage data, clearing target key value data in local storage, and clearing target field data of target key value in local storage.
4. The method of claim 1, wherein the determining, in the application, a cleanup logic corresponding to a target cleanup rule in response to receiving the target cleanup rule comprises:
responding to and monitoring a transmission control protocol sent by an application program server, and obtaining the target clearing rule according to the clearing rule in the transmission control protocol;
and determining the clearing logic corresponding to the target clearing rule in the application program.
5. The method of claim 1, wherein the determining, in the application, a cleanup logic corresponding to a target cleanup rule in response to receiving the target cleanup rule comprises:
responding to the received target clearing rule, and determining a target application program client indicated by the target clearing rule;
determining a clearing logic corresponding to the target clearing rule in an application program under the condition that the target application program client comprises a current application program client;
the executing the clearing logic corresponding to the target clearing rule to clear the locally stored data of the application client includes:
and executing a clearing logic corresponding to the target clearing rule to clear the local storage data of the current application program client.
6. A cleaning method for local storage data according to claim 1, wherein the application program comprises a browser application program and/or a local application program, and the application program client comprises a browser application program client and/or a local application program client.
7. A method of clearing locally stored data according to claim 1, the method further comprising:
and recording log information of an operation instruction for executing the clearing logic corresponding to the target clearing rule so as to send the log information to an application program server.
8. An apparatus for purging locally stored data, comprising:
the target clearing rule receiving module is configured to respond to receiving a target clearing rule and determine clearing logic corresponding to the target clearing rule in an application program;
and the data clearing module is configured to execute clearing logic corresponding to the target clearing rule so as to clear the locally stored data of the application client.
9. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out the method of any one of claims 1 to 7.
CN202211328085.7A 2022-10-26 2022-10-26 Method and device for clearing local storage data, storage medium and electronic equipment Pending CN115657949A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211328085.7A CN115657949A (en) 2022-10-26 2022-10-26 Method and device for clearing local storage data, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211328085.7A CN115657949A (en) 2022-10-26 2022-10-26 Method and device for clearing local storage data, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN115657949A true CN115657949A (en) 2023-01-31

Family

ID=84993980

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211328085.7A Pending CN115657949A (en) 2022-10-26 2022-10-26 Method and device for clearing local storage data, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN115657949A (en)

Similar Documents

Publication Publication Date Title
CN108196915B (en) Code processing method and device based on application container engine and storage medium
US10289468B1 (en) Identification of virtual computing instance issues
CN110083455B (en) Graph calculation processing method, graph calculation processing device, graph calculation processing medium and electronic equipment
CN109656570B (en) Cluster system, operation method thereof, electronic device and storage medium
US10572319B2 (en) Optimization of message oriented middleware monitoring in heterogenenous computing environments
US9374417B1 (en) Dynamic specification auditing for a distributed system
CN111190673B (en) Page display method and device based on operation monitoring and electronic equipment
US11314575B2 (en) Computing system event error corrective action recommendation
US11934287B2 (en) Method, electronic device and computer program product for processing data
CN110858172A (en) Automatic test code generation method and device
CN110442402A (en) Data processing method, device, equipment and storage medium
CN112615909B (en) Method for storing data in cascade storage server cluster and related equipment
CN114022711A (en) Industrial identification data caching method and device, medium and electronic equipment
CN113656102A (en) Data point burying method and device, storage medium and electronic equipment
CN112394907A (en) Container-based delivery system construction method, application delivery method and delivery system
CN113722007B (en) Configuration method, device and system of VPN branch equipment
CN115657949A (en) Method and device for clearing local storage data, storage medium and electronic equipment
US11803438B2 (en) Message call request data having error frequency metrics
CN111681093B (en) Method and device for displaying resource page and electronic equipment
CN114398343A (en) Database abnormal key processing method, device, equipment and medium
CN111767111A (en) Page data processing method and device, electronic equipment and storage medium
CN111176982A (en) Test interface generation method and device
CN110825599A (en) Information management system monitoring method, device, medium, electronic equipment and system
WO2024000917A1 (en) Non-intrusive, pluggable front-end build transfer acceleration method and apparatus
CN109639686B (en) Distributed webpage filtering method and device, electronic equipment and storage medium

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