[go: up one dir, main page]

CN107395770B - Data synchronization method and device - Google Patents

Data synchronization method and device Download PDF

Info

Publication number
CN107395770B
CN107395770B CN201710796549.XA CN201710796549A CN107395770B CN 107395770 B CN107395770 B CN 107395770B CN 201710796549 A CN201710796549 A CN 201710796549A CN 107395770 B CN107395770 B CN 107395770B
Authority
CN
China
Prior art keywords
data
list
data object
data list
displayed
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.)
Active
Application number
CN201710796549.XA
Other languages
Chinese (zh)
Other versions
CN107395770A (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.)
China Southern Power Grid Internet Service Co ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710796549.XA priority Critical patent/CN107395770B/en
Publication of CN107395770A publication Critical patent/CN107395770A/en
Priority to PCT/CN2017/115314 priority patent/WO2019047406A1/en
Application granted granted Critical
Publication of CN107395770B publication Critical patent/CN107395770B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a data synchronization method and a data synchronization device, which are applied to a user terminal communicated with a server. The method comprises the following steps: acquiring a first data list from a server; comparing the first data list with a second data list in the user terminal; and according to the comparison result, synchronizing the data object included in the first data list in the second data list into the first data list to obtain a target data list, and displaying the target data list. Therefore, the user terminal can quickly and accurately determine whether the data to be displayed is downloaded, the display speed of the data to be displayed is increased, and the user experience is improved.

Description

