Local dual-storage method and device for application program data, equipment and medium
By adopting a local dual storage method in a closed operating system, application data is stored in two storage spaces, which solves the problem of data loss and tampering, achieves rapid data recovery and high-reliability storage, and improves user experience.
Patent Information
- Application Number
- CN202410770287.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-09-10
AI Technical Summary
In a highly closed operating system, application data is easily lost, damaged, or tampered with, resulting in cumbersome recovery steps and inconvenience for quick recovery, and a lack of security and integrity storage solutions.
Using the local dual storage method of application data, the data is obtained when a write event is recognized and stored in two independent storage spaces. After receiving the read request, the read result of each storage space is determined and the completeness level is returned. Higher target stats.
It achieves complete and accurate storage of application data, improves user experience in the application, and ensures data security and reliability.
Smart Images

Figure CN118626013A
Abstract
Description
Technical Field
[0001] The present application belongs to the field of Internet technology, and specifically relates to a local dual storage method, device, equipment and medium for application data. Background Art
[0002] With the rapid advancement of technology, the Internet has penetrated into every aspect of people's lives, and people can use applications to meet various needs. In the process of people using applications, a large amount of application data is generated to record user personal information, usage behavior, preference settings and other information. Storing this large amount of application data can provide users with a personalized service experience.
[0003] However, if application data is lost, damaged, or tampered with in a closed operating system, users can only recover it through the official channels provided by the operating system. The various restrictions of the official channels will make the recovery process cumbersome, and even make it impossible to recover data in some cases. Therefore, how to quickly recover application data in a closed operating system and store it securely and with integrity is an urgent problem that people in this field need to solve. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a local dual storage method, device, equipment and medium for application data, with the aim of achieving complete and accurate storage of application data, thereby improving the user experience in the application.
[0005] In a first aspect, an embodiment of the present application provides a local dual storage method for application data, the method comprising:
[0006] When a write event of application data is identified, acquiring the application data;
[0007] Storing the application data in a first storage space and a second storage space;
[0008] In case of receiving a read request for the application data, determining a first read result in the first storage space and a second read result in the second storage space according to the read request;
[0009] Determine read target data according to the first read result and the second read result, and return the read target data.
[0010] In a second aspect, an embodiment of the present application provides a local dual storage device for application data, the device comprising:
[0011] A data acquisition module, configured to acquire the application data when a write event of the application data is identified;
[0012] A data storage module, used for storing the application data in a first storage space and a second storage space;
[0013] a data reading module, configured to, upon receiving a read request for the application data, determine a first read result in the first storage space and a second read result in the second storage space according to the read request;
[0014] A data returning module is used to determine the read target data according to the first read result and the second read result, and return the read target data.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0016] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0017] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0018] In an embodiment of the present application, when a write event of application data is identified, the application data is obtained; the application data is stored in a first storage space and a second storage space; when a read request for the application data is received, a first read result in the first storage space and a second read result in the second storage space are determined according to the read request; read target data is determined according to the first read result and the second read result, and the read target data is returned. The above-mentioned local dual storage method for application data can achieve complete and accurate storage of application data by storing application data in two storage spaces and returning a read result with a higher completeness parameter, thereby improving the user experience in the application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flowchart of a local dual storage method for application data provided in Embodiment 1 of the present application;
[0020] Figure 2 It is a flowchart of a local dual storage method for application data provided in Embodiment 2 of the present application;
[0021] Figure 3 It is a flowchart of a local dual storage method for application data provided in Embodiment 3 of the present application;
[0022] Figure 4 It is a flowchart of a local dual storage method for application data provided in Embodiment 4 of the present application;
[0023] Figure 5 This is a flowchart of an iOS local dual storage method for APP data provided in Embodiment 4 of the present application;
[0024] Figure 6 It is a schematic diagram of the structure of a local dual storage device for application data provided in Embodiment 5 of the present application;
[0025] Figure 7 It is a structural diagram of an electronic device provided in Example 6 of the present application. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0028] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0029] The local dual storage method, device, equipment and medium for application data provided by the embodiments of the present application are described in detail below in conjunction with the accompanying drawings through specific embodiments and their application scenarios.
[0030] Embodiment 1
[0031] Figure 1 1 is a flow chart of a local dual storage method for application data provided in the first embodiment of the present application. Figure 1 As shown, the specific steps include:
[0032] S101, when a write event of application data is identified, acquiring the application data;
[0033] First of all, this application is applicable to scenarios where application data needs to be stored. Based on the above usage scenarios, it can be understood that the execution subject of this application can be the operating system of the smart terminal device. Specifically, the acquisition and storage of application data and the reading and returning of stored data can be performed by the operating system of the smart terminal device. Local storage of application data can avoid the loss and damage of application data.
[0034] Among them, the smart terminal device can be an electronic device with certain computing capabilities and functions, such as desktop computers, laptops, mobile phones, tablet computers, and interactive multimedia, etc., and there is no excessive limitation here. The operating system of the smart terminal device can be a software system that can install and run applications, responsible for managing the hardware resources of the smart terminal device and providing basic functions and programming interfaces, providing a user experience for users and applications. The operating system of the smart terminal device is "local". For example, the operating system of a mobile phone or tablet computer can be Android or iOS, etc.
[0035] An application (APP) is a computer program that is used to complete one or more specific tasks. Application data can refer to various data generated by a user when using an application, including user account information, file data created by the user in the application, user behavior data, and user preference settings.
[0036] The application data write event may refer to the generation of new application data by a user when using an application. The execution process of the method may be encapsulated as an independent module. By adding a mechanism for automatically calling the module in the execution process of the application data write operation, the recognition of the application data write event may be realized. Furthermore, by calling the module with the application data as an input parameter for calling the module in the execution process of the application data write operation, the acquisition of the application data may be realized.
[0037] S102, storing the application data in a first storage space and a second storage space;
[0038] The first storage space can be a data storage space in the operating system of the intelligent terminal device that can be used to store application data of all applications, and the second storage space is the same. It can be understood that the first storage space and the second storage space are two inconsistent data storage spaces.
[0039] The method of storing the application data in the first storage space and the second storage space may be to store the application data in the first storage space according to the storage method of the first storage space, and to store the application data in the second storage space according to the storage method of the second storage space.
[0040] Optionally, the application data may be directly stored in the first storage space and the second storage space, or the encrypted application data may be stored in the first storage space and the second storage space.
[0041] S103, when receiving a read request for the application data, determining a first read result in the first storage space and a second read result in the second storage space according to the read request;
[0042] The read request of application data may refer to information sent by the application to read the stored application data. Generally, when the application needs to read the application data, it first reads the data storage space dedicated to storing the application data of the application in the operating system of the intelligent terminal device. If the application data that the application wants to read does not exist in the data storage space, the application can send a read request for the application data to the module encapsulated by the execution process of the present method. The specific sending method can be to use the data identifier of the application data as the input parameter of calling the module. The module reads the data identifier, that is, receives the read request for the application data.
[0043] The data identifier may be an identifier for uniquely identifying the data stored in the first storage space and the second storage space, and may be composed of an application identifier and a specific identifier of the application data by the application, etc. By querying the first storage space with the data identifier as a query keyword, a first read result in the first storage space may be determined; by querying the second storage space with the data identifier as a query keyword, a second read result in the second storage space may be determined.
[0044] The first read result is a query result obtained by querying the first storage space, and the second read result is a query result obtained by querying the second storage space.
[0045] S104: Determine read target data according to the first read result and the second read result, and return the read target data.
[0046] The read target data may refer to the read result returned to the application program from the first read result and the second read result. The read target data may be determined by determining the completeness parameters of the first read result and the second read result. If the completeness parameter of the first read result is greater than the completeness parameter of the second stored data, the first read result is determined as the read target data. If the completeness parameter of the first read result is not greater than the completeness parameter of the second read result, the second read result is determined as the read target data.
[0047] The method of returning the read target data can be to return the read target data as an output parameter to the application.
[0048] In an embodiment of the present application, when a write event of application data is identified, the application data is obtained; the application data is stored in a first storage space and a second storage space; when a read request for the application data is received, a first read result in the first storage space and a second read result in the second storage space are determined according to the read request; read target data is determined according to the first read result and the second read result, and the read target data is returned. The above-mentioned local dual storage method for application data can achieve complete and accurate storage of application data by storing application data in two storage spaces and returning a read result with a higher completeness parameter, thereby improving the user experience in the application.
[0049] Embodiment 2
[0050] Figure 2 This is a flow chart of the local dual storage method for application data provided in the second embodiment of the present application. This solution makes a better improvement on the above embodiment, and the specific improvement is: storing the application data in the first storage space and the second storage space, including: encrypting the application data to obtain encrypted data; storing the encrypted data in the first storage space and the second storage space.
[0051] like Figure 2 As shown, the specific steps include:
[0052] S201, when a write event of application data is identified, acquiring the application data;
[0053] S202, encrypting the application data to obtain encrypted data;
[0054] Encryption processing may refer to the process of converting application data from a plain text format to a cipher text format. It is understandable that encryption processing should be reversible. The application data after encryption processing is encrypted data.
[0055] The encryption process may be performed by selecting a suitable reversible encryption algorithm according to the application data, generating or obtaining an encryption key, and executing the selected reversible encryption algorithm according to the encryption key.
[0056] S203, storing the encrypted data in the first storage space and the second storage space;
[0057] The encrypted data may be stored in the first storage space and the second storage space by storing the encrypted data in the first storage space according to the storage method of the first storage space and storing the encrypted data in the second storage space according to the storage method of the second storage space.
[0058] S204, when receiving a read request for the application data, determining a first read result in the first storage space and a second read result in the second storage space according to the read request;
[0059] In the technical solution, optionally, in the case of receiving a read request for the application data, determining a first read result in the first storage space and a second read result in the second storage space according to the read request includes:
[0060] In case of receiving a read request for the application data, determining first encrypted data in the first storage space according to the read request, and performing reverse decryption processing on the first encrypted data to obtain a first read result;
[0061] as well as,
[0062] Determine the second encrypted data in the second storage space according to the read request, perform reverse decryption processing on the second encrypted data, and obtain a second read result.
[0063] By querying the first storage space with the data identifier as the query keyword, the first encrypted data in the first storage space can be determined; by querying the second storage space with the data identifier as the query keyword, the second encrypted data in the second storage space can be determined. The first encrypted data is the query result obtained by querying the first storage space, and the second encrypted data is the query result obtained by querying the second storage space.
[0064] The reverse decryption process may refer to a process of converting application data from a ciphertext format to a plaintext format. The reverse decryption process may be performed by determining a decryption algorithm based on a reversible encryption algorithm and executing the decryption algorithm based on an encryption key.
[0065] The benefit of this arrangement of the present solution is that by determining the first encrypted data in the first storage space and the second encrypted data in the second storage space, and performing reverse decryption processing on the first encrypted data and the second encrypted data, it can be ensured that the encrypted application data can be read normally.
[0066] S205: Determine read target data according to the first read result and the second read result, and return the read target data.
[0067] The benefit of this arrangement of the scheme is that by encrypting the application data before storing it, it is possible to prevent the stored application data from being stolen, tampered with or leaked by unauthorized persons or programs, thereby improving the storage security of the application data.
[0068] Embodiment 3
[0069] Figure 3 It is a flowchart of the local dual storage method for application data provided in Example 3 of the present application. This solution makes a better improvement on the above-mentioned embodiment, and the specific improvement is: storing the encrypted data in the first storage space and the second storage space, including: storing the encrypted data in the first storage space, and obtaining the storage verification result; if the storage verification result is a storage failure, re-executing the storage operation of the encrypted data in the first storage space until the storage verification result is a storage success, completing the storage of the encrypted data in the first storage space; and storing the encrypted data in the second storage space, and obtaining the storage verification result; if the storage verification result is a storage failure, re-executing the storage operation of the encrypted data in the second storage space until the storage verification result is a storage success, completing the storage of the encrypted data in the second storage space.
[0070] like Figure 3 As shown, the specific steps include:
[0071] S301, when a write event of application data is identified, acquiring the application data;
[0072] S302, encrypting the application data to obtain encrypted data;
[0073] S303, storing the encrypted data in a first storage space, and obtaining a storage verification result;
[0074] The storage verification result may be information describing whether the encrypted data is successfully stored in the first storage space or the second storage space, and the content of the storage verification result may include storage success and storage failure. Among them, storage success may refer to the situation that after the encrypted data is stored in the first storage space or the second storage space, the storage data in the first storage space or the second storage space is consistent with the encrypted data; storage failure may refer to the situation that after the encrypted data is stored in the first storage space or the second storage space, the storage data in the first storage space or the second storage space is inconsistent with the encrypted data.
[0075] After the encrypted data is stored in the first storage space or the second storage space, the storage data stored in the first storage space or the second storage space is read, and the storage data is compared with the encrypted data to see if they are consistent. If they are consistent, the storage verification result is determined to be a successful storage; if they are inconsistent, the storage verification result is determined to be a failed storage.
[0076] S304, identifying the storage verification result; if the storage verification result is storage failure, executing S303; if the storage verification result is storage success, executing S305;
[0077] S305, storing the encrypted data in a second storage space, and obtaining a storage verification result;
[0078] S306, identifying the storage verification result; if the storage verification result is storage failure, executing S305; if the storage verification result is storage success, executing S307;
[0079] In this technical solution, optionally, after re-executing the storage operation of the encrypted data in the first storage space, the method further includes:
[0080] If the number of executions of the storage operation exceeds the preset number threshold, storage failure information of the first storage space is returned;
[0081] Accordingly, after re-executing the storage operation of the encrypted data in the second storage space, the method further includes:
[0082] If the execution times of the storage operation exceed the preset times threshold, storage failure information of the second storage space is returned.
[0083] The storage operation may refer to an operation of storing the encrypted data in the first storage space or the second storage space. The number of executions of the storage operation may refer to the number of repetitions of the storage operation.
[0084] The preset number threshold may be an upper limit of the number of executions indicating that continued repeated execution of the storage operation may fail to successfully store the encrypted data.
[0085] If the number of executions of the storage operation exceeds a preset number threshold, the storage operation is stopped and storage failure information of the first storage space or the second storage space is returned. The storage failure information of the first storage space or the second storage space may be information used to prompt an application or user that the application data cannot be successfully stored in the first storage space or the second storage space and needs to be processed in other ways; the storage failure information of the first storage space or the second storage space may be returned by sending the storage failure information of the first storage space or the second storage space as an output parameter to the application.
[0086] The benefit of this arrangement of the scheme is that, by setting an upper limit on the number of executions of the storage operation, it is possible to prevent continuous storage failures of encrypted data, which would lead to continuous repeated executions of the storage operation, thereby improving the robustness of the scheme.
[0087] S307, when receiving a read request for the application data, determining a first read result in the first storage space and a second read result in the second storage space according to the read request;
[0088] S308: Determine read target data according to the first read result and the second read result, and return the read target data.
[0089] The advantage of this arrangement of the present solution is that by verifying the storage data obtained by storing the encrypted data in the first storage space or the second storage space, and if the encrypted data is inconsistent with the storage data, re-storing and verifying until they are consistent, the consistency of subsequent reading results and application data can be improved.
[0090] Embodiment 4
[0091] Figure 4 It is a flowchart of the local dual storage method of application data provided in the fourth embodiment of the present application. This solution makes better improvements to the above embodiments, and the specific improvements are: determining the read target data according to the first read result and the second read result, and returning the read target data, including: determining the completeness parameters of the first read result and the second read result; if the completeness parameter of the first read result is greater than the completeness parameter of the second stored data, determining the first read result as the read target data, and returning the read target data; if the completeness parameter of the first read result is not greater than the completeness parameter of the second read result, determining the second read result as the read target data, and returning the read target data.
[0092] like Figure 4 As shown, the specific steps include:
[0093] S401, when a write event of application data is identified, acquiring the application data;
[0094] S402, storing the application data in a first storage space and a second storage space;
[0095] S403, when receiving a read request for the application data, determining a first read result in the first storage space and a second read result in the second storage space according to the read request;
[0096] S404, determining completeness parameters of the first reading result and the second reading result;
[0097] The integrity parameter may be a parameter used to describe the data integrity of the first read result or the second read result. Specifically, the integrity parameter may be a percentage value. The integrity parameters of the first read result and the second read result may be determined by using an algorithm capable of determining data integrity on the first read result and the second read result. The algorithm capable of determining data integrity may include a hash function, a message authentication code, an encryption and integrity protection algorithm, a serialized Merkle tree, and a digital signature algorithm.
[0098] S405, identifying whether the integrity parameter of the first read result is greater than the integrity parameter of the second stored data; if so, executing S406; if not, executing S407;
[0099] If the integrity parameter of the first read result is greater than the integrity parameter of the second stored data, it means that the first read result is more consistent with the application data; if the integrity parameter of the first read result is not greater than the integrity parameter of the second stored data, it means that the second read result is more consistent with the application data.
[0100] S406, determining the first reading result as read target data, and returning the read target data;
[0101] S407: Determine the second read result as read target data, and return the read target data.
[0102] In the technical solution, optionally, after determining that the first reading result is read as target data and returning the read target data, the method further includes:
[0103] Encrypting the first reading result, storing it in a second storage space, and performing storage verification;
[0104] Correspondingly, after determining the second reading result as the read target data and returning the read target data, the method further includes:
[0105] The second reading result is encrypted, stored in the first storage space, and subjected to storage verification.
[0106] The method for encrypting the first reading result may be to select a suitable reversible encryption algorithm based on the first reading result, generate or obtain an encryption key, and execute the selected reversible encryption algorithm based on the encryption key; the method for encrypting the second reading result may be to select a suitable reversible encryption algorithm based on the second reading result, generate or obtain an encryption key, and execute the selected reversible encryption algorithm based on the encryption key.
[0107] The method of storing the first read result in the second storage space and performing storage verification may be that the first read result is stored in the second storage space and a storage verification result is obtained. If the storage verification result is a storage failure, the storage operation of the first read result in the second storage space is re-executed until the storage verification result is a storage success, thereby completing the storage of the first read result in the second storage space; the method of storing the second read result in the first storage space and performing storage verification may be that the second read result is stored in the first storage space and a storage verification result is obtained. If the storage verification result is a storage failure, the storage operation of the second read result in the first storage space is re-executed until the storage verification result is a storage success, thereby completing the storage of the second read result in the first storage space.
[0108] Figure 5 This is a flowchart of the iOS local dual storage method for APP data provided in the fourth embodiment of the present application. Figure 5 As shown, for the iOS system, the first storage space can be a keychain, and the second storage space can be a sandbox; after recognizing that APP data is written, a reversible algorithm is used to encrypt the APP data, and the encrypted data is written to the keychain, the keychain data is read and compared with the encrypted data, and the writing and checking are repeated until the keychain data is consistent with the encrypted data, and then the encrypted data is written to the sandbox, the sandbox data is read and compared with the encrypted data, and the writing and checking are repeated until the sandbox data is consistent with the encrypted data; after receiving a request to read APP data, the keychain data and the sandbox data are read and decrypted, the integrity of the two decrypted data is compared, the decrypted data with higher integrity is returned and the data is stored in a storage space with lower integrity until the stored data in the storage space is consistent with the decrypted data with higher integrity.
[0109] The benefit of such a configuration of the present solution is that by storing a reading result with a higher integrity parameter in another storage space, the integrity and accuracy of the stored data in the storage space with a lower integrity parameter can be improved.
[0110] The benefit of this arrangement of the present solution is that by determining and returning the read target data based on the completeness parameters of the first read result and the second read result, the most complete and accurate read result can be selected for return, thereby improving the stability of the application and thus improving the user experience.
[0111] Embodiment 5
[0112] Figure 6 Schematic diagram of the structure of the local dual storage device for application data provided in Embodiment 5 of the present application. Figure 6 As shown, the device comprises:
[0113] A data acquisition module 610 is used to acquire the application data when a write event of the application data is identified;
[0114] A data storage module 620, configured to store the application data in a first storage space and a second storage space;
[0115] a data reading module 630, configured to, upon receiving a read request for the application data, determine a first read result in the first storage space and a second read result in the second storage space according to the read request;
[0116] The data returning module 640 is configured to determine the read target data according to the first read result and the second read result, and return the read target data.
[0117] In an embodiment of the present application, a data acquisition module is used to acquire the application data when a write event of the application data is identified; a data storage module is used to store the application data in a first storage space and a second storage space; a data reading module is used to determine a first reading result in the first storage space and a second reading result in the second storage space according to the reading request when a read request of the application data is received; a data return module is used to determine the read target data according to the first reading result and the second reading result, and return the read target data. The above-mentioned local dual storage device for application data can achieve complete and accurate storage of application data by storing the application data in two storage spaces and returning a reading result with a higher completeness parameter, thereby improving the user experience in the application.
[0118] The local dual storage device of the application data in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0119] The local dual storage device for application data in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0120] The local dual storage device for application data provided in the embodiment of the present application can implement the various processes implemented in the above-mentioned embodiments one to four, and will not be described again here to avoid repetition.
[0121] Embodiment 6
[0122] like Figure 7 As shown, an embodiment of the present application also provides an electronic device 700, including a processor 701, a memory 702, and a program or instruction stored in the memory 702 and executable on the processor 701. When the program or instruction is executed by the processor 701, each process of the local dual storage method embodiment of the above-mentioned application data is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0123] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0124] Embodiment 7
[0125] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the local dual storage method embodiment of the above-mentioned application data are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0126] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0127] Embodiment 8
[0128] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned local dual storage method embodiment for application data, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0129] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0130] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0131] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0132] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0133] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A local dual storage method for application data, characterized in that: The method comprises: When a write event of application data is identified, acquiring the application data; Storing the application data in a first storage space and a second storage space; In case of receiving a read request for the application data, determining a first read result in the first storage space and a second read result in the second storage space according to the read request; Determine read target data according to the first read result and the second read result, and return the read target data.
2. The local dual storage method for application data according to claim 1, characterized in that: Storing the application data in the first storage space and the second storage space includes: Encrypting the application data to obtain encrypted data; The encrypted data is stored in the first storage space and the second storage space.
3. The local dual storage method for application data according to claim 2, characterized in that: In case of receiving a read request for the application data, determining a first read result in the first storage space and a second read result in the second storage space according to the read request, comprises: In case of receiving a read request for the application data, determining first encrypted data in the first storage space according to the read request, and performing reverse decryption processing on the first encrypted data to obtain a first read result; as well as, Determine the second encrypted data in the second storage space according to the read request, perform reverse decryption processing on the second encrypted data, and obtain a second read result.
4. The local dual storage method for application data according to claim 2, characterized in that: Storing the encrypted data in a first storage space and the second storage space includes: Storing the encrypted data in a first storage space and obtaining a storage verification result; If the storage verification result is a storage failure, re-execute the storage operation of the encrypted data in the first storage space until the storage verification result is a storage success, thereby completing the storage of the encrypted data in the first storage space; as well as, Storing the encrypted data in a second storage space and obtaining a storage verification result; If the storage verification result is storage failure, the storage operation of the encrypted data in the second storage space is re-executed until the storage verification result is storage success, thereby completing the storage of the encrypted data in the second storage space.
5. The local dual storage method for application data according to claim 4, characterized in that: After re-executing the storage operation of the encrypted data in the first storage space, the method further includes: If the number of executions of the storage operation exceeds the preset number threshold, storage failure information of the first storage space is returned; Accordingly, after re-executing the storage operation of the encrypted data in the second storage space, the method further includes: If the execution times of the storage operation exceed the preset times threshold, storage failure information of the second storage space is returned.
6. The local dual storage method for application data according to claim 1, characterized in that: Determining read target data according to the first read result and the second read result, and returning the read target data, includes: Determining completeness parameters of the first reading result and the second reading result; If the completeness parameter of the first read result is greater than the completeness parameter of the second stored data, determining the first read result as the read target data, and returning the read target data; If the completeness parameter of the first read result is not greater than the completeness parameter of the second read result, the second read result is determined as the read target data, and the read target data is returned.
7. The local dual storage method for application data according to claim 6, characterized in that: After determining the first read result to be read as target data and returning the read target data, the method further includes: Encrypting the first reading result, storing it in a second storage space, and performing storage verification; Correspondingly, after determining the second reading result as the read target data and returning the read target data, the method further includes: The second reading result is encrypted, stored in the first storage space, and subjected to storage verification.
8. A local dual storage device for application data, characterized in that: The device comprises: A data acquisition module, configured to acquire the application data when a write event of the application data is identified; A data storage module, used for storing the application data in a first storage space and a second storage space; a data reading module, configured to, upon receiving a read request for the application data, determine a first read result in the first storage space and a second read result in the second storage space according to the read request; A data returning module is used to determine the read target data according to the first read result and the second read result, and return the read target data.
9. An electronic device, characterized in that: The method comprises a processor, a memory and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the local dual storage method for application data as described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium stores programs or instructions, and when the programs or instructions are executed by the processor, the steps of the local dual storage method for application data according to any one of claims 1 to 7 are implemented.
