CN107145572B - Data processing method and device, computer equipment and storage medium - Google Patents

Data processing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN107145572B
CN107145572B CN201710312691.2A CN201710312691A CN107145572B CN 107145572 B CN107145572 B CN 107145572B CN 201710312691 A CN201710312691 A CN 201710312691A CN 107145572 B CN107145572 B CN 107145572B
Authority
CN
China
Prior art keywords
data
file
synchronized
cleaned
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201710312691.2A
Other languages
Chinese (zh)
Other versions
CN107145572A (en
Inventor
张烨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201710312691.2A priority Critical patent/CN107145572B/en
Publication of CN107145572A publication Critical patent/CN107145572A/en
Application granted granted Critical
Publication of CN107145572B publication Critical patent/CN107145572B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/178Techniques for file synchronisation in file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention relates to a data processing method, a data processing device, computer equipment and a storage medium. The method comprises the following steps: receiving a data cleaning instruction of an application; acquiring file information corresponding to the data to be cleaned according to the data cleaning instruction; detecting whether the data to be cleaned contains data to be synchronized according to the file information; if yes, synchronizing the data to be synchronized to a server; and deleting the data to be cleaned. The data processing method, the data processing device, the computer equipment and the storage medium can avoid the situation of data loss when the application performs data cleaning.

Description

Data processing method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data processing method and apparatus, a computer device, and a storage medium.
Background
With the development of internet technology, more and more applications appear in the market, and various requirements of users in daily life are met. The user installs the application to a mobile terminal such as a smart phone or a tablet computer and uses the application, and a large amount of application data are often generated in the application using process. In a conventional manner, when a user needs to clean data of an application, the cleaned data is deleted from the terminal, which may cause some important data to be lost.
Disclosure of Invention
Embodiments of the present invention provide a data processing method and apparatus, a computer device, and a storage medium, which can avoid a situation of data loss when an application performs data cleaning.
A method of data processing, comprising:
receiving a data cleaning instruction of an application;
acquiring file information corresponding to the data to be cleaned according to the data cleaning instruction;
detecting whether the data to be cleaned contains data to be synchronized according to the file information;
if yes, synchronizing the data to be synchronized to a server;
and deleting the data to be cleaned.
In one embodiment, the obtaining file information corresponding to data to be cleaned according to the data cleaning instruction includes:
acquiring an application identifier according to the data cleaning instruction;
and reading the change time of each file corresponding to the data to be cleaned from the specified folder according to the application identifier.
In one embodiment, the detecting whether the data to be cleaned includes data to be synchronized according to the file information includes:
acquiring a history synchronous record according to the application identifier;
if the historical synchronous record is not empty, reading the last synchronous time from the historical synchronous record;
comparing the change time of each file corresponding to the data to be cleaned with the last synchronization time;
and if the change time of the file is later than the last synchronization time, determining the file with the change time later than the last synchronization time as the data to be synchronized.
In one embodiment, the detecting whether the data to be cleaned includes data to be synchronized according to the file information includes:
reading specific mark positions in each file corresponding to the data to be cleaned according to the file information, and judging whether the specific mark positions are preset labels;
and if the label is a preset label, determining that the file with the specific mark bit as the preset label is the data to be synchronized.
In one embodiment, if the synchronization is performed, synchronizing the data to be synchronized to a server includes:
acquiring a server identifier;
establishing a link according to the server identification, and logging in a corresponding server through the link;
and encapsulating the data to be synchronized into a message according to a preset format, and sending the message to the server.
A data processing apparatus comprising:
the receiving module is used for receiving a data cleaning instruction of an application;
the information acquisition module is used for acquiring file information corresponding to the data to be cleaned according to the data cleaning instruction;
the detection module is used for detecting whether the data to be cleaned contains the data to be synchronized according to the file information;
the synchronization module is used for synchronizing the data to be synchronized to a server if the data to be cleaned comprises the data to be synchronized;
and the deleting module is used for deleting the data to be cleaned.
In one embodiment, the information obtaining module includes:
the application identifier acquisition unit is used for acquiring an application identifier according to the data cleaning instruction;
and the change time reading unit is used for reading the change time of each file corresponding to the data to be cleaned from the specified folder according to the application identification.
In one embodiment, the detection module includes:
the record acquisition unit is used for acquiring a history synchronous record according to the application identifier;
the synchronization time reading unit is used for reading the last synchronization time from the historical synchronization record if the historical synchronization record is not empty;
the comparison unit is used for comparing the change time of each file corresponding to the data to be cleaned with the last synchronization time;
and the first determining unit is used for determining the file with the changing time later than the last synchronizing time as the data to be synchronized if the changing time of the file is later than the last synchronizing time.
In one embodiment, the detection module includes:
the judging unit is used for reading specific mark positions in each file corresponding to the data to be cleaned according to the file information and judging whether the specific mark positions are preset labels or not;
and the second determining unit is used for determining that the file with the specific mark bit as the preset label is the data to be synchronized if the preset label is the preset label.
In one embodiment, the synchronization module includes:
a server identifier acquisition unit configured to acquire a server identifier;
the establishing unit is used for establishing a link according to the server identifier and logging in a corresponding server through the link;
and the sending unit is used for encapsulating the data to be synchronized into a message according to a preset format and sending the message to the server.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method as described above when executing the program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method as set forth above.
According to the data processing method, the data processing device, the computer equipment and the storage medium, the data cleaning instruction of the application is received, the file information corresponding to the data to be cleaned is obtained according to the data cleaning instruction, whether the data to be synchronized is contained in the data to be cleaned is detected according to the file information, if yes, the data to be synchronized is synchronized to the server, then the data to be cleaned is deleted, and the situation that the data is lost when the application cleans the data can be avoided.
Drawings
FIG. 1 is a diagram of an exemplary implementation of a data processing method;
FIG. 2 is a block diagram of a terminal in one embodiment;
FIG. 3 is a flow diagram illustrating a data processing method according to one embodiment;
FIG. 4 is a flowchart illustrating obtaining file information according to one embodiment;
FIG. 5 is a flowchart illustrating an embodiment of detecting whether data to be cleaned includes data to be synchronized;
FIG. 6 is a flowchart illustrating another embodiment of detecting whether data to be cleaned includes data to be synchronized;
FIG. 7 is a flow diagram that illustrates synchronizing data to be synchronized to a server, in one embodiment;
FIG. 8 is a block diagram of a data processing apparatus in one embodiment;
FIG. 9 is a block diagram of an information acquisition module in one embodiment;
FIG. 10 is a block diagram of a detection module in one embodiment;
FIG. 11 is a block diagram of a detection module in another embodiment;
FIG. 12 is a block diagram of a synchronization module in one embodiment;
FIG. 13 is a block diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 is a diagram illustrating an application scenario of a data processing method according to an embodiment. As shown in fig. 1, the terminal 10 and the server 20 are connected via a network. The terminal 10 receives the data cleaning instruction of the application, acquires file information corresponding to the data to be cleaned according to the data cleaning instruction, detects whether the data to be cleaned includes the data to be synchronized according to the file information, and synchronizes the data to be synchronized to the server 20 if the data to be cleaned includes the data to be synchronized. After the data synchronization is completed, the terminal 10 deletes the data to be cleaned.
Fig. 2 is a block diagram of a terminal in one embodiment. As shown in fig. 2, the terminal includes a processor, a nonvolatile storage medium, an internal memory, and a network interface, a display screen, and an input device, which are connected through a system bus. The nonvolatile storage medium of the terminal stores an operating system and computer-executable instructions, and the computer-executable instructions are executed by the processor to implement the data processing method provided in the embodiment of the present application. The processor is used for providing calculation and control capability and supporting the operation of the whole terminal. The internal memory in the terminal provides an environment for the execution of computer-readable instructions in the non-volatile storage medium. The network interface is used for network communication with the server, for example, sending data to be synchronized to the server. The display screen of the terminal can be a liquid crystal display screen or an electronic ink display screen, and the input device can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the terminal, or an external keyboard, a touch pad or a mouse. The terminal can be a mobile phone, a tablet computer, a personal digital assistant or a wearable device. Those skilled in the art will appreciate that the configuration shown in fig. 2 is a block diagram of only a portion of the configuration associated with the present application and does not constitute a limitation on the terminal to which the present application is applied, and that a particular terminal may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
As shown in fig. 3, in one embodiment, there is provided a data processing method comprising the steps of:
step S310, receiving a data cleaning instruction of the application.
The user can select the application to perform data cleaning by triggering the screen of the terminal, the data cleaning can be to select partial data of the application to be deleted from the terminal, or can also be to unload the application to delete all the data of the application, wherein the unloading refers to operations of deleting program files and folders of the application from a storage medium and deleting related data from a registry, and the original occupied disk space is released so that the application does not exist in an operating system any more. And when the terminal screen captures the data cleaning operation, the terminal receives the data cleaning instruction of the application. Further, the data cleaning operation may include directly clicking to select a file in the application for deletion, or selecting a data category in the application, such as cache data, picture data, audio data, and the like for deletion, or may include directly clicking to select an uninstall option of the application, dragging the application out of a screen interface of the terminal, or selecting the application through a third-party application management program for uninstallation.
Step S320, obtaining file information corresponding to the data to be cleaned according to the data cleaning instruction.
The terminal receives a data cleaning instruction generated according to the data cleaning operation, and acquires an application identifier for cleaning data according to the data cleaning instruction, wherein the application identifier can be information which can be used for uniquely identifying an application identity, such as an application name, an application product number and the like. The terminal can obtain file information of each file corresponding to the data to be cleaned according to the application identifier, each file corresponding to the data to be cleaned can comprise a data file to be cleaned and a resource file, wherein the data file refers to a database file for storing the data, the resource file refers to a file from which required resources can be read out, the read resources can be picture, audio, video, character resources and the like, and the file information can comprise information of file names, creation time, modification time, sizes, file types and the like of the files.
In one embodiment, the terminal can read file information of each file corresponding to the data to be cleaned in the application from the specified folder according to the application identification. The specified folder can be a folder for storing each file of the application for data cleaning, and the terminal can determine a file storage path of the application according to the application identifier, acquire a record file from the folder for storing each file of the application according to the file storage path, and read file information of each file corresponding to the data to be cleaned from the record file. The specified folder may also be a folder specially used for storing file information records of each application on the terminal, in the specified folder, file information of different applications may be respectively recorded in different files, and the file in which the file information is recorded is named according to the application identifier, the terminal may query a corresponding record file in the specified folder according to the application identifier and read file information of each file corresponding to the data to be cleaned from the corresponding record file, and the specified folder may also be another folder, without being limited thereto.
Step S330, detecting whether the data to be cleaned includes data to be synchronized according to the file information, if so, performing step S340, and if not, performing step S350.
Data synchronization refers to that two or more computer devices maintain the integrity and the uniformity of data and realize information sharing. The terminal can detect whether the data to be cleaned contains the data to be synchronized according to the acquired file information, wherein the data to be synchronized refers to the data which needs to be synchronized but is not synchronized. If the data to be cleaned comprises the data to be synchronized, the terminal can synchronize the data to be synchronized to the server, and if the data to be cleaned does not comprise the data to be synchronized, the terminal can directly delete the data to be cleaned.
Step S340, synchronize the data to be synchronized to the server, and then execute step S350.
In one embodiment, the terminal and the server implement data synchronization to ensure data uniformity of the terminal and the server, and the data synchronization can be in a real-time data synchronization mode or an asynchronous data transmission mode, wherein the real-time data synchronization refers to that the terminal directly communicates with the server when data is generated or modified to synchronize the data; asynchronous data transmission means that generated or modified data are stored in a local terminal, and newly generated or modified data are transmitted to a server at regular intervals to realize data synchronization.
In this embodiment, the terminal may select an asynchronous data transmission mode to implement data synchronization with the server, and the terminal may detect, according to the file information, whether each of the files corresponding to the data to be cleaned is a newly generated file or a modified file from last synchronization to reception of the data cleaning instruction, and if so, may determine the newly generated file or the modified file as the data to be synchronized, and synchronize the data to be synchronized with the server. Furthermore, the terminal can realize data synchronization by adopting a full synchronization or incremental synchronization mode, wherein the full synchronization refers to that a newly generated file or a modified file is completely transmitted to the server for synchronization at one time, the incremental synchronization refers to that the newly generated file and the changed data in the modified file are transmitted to the server for synchronization, and the incremental synchronization is adopted, so that the data transmission quantity can be reduced, and the synchronization speed is accelerated.
In one embodiment, when the terminal detects that the data to be cleaned includes the data to be synchronized, the terminal can prompt the included data to be synchronized on a screen, and a user confirms whether to synchronize the data to be synchronized to the server, and when receiving a confirmation instruction, the terminal synchronizes the data to be synchronized to the server.
Step S350, delete the data to be cleaned.
After the terminal synchronizes the data to be synchronized to the server, the data to be cleaned can be deleted.
According to the data processing method, the data cleaning instruction of the application is received, the file information corresponding to the data to be cleaned is obtained according to the data cleaning instruction, whether the data to be cleaned contains the data to be synchronized is detected according to the file information, if yes, the data to be synchronized is synchronized to the server, then the data to be cleaned is deleted, and the situation that the data is lost when the application is used for cleaning the data can be avoided.
As shown in fig. 4, in an embodiment, the step S320 of acquiring file information corresponding to data to be cleaned according to the data cleaning instruction includes the following steps:
and step S402, acquiring an application identifier according to the data cleaning instruction.
And the terminal receives a data cleaning instruction generated according to the data cleaning operation and acquires an application identifier for data cleaning according to the data cleaning instruction.
And S404, reading the change time of each file corresponding to the data to be cleaned from the specified folder according to the application identifier.
The terminal can read the change time of each file corresponding to the data to be cleaned in the application from the specified folder according to the application identifier, wherein the change time refers to the time when the data of the file is changed for the last time, if the file has no change time, the change time is the creation time of the file, and if the file has the change time, the change time is the last change time of the file.
As shown in fig. 5, in an embodiment, the step S330 detects whether the data to be cleaned includes the data to be synchronized according to the file information, and includes the following steps:
step S502, acquiring a history synchronous record according to the application identifier.
The terminal can inquire whether the application for data cleaning has a corresponding historical synchronous record from a folder or a database which stores the historical synchronous record according to the application identification, wherein the historical synchronous record can comprise synchronous time, synchronous server information, name, size, type and the like of synchronous data.
In step S504, if the history synchronization record is not empty, the last synchronization time is read from the history synchronization record.
If the terminal inquires the corresponding history synchronous record according to the application identifier, the returned result is empty, which indicates that the application for data cleaning does not have the corresponding history synchronous record, the terminal can directly delete the data to be cleaned, and if the returned result is not empty, the terminal acquires the history synchronous record of the application and reads the last synchronous time of the record from the history synchronous record.
Step S506, comparing the change time of each file corresponding to the data to be cleaned with the last synchronization time.
The terminal can respectively compare the change time of each file corresponding to the data to be cleaned with the read last synchronization time, detect whether a newly generated file or a modified file exists in each file corresponding to the data to be cleaned from the last synchronization to the time when the terminal receives the data cleaning instruction, if the change time of the file is later than the last synchronization time, the file is a newly generated or modified file between the last synchronization and the time when the terminal receives the data cleaning instruction, and the file can be determined to be the data to be synchronized.
In step S508, if the change time of the file is later than the last synchronization time, the file with the change time later than the last synchronization time is determined as the data to be synchronized.
In this embodiment, the change time of each file corresponding to the data to be cleaned may be compared with the last synchronization time of the application, a file whose change time is later than the last synchronization time is determined as the data to be synchronized, the data to be synchronized is synchronized to the server, and then the data to be cleaned is deleted, so that the situation that the data is lost when the application performs data cleaning can be avoided.
As shown in fig. 6, in an embodiment, the step S330 detects whether the data to be cleaned includes the data to be synchronized according to the file information, and includes the following steps:
step S602, reading specific flag bits in each file corresponding to the data to be cleaned according to the file information.
The terminal can read the specific mark bits of each file corresponding to the data to be cleaned one by one according to the recorded file information. In one embodiment, the user may preset data that the application installed on the terminal needs to synchronize, for example, for an instant messaging application, setting a chat record as the synchronized data, the chat record generated by the instant messaging application is synchronized to the server for storage. The specific flag bit can be used for marking whether the file is data which needs to be synchronized, and when the preset data which needs to be synchronized is stored in the applied file, a corresponding label can be added to the specific flag bit. The terminal may further set that, for data that needs to be synchronized, different labels may be added to the synchronized and unsynchronized data at specific flag bits, for example, the specific flag bit DS _1 may be preset to indicate synchronized data, the specific flag bit DS _0 may be preset to indicate unsynchronized data that needs to be synchronized, and the specific flag bit N _ DS may be preset to indicate data that does not need to be synchronized, but is not limited thereto.
Step S604, determine whether the specific flag bit is a preset tag, if yes, go to step S606, otherwise go to step S608.
The terminal reads the specific mark bits of each file corresponding to the data to be cleaned one by one, and determines whether the specific mark bits are preset tags, where the preset tags are tags used for indicating data which needs to be synchronized but is not synchronized, such as DS _0 in the above. If the specific mark bit in the file is a preset label, the terminal can determine the file as the data to be synchronized.
Step S606, determining the file with the specific mark bit as the preset tag as the data to be synchronized.
In step S608, it is determined whether the file with the specific flag bit not being the preset tag is the data to be synchronized.
In this embodiment, the data to be synchronized can be determined according to the specific flag bit of each file corresponding to the data to be cleaned, and the data to be synchronized is synchronized to the server, and then the data to be cleaned is deleted, so that the situation of data loss when the application performs data cleaning can be avoided.
As shown in fig. 7, in one embodiment, the step S340 synchronizes the data to be synchronized to the server, including the following steps:
step S702, obtain the server identifier.
The terminal may obtain a server identifier for data synchronization, where the server identifier may be one or more of an IP (Internet Protocol) address, an MAC (Media Access Control) address, or a name, a number, and the like of the server.
Step S704, establishing a link according to the server identifier, and logging in a corresponding server through the link.
The terminal may establish a link with the server according to the server identifier, where the link may be a link such as HTTP (HyperText Transfer Protocol), HTTPs (HyperText Transfer Protocol over Secure Socket Layer), but is not limited thereto. The terminal can log in a corresponding server through the established link according to information such as a preset account number and a preset password, wherein the account number can be fixed identification information such as an International Mobile Equipment Identity (IMEI) of the terminal, a Media Access Control (MAC) address and the like, and can also be a character string which is set by a user and consists of one or more of numbers, letters or symbols and the like.
Step S706, the data to be synchronized is encapsulated into a message according to a preset format, and the message is sent to a server.
The terminal can encapsulate the data to be synchronized into a message according to the link type established with the server and the preset format matched with the link type, for example, if the link is an HTTP link, the data to be synchronized can be encapsulated according to the data transmission format of the HTTP, and the message obtained by encapsulation is sent to the server. After receiving the message sent by the terminal, the server analyzes the message to obtain the data to be synchronized, inquires the file to be updated and synchronized in the database according to the file information corresponding to the data to be synchronized, and synchronizes.
In this embodiment, a link may be established with a server, and data to be synchronized in the data to be cleaned is synchronized to the corresponding server, so that a situation that the data is lost when the application performs data cleaning can be avoided.
As shown in fig. 8, in one embodiment, a data processing apparatus 800 is provided and includes a receiving module 810, an information obtaining module 820, a detecting module 830, a synchronizing module 840, and a deleting module 850.
The receiving module 810 is configured to receive a data cleaning instruction of an application.
And an information obtaining module 820, configured to obtain file information corresponding to the data to be cleaned according to the data cleaning instruction.
The detecting module 830 is configured to detect whether the data to be cleaned includes data to be synchronized according to the file information.
The synchronization module 840 is configured to synchronize the data to be synchronized with the server if the data to be cleaned includes the data to be synchronized.
And a deleting module 850, configured to delete the data to be cleaned.
The data processing device receives the data cleaning instruction of the application, acquires the file information corresponding to the data to be cleaned according to the data cleaning instruction, detects whether the data to be cleaned contains the data to be synchronized or not according to the file information, synchronizes the data to be synchronized to the server if the data to be synchronized contains the data to be synchronized, and then deletes the data to be cleaned, so that the situation that the data is lost when the application cleans the data can be avoided.
As shown in fig. 9, in one embodiment, the information obtaining module 820 includes an application identification obtaining unit 822 and a change time reading unit 824.
An application identifier obtaining unit 822, configured to obtain the application identifier according to the data cleaning instruction.
A change time reading unit 824, configured to read the change time of each file corresponding to the data to be cleaned from the specified folder according to the application identifier.
As shown in fig. 10, in one implementation, the detection module 830 includes a record acquisition unit 832, a synchronized time reading unit 834, a comparison unit 836, and a first determination unit 838.
A record obtaining unit 832, configured to obtain the history synchronization record according to the application identifier.
A synchronization time reading unit 834 for reading the last synchronization time from the history synchronization record if the history synchronization record is not empty.
A comparing unit 836, configured to compare the change time of each file corresponding to the data to be cleaned with the last synchronization time.
The first determining unit 838 is configured to determine, if the change time of the file is later than the last synchronization time, the file with the change time later than the last synchronization time as the data to be synchronized.
In this embodiment, the change time of each file corresponding to the data to be cleaned may be compared with the last synchronization time of the application, a file whose change time is later than the last synchronization time is determined as the data to be synchronized, the data to be synchronized is synchronized to the server, and then the data to be cleaned is deleted, so that the situation that the data is lost when the application performs data cleaning can be avoided.
As shown in fig. 11, in one embodiment, the detecting module 830 includes a determining unit 831 and a second determining unit 833.
The determining unit 831 is configured to read a specific flag bit in each file corresponding to the data to be cleaned according to the file information, and determine whether the specific flag bit is a preset tag.
The second determining unit 833 is configured to determine, if the specific flag bit is the preset tag, that the file with the specific flag bit being the preset tag is to-be-synchronized data.
In this embodiment, the data to be synchronized can be determined according to the specific flag bit of each file corresponding to the data to be cleaned, and the data to be synchronized is synchronized to the server, and then the data to be cleaned is deleted, so that the situation of data loss when the application performs data cleaning can be avoided.
As shown in fig. 12, in one embodiment, synchronization module 840 includes a server identifier obtaining unit 842, a establishing unit 844, and a sending unit 846.
A server identifier obtaining unit 842, configured to obtain the server identifier.
An establishing unit 844 is configured to establish a link according to the server identifier, and log in a corresponding server through the link.
A sending unit 846, configured to encapsulate the data to be synchronized into a message according to a preset format, and send the message to the server.
In this embodiment, a link may be established with a server, and data to be synchronized in the data to be cleaned is synchronized to the corresponding server, so that a situation that the data is lost when the application performs data cleaning can be avoided.
The embodiment of the invention also provides computer equipment. As shown in fig. 13, for convenience of illustration, only the portion related to the embodiment of the present invention is shown, and the detailed technical details are not disclosed, please refer to the method portion of the embodiment of the present invention. The computer device may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, a wearable device, and the like, taking the computer device as the mobile phone as an example:
fig. 13 is a block diagram of a partial structure of a cellular phone related to a computer device provided in an embodiment of the present invention. Referring to fig. 13, the handset includes: radio Frequency (RF) circuitry 1310, memory 1320, input unit 1330, display unit 1340, sensors 1350, audio circuitry 1360, WiFi module 1370, processor 1380, and power supply 1390. Those skilled in the art will appreciate that the handset configuration shown in fig. 13 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The RF circuit 1310 may be used for receiving and transmitting signals during information transmission and reception or during a call, and may receive downlink information from a base station and then process the received downlink information to the processor 1380; the uplink data may also be transmitted to the base station. Typically, the RF circuitry includes, but is not limited to, an antenna, at least one Amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuit 1310 may also communicate with networks and other devices via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM, General Packet Radio Service (GPRS), CDMA, Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
The memory 1320 may be used to store software programs and modules, and the processor 1380 executes various functional applications and data processing of the cellular phone by operating the software programs and modules stored in the memory 1320. The memory 1320 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as an application program for a sound playing function, an application program for an image playing function, and the like), and the like; the data storage area may store data (such as audio data, an address book, etc.) created according to the use of the mobile phone, and the like. Further, the memory 1320 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 1330 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the cellular phone 1300. Specifically, the input unit 1330 may include a touch panel 1332 and other input devices 1334. Touch panel 1332, which may also be referred to as a touch screen, can collect touch operations by a user on or near touch panel 1332 (e.g., operations by a user on or near touch panel 1332 using a finger, a stylus, or any other suitable object or attachment), and drive the corresponding connection device according to a predetermined program. In one embodiment, touch panel 1332 can include two portions, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, and sends the touch point coordinates to the processor 1380, where the touch controller can receive and execute commands sent by the processor 1380. In addition, the touch panel 1332 can be implemented by various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to touch panel 1332, input unit 1330 may include other input devices 1334. In particular, other input devices 1334 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), and the like.
The display unit 1340 may be used to display information input by a user or information provided to the user and various menus of the cellular phone. The display unit 1340 may include a display panel 1342. In one embodiment, the Display panel 1342 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. In one embodiment, touch panel 1332 can overlay display panel 1342 and, when touch panel 1332 detects a touch operation on or near touch panel 1332, communicate to processor 1380 to determine the type of touch event, and processor 1380 then provides a corresponding visual output on display panel 1342 based on the type of touch event. Although in fig. 13, the touch panel 1332 and the display panel 1342 are two separate components to implement the input and output functions of the mobile phone, in some embodiments, the touch panel 1332 and the display panel 1342 may be integrated to implement the input and output functions of the mobile phone.
The cell phone 1300 may also include at least one sensor 1350, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel 1342 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 1342 and/or the backlight when the mobile phone is moved to the ear. The motion sensor can comprise an acceleration sensor, the acceleration sensor can detect the magnitude of acceleration in each direction, the magnitude and the direction of gravity can be detected when the mobile phone is static, and the motion sensor can be used for identifying the application of the gesture of the mobile phone (such as horizontal and vertical screen switching), the vibration identification related functions (such as pedometer and knocking) and the like; the mobile phone may be provided with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor.
The audio circuit 1360, speaker 1362, and microphone 1364 may provide an audio interface between the user and the cell phone. The audio circuit 1360 may transmit the electrical signal converted from the received audio data to the speaker 1362, and the electrical signal is converted into a sound signal by the speaker 1362 and output; on the other hand, the microphone 1364 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 1360, and then outputs the audio data to the processor 1380 for processing, and then the audio data can be transmitted to another mobile phone through the RF circuit 1310, or the audio data can be output to the memory 1320 for subsequent processing.
WiFi belongs to short-distance wireless transmission technology, and the mobile phone can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 1370, and provides wireless broadband internet access for the user.
The processor 1380 is a control center of the mobile phone, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 1320 and calling data stored in the memory 1320, thereby integrally monitoring the mobile phone. In one embodiment, processor 1380 may include one or more processing units. In one embodiment, the processor 1380 may integrate an application processor and a modem processor, wherein the application processor primarily handles operating systems, user interfaces, application programs, and the like; the modem processor handles primarily wireless communications. It will be appreciated that the modem processor described above may not be integrated within processor 1380.
The handset 1300 also includes a power supply 1390 (e.g., a battery) to supply power to the various components, and preferably, the power supply 1390 is logically connected to the processor 1380 via a power management system that provides management of charging, discharging, and power consumption.
In one embodiment, the cell phone 1300 may also include a camera, a bluetooth module, and the like.
In the embodiment of the present invention, the processor 1380 included in the mobile terminal implements the data processing method described above when executing a computer program stored on a memory.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the above-mentioned data processing method.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (12)