Data synchronization method and device
Technical Field
The invention relates to the technical field of information, in particular to a data synchronization method and device.
Background
In an application program, there are usually many data (e.g., sticker data, skin data, etc.) to be displayed, so that the server needs to request corresponding data to be displayed according to the operation of a user and display the data. However, some data to be displayed may have already been downloaded, and at this time, the data to be displayed may be directly obtained from the local for displaying.
Currently, a common method for determining whether data to be displayed is downloaded is to traverse filenames in a local directory folder of the data to be displayed. By adopting the method, if the duplicate data file to be displayed is locally stored, correct judgment cannot be made, the traversing process consumes long time, the running speed of the program can be greatly reduced, and the user experience is reduced.
Disclosure of Invention
Accordingly, the present invention is directed to a data synchronization method and apparatus to solve the above problems.
In order to achieve the above object, an embodiment of the present invention provides a data synchronization method applied to a user terminal in communication with a server, where the method includes:
acquiring a first data list from the server, wherein the first data list comprises identification information of a plurality of data to be displayed;
establishing a data object comprising a data element and a status flag for each identification information in the first data list, storing the identification information into the data element, and setting the status flag to be not downloaded;
comparing the first data list with a second data list in the user terminal, wherein the second data list comprises a data object which downloads corresponding data to be displayed, the downloaded data to be displayed is stored in a data element of the data object, and the state of the data object is marked as downloaded;
and according to the comparison result, synchronizing the data object included in the first data list in the second data list into the first data list to obtain a target data list, and displaying the target data list.
The embodiment of the invention also provides a data synchronization device, which is applied to a user terminal communicated with a server, and comprises:
the display device comprises a list acquisition module, a display module and a display module, wherein the list acquisition module is used for acquiring a first data list from the server, and the first data list comprises identification information of a plurality of data to be displayed;
the data processing module is used for establishing a data object comprising a data element and a state mark for each identification information in the first data list, storing the identification information into the data element, and setting the state mark as not downloaded;
the list comparison module is used for comparing the first data list with a second data list in the user terminal, the second data list comprises a data object which is downloaded with corresponding data to be displayed, the downloaded data to be displayed is stored in a data element of the data object, and the state of the data object is marked as downloaded;
and the data synchronization module is used for synchronizing the data object included in the first data list in the second data list into the first data list according to the comparison result to obtain a target data list and displaying the target data list.
According to the data synchronization method and device provided by the embodiment of the invention, the first data list comprising the identification information of a plurality of data to be displayed is obtained from the server, each identification information in the first data list is assembled into a data object comprising a state mark, and the state mark in each data object is set to be not downloaded. And comparing the first data list with a second data list in the user terminal, wherein the second data list comprises a data object which downloads corresponding data to be displayed, and the state of the data object is marked as downloaded. And according to the comparison result, synchronizing the data object included in the first data list in the second data list into the second data list to form a target data list, and displaying the target data list. Therefore, the user terminal can directly determine whether the corresponding data to be displayed is downloaded according to the state mark without traversing the local directory folder, so that the response speed and accuracy are improved, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a schematic diagram of interaction between a user terminal and a server according to an embodiment of the present invention;
fig. 2 is a schematic block diagram of a user equipment according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a data synchronization method according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a data synchronization apparatus according to an embodiment of the present invention.
Icon: 100-a user terminal; 110-data synchronization means; 111-list acquisition module; 112-a data processing module; 113-list comparison module; 114-a data synchronization module; 115-a judgment module; 116-a display module; 117-download module; 118-a state modification module; 119-a data object storage module; 120-a memory; 130-a processor; 140-a communication unit; 150-a display unit; 200-a server; 300-a network; 400-application program.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Fig. 1 is a schematic diagram illustrating interaction between a user terminal 100 and a server 200 according to an embodiment of the present invention. The user terminal 100 may communicate with the server 200 through a network 300 to implement data interaction. The network 300 may be a wired network or a wireless network.
The server 200 is provided with an Application (APP) 400 that can be downloaded and installed by the user terminal 100, and a user can acquire a service provided by the server 200 through the APP 400. In this embodiment, the APP can be the APP that has the image acquisition function such as live APP, the APP of making a video recording, the APP of shooing, also can be the APP of other information sets that need to show. The information set is a set of a plurality of categories of information.
In this embodiment, the user terminal 100 may be a Personal Computer (PC), a smart phone, a tablet Computer, a wearable mobile device, or the like. The user terminal 100 has installed therein an APP provided by the server 200. Optionally, the user terminal 100 may be a terminal device based on an Android system.
Fig. 2 is a block diagram of a user terminal 100 according to an embodiment of the present invention. The user terminal 100 includes a data synchronization apparatus 110, a memory 120, a processor 130, a communication unit 140, and a display unit 150.
The memory 120, the processor 130, the communication unit 140 and the display unit 150 are electrically connected to each other directly or indirectly to realize data interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The data synchronization device 110 includes at least one software function module that can be solidified in an Operating System (OS) of the user terminal 100 in the form of software or firmware (firmware).
In this embodiment, the data synchronization apparatus 110 may be a subroutine of the APP, or may be a program independent of the APP.
The Memory 120 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like.
The processor 130 may be an integrated circuit chip having signal processing capabilities. The processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP)), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The communication unit 140 is used for establishing a communication connection between the user terminal 100 and the server 200 through the network 300.
The display unit 150 is used for establishing an interactive interface between the user terminal 100 and a user, or for displaying information to be displayed.
Fig. 3 is a schematic flow chart of a data synchronization method according to an embodiment of the present invention, where the data synchronization method is applied to the user terminal 100 shown in fig. 2. The specific process and steps shown in fig. 2 will be described in detail below.
Step S101, a first data list is obtained from the server 200, where the first data list includes identification information of a plurality of data to be displayed.
The data to be displayed refers to data that the APP in the user terminal 100 needs to display, for example, sticker data, skin data, and the like.
Taking a live APP as an example, the server 200 corresponding to the live APP will generally provide a plurality of sticker data for users to select. When the user opens the live APP at the user terminal 100, the identifiers (e.g., thumbnails, names) of the sticker data are displayed on the user interface of the live APP. Assuming that the user selects one of the identifiers, the user terminal 100 detects whether the sticker data corresponding to the identifier has been downloaded, and if so, the sticker data is taken directly from the local without requesting the sticker data from the server 200.
The inventor researches and discovers that some existing methods are to judge whether a file name corresponding to the detected sticker data exists or not by scanning the file name in a local directory folder, and if so, the detected sticker data is determined to be downloaded, otherwise, the detected sticker data is not downloaded.
However, this approach has drawbacks. On one hand, if there is a duplicate name sticker file in the downloaded sticker data stored locally, the above-mentioned detection process cannot be realized. On the other hand, if the content of the same sticker file is changed, it cannot be detected only by the file name. In addition, downloaded local files are typically stored on disk, and thus, traversing the file name is essentially an IO operation. IO operation is a very slow process, which will slow down the running speed of the APP, and further affect the user experience.
The data synchronization method provided in this embodiment may be executed when the APP is started, or may be periodically executed in the running process of the APP, which is not limited in this embodiment.
In practice, the ue 100 sends a network 300 request (e.g. HTTP request) to the server 200, and the server 200 feeds back the first data list to the ue 100 according to the network 300 request. The first data list includes identification information of a plurality of data to be displayed, where the identification information may include identity information and summary information of the data to be displayed. The identity information may be an ID number, and the summary information may be summary information obtained by calculating the data to be displayed by using a message summary Algorithm fifth edition (MessageDigest Algorithm MD5, MD 5). The identification information is used to uniquely characterize the data to be displayed.
Step S102, establishing a data object including a data element and a status flag for each identification information in the first data list, storing the identification information in the data element, and setting the status flag to be not downloaded.
In this embodiment, the first data list returned by the server 200 does not include the data to be displayed, but includes the identification information of the data to be displayed. That is, each data to be displayed is in an un-downloaded state. And aiming at each identification information in the first data list, establishing a data object for the identification information, wherein the data object comprises a data element and a state mark, and the data element and the state mark are attributes of the data object. And storing the identification information into the data elements of the data objects established for the identification information, and setting the established state mark attribute of each data object as not downloaded.
The setting of the status flag attribute as not downloaded means that the value of the status flag attribute is set to a value or a character string used for representing not downloaded, for example, 0, 1, available, etc. may be used for representing not downloaded, and may be determined according to actual requirements.
Still taking the sticker data as an example, for each identification information, the following data structure may be established:
Public class PatsrItem{
Private int type;
Private int status;
Private pasterResource prs;
}
that is, the data structure of each identification information in the first data list is processed. In implementation, a sticker object passitem is established for each piece of identification information in the first data list, where a passive resource is a sticker element and is used to store the sticker data information returned by the server 200, that is, to store the identification information or the data to be displayed. The type comprises type _ stop, type _ setting and type _ item, and the type _ stop, the type _ setting and the type _ item respectively correspond to a stop button, a setting button and a sticker element button on the application interface of the APP. The stop button is used for controlling to stop downloading, the setting button is used for setting the paster, and the paster element is used for representing corresponding paster data and is usually displayed as a thumbnail or a name and the like of the corresponding paster data.
In the present embodiment, when the value of the type attribute is type _ stop or type _ setting, the values of the other attributes may be null.
The STATUS indicates the STATUS flag of the current sticker, and in this embodiment, the STATUS may include the selection of STATUS _ FINISH, STATUS _ AVAI L AB L E, STATUS _ RETRY, STATUS _ DWON L pending, etc., where STATUS _ FINISH indicates downloaded, STATUS _ AVAI L AB L E indicates not downloaded (downloadable), STATUS _ RETRY indicates retriable, STATUS _ DWON L pending indicates downloading.
Through the above processing, the obtained first data list is actually a list including a plurality of data objects, and each data object in the first data list does not store corresponding data to be displayed, and the status flag attribute of each data object is not downloaded.
Step S103, comparing the first data list with a second data list in the user terminal 100, where the second data list includes a data object that has downloaded corresponding data to be displayed, the downloaded data to be displayed is stored in a data element of the data object, and a status of the data object is marked as downloaded.
The second data list is a list formed by data objects of the data to be displayed which are downloaded before. That is, the second data list includes a plurality of data objects, the data objects each store corresponding data to be displayed, and the status flag attributes of the data objects are all downloaded.
Taking the above-mentioned sticker data as an example, the second data list includes a plurality of sticker objects, the sticker element of each sticker object stores corresponding sticker data, and the status flag of each sticker object is downloaded, where the status flag is downloaded, which means that the value corresponding to the attribute of the status flag is a value or a character string used for characterizing that the downloaded value or character string is downloaded.
Optionally, in this embodiment, the step S103 may be implemented by:
and acquiring identity information and summary information in each data object in the first data list, and detecting whether the data objects with the same identity information and summary information exist in the second data list.
In this embodiment, the identification information of the data to be displayed may include identity information and summary information of the data to be displayed. When the first data list is compared with the second data list, the first data list processed in step S102 is actually compared with the second data list.
Before comparison, a first data list and a second data list which can be used need to be acquired, and in detail, the second data list can be acquired in the following manner:
the shared parameter object provided by the system of the user terminal 100 is obtained by calling the shared parameter obtaining instruction getSharedPreferences (), the data objects stored in the user terminal 100 are obtained by calling the information obtaining instruction getString () of the shared parameter object, and the second data list can be obtained by adding a mark corresponding to the second data list to each obtained data object, for example, the mark is localPasterItem, and then calling the getpointer L ist () instruction of the localPasterItem.
Accordingly, each data object in the first data list may be marked as a remoutPasterItem, and the first data list may be obtained by calling a getMaster L ist () instruction of the remoutPasterItem.
In implementation, a for-loop method may be adopted to traverse the first data list, take one data object in each loop, call the getid () instruction and getMd5() instruction of the data object to obtain the identity information and the digest information of the data object, and compare the identity information and the digest information with the identity information and the digest information of each data object in the second data list to detect whether a data object with the same identity information and digest information exists in the second data list.
The manner of obtaining the identity information and the summary information of each data object in the second list is similar to the manner of obtaining the identity information and the summary information of each data object in the first data list.
And step S104, synchronizing the data objects included in the first data list in the second data list into the first data list according to the comparison result to obtain a target data list, and displaying the target data list.
In this embodiment, the step S104 may be implemented in various manners, for example, by:
establishing a target data list, and if the second data list comprises the data object, adding the data object in the second data list to the target data list aiming at each data object in the first data list; and if the second data list does not comprise the data object, adding the data object in the first data list into the target data list.
For another example, the data object included in the first data list in the second data list may be directly synchronized to the first data list. For example, assuming that there is a data object X in the first data list, and the comparison shows that there is also a data object X in the second data list, the data object X in the second data list is synchronized into the first data list, that is, the data object X in the first data list is covered by the data object X in the second data list. In this way, the finally obtained first data list is substantially identical to the target data list, and thus, the processed first data list is the target data list.
In this embodiment, displaying the target data list refers to sending the target data list to an application interface of the APP for displaying.
Optionally, after the user terminal 100 presents the target data list, the method may further include step S105, step S106, and step S107.
Step S105, responding to the selection operation of the user on each data object in the target data list, and determining whether the data to be displayed corresponding to the data object has been downloaded according to the status flag of the selected data object. If yes, go to step S106; if not, step S107 is executed.
And step S106, displaying the data to be displayed stored in the data element of the data object.
Step S107, downloading the data to be displayed corresponding to the data object from the server 200.
Through the design, after the user executes the selection operation, whether the selected data object is downloaded or not can be immediately and accurately known, and then the corresponding operation is executed, so that the user experience is improved.
Optionally, the method may further comprise the steps of:
after the data to be displayed corresponding to the data object is acquired from the server 200, the acquired data to be displayed is stored in the data element of the data object, and the status flag of the data object is set to be downloaded; and storing the data object into a specified target file.
The step of storing the data object into the specified target file can be realized by the following steps:
calling a shared parameter acquisition instruction getsharedPreferences (), acquiring a storage path of the target file in the user terminal 100, and returning a shared parameter object including the storage path; calling an Edit instruction Edit () of the shared parameter object to acquire an Edit object for editing the target file; calling a data writing instruction putString () of the editing object to write the data object in a key value pair mode; and calling a commit command commit () of the editing object, and committing the content written by the data writing command putString () to the target file.
Wherein the shared parameter get instruction getsharedPreferences () is an integrated instruction in the SharedPreferences tool class.
As shown in fig. 4, an embodiment of the present invention further provides a data synchronization apparatus 110, which is applied to the user terminal 100 shown in fig. 2. The apparatus includes a list acquisition module 111, a data processing module 112, a list comparison module 113, and a data synchronization module 114.
The list acquiring module 111 is configured to acquire a first data list from the server 200, where the first data list includes identification information of a plurality of data to be displayed.
In this embodiment, the description of the list obtaining module 111 may specifically refer to the detailed description of step S101 shown in fig. 3, that is, step S101 may be performed by the list obtaining module 111.
The data processing module 112 is configured to establish a data object including a data element and a status flag for each identification information in the first data list, store the identification information in the data element, and set the status flag to be not downloaded.
In the present embodiment, the description of the data processing module 112 may specifically refer to the detailed description of step S102 shown in fig. 3, that is, step S102 may be executed by the data processing module 112.
The list comparing module 113 is configured to compare the first data list with a second data list in the user terminal 100, where the second data list includes a data object in which corresponding data to be displayed has been downloaded, the downloaded data to be displayed is stored in a data element of the data object, and a status of the data object is marked as downloaded.
In this embodiment, the detailed description of the step S102 shown in fig. 3 may be referred to for the description of the list comparing module 113, that is, the step S102 may be executed by the list comparing module 113.
Optionally, in this embodiment, the manner in which the list comparison module 113 compares the first data list with the second data list in the user terminal 100 may include:
and acquiring identification information and summary information in each data object in the first data list, and detecting whether the data objects with the same identification information and summary information exist in the second data list.
The data synchronization module 114 is configured to synchronize the data object included in the first data list in the second data list to the first data list according to the comparison result, so as to obtain a target data list, and display the target data list.
In this embodiment, the description of the data synchronization module 114 may specifically refer to the detailed description of step S104 shown in fig. 3, that is, the step S104 may be executed by the data synchronization module 114.
Optionally, in this embodiment, the manner in which the data synchronization module 114 synchronizes the data object included in the first data list in the second data list to the first data list to obtain a target data list may include:
establishing a target data list; for each data object in the first data list, if the data object is included in the second data list, adding the data object in the second data list to the target data list; and if the second data list does not comprise the data object, adding the data object in the first data list into the target data list.
Optionally, the apparatus may further include a determining module 115, a presenting module 116, and a downloading module 117.
The determining module 115 is configured to respond to a selection operation of a user on each data object in the target data list after the user terminal 100 displays the target data list, and determine whether the data to be displayed corresponding to the data object has been downloaded according to a status flag of the selected data object.
In this embodiment, the detailed description of step S105 shown in fig. 3 may be referred to for the description of the determining module 115. That is, the step S105 may be performed by the determination module 115.
The presentation module 116 is configured to present the data to be displayed stored in the data element of the data object when whether the data to be displayed corresponding to the data object has been downloaded.
In the present embodiment, the description of the presentation module 116 may specifically refer to the detailed description of step S106 shown in fig. 3. That is, the step S106 may be performed by the presentation module 116.
The downloading module 117 is configured to download the data to be displayed corresponding to the data object from the server 200 when the data to be displayed corresponding to the data object is not downloaded.
In this embodiment, the description of the downloading module 117 may specifically refer to the detailed description of step S107 shown in fig. 3. That is, the step S107 may be performed by the download module 117.
Optionally, the apparatus may further include a state modification module 118 and a data object storage module 119.
The status modification module 118 is configured to, after acquiring the data to be displayed corresponding to the data object from the server 200, store the acquired data to be displayed in the data element of the data object, and set the status flag of the data object to be downloaded.
In the present embodiment, the description of the status modification module 118 may specifically refer to the description of the relevant steps in the above.
The data object storage module 119 is configured to store the data object in a specified target file.
In this embodiment, the description of the data object storage module 119 may specifically refer to the detailed description of the relevant steps in the above.
In summary, the data synchronization method and apparatus provided in the embodiments of the present invention obtain the first data list including the identification information of the multiple data to be displayed from the server 200, assemble the identification information in the first data list into data objects including status flags, and set the status flag in each data object as not downloaded. The first data list is compared with a second data list in the user terminal 100, the second data list includes a data object of which corresponding data to be displayed has been downloaded, and the status of the data object is marked as downloaded. And according to the comparison result, synchronizing the data object included in the first data list in the second data list into the second data list to form a target data list, and displaying the target data list. In this way, the user terminal 100 can directly determine whether the corresponding data to be displayed has been downloaded according to the status flag without traversing the local directory folder, thereby improving the response speed and accuracy and improving the user experience.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (8)

