Method and device for clearing local stored data, storage medium and electronic device
By pre-configuring the clearing rule logic in the application and remotely sending the target clearing rules, the problem of low efficiency in clearing local storage data in browser applications is solved, and efficient local storage data management is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-26
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, browser applications are inefficient at clearing local storage data when they need to go offline or shut down urgently, resulting in excessive local storage space being occupied by users and affecting normal functionality.
The application pre-configures the clearing logic corresponding to the candidate clearing rules, remotely sends the target clearing rules via the Transmission Control Protocol, and the browser application client determines and executes the clearing logic to clear the locally stored data.
It improves the efficiency of clearing local storage data, avoids redundant development and version releases, and enables timely management of user-side local storage data.
Smart Images

Figure CN115657949B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and in particular, to a method and device for clearing local storage data, a computer readable storage medium and an electronic device. BACKGROUND
[0002] Local storage data in an application is an important dependent credential for the opening or closing of a function. Taking a browser application as an example, the local storage data of the browser in the browser application includes cookie (data stored on the user's local terminal), sessionStorage (session storage), localStorage (local storage), indexDB (object-oriented database), etc., and localStorage is the data persistently stored in the local browser in particular.
[0003] In the related art, for some functions that depend on local storage data, when they need to be closed in the later stage or in an emergency, a new version needs to be temporarily released to clean up the user's local storage data, which is inefficient.
[0004] It should be noted that the information disclosed in the above background section is only used to strengthen the understanding of the background of the present disclosure, and therefore can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY
[0005] The purpose of the present disclosure is to provide a method and device for clearing local storage data, a computer readable storage medium and an electronic device, thereby at least partially improving the problem of low efficiency of clearing local storage data.
[0006] Other characteristics and advantages of the present disclosure will become apparent from the following detailed description, or will be learned by practice of the present disclosure.
[0007] According to a first aspect of the present disclosure, a method for clearing local storage data is provided, comprising: in response to receiving a target clearing rule, determining a clearing logic corresponding to the target clearing rule in an application; and executing the clearing logic corresponding to the target clearing rule to clear the local storage data of the application client.
[0008] In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the method further comprises: pre-configuring a clearing logic corresponding to a candidate clearing rule in the application, and the target clearing rule comprises one or more of the candidate clearing rules.
[0009] In an example embodiment of the present disclosure, based on the foregoing scheme, the candidate clearing rule comprises one or more of clearing all local storage data of all users, clearing local storage data of a target user, clearing all local storage data, clearing target key value data in the local storage, and clearing target field data of the target key value in the local storage.
[0010] In an example embodiment of the present disclosure, based on the foregoing scheme, in response to receiving the target clearing rule, determining the clearing logic corresponding to the target clearing rule in the application program comprises: in response to listening to a transmission control protocol sent by the application program server, 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.
[0011] In an example embodiment of the present disclosure, based on the foregoing scheme, in response to receiving the target clearing rule, determining the clearing logic corresponding to the target clearing rule in the application program comprises: in response to receiving the target clearing rule, determining a target application program client indicated by the target clearing rule; in the case where the target application program client comprises the current application program client, determining the clearing logic corresponding to the target clearing rule in the application program; and executing the clearing logic corresponding to the target clearing rule to clear the local storage data of the application program client comprises: executing the clearing logic corresponding to the target clearing rule to clear the local storage data of the current application program client.
[0012] In an example embodiment of the present disclosure, based on the foregoing scheme, 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.
[0013] In an example embodiment of the present disclosure, based on the foregoing scheme, the method further comprises: recording log information of an operation indication of executing the clearing logic corresponding to the target clearing rule, and sending the log information to the application program server.
[0014] According to a second aspect of the present disclosure, a local storage data clearing device is provided, comprising: a target clearing rule receiving module configured to determine, in response to receiving a target clearing rule, a clearing logic corresponding to the target clearing rule in an application program; and a data clearing module configured to execute the clearing logic corresponding to the target clearing rule to clear local storage data of an application program client.
[0015] According to a third aspect of the present disclosure, a computer readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, implements the method for clearing local storage data according to the first aspect of the above-described embodiments.
[0016] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: 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 for clearing local storage data according to the first aspect of the above-described embodiments.
[0017] According to the above technical solutions, the method for clearing local storage data, the device for clearing local storage data, and the computer readable storage medium and the electronic device for implementing the method for clearing local storage data according to the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
[0018] In the technical solutions provided in some embodiments of the present disclosure, in response to receiving the target clearing rule, the clearing logic corresponding to the target clearing rule is determined in the application program, the clearing logic corresponding to the target clearing rule is executed to clear the local storage data of the application program client. Compared with the related art, on the one hand, the present disclosure pre-configures the clearing logic of the target clearing rule in the application program, and when it is necessary to clear the local storage data, the target clearing rule is directly sent to the application program client remotely, so that the application program client can determine the clearing logic corresponding to the target clearing rule in the application program to clear the local storage data, without repeated development and release, which can improve the clearing efficiency of the local storage data. On the other hand, the present disclosure can improve the passive situation of user-side local data management by means of active deletion, and can effectively and timely manage the user-side local storage data.
[0019] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0020] The accompanying drawings, which are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure. It is obvious that the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0021] Figure 1 A schematic diagram of a system architecture of an exemplary application environment of a method and device for clearing local storage data to which the embodiments of the present disclosure can be applied is shown;
[0022] Figure 2 Fig. 1 shows a flowchart of a method for clearing locally stored data in an example embodiment of the present disclosure;
[0023] Figure 3 Fig. 2 shows a flowchart of a method for determining the clearing logic corresponding to a target clearing rule in an application in an example embodiment of the present disclosure;
[0024] Figure 4 Fig. 3 shows a flowchart of another method for determining the clearing logic corresponding to a target clearing rule in an application in an example embodiment of the present disclosure;
[0025] Figure 5 Fig. 4 shows a flowchart of another method for clearing locally stored data in an example embodiment of the present disclosure;
[0026] Figure 6 Fig. 5 shows a flowchart of still another method for clearing locally stored data in an example embodiment of the present disclosure;
[0027] Figure 7 Fig. 6 shows a structural diagram of a method for clearing locally stored data in an example embodiment of the present disclosure;
[0028] Figure 8 Fig. 7 shows a structural diagram of an electronic device in an example embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] Example implementations will now be described more fully with reference to the accompanying drawings. Example implementations may, however, be implemented in many different forms and should not be construed as limited to the implementations set forth herein; rather, these implementations are provided so that this disclosure will be thorough and complete, and will fully convey the scope of example implementations to those skilled in the art. The described features, structures, or characteristics can be combined in one or more implementations. In the following description, numerous specific details are provided, such as examples of programming, software modules, user selections, etc., to provide a thorough understanding of implementations of the present disclosure. One skilled in the relevant art will recognize, however, that the implementations can be practiced without one or more of the specific details, or with other methods, components, materials, and so forth. Some features, structures, or characteristics can be described as being part of one or more implementations, but can be combined in other implementations. In other instances, well-known features, structures or characteristics have not been described in order to avoid obscuring the concepts of the present disclosure.
[0030] The terms "a," "an," "the," and "said" are used as referring to one or more item / element / part, etc.; the term "comprising" and "having" are used as meaning including, but not limited to, the listed item / element / part, etc.
[0031] In addition, the accompanying drawings are merely schematic and are not intended to be drawn to scale. Identical reference numerals denote like or similar elements throughout the several views, so that repeated description will be omitted. Some of the block diagrams shown in the drawings are functional entities that do not necessarily correspond to physically or logically separate entities.
[0032] Storing data locally in an application is an important dependent credential for turning on or off a function. Taking a browser application as an example, the local storage data of the browser in the browser application includes cookies (data stored on the user's local terminal), sessionStorage (session storage), localStorage (local storage), indexDB (object-oriented database), etc., and localStorage is the data stored persistently in the local browser.
[0033] In the related art, for some functions that depend on local storage data, when they need to be closed in the later stage or in an emergency, a new version needs to be temporarily released to clean up the user's local storage data, and the cleaning efficiency is low.
[0034] In addition, for the local storage data of an application, it also has a size limit, and some historical data may have been abandoned. If it is not cleaned up in time, the user's local storage space will be seriously occupied, so that new data cannot be written, and the normal use of the function is affected.
[0035] To solve the above problems, the present disclosure provides a method and device for cleaning local storage data, which can be applied to Figure 1 the system architecture of the exemplary application environment shown.
[0036] As shown in Figure 1 , the system architecture 100 can include one or more of terminal devices 101, 102, 103, 104, a network 105, and a server 106. The network 105 is used to provide a communication link medium between the terminal devices 101, 102, 103, 104 and the server 106. The network 105 can include various connection types, such as wired, wireless communication links, or optical fiber cables, etc. The terminal devices 101, 102, 103, 104 can be smart phones, tablet computers, notebook computers, desktop computers, etc., but are not limited thereto.
[0037] The terminal device 101, 102, 103, 104 can install an application program, and the terminal device 101, 102, 103, 104 can be understood as a local application program client. The browser application program can run in the browser, and the browser displays the content in the browser application program through the graphical user interface of the terminal device 101, 102, 103, 104, and the browser in the terminal device 101, 102, 103, 104 can be understood as a browser application program client.
[0038] It should be understood that Figure 1 The number of terminal devices, networks and servers in the system is only illustrative. According to the needs of implementation, there can be any number of terminal devices, networks and servers. For example, the server 106 can be a stand-alone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms.
[0039] The method for cleaning local storage data provided by the embodiments of the present disclosure can be executed in the terminal device 101, 102, 103, 104, and accordingly, the cleaning device for local storage data can be arranged in the terminal device 101, 102, 103, 104.
[0040] The method for cleaning local storage data provided by the embodiments of the present disclosure can also be partially executed in the terminal device 101, 102, 103, 104 and partially executed in the server 106, and accordingly, the cleaning device for local storage data can be partially arranged in the terminal device 101, 102, 103, 104 and partially arranged in the server 106.
[0041] The method for cleaning local storage data provided by the embodiments of the present disclosure can also be executed in the server 106, and accordingly, the cleaning device for local storage data can be arranged in the server 106.
[0042] With the application program being a browser application program, taking the example of displaying the content of the browser application program through the graphical user interface of the terminal device 101, 102, 103, 104, the candidate clearing rule corresponding clearing logic can be configured in the browser application program in advance. When the application developer needs to clear the local storage data of the browser application program client, the application developer can send the clearing rule to the browser application program client based on the browser application program server through the transmission control protocol (TCP). After receiving the clearing rule, the browser application program client can determine the clearing logic corresponding to the clearing rule sent by the browser application program server from the candidate clearing rule corresponding clearing logic, and execute the clearing logic to clear the data of the browser application stored locally by the browser application program client. At the same time, the browser application program client can also record the clearing log corresponding to the clearing operation, and report the clearing log to the browser application program server.
[0043] It is easy for those skilled in the art to understand that the above application scenarios are only for example, and the present example embodiment is not limited thereto.
[0044] Figure 2 The flowchart of the local storage data clearing method in the example embodiment of the present disclosure is shown. The local storage data clearing method provided in the present embodiment can be applied to the client where the application program is located. Referring to Figure 1 The method comprises:
[0045] Step S210, in response to receiving the target clearing rule, determining the clearing logic corresponding to the target clearing rule in the application program;
[0046] Step S220, executing the clearing logic corresponding to the target clearing rule to clear the local storage data of the application program client.
[0047] In Figure 1In the technical solution provided by the embodiment, in response to receiving the target clearing rule, the clearing logic corresponding to the target clearing rule is determined in the application program, and the clearing logic corresponding to the target clearing rule is executed to clear the local storage data of the application program client. Compared with the related art, on the one hand, the disclosure pre-configures the clearing logic of the target clearing rule in the application program, and when local storage data needs to be cleared, the target clearing rule is directly sent to the application program client remotely, so that the application program client can determine the clearing logic corresponding to the target clearing rule in the application program to clear the local storage data, without repeated development and release, and the clearing efficiency of the local storage data can be improved. On the other hand, the disclosure can improve the passive situation of user-side local data management by the active deletion manner, and can effectively and timely manage the user-side local storage data.
[0048] The specific implementation of each step in the embodiment is described in detail as follows: Figure 1 The specific implementation of each step in the embodiment is described in detail as follows:
[0049] In step S210, in response to receiving the target clearing rule, the clearing logic corresponding to the target clearing rule is determined in the application program.
[0050] In an exemplary embodiment, the application program in the disclosure can include one or more of a browser application program and a local application program.
[0051] The browser application program, such as a web (World Wide Web, also known as the World Wide Web) application program, can access the web application program through the web browser of the terminal device, and the web application program is based on an Internet-enabled application program. It can be achieved without downloading the application program and installing it on the terminal device. The browser application program can be developed into a web page using HTML (Hyper Text Markup Language) and CSS (Cascading Style Sheets). The browser application program can be applied to any device that can access the Internet, and does not depend on the operating system used by the device.
[0052] The local application program can be understood as an application program that needs to be installed on the terminal device itself and is developed for a specific mobile operating system. These application programs can be obtained and installed in the application store. That is, the local application program needs to be installed and downloaded to the terminal device to run.
[0053] In an exemplary embodiment, the clearing logic corresponding to the candidate clearing rule can be pre-configured in the application program. The target clearing rule includes one or more of the candidate clearing rules.
[0054] For example, the application developer can configure the application client to implement the candidate cleaning rule corresponding to the cleaning logic for cleaning the local storage data of the application client in the application during the development of the application. The candidate cleaning rule can be customized according to the needs, such as the cleaning rule corresponding to the cleaning method that can be used later.
[0055] In an exemplary embodiment, the candidate cleaning rule includes one or more of cleaning all local storage data of all users, cleaning local storage data of a target user, cleaning all local storage data, cleaning target key value data in the local storage, and cleaning target field data of the target key value in the local storage.
[0056] For example, in the user dimension, the candidate cleaning rule can include cleaning all local storage data of all users (i.e., all application clients) and cleaning local storage data of a target user (i.e., a target application client). The target user can be one or more of all users. In the data dimension, the candidate cleaning rule can include cleaning all local storage data of the application client, cleaning local storage data of the application client indicated by a specified key value, and cleaning local storage data of the application client indicated by a certain field or item in the specified key value.
[0057] In other words, the candidate cleaning rule can include one or more of cleaning all local storage data of all users, cleaning target key value data in the local storage of all users, cleaning target field data of the target key value in the local storage of all users, cleaning all local storage data of a target user, cleaning target key value data in the local storage of the target user, and cleaning target field data of the target key value in the local storage of the target user.
[0058] Of course, the candidate cleaning rule can also be customized according to the needs of the application developer, and can be other cleaning rules that can be used for cleaning the local storage data of the application client later. The exemplary embodiment does not limit the characteristics.
[0059] After the application developer determines the candidate cleaning rule, the application developer can implement the cleaning logic corresponding to the candidate cleaning rule in the application during the development of the application, i.e., configure the program code corresponding to the candidate cleaning rule in the application.
[0060] Since the candidate cleaning rule corresponding cleaning logic is pre-configured in the application, when the application developer wants to delete the local storage data of the application client, the target cleaning rule can be determined from the candidate cleaning rule according to the needs of the application developer, and then the target cleaning rule can be sent to the application client based on the application server. After receiving the target cleaning rule, the application client can determine the cleaning logic corresponding to the target cleaning rule from the application, and then delete the data of the application stored in the local storage of the application client based on the cleaning logic corresponding to the target cleaning rule.
[0061] Exemplary, Figure 3 A flowchart of a method for determining the cleaning logic corresponding to the target cleaning rule in the application is shown in an exemplary embodiment of the present disclosure. Referring to Figure 3 The method can include steps S310 to S320. Wherein:
[0062] In step S310, in response to listening to the transmission control protocol sent by the application server, the target cleaning rule is obtained according to the cleaning rule in the transmission control protocol.
[0063] For example, the application developer can configure a listening function in the application for listening to the target cleaning rule sent by the application server.
[0064] When it is necessary to clean the local storage data of the application client, the application server can broadcast a transmission control protocol to the application client, and the cleaning rule and the user identifier are carried in the transmission control protocol.
[0065] After the application listens to the transmission control protocol sent by the application server, the cleaning rule in the transmission control protocol can be obtained, and the rule is determined as the target cleaning rule.
[0066] The cleaning rule carried in the transmission control protocol is used to indicate which data in the local storage is cleaned, and the user identifier is used to indicate which local storage data in the application client is cleaned.
[0067] Next, in step S320, the cleaning logic corresponding to the target cleaning rule is determined in the application.
[0068] As described above, the cleaning logic corresponding to each candidate cleaning rule is pre-configured in the application, and the application client can determine the cleaning logic code corresponding to the target cleaning rule from the cleaning logic code corresponding to the candidate cleaning rule configured in the application after listening to the target cleaning rule sent by the application server.
[0069] In an exemplary embodiment, the application-related locally-stored data in all application clients can be deleted, or the application-related locally-stored data in specified application clients can be deleted.
[0070] Since the clearing rule is sent to the application clients in a broadcast manner through the transmission control protocol, after receiving the transmission control protocol sent by the application server, the application client can determine whether the application data locally stored by itself needs to be cleared according to the clearing rule in the transmission control protocol.
[0071] Based on this, Figure 4 A flowchart showing another method for determining the clearing logic corresponding to the target clearing rule in an exemplary embodiment of the present disclosure is shown. Referring to FIG. 4, Figure 4 The method can include steps S410 to S440.
[0072] In step S410, in response to receiving the target clearing rule, the target application client indicated by the target clearing rule is determined.
[0073] In step S420, it is judged whether the target application client includes the current application client. If yes, go to step S430, otherwise go to step S440.
[0074] In step S430, in the application of the current application client, the clearing logic corresponding to the target clearing rule is determined.
[0075] In step S440, no processing is performed.
[0076] For example, the target clearing rule can include a clearing type and a user identifier. From the user dimension, in the case of the clearing type being to clear the locally-stored data of all application clients, the user identifier can be empty. At this time, any application client receiving the target clearing rule can be understood as the target application client. From the user dimension, in the case of the clearing type being to clear the locally-stored data of specified application clients, the value of the user identifier can be the identifier corresponding to the application client whose locally-stored data is to be cleared.
[0077] Based on this, after the application client receives the target clearing rule, the target application client indicated by the target clearing rule can be determined according to the clearing type. Specifically, in the case where the clearing type is clearing all local storage data of the application client, it can be determined that the current application client itself is the target application client, i.e., the current application client receiving the target clearing rule can determine that the target application client includes itself; in the case where the target clearing rule is clearing local storage data of a specified application client, each application client receiving the target clearing rule can continue to acquire the user identifier in the target clearing rule, and match the user identifier in the target clearing rule with the user identifier of itself. If the matching is successful, it is determined that the target application client includes itself, otherwise, it is determined that the target application client does not include itself.
[0078] In the case where the application client receiving the target clearing rule determines that the target application client includes itself, the application client can determine the clearing logic corresponding to the target clearing rule in the application, otherwise, the application client can not perform any processing and continue to listen to the transmission control protocol sent by the application server.
[0079] Through the above steps S410 to S420, the local storage data in the specified application client can be actively deleted, and the accuracy of clearing the local storage data is improved.
[0080] Next, in step S220, the clearing logic corresponding to the target clearing rule is executed to clear the local storage data of the application client.
[0081] For example, in the case where the application client receiving the target clearing rule determines that the target application client includes itself, the application client can execute the clearing logic corresponding to the target clearing rule included in the application, so as to clear the data of the application stored in itself. That is, in the case where the current application client is the target application client, the current application client executes the clearing logic corresponding to the target clearing rule to clear the local storage data of the current application client.
[0082] In an exemplary embodiment, in the case where the application includes a browser application, the application client includes a browser application client, which is self-explanatory, i.e., the application takes the browser as the client. In the case where the application includes a local application, the application client can include a local application client, which is self-explanatory, i.e., the application needs to be downloaded and installed on the terminal device, and the terminal device is taken as the client.
[0083] In an example embodiment, the application client records log information of an operation instruction of the cleaning logic corresponding to the target cleaning rule, and sends the log information to the application server.
[0084] For example, the application client can record log information corresponding to the operation of the cleaning logic corresponding to the target cleaning rule, and then report the log information to the application server. In this way, the compliance and security of the cleaning process of the local storage data of the application client can be ensured, and the tracking in the future can be facilitated.
[0085] Figure 5 A flowchart of another method for cleaning local storage data in an example embodiment of the present disclosure is shown. The method for cleaning local storage data can be applied to an application server. Referring to Figure 5 , the method can include steps S510 to S520.
[0086] In step S510, a target cleaning rule is sent to an application client, so that the application client executes the cleaning logic corresponding to the target cleaning rule;
[0087] In step S520, log information corresponding to the cleaning operation of the local storage data sent by the target application client is received.
[0088] For example, when the application developer needs to clean the local storage data of the application client, the application server can broadcast a transmission control protocol to the application client, and the transmission control protocol carries a target cleaning rule. After listening to the transmission control protocol sent by the application server, the application client can determine the target cleaning rule from the transmission control protocol, and then determine the cleaning logic corresponding to the target cleaning rule from the cleaning logic corresponding to the candidate cleaning rule pre-configured in the application, and then execute the cleaning logic to clean the related data of the application stored locally by the application client. When cleaning the local storage data, the application client can record log information corresponding to the cleaning operation, and report the log information to the application server.
[0089] Among them, Figure 5 The specific details of the method for cleaning local storage data shown can refer to the method for cleaning local storage data shown in the above Figure 2 , which will not be described here.
[0090] Next, taking a browser web application as an example, Figure 6 A flowchart of another method for cleaning local storage data in an example embodiment of the present disclosure is shown. Referring to Figure 6The method can include steps S610 to S640. In step S610, the candidate clearing rule corresponding clearing logic is configured in advance in the browser application; in step S620, the browser application program server sends a transmission control protocol to the browser application program client; in step S630, the browser application program client executes the clearing logic corresponding to the clearing rule in the transmission control protocol to clear the local storage data when the transmission control protocol is listened to; in step S640, the browser application program client records the log information corresponding to the clearing process and sends the log information to the browser application program server.
[0091] For example, when developing a web application, the clearing logic code corresponding to the candidate clearing rule can be configured in the web application. When it is necessary to clear the browser local storage data, the server can issue a TCP protocol to the client, and the protocol content can include the clearing rule and the user information to be cleared. After the client listens to the TCP protocol, the client can execute the clearing logic corresponding to the clearing rule in the TCP protocol to clear the current local storage data. Meanwhile, the client can record and report log information during the clearing process.
[0092] According to the local storage data clearing method of the present disclosure, only the clearing logic code corresponding to each clearing rule needs to be configured in the application program client during development, and subsequent remote clearing of the local storage data of the application program client can be implemented without the need to release a new version or repeat development, thereby improving the efficiency of local storage data clearing. The passive situation of user-side local storage data management can be improved, and the user-side local storage data can be actively and accurately managed.
[0093] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments are implemented as a computer program executed by a CPU. When the computer program is executed by the CPU, the above-mentioned functions defined by the above-mentioned method provided by the present application are executed. The program can be stored in a computer readable storage medium, which can be a read-only memory, a magnetic disk or an optical disk, etc.
[0094] In addition, it should be noted that the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present application, and are not for limiting purposes. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be executed synchronously or asynchronously, for example, in multiple modules.
[0095] Figure 7 A structure schematic diagram of a local storage data clearing device in an exemplary embodiment of the present disclosure is shown. Referring to Figure 7The apparatus 700 can comprise a target clearance rule receiving module 710 and a data clearance module 720. Wherein:
[0096] The target clearance rule receiving module 710 is configured to determine the clearance logic corresponding to the target clearance rule in the application in response to receiving the target clearance rule.
[0097] The data clearance module 720 is configured to execute the clearance logic corresponding to the target clearance rule to clear the local storage data of the application client.
[0098] In some example embodiments of the present disclosure, based on the foregoing embodiments, the apparatus 700 can further comprise a pre-configuration module, which can be configured to pre-configure the clearance logic corresponding to the candidate clearance rule in the application, and the target clearance rule comprises one or more of the candidate clearance rules.
[0099] In some example embodiments of the present disclosure, based on the foregoing embodiments, the candidate clearance rule comprises one or more of clearing all local storage data of all users, clearing local storage data of a target user, clearing all local storage data, clearing target key value data in the local storage, and clearing target field data of the target key value in the local storage.
[0100] In some example embodiments of the present disclosure, based on the foregoing embodiments, the target clearance rule receiving module 710 described above can be specifically configured to obtain the target clearance rule according to the clearance rule in the transmission control protocol in response to listening to the transmission control protocol sent by the application server, and determine the clearance logic corresponding to the target clearance rule in the application.
[0101] In some example embodiments of the present disclosure, based on the foregoing embodiments, the target clearance rule receiving module 710 described above can be specifically configured to determine the target application client indicated by the target clearance rule in response to receiving the target clearance rule, and determine the clearance logic corresponding to the target clearance rule in the application in the case that the target application client comprises the current application client.
[0102] In some example embodiments of the present disclosure, based on the foregoing embodiments, the clearance module 720 described above can be specifically configured to execute the clearance logic corresponding to the target clearance rule to clear the local storage data of the current application client.
[0103] In some example embodiments of the present disclosure, based on the foregoing embodiments, the application comprises a browser application and / or a local application, and the application client comprises a browser application client and / or a local application client.
[0104] In some example embodiments of the present disclosure, based on the foregoing embodiments, the apparatus 700 can further include a reporting module, which can be configured to record log information of an operation instruction of executing the cleaning logic corresponding to the target cleaning rule, and send the log information to an application server.
[0105] The specific details of the units of the cleaning apparatus of the local storage data have been described in detail in the cleaning method of the local storage data, and thus will not be described here.
[0106] It should be noted that, although several modules or units of the device for action execution are mentioned in the foregoing detailed description, such division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into several modules or units.
[0107] In addition, although the steps of the method in the present disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired result. Additionally or alternatively, some steps can be omitted, a plurality of steps can be combined into one step, one step can be divided into a plurality of steps, etc.
[0108] Through the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.) or a network, and includes a number of instructions to make a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) execute the method according to the embodiments of the present disclosure.
[0109] In the exemplary embodiments of the present disclosure, a computer storage medium capable of implementing the above method is also provided. A program product capable of implementing the above method of the present disclosure is stored thereon. In some possible embodiments, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program code for causing the terminal device to perform the steps described in the above "Exemplary Method" section according to various exemplary embodiments of the present disclosure when the program product is run on the terminal device, such as: in response to receiving a target cleaning rule, determining the cleaning logic corresponding to the target cleaning rule in the application; and executing the cleaning logic corresponding to the target cleaning rule to clean the local storage data of the application client.
[0110] Optionally, the cleaning logic corresponding to the candidate cleaning rule can be pre-configured in the application, and the target cleaning rule includes one or more of the candidate cleaning rules.
[0111] Optionally, the candidate cleaning rule includes one or more of cleaning all local storage data of all users, cleaning local storage data of a target user, cleaning all local storage data, cleaning target key value data in the local storage, and cleaning target field data of the target key value in the local storage.
[0112] Optionally, the step of determining the cleaning logic corresponding to the target cleaning rule in the application in response to receiving the target cleaning rule includes: in response to listening to the transmission control protocol sent by the application server, obtaining the target cleaning rule according to the cleaning rule in the transmission control protocol; and determining the cleaning logic corresponding to the target cleaning rule in the application.
[0113] Optionally, the step of determining the cleaning logic corresponding to the target cleaning rule in the application in response to receiving the target cleaning rule includes: in response to receiving the target cleaning rule, determining the target application client indicated by the target cleaning rule; in the case where the target application client includes the current application client, determining the cleaning logic corresponding to the target cleaning rule in the application; and the step of executing the cleaning logic corresponding to the target cleaning rule to clean the local storage data of the application client includes: executing the cleaning logic corresponding to the target cleaning rule to clean the local storage data of the current application client.
[0114] Optionally, the application includes a browser application and / or a local application, and the application client includes a browser application client and / or a local application client.
[0115] Optionally, log information of an operation instruction of executing the cleaning logic corresponding to the target cleaning rule can be recorded and sent to the application server side.
[0116] Through the embodiments of the present disclosure, on the one hand, the present disclosure can improve the cleaning efficiency of the local storage data by pre-configuring the cleaning logic of the target cleaning rule in the application, directly sending the target cleaning rule to the application client side remotely when the local storage data needs to be cleaned, and determining the cleaning logic corresponding to the target cleaning rule in the application by the application client side to clean the local storage data without repeated development and release; on the other hand, the present disclosure can improve the passive situation of the user side local data management by the active deletion manner, and can effectively and timely manage the user side local storage data.
[0117] The embodiments of the present disclosure can also include a program product for implementing the above method, which can adopt a portable compact disc read-only memory (CD-ROM) and include a program code, and can run on a terminal device such as a personal computer. However, the program product of the present disclosure is not limited to this, and in this document, the readable storage medium can be any tangible medium containing or storing a program which can be used or combined with an instruction execution system, device or apparatus.
[0118] The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include an electrical connection having one or more wires, a portable disc, 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 above.
[0119] The computer readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, in which readable program codes are borne. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The readable signal medium can also be any readable medium other than the readable storage medium, which can send, propagate or transmit a program for use by or in connection with an instruction execution system, device or apparatus.
[0120] The program code embodied on the computer readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, and the like, or any suitable combination of the foregoing.
[0121] Program code implemented as routine 920 is shown stored on a computer readable medium 910, such as a storage device. The program code 920 can be downloaded over a network from computer readable medium 910 or from another computer readable medium or to another computer readable medium. Program code 920 can be downloaded using, for example, the Internet or an intranet. In some embodiments, program code 920 can be downloaded over the network 950, for example, from the server 930. A remote server can transmit program code 920 expected for execution by a computing device 900, or instructions directing a remote server to transmit the program code 920. One will appreciate the program code 920 may
[0122] Furthermore, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above-described method is provided.
[0123] Those skilled in the art can understand that each aspect of the present disclosure can be implemented as a system, a method or a program product. Therefore, each aspect of the present disclosure can be specifically implemented as a form of entirely hardware, entirely software (including firmware, microcode, etc.), or a combination of hardware and software, which can be collectively referred to as "circuitry", "module" or "system".
[0124] The electronic device 800 according to this embodiment of the present disclosure will be described below with reference to Figure 8 Figure 8 The electronic device 800 shown is merely an example and should not limit the function and usage range of the embodiments of the present disclosure.
[0125] As shown in Figure 8 , the electronic device 800 is in the form of a general computing device. The components of the electronic device 800 can include, but are not limited to, the at least one processing unit 810 described above, the at least one storage unit 820 described above, a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810), and a display unit 840.
[0126] The storage unit stores program codes, which can be executed by the processing unit 810, so that the processing unit 810 performs the steps described in the above “Exemplary Method” section according to various exemplary embodiments of the present disclosure. For example, the processing unit 810 can perform the steps as shown below:
[0127] In response to receiving the target cleanup rule, the application determines the cleanup logic corresponding to the target cleanup rule, and executes the cleanup logic corresponding to the target cleanup rule to clean up the local storage data of the application client.
[0128] Optionally, the application can be pre-configured with cleanup logic corresponding to candidate cleanup rules, and the target cleanup rule includes one or more of the candidate cleanup rules.
[0129] Optionally, the candidate cleanup rules include one or more of cleaning up all local storage data of all users, cleaning up local storage data of a target user, cleaning up all local storage data, and cleaning up target key value data in the local storage.
[0130] Optionally, in response to receiving the target cleanup rule, the application determines the cleanup logic corresponding to the target cleanup rule, including: in response to listening to the transmission control protocol sent by the application server, obtaining the target cleanup rule according to the cleanup rule in the transmission control protocol; and determining the cleanup logic corresponding to the target cleanup rule in the application.
[0131] Optionally, in response to receiving the target cleanup rule, the application determines the cleanup logic corresponding to the target cleanup rule, including: in response to receiving the target cleanup rule, determining the target application client indicated by the target cleanup rule; in the case that the target application client includes the current application client, determining the cleanup logic corresponding to the target cleanup rule in the application; and executing the cleanup logic corresponding to the target cleanup rule to clean up the local storage data of the application client, including: executing the cleanup logic corresponding to the target cleanup rule to clean up the local storage data of the current application client.
[0132] Optionally, the application includes a browser application and / or a local application, and the application client includes a browser application client and / or a local application client.
[0133] Optionally, log information indicating the operation of executing the cleanup logic corresponding to the target cleanup rule can be recorded to send the log information to the application server.
[0134] Through the embodiments of the present disclosure, on the one hand, the present disclosure, by pre-configuring the cleaning logic of the target cleaning rule in the application, when the local storage data needs to be cleaned, the target cleaning rule is directly sent to the application client remotely, and the application client can determine the cleaning logic corresponding to the target cleaning rule in the application to clean the local storage data, without repeated development and release, so that the cleaning efficiency of the local storage data can be improved; on the other hand, the present disclosure can improve the passive situation of the user side local data management by the active deletion mode, so that the user side local storage data can be effectively and timely managed.
[0135] The storage unit 820 can include a readable medium in the form of a volatile storage unit, such as a random access memory (RAM) 8201 and / or a cache memory unit 8202, and can further include a read-only memory (ROM) 8203.
[0136] The storage unit 820 can further include a program / utility 8204 having a set (at least one) of program modules 8205, such as an operating system, one or more application programs, other program modules, and program data, each of which or a combination of which can include an implementation of a network environment.
[0137] The bus 830 can represent one or more of several types of bus structures, including a storage unit bus or bus controller, a peripheral bus, a graphics acceleration port, a processing unit bus, or a local bus using any of a variety of bus architectures.
[0138] The electronic device 800 can also communicate with one or more external devices 900 such as a keyboard or pointing device, a Bluetooth device, etc.; other devices that enable a user to interact with the electronic device 800; and / or one or more devices that enable the electronic device 800 to communicate with one or more other computing devices. Such communication can occur via an input / output (I / O) interface 850. Still yet, the electronic device 800 can communicate with one or more networks such as a local area network (LAN), a general wide area network (WAN), and / or a public network such as the Internet, via a network adapter 860. As depicted, the network adapter 860 is communicatively coupled to the other components of the electronic device 800 via the bus 830. It should be appreciated that the electronic device 800 can be implemented using other types of hardware and / or software systems, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc.
[0139] Through the above description of the embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, or the like) or a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to perform the methods according to the embodiments of the present disclosure.
[0140] In addition, the above-described drawings are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended for limiting purposes. It is easily understood that the processes shown in the above-described drawings do not indicate or limit the time sequence of the processes. In addition, it is also easily understood that the processes can be executed synchronously or asynchronously, for example, in a plurality of modules.
[0141] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure following the general principles thereof and including such departures from the present disclosure that come within known use or custom in the art. The specification and examples are to be regarded as illustrative only, and the true scope and spirit of the present disclosure are indicated by the claims.
Claims
1. A method for clearing locally stored data, characterized in that, include: Upon receiving a target removal rule, the application determines the removal logic corresponding to the target removal rule, wherein the removal logic is used to indicate the removal logic code corresponding to the target removal rule; Execute the clearing logic corresponding to the target clearing rule to clear the local storage data of the application client; The step of receiving a target removal rule and determining the removal logic corresponding to the target removal rule in the application includes: receiving a target removal rule and determining the target application client indicated by the target removal rule; if the target application client includes the current application client, determining the removal logic corresponding to the target removal rule in the application, wherein the target removal rule includes one or more candidate removal rules, and the removal logic corresponding to the candidate removal rules is pre-configured in the application.
2. The method for clearing locally stored data according to claim 1, characterized in that, The candidate clearing rules include one or more of the following: clearing all users' local storage data, clearing the target user's local storage data, clearing all local storage data, clearing the target key-value data in local storage, and clearing the target field data of the target key-value in local storage.
3. The method for clearing locally stored data according to claim 1, characterized in that, The response receives the target removal rule and determines the removal logic corresponding to the target removal rule in the application, including: Upon receiving a transmission control protocol message from the application server, the target cleanup rule is obtained based on the cleanup rules in the transmission control protocol. The application determines the clearing logic corresponding to the target clearing rule.
4. The method for clearing locally stored data according to claim 1, characterized in that, The execution of the clearing logic corresponding to the target clearing rule to clear the local storage data of the application client includes: The clearing logic corresponding to the target clearing rule is executed to clear the local storage data of the current application client.
5. The method for clearing locally stored data according to claim 1, characterized in that, The application includes browser applications and / or native applications, and the application client includes browser application clients and / or native application clients.
6. The method for clearing locally stored data according to claim 1, characterized in that, The method further includes: Log information is recorded indicating the operation instructions for executing the cleanup logic corresponding to the target cleanup rule, and this log information is sent to the application server.
7. A device for erasing locally stored data, characterized in that, include: The target removal rule receiving module is configured to, upon receiving a target removal rule, determine the removal logic corresponding to the target removal rule in the application, wherein the removal logic is used to indicate the removal logic code corresponding to the target removal rule; The data clearing module is configured to execute the clearing logic corresponding to the target clearing rule in order to clear the local storage data of the application client; The step of receiving a target removal rule and determining the removal logic corresponding to the target removal rule in the application includes: receiving a target removal rule and determining the target application client indicated by the target removal rule; if the target application client includes the current application client, determining the removal logic corresponding to the target removal rule in the application, wherein the target removal rule includes one or more candidate removal rules, and the removal logic corresponding to the candidate removal rules is pre-configured in the application.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 6.
9. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for clearing up files in mobile terminal applications
CN104951507A
Selective chat message clearing method and device
CN107864088A
Cleaning rule obtaining method and system based on big data analysis
CN112015704A