1. A data processing method, comprising:
receiving a data cleaning instruction of an application when a user unloads the application by triggering a screen of a terminal;
acquiring file information corresponding to the data to be cleaned according to the data cleaning instruction;
detecting whether the data to be cleaned contains data to be synchronized according to the file information;
if yes, the data to be synchronized is synchronized to a server in real time or asynchronously transmitted to the server;
detecting whether each file corresponding to the data to be processed contains a newly generated file or a modified file from last synchronization to data cleaning instruction receiving according to the file information, if so, determining the newly generated file or the modified file as the data to be synchronized, and synchronizing the data to be synchronized to a server in real time or asynchronously transmitting the data to be synchronized to the server;
and deleting the data to be cleaned.
2. The method according to claim 1, wherein the obtaining file information corresponding to the data to be cleaned according to the data cleaning instruction comprises:
acquiring an application identifier according to the data cleaning instruction;
and reading the change time of each file corresponding to the data to be cleaned from the specified folder according to the application identifier.
3. The method according to claim 2, wherein the detecting whether the data to be cleaned includes data to be synchronized according to the file information comprises:
acquiring a history synchronous record according to the application identifier;
if the historical synchronous record is not empty, reading the last synchronous time from the historical synchronous record;
comparing the change time of each file corresponding to the data to be cleaned with the last synchronization time;
and if the change time of the file is later than the last synchronization time, determining the file with the change time later than the last synchronization time as the data to be synchronized.
4. The method according to claim 1, wherein the detecting whether the data to be cleaned includes data to be synchronized according to the file information comprises:
reading specific mark positions in each file corresponding to the data to be cleaned according to the file information, and judging whether the specific mark positions are preset labels;
and if the label is a preset label, determining that the file with the specific mark bit as the preset label is the data to be synchronized.
5. The method according to any one of claims 1 to 4, wherein the synchronizing the data to be synchronized to the server in real time or the asynchronously transmitting the data to be synchronized to the server comprises:
acquiring a server identifier;
establishing a link according to the server identification, and logging in a corresponding server through the link;
and encapsulating the data to be synchronized into a message according to a preset format, and sending the message to the server.
6. A data processing apparatus, comprising:
the receiving module is used for receiving a data cleaning instruction of the application when the user unloads the application through a screen of the trigger terminal;
the information acquisition module is used for acquiring file information corresponding to the data to be cleaned according to the data cleaning instruction;
the detection module is used for detecting whether the data to be cleaned contains the data to be synchronized according to the file information;
the synchronization module is used for synchronizing the data to be synchronized to a server in real time or asynchronously transmitting the data to be synchronized to the server if the data to be cleaned comprises the data to be synchronized;
the deleting module is used for deleting the data to be cleaned;
the detection module is further configured to detect whether each file corresponding to the data to be processed includes a newly generated file or a modified file from last synchronization to reception of the data cleaning instruction according to the file information, determine the newly generated file or the modified file as the data to be synchronized if the file includes the newly generated file or the modified file, and synchronize the data to be synchronized to the server in real time or asynchronously transmit the data to be synchronized to the server.
7. The apparatus of claim 6, wherein the information obtaining module comprises:
the application identifier acquisition unit is used for acquiring an application identifier according to the data cleaning instruction;
and the change time reading unit is used for reading the change time of each file corresponding to the data to be cleaned from the specified folder according to the application identification.
8. The apparatus of claim 7, wherein the detection module comprises:
the record acquisition unit is used for acquiring a history synchronous record according to the application identifier;
the synchronization time reading unit is used for reading the last synchronization time from the historical synchronization record if the historical synchronization record is not empty;
the comparison unit is used for comparing the change time of each file corresponding to the data to be cleaned with the last synchronization time;
and the first determining unit is used for determining the file with the changing time later than the last synchronizing time as the data to be synchronized if the changing time of the file is later than the last synchronizing time.
9. The apparatus of claim 6, wherein the detection module comprises:
the judging unit is used for reading specific mark positions in each file corresponding to the data to be cleaned according to the file information and judging whether the specific mark positions are preset labels or not;
and the second determining unit is used for determining that the file with the specific mark bit as the preset label is the data to be synchronized if the preset label is the preset label.
10. The apparatus of any of claims 6 to 9, wherein the synchronization module comprises:
a server identifier acquisition unit configured to acquire a server identifier;
the establishing unit is used for establishing a link according to the server identifier and logging in a corresponding server through the link;
and the sending unit is used for encapsulating the data to be synchronized into a message according to a preset format and sending the message to the server.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1 to 5 when executing the program.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1 to 5.
CN201710312691.2A 2017-05-05 2017-05-05 Data processing method and device, computer equipment and storage medium Expired - Fee Related CN107145572B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710312691.2A CN107145572B (en) 2017-05-05 2017-05-05 Data processing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710312691.2A CN107145572B (en) 2017-05-05 2017-05-05 Data processing method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN107145572A CN107145572A (en) 2017-09-08
CN107145572B true CN107145572B (en) 2020-12-18