1. A data synchronization method applied to a user terminal in communication with a server, the method comprising:
acquiring a first data list from the server, wherein the first data list comprises identification information of a plurality of data to be displayed;
establishing a data object comprising a data element and a status flag for each identification information in the first data list, storing the identification information into the data element, and setting the status flag to be not downloaded;
comparing the first data list with a second data list in the user terminal, wherein the second data list comprises a data object which downloads corresponding data to be displayed, the downloaded data to be displayed is stored in a data element of the data object, and the state of the data object is marked as downloaded;
the identification information of the data to be displayed comprises identity information and summary information of the data to be displayed; the step of comparing the first data list with a second data list in the user terminal comprises:
for each data object in the first data list, acquiring identity information and summary information in the data object, and detecting whether a data object with the same identity information and summary information exists in the second data list; the method comprises the steps that a for-loop traversal is adopted to traverse a first data list, a data object is taken out of each loop body, an obtaining instruction of the data object is called to respectively obtain identity information and abstract information of the data object, and the identity information and the abstract information are compared with the identity information and the abstract information of each data object in a second data list to detect whether the data object with the same identity information and abstract information exists in the second data list or not;
according to the comparison result, synchronizing the data object included in the first data list in the second data list into the first data list to obtain a target data list, and displaying the target data list;
and responding to the selection operation of the user on each data object in the target data list, and judging whether the data to be displayed corresponding to the data object is downloaded according to the state mark of the selected data object.
2. The method of claim 1, further comprising:
if the data to be displayed corresponding to the selected data object is downloaded, displaying the data to be displayed stored in the data element of the data object;
and if the data to be displayed corresponding to the selected data object is not downloaded, downloading the data to be displayed corresponding to the data object from the server.
3. The method according to claim 2, wherein after the step of obtaining the data to be displayed corresponding to the data object from the server, the method further comprises:
storing the acquired data to be displayed into a data element of the data object, and setting a state mark of the data object as downloaded;
and storing the data object into a specified target file.
4. The method according to any one of claims 1 to 3, wherein the step of synchronizing the data object included in the first data list in the second data list into the first data list to obtain a target data list comprises:
establishing a target data list;
for each data object in the first data list, if the data object is included in the second data list, adding the data object in the second data list to the target data list;
and if the second data list does not comprise the data object, adding the data object in the first data list into the target data list.
5. A data synchronization apparatus applied to a user terminal communicating with a server, the apparatus comprising:
the display device comprises a list acquisition module, a display module and a display module, wherein the list acquisition module is used for acquiring a first data list from the server, and the first data list comprises identification information of a plurality of data to be displayed;
the data processing module is used for establishing a data object comprising a data element and a state mark for each identification information in the first data list, storing the identification information into the data element, and setting the state mark as not downloaded;
the list comparison module is used for comparing the first data list with a second data list in the user terminal, the second data list comprises a data object which is downloaded with corresponding data to be displayed, the downloaded data to be displayed is stored in a data element of the data object, and the state of the data object is marked as downloaded;
the list comparison module acquires identification information and summary information in each data object in the first data list, and detects whether a data object with the same identification information and summary information exists in the second data list so as to compare the first data list with the second data list in the user terminal; the method comprises the steps that a for-loop traversal is adopted to traverse a first data list, a data object is taken out of each loop body, an obtaining instruction of the data object is called to respectively obtain identity information and abstract information of the data object, and the identity information and the abstract information are compared with the identity information and the abstract information of each data object in a second data list to detect whether the data object with the same identity information and abstract information exists in the second data list or not;
the data synchronization module is used for synchronizing the data objects included in the first data list in the second data list into the first data list according to the comparison result to obtain a target data list and displaying the target data list;
and the judging module is used for responding to the selection operation of the user on each data object in the target data list after the target data list is displayed by the user terminal, and judging whether the data to be displayed corresponding to the data object is downloaded according to the state mark of the selected data object.
6. The apparatus of claim 5, further comprising:
the display module is used for displaying the data to be displayed stored in the data element of the selected data object when the data to be displayed corresponding to the data object is downloaded;
and the downloading module is used for downloading the data to be displayed corresponding to the data object from the server when the data to be displayed corresponding to the selected data object is not downloaded.
7. The apparatus of claim 6, further comprising:
the state modification module is used for storing the acquired data to be displayed into the data element of the data object after acquiring the data to be displayed corresponding to the data object from the server, and setting the state mark of the data object as downloaded;
and the data object storage module is used for storing the data object into the specified target file.
8. The apparatus according to any one of claims 5 to 7, wherein the data synchronization module establishes a target data list, and for each data object in the first data list, when the data object is included in the second data list, adds the data object in the second data list to the target data list; and when the data object is not included in the second data list, adding the data object in the first data list to the target data list so as to synchronize the data object included in the first data list in the second data list to the first data list.
CN201710796549.XA 2017-09-06 2017-09-06 Data synchronization method and device Active CN107395770B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710796549.XA CN107395770B (en) 2017-09-06 2017-09-06 Data synchronization method and device
PCT/CN2017/115314 WO2019047406A1 (en) 2017-09-06 2017-12-08 Data synchronizing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710796549.XA CN107395770B (en) 2017-09-06 2017-09-06 Data synchronization method and device