Family

ID=59777011

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710312691.2A Expired - Fee Related CN107145572B (en) 2017-05-05 2017-05-05 Data processing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN107145572B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918348B (en) * 2019-03-26 2023-09-19 努比亚技术有限公司 Cleaning method, terminal and computer readable storage medium for application browsing record
CN110309164B (en) * 2019-06-27 2023-05-09 深圳前海微众银行股份有限公司 Information updating method, device, equipment and computer readable storage medium
CN113326242A (en) * 2020-02-28 2021-08-31 阿里巴巴集团控股有限公司 Data processing method and device, electronic equipment and computer storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101325478A (en) * 2008-08-06 2008-12-17 北京北纬通信科技股份有限公司 Method and system for data synchronization
CN101364250B (en) * 2007-08-08 2011-06-08 深圳华为通信技术有限公司 Copyright information processing method and device
CN105843708A (en) * 2016-04-06 2016-08-10 北京小米移动软件有限公司 Data processing method and device
CN105868049A (en) * 2015-12-15 2016-08-17 乐视移动智能信息技术(北京)有限公司 Data processing method and apparatus
CN106506820A (en) * 2016-10-25 2017-03-15 广东欧珀移动通信有限公司 A kind of backup method of mobile terminal data and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101364250B (en) * 2007-08-08 2011-06-08 深圳华为通信技术有限公司 Copyright information processing method and device
CN101325478A (en) * 2008-08-06 2008-12-17 北京北纬通信科技股份有限公司 Method and system for data synchronization
CN105868049A (en) * 2015-12-15 2016-08-17 乐视移动智能信息技术(北京)有限公司 Data processing method and apparatus
CN105843708A (en) * 2016-04-06 2016-08-10 北京小米移动软件有限公司 Data processing method and device
CN106506820A (en) * 2016-10-25 2017-03-15 广东欧珀移动通信有限公司 A kind of backup method of mobile terminal data and device

Also Published As

Publication number Publication date
CN107145572A (en) 2017-09-08

Similar Documents

Publication Publication Date Title
CN103327189B (en) Method and device for uploading, browsing and deleting pictures
CN108549698B (en) File processing method and device, mobile terminal and computer readable storage medium
CN104426963B (en) The method and terminal of associated terminal
CN105490919A (en) Message withdrawal method and device
WO2018049887A1 (en) Data transmission processing method and terminal device
CN107562539B (en) Application program processing method and device, computer equipment and storage medium
CN108834132B (en) Data transmission method and equipment and related medium product
CN112148579B (en) User interface testing method and device
CN106302808A (en) Data transmission method and mobile terminal
CN108563754B (en) File processing method and device, mobile terminal and computer readable storage medium
CN105260087A (en) Information display method and terminal
CN107423099B (en) Key code programming method, server, terminal, key code programming system and storage medium
CN106951492B (en) File searching method and device and electronic equipment
CN107145572B (en) Data processing method and device, computer equipment and storage medium
CN106302603A (en) The method and apparatus remotely deleting information
CN103607431A (en) Mobile terminal resource processing method, apparatus and equipment thereof
CN106020945B (en) Shortcut item adding method and device
CN108256466B (en) Data processing method and device, electronic equipment and computer readable storage medium
CN106332058A (en) Data transmission method and terminal equipment
CN107729391B (en) Image processing method, image processing device, computer-readable storage medium and mobile terminal
CN107770449A (en) continuous shooting method, electronic equipment and storage medium
CN105022621A (en) Method and device for collecting session message and terminal
CN105872041B (en) The processing method and processing device of operation object
US11327845B2 (en) Image synchronization method and device, and server
CN104424321A (en) File directory obtainment method and file directory obtainment device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20201218

CF01 Termination of patent right due to non-payment of annual fee