Publications (2)

Publication Number Publication Date
CN107395770A CN107395770A (en) 2017-11-24
CN107395770B true CN107395770B (en) 2020-08-04

Family

ID=60351735

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710796549.XA Active CN107395770B (en) 2017-09-06 2017-09-06 Data synchronization method and device

Country Status (2)

Country Link
CN (1) CN107395770B (en)
WO (1) WO2019047406A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107395770B (en) * 2017-09-06 2020-08-04 武汉斗鱼网络科技有限公司 Data synchronization method and device
CN110308715A (en) * 2019-06-25 2019-10-08 重庆长安汽车股份有限公司 Reading data shows that equipment, automatic Pilot critical data read display system and method
CN112464691B (en) * 2019-09-06 2024-12-20 北京字节跳动网络技术有限公司 Image processing method and device

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4111881B2 (en) * 2003-06-30 2008-07-02 エスアーペー アーゲー Data synchronization control device, data synchronization control method, and data synchronization control program
CN100546260C (en) * 2007-06-27 2009-09-30 中国移动通信集团四川有限公司 Data inconsistency detection and processing method
CN101626339A (en) * 2008-07-07 2010-01-13 英华达(上海)电子有限公司 Method and system for downloading network data
CN102968347B (en) * 2012-10-29 2017-03-08 北京奇虎科技有限公司 The method of browser note real-time synchronization and the browser realizing note real-time synchronization
CN104426924A (en) * 2013-08-21 2015-03-18 腾讯科技(深圳)有限公司 Method, apparatus, client, server and system for updating application software
CN104346479A (en) * 2014-11-26 2015-02-11 北京奇虎科技有限公司 Database synchronization method and database synchronization device
CN105847430B (en) * 2016-05-20 2019-04-16 北京小米移动软件有限公司 Mix application page data access method and device
CN106227541A (en) * 2016-07-27 2016-12-14 乐视控股(北京)有限公司 A kind of program updates download process method and mobile terminal
CN106888252A (en) * 2017-01-17 2017-06-23 深圳市金立通信设备有限公司 The method and terminal of a kind of refresh data
CN107395770B (en) * 2017-09-06 2020-08-04 武汉斗鱼网络科技有限公司 Data synchronization method and device

Also Published As

Publication number Publication date
CN107395770A (en) 2017-11-24
WO2019047406A1 (en) 2019-03-14

Similar Documents

Publication Publication Date Title
WO2019091017A1 (en) Method and device for processing buried points in dynamic pages, and computer device
US10932106B2 (en) System, a method and a computer program product for automated remote control
CN107395770B (en) Data synchronization method and device
CN104737135B (en) Information processing terminal and synchronization control method
WO2015100307A1 (en) Providing access to a cloud based content management system on a mobile device
CN110245069A (en) The methods of exhibiting and device of the test method and device of page versions, the page
AU2021240218A1 (en) Configuration updating method and apparatus, device and storage medium
CN108536467A (en) Location processing method, device, terminal device and the storage medium of code
EP3467681B1 (en) Data migration method and device
CN108595965B (en) Method and device for preventing attribute information of interface control from being stolen
CN110262948B (en) Page data monitoring method, device and equipment
CN114286167B (en) Cross-device interaction method, device, electronic device, and storage medium
WO2021169811A1 (en) Method, apparatus, system and device for generating special effects, and storage medium
US20130185346A1 (en) Proofing electronic publications on portable devices
EP3035217A1 (en) Computer-readable storage medium and method for cross-platform synchronizing attributes of files
CN108241515B (en) Application shortcut establishing method and terminal
CN109783463A (en) File synchronisation method, device and computer readable storage medium
CN107577822A (en) A data synchronization method, data synchronization device and mobile terminal
CN109857888B (en) Image file processing method, apparatus, computer equipment and storage medium
KR20200111989A (en) Electronic device for searching a file information stored in external device and method of operating thereof
CN113168496A (en) Note synchronization method, system and related device
CN110321251B (en) Data backup method, device, equipment and storage medium based on network block equipment
CN112118474B (en) Video barrage display method and system, computer equipment and readable storage medium
CN111538666A (en) Method and device for collecting test results in batches, computer equipment and storage medium
CN112633844B (en) Data adaptation processing method, workflow system, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231110

Address after: Room 606-609, Compound Office Complex Building, No. 757, Dongfeng East Road, Yuexiu District, Guangzhou, Guangdong Province, 510699

Patentee after: China Southern Power Grid Internet Service Co.,Ltd.

Address before: 430000 East Lake Development Zone, Wuhan City, Hubei Province, No. 1 Software Park East Road 4.1 Phase B1 Building 11 Building

Patentee before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd.