WO2019047406A1 - Data synchronizing method and device - Google Patents

Data synchronizing method and device Download PDF

Info

Publication number
WO2019047406A1
WO2019047406A1 PCT/CN2017/115314 CN2017115314W WO2019047406A1 WO 2019047406 A1 WO2019047406 A1 WO 2019047406A1 CN 2017115314 W CN2017115314 W CN 2017115314W WO 2019047406 A1 WO2019047406 A1 WO 2019047406A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
list
data list
displayed
data object
Prior art date
Application number
PCT/CN2017/115314
Other languages
French (fr)
Chinese (zh)
Inventor
张磊
张文明
陈少杰
Original Assignee
武汉斗鱼网络科技有限公司
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 武汉斗鱼网络科技有限公司 filed Critical 武汉斗鱼网络科技有限公司
Publication of WO2019047406A1 publication Critical patent/WO2019047406A1/en

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/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
    • 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]

Definitions

  • the present invention relates to the field of information technology, and in particular to a data synchronization method and apparatus.
  • the usual way to determine whether the data to be displayed has been downloaded is by traversing the file name in the local data directory folder to be displayed. In this way, if the data file to be displayed with the duplicate name is stored locally, the correct judgment cannot be made, and the traversal process takes a long time, which greatly reduces the running speed of the program, thereby reducing the user experience.
  • an embodiment of the present invention provides a data synchronization method, which is applied to a user terminal that communicates with a server, and the method includes:
  • the server Acquiring, by the server, a first data list, where the first data list includes identifier information of multiple to-be-displayed data;
  • the second data The list includes data objects for which the corresponding data to be displayed has been downloaded, and the downloaded data to be displayed is stored in the data element of the data object, and the status of the data object is marked as downloaded;
  • the data objects included in the first data list in the second data list are synchronized into the first data list to obtain a target data list, and the target data list is displayed.
  • the method further includes:
  • the data to be displayed stored in the data element of the data object is displayed;
  • the data to be displayed corresponding to the data object is downloaded from the server.
  • the method further includes:
  • the obtained data to be displayed is stored in a data element of the data object, and the status flag of the data object is set to be downloaded;
  • the identification information of the data to be displayed includes identity information and summary information of the data to be displayed; and the step of comparing the first data list with the second data list in the user terminal ,include:
  • the step of synchronizing the data objects included in the first data list in the second data list to the first data list to obtain a target data list includes:
  • the data object in the first data list is added to the target data list.
  • the user terminal communicates with the server through a network to implement data interaction.
  • the server provides an application that is downloaded and installed by the user terminal, and the user obtains the service provided by the server through the application.
  • the user terminal is a personal computer, a smart phone, a tablet, and/or a wearable mobile device.
  • the user terminal includes a data synchronization device, a memory, a processor, a communication unit, and a display
  • the memory, the processor, the communication unit, and the components of the display unit are electrically connected directly or indirectly to each other to implement data interaction.
  • the memory is a random access memory, a read only memory, a programmable read only memory, an erasable read only memory, and/or an electrically erasable read only memory.
  • the processor is an integrated circuit chip and has signal processing capability.
  • the embodiment of the present invention further provides a data synchronization device, which should be configured as a user terminal that communicates with a server, and the device includes:
  • a list obtaining module configured to acquire a first data list from the server, where the first data list includes identifier information of a plurality of data to be displayed;
  • a data processing module configured to: in the first data list, create a data object including a data element and a status tag for each identification information, store the identification information in the data element, and set the status flag to Not downloaded
  • a list comparison module configured to compare the first data list with a second data list in the user terminal, where the second data list includes a data object that has been downloaded corresponding to the data to be displayed, and the downloaded data storage to be displayed In the data element of the data object, the status of the data object is marked as downloaded;
  • a data synchronization module configured to synchronize data objects included in the first data list in the second data list to the first data list according to a comparison result, to obtain a target data list, and to the target data The list is displayed.
  • the device further includes:
  • the determining module is configured to: after the user terminal displays the target data list, respond to the user selecting operation of each data object in the target data list, and determine, according to the status flag of the selected data object, the corresponding data object Show if the data has been downloaded;
  • the display module is configured to display, when the data to be displayed corresponding to the data object has been downloaded, the data to be displayed stored in the data element of the data object;
  • the downloading module is configured to download the data to be displayed corresponding to the data object from the server when the data to be displayed corresponding to the data object is not downloaded.
  • the device further includes:
  • the state modification module is configured to: after acquiring the data to be displayed corresponding to the data object from the server, storing the acquired data to be displayed into a data element of the data object, and setting a status flag of the data object Set to downloaded;
  • a data object storage module that stores the data object in a specified object file.
  • the list comparison module acquires the identification information and the summary information in the data object for each data object in the first data list, and detects whether the same identification information and the abstract are present in the second data list.
  • the data synchronization module synchronizes the data objects included in the first data list in the second data list to the first data list according to the comparison result, to obtain a target data list, and The target data list is displayed.
  • 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, the second data list is Adding the data object to the target data list; and adding the data object in the first data list to the target data list when the data object is not included in the second data list, Synchronizing the data objects included in the first data list in the second data list into the first data list.
  • the data synchronization method and device acquires, from a server, a first data list including identification information of a plurality of data to be displayed, and assembles each identification information in the first data list into a data object including a status tag, and Set the status flag in each data object to not downloaded.
  • the first data list is compared with a second data list in the user terminal, the second data list includes a data object to which the corresponding data to be displayed has been downloaded, and the status of the data object is marked as downloaded.
  • the data objects included in the first data list in the second data list are synchronized into the second data list to form a target data list, and the target data list is displayed.
  • the user terminal can directly determine whether the corresponding data to be displayed has been downloaded according to the status flag, without having to traverse the local directory folder, improve the response speed and accuracy, and improve the user experience.
  • 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 terminal 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 schematic flowchart of a data synchronization apparatus according to an embodiment of the present invention.
  • Icons 100-user terminal; 110-data synchronization device; 111-list acquisition module; 112-data processing module; 113-list comparison module; 114-data synchronization module; 115-judging module; 116-display module; Module; 118-state modification module; 119-data object storage module; 120-memory; 130-processor; 140-communication unit; 150-display unit; 200-server; 300-network; 400-application.
  • FIG. 1 is a schematic diagram of interaction between a user terminal 100 and a server 200 according to an embodiment of the present invention.
  • the user terminal 100 can communicate with the server 200 through the network 300 to implement data interaction.
  • the network 300 can be a wired network or a wireless network.
  • the server 200 is provided with an application (Application, APP) 400 that can be downloaded and installed by the user terminal 100, and the user can obtain the service provided by the server 200 through the application 400.
  • the APP may be an APP with an image collection function such as a live APP, a camera APP, a photo app, or the like, or may be an APP that needs to display a collection of information.
  • the information set refers to a set of information of a plurality of categories.
  • the user terminal 100 may be a personal computer (PC), a smart phone, a tablet, a wearable mobile device, or the like.
  • the server 200 is installed in the user terminal 100.
  • the provided app may be a terminal device based on an Android system.
  • FIG. 2 is a schematic block diagram of a user terminal 100 according to an embodiment of the present invention.
  • the user terminal 100 includes a data synchronization device 110, a memory 120, a processor 130, a communication unit 140, and a display unit 150.
  • the components of the memory 120, the processor 130, the communication unit 140, and the display unit 150 are electrically connected directly or indirectly to each other to implement data interaction.
  • the components can be electrically connected to one another via one or more communication buses or signal lines.
  • the data synchronization device 110 includes at least one software function module that can be firmwareized in an operating system (OS) of the user terminal 100 in the form of software or firmware.
  • OS operating system
  • the data synchronization device 110 may be a subroutine of the APP, or may be a program independent of the APP.
  • the memory 120 can be, but not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), and a Programmable Read-Only Memory (PROM). Erasable Programmable Read-Only Memory (EPROM), Electric Erasable Programmable Read-Only Memory (EEPROM), and the like.
  • RAM Random Access Memory
  • ROM Read Only Memory
  • PROM Programmable Read-Only Memory
  • EPROM Erasable Programmable Read-Only Memory
  • EEPROM Electric Erasable Programmable Read-Only Memory
  • the processor 130 can be an integrated circuit chip with signal processing capabilities.
  • the above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; or may be a digital signal processor (DSP), an application specific integrated circuit (ASIC) ), Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA Field Programmable Gate Array
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the communication unit 140 is configured to establish a communication connection between the user terminal 100 and the server 200 through the network 300.
  • the display unit 150 is configured to establish an interaction interface between the user terminal 100 and the user, or to display information to be displayed.
  • FIG. 3 it is a schematic flowchart of a data synchronization method according to an embodiment of the present invention.
  • the data synchronization method is applied to the user terminal 100 shown in FIG. 2.
  • the specific process and steps shown in Figure 2 will be detailed below. set forth.
  • Step S101 Acquire a first data list from the server 200, where the first data list includes identifier 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.
  • the server 200 corresponding to the live broadcast APP usually provides a plurality of sticker data for the user to select.
  • the user interface of the live broadcast APP displays an identifier (eg, a thumbnail, a name) of the plurality of sticker data.
  • the user terminal 100 detects whether the sticker data corresponding to the identifier has been downloaded, and if downloaded, directly retrieves from the local without having to request the sticker data from the server 200.
  • some existing methods are to detect whether there is a file name corresponding to the detected sticker data by scanning the file name in the local directory folder, and if so, determining that the detected sticker data has been Downloaded, otherwise it has not been downloaded.
  • the data synchronization method provided in this embodiment may be executed when the APP is started, or may be executed periodically during the running of the APP, which is not limited in this embodiment.
  • the user terminal 100 sends a network 300 request (eg, an HTTP request) to the server 200, and the server 200 requests feedback to the user terminal 100 for the first data list for the network 300.
  • the first data list includes identification information of a plurality of to-be-displayed data, where the identification information may include identity information and summary information of data to be displayed.
  • the identity information may be an ID number
  • the digest information may be digest information obtained by calculating the to-be-displayed data by a Message Digest Algorithm (MD5, MD5).
  • MD5 Message Digest Algorithm
  • Step S102 Create a data object including a data element and a status tag for each identification information in the first data list, store the identification information in the data element, and set the status flag to not download.
  • 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 undownloaded state.
  • a data object is created for the identification information
  • the data object includes a data element and a status tag
  • the data element and the status tag are attributes of the data object.
  • the identification information is stored in the data element of the data object created for the identification information, and the status flag attribute of each established data object is set to not downloaded.
  • Setting the status tag attribute to not download means that the value of the status tag attribute is set to indicate a value or a string that has not been downloaded. For example, 0, 1, available, etc. may be used to indicate that the download is not performed, and may be determined according to actual needs.
  • a sticker object PasterItem is created for each identification information in the first data list, wherein the pasterResource is a sticker element for storing the sticker data information returned by the server 200, that is, for storing the identification information or Data to be displayed.
  • the type includes a type_stop, a type_setting, and a type_item, respectively corresponding to a stop button, a setting button, and a sticker element button on an application interface of the APP.
  • the stop button is used to control the stop of downloading
  • the setting button is used to set the sticker
  • the sticker element is used to represent the corresponding sticker data, which is usually displayed as a thumbnail or name corresponding to the sticker data.
  • the values of other attributes may be null.
  • the status indicates a status flag of the current sticker.
  • the status may include the following options: STATUS_FINISH, STATUS_AVAILABLE, STATUS_RETRY, STATUS_DWONLOADING, etc., wherein STATUS_FINISH indicates that the download has been made, STATUS_AVAILABLE indicates that the download is not available (downloadable), and STATUS_RETRY indicates that Retry, STATUS_DWONLOADING indicates that the download is in progress.
  • the obtained first data list is actually a list including a plurality of data objects, and the corresponding data to be displayed is not stored in each data object in the first data list, and the status tag 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 been downloaded corresponding data to be displayed, and the downloaded to-be-displayed data is stored in the In the data element of a data object, the status of the data object is marked as downloaded.
  • the second data list is a list of data objects that have been downloaded before to be displayed. That is, the second data list includes a plurality of data objects, wherein the plurality of data objects store corresponding data to be displayed, and the status tag attributes of the plurality of data objects are all downloaded.
  • the second data list includes a plurality of sticker objects, and the sticker elements of each sticker object store corresponding sticker data, and the status of each sticker object is marked as downloaded, wherein the state Marked as downloaded, the value corresponding to the status tag attribute is used to represent the downloaded value or string.
  • step S103 can be implemented by the following steps:
  • the identification information of the data to be displayed may include identity information and summary information of the data to be displayed.
  • the second data list can be obtained by:
  • Each data object adds a tag corresponding to the second data list, for example, labeled localPasterItem.
  • the second data list can be obtained by calling the getPasterList() instruction of localPasterItem.
  • each data object in the first data list may be marked as remoutPasterItem, and then The first data list can be obtained by calling the getPasterList() instruction of remoutPasterItem.
  • the for loop method may be used to traverse the first data list, take a data object in each loop body, and call the getid() instruction and the getMd5() instruction of the data object to obtain the identity information of the data object and The summary information is compared with the identity information and the summary information of each data object in the second data list to detect whether the data object having the same identity information and the summary information exists in the second data list.
  • the manner of obtaining the identity information and the digest information of each data object in the second list is similar to the manner of obtaining the identity information and the digest information of each data object in the first data list.
  • Step S104 Synchronize the data objects included in the first data list in the second data list to the first data list according to the comparison result, obtain a target data list, and display the target data list. .
  • the step S104 may have multiple implementation manners, for example, by implementing the following manners:
  • the data object included in the first data list in the second data list may be directly synchronized into the first 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 overwritten with the data object X in the second data list.
  • the finally obtained first data list is essentially equivalent to the target data list, and thus the processed first data list is the target data list.
  • displaying the target data list means that the target data list is sent to an application interface of the APP for display.
  • the method may further include step S105, step S106, and step S107.
  • Step S105 in response to the user selecting operation of each data object in the target data list, 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, then Go to step S106; if no, go to step S107.
  • Step S106 displaying the data to be displayed stored in the data element of the data object.
  • Step S107 downloading data to be displayed corresponding to the data object from the server 200.
  • the user when the user performs the selection operation, the user can immediately and accurately know whether the selected data object is downloaded, and then perform corresponding operations, thereby improving the user experience.
  • the method may further include the following steps:
  • the acquired data to be displayed is stored in a data element of the data object, and the status flag of the data object is set to be downloaded; the data object is Stored in the specified target file.
  • the step of storing the data object in the specified object file can be implemented as follows:
  • the shared parameter acquisition instruction getsharedPreferences() is an integrated instruction in the SharedPreferences utility class.
  • an embodiment of the present invention further provides a data synchronization apparatus 110, which is applied to the user terminal 100 shown in FIG.
  • the device includes a list acquisition module 111, a data processing module 112, a list comparison module 113, and a data synchronization module 114.
  • the list obtaining module 111 is configured to obtain a first data list from the server 200, where the first data list includes identifier information of a plurality of data to be displayed.
  • the description about the list obtaining module 111 can be specifically referred to the detailed description of step S101 shown in FIG. 3, that is, the step S101 can be performed by the list obtaining module 111.
  • the data processing module 112 is configured to: in the first data list, establish a data object including a data element and a status tag for each identification information, and store the identification information into the data element, and mark the status Set to not downloaded.
  • the description of the data processing module 112 may be specifically referred to the detailed description of step S102 shown in FIG. 3, that is, the step S102 may be performed by the data processing module 112.
  • the list comparison 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 that has been downloaded corresponding to the data to be displayed, and the downloaded data is to be displayed. Display data is stored in the data element of the data object whose status is marked as downloaded.
  • the description about the list comparison module 113 can be specifically referred to the detailed description of the step S102 shown in FIG. 3, that is, the step S102 can be performed by the list comparison module 113.
  • 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:
  • the data synchronization module 114 is configured to synchronize, according to the comparison result, the data objects included in the first data list in the second data list into the first data list, to obtain a target data list, and The target data list is displayed.
  • the description of the data synchronization module 114 may be specifically referred to the detailed description of step S104 shown in FIG. 3, that is, the step S104 may be performed by the data synchronization module 114.
  • the data synchronization module 114 synchronizes the data objects included in the first data list in the second data list to the first data list to obtain a target data list.
  • Ways can include:
  • the device may further include a determining module 115, a display module 116, and a downloading module 117.
  • the determining module 115 is configured to: after the user terminal 100 displays the target data list, respond to a user selecting a data object in the target data list, and determine the status according to the status flag of the selected data object. Whether the data to be displayed corresponding to the data object has been downloaded.
  • the description about the determining module 115 may refer to the detailed description of step S105 shown in FIG. 3 . That is, the step S105 can be performed by the determination module 115.
  • the display module 116 is configured to display the data to be displayed stored in the data element of the data object when the data to be displayed corresponding to the data object has been downloaded.
  • step S106 can be performed by the display module 116.
  • the downloading module 117 is configured to download 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.
  • the description about the download module 117 can be specifically referred to the detailed description of step S107 shown in FIG. 3. That is, the step S107 can be performed by the download module 117.
  • the device may further include a state modification module 118 and a data object storage module 119.
  • the state modification module 118 is configured to store 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 200, and set the status flag of the data object. It has been downloaded.
  • the description of the state modification module 118 can be specifically referred to the description of the relevant steps in the above content.
  • the data object storage module 119 is configured to store the data object in a specified target file.
  • the description of the data object storage module 119 can be specifically referred to the detailed description of the relevant steps in the above content.
  • the data synchronization method and apparatus acquires, from the server 200, a first data list including identification information of a plurality of data to be displayed, and assembles each identification information in the first data list into a status including Marked data objects and set the status flags in each data object to 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 to which the corresponding data to be displayed has been downloaded, and the status of the data object is marked as downloaded.
  • the data objects included in the first data list in the second data list are synchronized into the second data list to form a target data list, and the target data list is displayed.
  • the user terminal 100 can directly determine whether the corresponding data to be displayed has been downloaded according to the status flag, without having to traverse the local directory folder, thereby improving the response speed and accuracy. Improved user experience.
  • the data synchronization method and device acquires, from a server, a first data list including identification information of a plurality of data to be displayed, and assembles each identification information in the first data list into a data object including a status tag, and Set the status flag in each data object to not downloaded.
  • the first data list is compared with a second data list in the user terminal, the second data list includes a data object to which the corresponding data to be displayed has been downloaded, and the status of the data object is marked as downloaded.
  • the data objects included in the first data list in the second data list are synchronized into the second data list to form a target data list, and the target data list is displayed.
  • the user terminal can directly determine whether the corresponding data to be displayed has been downloaded according to the status flag, without having to traverse the local directory folder, improve the response speed and accuracy, and improve the user experience.

Landscapes

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

Abstract

Provided in the invention are a data synchronizing method and a device which are applied to a user terminal communicated with a server. The method comprises: obtaining a first data list from the server; comparing the first data list with a second data list in the user terminal; according to a comparison result, data objects that are included in the first data list in the second data list are synchronized into the first data list to obtain a target data list, and showing the target data list. Accordingly, the user terminal can rapidly and accurately determine whether the data to be displayed is downloaded or not, then, the showing speed of the data to be displayed is increased, and user experience is improved.

Description

数据同步方法及装置Data synchronization method and device
相关申请的交叉引用Cross-reference to related applications
本申请要求于2017年09月06日提交中国专利局的申请号为201710796549.X、名称为“数据同步方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims the priority of the Chinese Patent Application No. JP-A----------
技术领域Technical field
本发明涉及信息技术领域,具体而言,涉及一种数据同步方法及装置。The present invention relates to the field of information technology, and in particular to a data synchronization method and apparatus.
背景技术Background technique
应用程序中通常有许多需要显示的数据(如,贴纸数据、皮肤数据等),从而需要根据用户的操作向服务器请求相应的待显示数据并进行展示。但某些待显示数据可能已经被下载过,此时,可以直接从本地获取该待显示数据进行展示。There are usually a lot of data (such as sticker data, skin data, etc.) that need to be displayed in the application, so that the corresponding data to be displayed needs to be requested from the server according to the user's operation and displayed. However, some of the data to be displayed may have been downloaded. In this case, the data to be displayed may be directly obtained from the local display.
目前,判断待显示数据是否被下载过的通常做法是,通过遍历本地的待显示数据目录文件夹中的文件名来实现的。采用这种做法,若本地存储有重名的待显示数据文件,则无法做出正确的判断,并且,遍历过程耗时较长,会极大地降低程序的运行速度,从而降低用户体验。Currently, the usual way to determine whether the data to be displayed has been downloaded is by traversing the file name in the local data directory folder to be displayed. In this way, if the data file to be displayed with the duplicate name is stored locally, the correct judgment cannot be made, and the traversal process takes a long time, which greatly reduces the running speed of the program, thereby reducing the user experience.
发明内容Summary of the invention
有鉴于此,本发明的目的之一在于提供一种数据同步方法及装置,以改善上述问题。In view of the above, it is an object of the present invention to provide a data synchronization method and apparatus to improve the above problems.
为了解决上述至少一个问题,本发明实施例提供一种数据同步方法,应用于与服务器通信的用户终端,所述方法包括:In order to solve at least one of the above problems, an embodiment of the present invention provides a data synchronization method, which is applied to a user terminal that communicates with a server, and the method includes:
从所述服务器获取第一数据列表,所述第一数据列表包括多个待显示数据的标识信息;Acquiring, by the server, a first data list, where the first data list includes identifier information of multiple to-be-displayed data;
在所述第一数据列表中为每个标识信息建立包括数据元素及状态标记的数据对象,将该标识信息存储至所述数据元素中,将所述状态标记设置为未下载;Generating, in the first data list, a data object including a data element and a status tag for each identification information, storing the identification information in the data element, and setting the status flag to not downloaded;
将所述第一数据列表与所述用户终端中的第二数据列表进行对比,所述第二数据 列表包括已下载相应待显示数据的数据对象,下载的待显示数据存储在该数据对象的数据元素中,该数据对象的状态标记为已下载;Comparing the first data list with a second data list in the user terminal, the second data The list includes data objects for which the corresponding data to be displayed has been downloaded, and the downloaded data to be displayed is stored in the data element of the data object, and the status of the data object is marked as downloaded;
根据对比结果,将所述第二数据列表中所述第一数据列表包括的数据对象同步至所述第一数据列表中,得到一目标数据列表,并对所述目标数据列表进行展示。According to the comparison result, the data objects included in the first data list in the second data list are synchronized into the first data list to obtain a target data list, and the target data list is displayed.
进一步的,在所述用户终端展示所述目标数据列表的步骤之后,所述方法还包括:Further, after the step of displaying the target data list by the user terminal, the method further includes:
响应用户对所述目标数据列表中各数据对象的选取操作,根据被选取的数据对象的状态标记判断该数据对象对应的待显示数据是否已被下载;Responding to the user selecting operation of each data object in the target data list, determining, according to the status flag of the selected data object, whether the data to be displayed corresponding to the data object has been downloaded;
若已被下载,则对该数据对象的数据元素中存储的待显示数据进行展示;If it has been downloaded, the data to be displayed stored in the data element of the data object is displayed;
若未被下载,则从所述服务器下载该数据对象对应的待显示数据。If not downloaded, the data to be displayed corresponding to the data object is downloaded from the server.
进一步的,其特征在于,在从所述服务器获取该数据对象对应的待显示数据的步骤之后,所述方法还包括:Further, after the step of acquiring the data to be displayed corresponding to the data object from the server, the method further includes:
将获取到的待显示数据存储至该数据对象的数据元素中,将该数据对象的状态标记设置为已下载;The obtained data to be displayed is stored in a data element of the data object, and the status flag of the data object is set to be downloaded;
将该数据对象存储至指定的目标文件中。Store the data object in the specified target file.
进一步的,其特征在于,所述待显示数据的标识信息包括所述待显示数据的身份信息及摘要信息;将所述第一数据列表与所述用户终端中的第二数据列表进行对比的步骤,包括:Further, the identification information of the data to be displayed includes identity information and summary information of the data to be displayed; and the step of comparing the first data list with the second data list in the user terminal ,include:
针对所述第一数据列表中的每个数据对象,获取该数据对象中的身份信息及摘要信息,检测所述第二数据列表中是否存在具有相同身份信息及摘要信息的数据对象。And obtaining, for each data object in the first data list, identity information and summary information in the data object, and detecting whether a data object having the same identity information and summary information exists in the second data list.
进一步的,其特征在于,将所述第二数据列表中所述第一数据列表包括的数据对象同步至所述第一数据列表中,得到一目标数据列表的步骤,包括:Further, the step of synchronizing the data objects included in the first data list in the second data list to the first data list to obtain a target data list includes:
建立目标数据列表;Establish a target data list;
针对所述第一数据列表中的每一数据对象,若所述第二数据列表中包括该数据对象,则将所述第二数据列表中的该数据对象添加至所述目标数据列表中;And 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;
若所述第二数据列表中不包括该数据对象,则将所述第一数据列表中的该数据对象添加至所述目标数据列表中。If the data object is not included in the second data list, the data object in the first data list is added to the target data list.
进一步的,所述用户终端通过网络与所述服务器通信,以实现数据交互。Further, the user terminal communicates with the server through a network to implement data interaction.
进一步的,所述服务器提供供所述用户终端下载并安装的应用程序,用户通过所述应用程序获取所述服务器提供的服务。Further, the server provides an application that is downloaded and installed by the user terminal, and the user obtains the service provided by the server through the application.
进一步的,所述用户终端是个人电脑、智能手机、平板电脑和/或穿戴式移动设备。Further, the user terminal is a personal computer, a smart phone, a tablet, and/or a wearable mobile device.
进一步的,所述用户终端包括数据同步装置、存储器、处理器、通信单元以及显 示单元;所述存储器、处理器、通信单元以及显示单元各元件相互之间直接或间接地电性连接,以实现数据的交互。Further, the user terminal includes a data synchronization device, a memory, a processor, a communication unit, and a display The memory, the processor, the communication unit, and the components of the display unit are electrically connected directly or indirectly to each other to implement data interaction.
进一步的,所述存储器是随机存取存储器、只读存储器、可编程只读存储器、可擦除只读存储器和/或电可擦除只读存储器。Further, the memory is a random access memory, a read only memory, a programmable read only memory, an erasable read only memory, and/or an electrically erasable read only memory.
进一步的,所述处理器是集成电路芯片,具有信号的处理能力。Further, the processor is an integrated circuit chip and has signal processing capability.
本发明实施例还提供一种数据同步装置,应配制成与服务器通信的用户终端,所述装置包括:The embodiment of the present invention further provides a data synchronization device, which should be configured as a user terminal that communicates with a server, and the device includes:
列表获取模块,配制成从所述服务器获取第一数据列表,所述第一数据列表包括多个待显示数据的标识信息;a list obtaining module, configured to acquire a first data list from the server, where the first data list includes identifier information of a plurality of data to be displayed;
数据处理模块,配制成在所述第一数据列表中,为每个标识信息建立包括数据元素及状态标记的数据对象,将该标识信息存储至所述数据元素中,将所述状态标记设置为未下载;a data processing module configured to: in the first data list, create a data object including a data element and a status tag for each identification information, store the identification information in the data element, and set the status flag to Not downloaded
列表对比模块,配制成将所述第一数据列表与所述用户终端中的第二数据列表进行对比,所述第二数据列表包括已下载相应待显示数据的数据对象,下载的待显示数据存储在该数据对象的数据元素中,该数据对象的状态标记为已下载;a list comparison module configured to compare the first data list with a second data list in the user terminal, where the second data list includes a data object that has been downloaded corresponding to the data to be displayed, and the downloaded data storage to be displayed In the data element of the data object, the status of the data object is marked as downloaded;
数据同步模块,配制成根据对比结果,将所述第二数据列表中所述第一数据列表包括的数据对象同步至所述第一数据列表中,得到一目标数据列表,并对所述目标数据列表进行展示。a data synchronization module, configured to synchronize data objects included in the first data list in the second data list to the first data list according to a comparison result, to obtain a target data list, and to the target data The list is displayed.
进一步的,所述装置还包括:Further, the device further includes:
判断模块,配制成在所述用户终端展示所述目标数据列表之后,响应用户对所述目标数据列表中各数据对象的选取操作,根据被选取的数据对象的状态标记判断该数据对象对应的待显示数据是否已被下载;The determining module is configured to: after the user terminal displays the target data list, respond to the user selecting operation of each data object in the target data list, and determine, according to the status flag of the selected data object, the corresponding data object Show if the data has been downloaded;
展示模块,配制成当该数据对象对应的待显示数据是否已被下载时,对该数据对象的数据元素中存储的待显示数据进行展示;The display module is configured to display, when the data to be displayed corresponding to the data object has been downloaded, the data to be displayed stored in the data element of the data object;
下载模块,配制成当该数据对象对应的待显示数据未被下载时,从所述服务器下载该数据对象对应的待显示数据。The downloading module is configured to download the data to be displayed corresponding to the data object from the server when the data to be displayed corresponding to the data object is not downloaded.
进一步的,所述装置还包括:Further, the device further includes:
状态修改模块,配制成在从所述服务器获取该数据对象对应的待显示数据之后,将获取到的待显示数据存储至该数据对象的数据元素中,将该数据对象的状态标记设 置为已下载;The state modification module is configured to: after acquiring the data to be displayed corresponding to the data object from the server, storing the acquired data to be displayed into a data element of the data object, and setting a status flag of the data object Set to downloaded;
数据对象存储模块,将该数据对象存储至指定的目标文件中。A data object storage module that stores the data object in a specified object file.
进一步的,所述列表对比模块针对所述第一数据列表中的每个数据对象,获取该数据对象中的标识信息及摘要信息,检测所述第二数据列表中是否存在具有相同标识信息及摘要信息的数据对象,以实现将所述第一数据列表与所述用户终端中的第二数据列表进行对比。Further, the list comparison module acquires the identification information and the summary information in the data object for each data object in the first data list, and detects whether the same identification information and the abstract are present in the second data list. A data object of information to enable comparison of the first data list with a second data list in the user terminal.
进一步的,所述数据同步模块根据对比结果,将所述第二数据列表中所述第一数据列表包括的数据对象同步至所述第一数据列表中,得到一目标数据列表,并对所述目标数据列表进行展示。Further, the data synchronization module synchronizes the data objects included in the first data list in the second data list to the first data list according to the comparison result, to obtain a target data list, and The target data list is displayed.
进一步的,所述数据同步模块建立目标数据列表,并针对所述第一数据列表中的每一数据对象,在所述第二数据列表中包括该数据对象时,将所述第二数据列表中的该数据对象添加至所述目标数据列表中;以及在所述第二数据列表中不包括该数据对象时,将所述第一数据列表中的该数据对象添加至所述目标数据列表中,以实现将所述第二数据列表中所述第一数据列表包括的数据对象同步至所述第一数据列表中。Further, 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, the second data list is Adding the data object to the target data list; and adding the data object in the first data list to the target data list when the data object is not included in the second data list, Synchronizing the data objects included in the first data list in the second data list into the first data list.
本发明实施例提供的数据同步方法及装置,从服务器获取包括多个待显示数据的标识信息的第一数据列表,将第一数据列表中的各标识信息组装成包括状态标记的数据对象,并将每个数据对象中的状态标记设置为未下载。将第一数据列表与用户终端中的第二数据列表对比,第二数据列表包括已下载相应待显示数据的数据对象,且该数据对象的状态标记为已下载。根据对比结果,将第二数据列表中第一数据列表包括的数据对象同步至第二数据列表中,形成一目标数据列表,并对该目标数据列表进行展示。如此,用户终端可以直接根据状态标记确定对应的待显示数据是否已经被下载,而不必遍历本地的目录文件夹,提高了响应速度和准确性,改善了用户体验。The data synchronization method and device provided by the embodiment of the present invention acquires, from a server, a first data list including identification information of a plurality of data to be displayed, and assembles each identification information in the first data list into a data object including a status tag, and Set the status flag in each data object to not downloaded. The first data list is compared with a second data list in the user terminal, the second data list includes a data object to which the corresponding data to be displayed has been downloaded, and the status of the data object is marked as downloaded. According to the comparison result, the data objects included in the first data list in the second data list are synchronized into the second data list to form a target data list, and the target data list is displayed. In this way, the user terminal can directly determine whether the corresponding data to be displayed has been downloaded according to the status flag, without having to traverse the local directory folder, improve the response speed and accuracy, and improve the user experience.
附图说明DRAWINGS
为了更清楚地说明本发明实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本发明的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly described below. It should be understood that the following drawings show only certain embodiments of the present invention, and therefore It should be seen as a limitation on the scope, and those skilled in the art can obtain other related drawings according to these drawings without any creative work.
图1为本发明实施例提供的一种用户终端与服务器的交互示意图;FIG. 1 is a schematic diagram of interaction between a user terminal and a server according to an embodiment of the present invention;
图2为本发明实施例提供的一种用户终端的方框示意图; 2 is a schematic block diagram of a user terminal according to an embodiment of the present invention;
图3为本发明实施例提供的一种数据同步方法的流程示意图;3 is a schematic flowchart of a data synchronization method according to an embodiment of the present invention;
图4为本发明实施例提供的一种数据同步装置的流程示意图。FIG. 4 is a schematic flowchart of a data synchronization apparatus according to an embodiment of the present invention.
图标:100-用户终端;110-数据同步装置;111-列表获取模块;112-数据处理模块;113-列表对比模块;114-数据同步模块;115-判断模块;116-展示模块;117-下载模块;118-状态修改模块;119-数据对象存储模块;120-存储器;130-处理器;140-通信单元;150-显示单元;200-服务器;300-网络;400-应用程序。Icons: 100-user terminal; 110-data synchronization device; 111-list acquisition module; 112-data processing module; 113-list comparison module; 114-data synchronization module; 115-judging module; 116-display module; Module; 118-state modification module; 119-data object storage module; 120-memory; 130-processor; 140-communication unit; 150-display unit; 200-server; 300-network; 400-application.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本发明实施例的组件可以以各种不同的配置来布置和设计。The technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. The components of the embodiments of the invention, which are generally described and illustrated in the figures herein, may be arranged and designed in various different configurations.
因此,以下对在附图中提供的本发明的实施例的详细描述并非旨在限制要求保护的本发明的范围,而是仅仅表示本发明的选定实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。Therefore, the following detailed description of the embodiments of the invention in the claims All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。It should be noted that similar reference numerals and letters indicate similar items in the following figures. Therefore, once an item is defined in one figure, it is not necessary to further define and explain it in the subsequent figures.
如图1所示,是本发明实施例提供的一种用户终端100与服务器200的交互示意图。所述用户终端100可通过网络300与所述服务器200通信,以实现数据交互。所述网络300可以是,有线网络或无线网络。FIG. 1 is a schematic diagram of interaction between a user terminal 100 and a server 200 according to an embodiment of the present invention. The user terminal 100 can communicate with the server 200 through the network 300 to implement data interaction. The network 300 can be a wired network or a wireless network.
所述服务器200提供有可供所述用户终端100下载并安装的应用程序(Application,APP)400,用户可通过所述应用程序400获取所述服务器200提供的服务。在本实施例中,所述APP可以是直播APP、摄像APP、拍照APP等具有图像采集功能的APP,也可以是其他需要显示信息集合的APP。其中,所述信息集合是指多个类别的信息构成的集合。The server 200 is provided with an application (Application, APP) 400 that can be downloaded and installed by the user terminal 100, and the user can obtain the service provided by the server 200 through the application 400. In this embodiment, the APP may be an APP with an image collection function such as a live APP, a camera APP, a photo app, or the like, or may be an APP that needs to display a collection of information. The information set refers to a set of information of a plurality of categories.
在本实施例中,所述用户终端100可以是个人电脑(Personal Computer,PC)、智能手机、平板电脑、穿戴式移动设备等。所述用户终端100中安装有所述服务器200 提供的APP。可选地,所述用户终端100可以是基于Android系统的终端设备。In this embodiment, the user terminal 100 may be a personal computer (PC), a smart phone, a tablet, a wearable mobile device, or the like. The server 200 is installed in the user terminal 100. The provided app. Optionally, the user terminal 100 may be a terminal device based on an Android system.
如图2所示,是本发明实施例提供的一种用户终端100的方框示意图。所述用户终端100包括数据同步装置110、存储器120、处理器130、通信单元140以及显示单元150。FIG. 2 is a schematic block diagram of a user terminal 100 according to an embodiment of the present invention. The user terminal 100 includes a data synchronization device 110, a memory 120, a processor 130, a communication unit 140, and a display unit 150.
所述存储器120、处理器130、通信单元140以及显示单元150各元件相互之间直接或间接地电性连接,以实现数据的交互。例如,这些元件相互之间可通过一条或多条通讯总线或信号线实现电性连接。所述数据同步装置110包括至少一个可以软件或固件(firmware)的形式固化在所述用户终端100的操作系统(Operating System,OS)中的软件功能模块。The components of the memory 120, the processor 130, the communication unit 140, and the display unit 150 are electrically connected directly or indirectly to each other to implement data interaction. For example, the components can be electrically connected to one another via one or more communication buses or signal lines. The data synchronization device 110 includes at least one software function module that can be firmwareized in an operating system (OS) of the user terminal 100 in the form of software or firmware.
在本实施例中,所述数据同步装置110可以是所述APP的子程序,也可以是独立于所述APP的程序。In this embodiment, the data synchronization device 110 may be a subroutine of the APP, or may be a program independent of the APP.
所述存储器120可以是,但不限于,随机存取存储器(Random Access Memory,RAM),只读存储器(Read Only Memory,ROM),可编程只读存储器(Programmable Read-Only Memory,PROM),可擦除只读存储器(Erasable Programmable Read-Only Memory,EPROM),电可擦除只读存储器(Electric Erasable Programmable Read-Only Memory,EEPROM)等。The memory 120 can be, but not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), and a Programmable Read-Only Memory (PROM). Erasable Programmable Read-Only Memory (EPROM), Electric Erasable Programmable Read-Only Memory (EEPROM), and the like.
所述处理器130可以是一种集成电路芯片,具有信号的处理能力。上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(DSP))、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 130 can be an integrated circuit chip with signal processing capabilities. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; or may be a digital signal processor (DSP), an application specific integrated circuit (ASIC) ), Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The methods, steps, and logical block diagrams disclosed in the embodiments of the present invention may be implemented or carried out. The general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
所述通信单元140用于通过网络300建立用户终端100与服务器200之间的通信连接。The communication unit 140 is configured to establish a communication connection between the user terminal 100 and the server 200 through the network 300.
所述显示单元150用于建立用户终端100与用户之间的交互界面,或用于显示待显示信息。The display unit 150 is configured to establish an interaction interface between the user terminal 100 and the user, or to display information to be displayed.
如图3所示,是本发明实施例提供的一种数据同步方法的流程示意图,所述数据同步方法应用于图2所示的用户终端100。下面将对图2所示的具体流程及步骤做详细 阐述。As shown in FIG. 3, it is a schematic flowchart of a data synchronization method according to an embodiment of the present invention. The data synchronization method is applied to the user terminal 100 shown in FIG. 2. The specific process and steps shown in Figure 2 will be detailed below. set forth.
步骤S101,从所述服务器200获取第一数据列表,所述第一数据列表包括多个待显示数据的标识信息。Step S101: Acquire a first data list from the server 200, where the first data list includes identifier information of a plurality of data to be displayed.
其中,所述待显示数据是指用户终端100中的APP需要展示的数据,例如,贴纸数据、皮肤数据等。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.
以直播APP为例,与该直播APP对应的服务器200通常会提供多个贴纸数据供用户选用。当用户在用户终端100打开该直播APP时,该直播APP的用户界面上展示有所述多个贴纸数据的标识(如,缩略图、名称)。假设用户选中其中一个标识,用户终端100会检测该标识对应的贴纸数据是否已被下载过,若下载过,则直接从本地取用,而不必向服务器200请求该贴纸数据。Taking the live broadcast APP as an example, the server 200 corresponding to the live broadcast APP usually provides a plurality of sticker data for the user to select. When the user opens the live broadcast application at the user terminal 100, the user interface of the live broadcast APP displays an identifier (eg, a thumbnail, a name) of the plurality of sticker data. 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 downloaded, directly retrieves from the local without having to request the sticker data from the server 200.
经发明人研究发现,现有的一些做法是通过扫描本地目录文件夹中的文件名,判断是否存在与被检测的贴纸数据对应的文件名,若存在,则确定该被检测的贴纸数据已被下载过,否则未被下载过。According to the research by the inventor, some existing methods are to detect whether there is a file name corresponding to the detected sticker data by scanning the file name in the local directory folder, and if so, determining that the detected sticker data has been Downloaded, otherwise it has not been downloaded.
然而,这一做法存在弊端。一方面,若本地存储的已下载的贴纸数据中有重名的贴纸文件,将导致上述检测过程无法实现。另一方面,若同一贴纸文件的内容发生改变,仅通过文件名并无法检测出。此外,已下载的本地文件通常存储在磁盘上,因而,遍历文件名实质上属于IO操作。IO操作是一个非常慢的过程,将会降低所述APP的运行速度,进而影响用户体验。However, this practice has drawbacks. On the one hand, if there is a duplicate sticker file in the downloaded sticker data stored locally, the above 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, so traversing file names is essentially an IO operation. IO operations are a very slow process that will slow down the running of the app and affect the user experience.
本实施例提供的数据同步方法可以在所述APP被开启时执行,也可以在所述APP的运行过程中定期执行,本实施例对此不做限制。The data synchronization method provided in this embodiment may be executed when the APP is started, or may be executed periodically during the running of the APP, which is not limited in this embodiment.
实施时,用户终端100向所述服务器200发送一网络300请求(如,HTTP请求),服务器200针对该网络300请求反馈给所述用户终端100第一数据列表。所述第一数据列表包括多个待显示数据的标识信息,其中,所述标识信息可以包括待显示数据的身份信息及摘要信息。所述身份信息可以是ID号,所述摘要信息可以是通过消息摘要算法第五版(Message Digest Algorithm MD5,MD5)对所述待显示数据进行计算得到的摘要信息。所述标识信息用于唯一地表征待显示数据。In implementation, the user terminal 100 sends a network 300 request (eg, an HTTP request) to the server 200, and the server 200 requests feedback to the user terminal 100 for the first data list for the network 300. The first data list includes identification information of a plurality of to-be-displayed data, where the identification information may include identity information and summary information of data to be displayed. The identity information may be an ID number, and the digest information may be digest information obtained by calculating the to-be-displayed data by a Message Digest Algorithm (MD5, MD5). The identification information is used to uniquely characterize data to be displayed.
步骤S102,在所述第一数据列表中为每个标识信息建立包括数据元素及状态标记的数据对象,将该标识信息存储至所述数据元素中,将所述状态标记设置为未下载。 Step S102: Create a data object including a data element and a status tag for each identification information in the first data list, store the identification information in the data element, and set the status flag to not download.
在本实施例中,服务器200返回的第一数据列表中并不包括待显示数据,而是包括待显示数据的标识信息。也即,每个待显示数据都是未下载状态。针对第一数据列表中的每个标识信息,为该标识信息建立一个数据对象,该数据对象包括数据元素及状态标记,所述数据元素及状态标记是该数据对象的属性。将标识信息存储到为该标识信息建立的数据对象的数据元素中,将建立的各数据对象的状态标记属性设置为未下载。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 undownloaded state. For each identification information in the first data list, a data object is created for the identification information, the data object includes a data element and a status tag, and the data element and the status tag are attributes of the data object. The identification information is stored in the data element of the data object created for the identification information, and the status flag attribute of each established data object is set to not downloaded.
将状态标记属性设置为未下载是指,将状态标记属性的值设置为用于表示未下载的值或字符串,例如,可以用0、1、available等表示未下载,可根据实际需求确定。Setting the status tag attribute to not download means that the value of the status tag attribute is set to indicate a value or a string that has not been downloaded. For example, 0, 1, available, etc. may be used to indicate that the download is not performed, and may be determined according to actual needs.
仍旧以贴纸数据为例,针对每个标识信息,可以建立如下数据结构:Still taking the sticker data as an example, for each identification information, the following data structure can be established:
Public class PatsrItem{Public class PatsrItem{
Private int type;Private int type;
Private int status;Private int status;
Private pasterResource prs;Private pasterResource prs;
}}
也即,对第一数据列表中的每个标识信息的数据结构进行处理。实施时,为第一数据列表中的每个标识信息建立一贴纸对象PasterItem,其中,pasterResource为贴纸元素,用于存储服务器200返回的贴纸数据信息,也即,用于存储所述标识信息或是待显示数据。所述type包括type_stop、type_setting、type_item,分别对应所述APP的应用界面上的stop按钮、setting按钮及贴纸元素按钮。其中,stop按钮用于控制停止下载,setting按钮用于对贴纸进行设置,贴纸元素用于表征对应的贴纸数据,通常显示为对应贴纸数据的缩略图或名称等。That is, the data structure of each identification information in the first data list is processed. In the implementation, a sticker object PasterItem is created for each identification information in the first data list, wherein the pasterResource is a sticker element for storing the sticker data information returned by the server 200, that is, for storing the identification information or Data to be displayed. The type includes a type_stop, a type_setting, and a type_item, respectively corresponding to a stop button, a setting button, and a sticker element button on an application interface of the APP. The stop button is used to control the stop of downloading, the setting button is used to set the sticker, and the sticker element is used to represent the corresponding sticker data, which is usually displayed as a thumbnail or name corresponding to the sticker data.
在本实施例中,当type属性的值为type_stop或type_setting时,其他属性的值可以为空。In this embodiment, when the value of the type attribute is type_stop or type_setting, the values of other attributes may be null.
所述status表示当前贴纸的状态标记,在本实施例中,status可包括如下选择:STATUS_FINISH、STATUS_AVAILABLE、STATUS_RETRY、STATUS_DWONLOADING等,其中,STATUS_FINISH表示已下载,STATUS_AVAILABLE表示未下载(可下载),STATUS_RETRY表示可以重试, STATUS_DWONLOADING表示正在下载。The status indicates a status flag of the current sticker. In this embodiment, the status may include the following options: STATUS_FINISH, STATUS_AVAILABLE, STATUS_RETRY, STATUS_DWONLOADING, etc., wherein STATUS_FINISH indicates that the download has been made, STATUS_AVAILABLE indicates that the download is not available (downloadable), and STATUS_RETRY indicates that Retry, STATUS_DWONLOADING indicates that the download is in progress.
通过上述处理,得到的第一数据列表实际是包括多个数据对象的列表,且该第一数据列表中的各数据对象中并未存储有相应的待显示数据,且各数据对象的状态标记属性为未下载。Through the above processing, the obtained first data list is actually a list including a plurality of data objects, and the corresponding data to be displayed is not stored in each data object in the first data list, and the status tag attribute of each data object is Not downloaded.
步骤S103,将所述第一数据列表与所述用户终端100中的第二数据列表进行对比,所述第二数据列表包括已下载相应待显示数据的数据对象,下载的待显示数据存储在该数据对象的数据元素中,该数据对象的状态标记为已下载。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 been downloaded corresponding data to be displayed, and the downloaded to-be-displayed data is stored in the In the data element of a data object, the status of the data object is marked as downloaded.
其中,所述第二数据列表是之前已下载的待显示数据的数据对象组成的列表。也即,所述第二数据列表中包括多个数据对象,该多个数据对象中均存储有相应的待显示数据,并且该多个数据对象的状态标记属性均为已下载。The second data list is a list of data objects that have been downloaded before to be displayed. That is, the second data list includes a plurality of data objects, wherein the plurality of data objects store corresponding data to be displayed, and the status tag attributes of the plurality of data objects are all downloaded.
以上述贴纸数据为例,所述第二数据列表中包括多个贴纸对象,每个贴纸对象的贴纸元素中存储有相应的贴纸数据,且每个贴纸对象的状态标记为已下载,其中,状态标记为已下载,是指状态标记属性对应的值为用于表征已下载的值或字符串。Taking the above sticker data as an example, the second data list includes a plurality of sticker objects, and the sticker elements of each sticker object store corresponding sticker data, and the status of each sticker object is marked as downloaded, wherein the state Marked as downloaded, the value corresponding to the status tag attribute is used to represent the downloaded value or string.
可选地,在本实施例中,所述步骤S103可以通过如下步骤实现:Optionally, in this embodiment, the step S103 can be implemented by the following steps:
针对所述第一数据列表中的每个数据对象,获取该数据对象中的身份信息及摘要信息,检测所述第二数据列表中是否存在具有相同身份信息及摘要信息的数据对象。And obtaining, for each data object in the first data list, identity information and summary information in the data object, and detecting whether a data object having the same identity information and summary information exists in the second data list.
在本实施例中,待显示数据的标识信息可以包括待显示数据的身份信息及摘要信息。在将第一数据列表与第二数据列表进行对比时,实际是将经步骤S102处理得到的第一数据列表与第二数据列表对比。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 the comparison, the first data list and the second data list that are usable need to be obtained. In detail, the second data list can be obtained by:
通过调用共享参数获取指令getSharedPreferences()来获取用户终端100的系统提供的共享参数对象,再通过调用该共享参数对象的信息获取指令getString()来获取用户终端100中存储的数据对象,为获取到的各数据对象添加与所述第二数据列表对应的标记,例如,标记为localPasterItem。再调用localPasterItem的getPasterList()指令即可获取到第二数据列表。Obtaining the shared parameter object provided by the system of the user terminal 100 by calling the shared parameter acquisition instruction getSharedPreferences(), and acquiring the data object stored in the user terminal 100 by calling the information acquisition instruction getString() of the shared parameter object, Each data object adds a tag corresponding to the second data list, for example, labeled localPasterItem. The second data list can be obtained by calling the getPasterList() instruction of localPasterItem.
相应地,可以将所述第一数据列表中的各数据对象均标记为remoutPasterItem,再 调用remoutPasterItem的getPasterList()指令即可获取到第一数据列表。Correspondingly, each data object in the first data list may be marked as remoutPasterItem, and then The first data list can be obtained by calling the getPasterList() instruction of remoutPasterItem.
实施时,可采用for循环的方法遍历第一数据列表,在每一循环体中取出一个数据对象,并调用该数据对象的getid()指令及getMd5()指令分别获取该数据对象的身份信息及摘要信息,将该身份信息及摘要信息与第二数据列表中每一数据对象的身份信息及摘要信息进行对比,以检测所述第二数据列表中是否存在具有相同身份信息及摘要信息的数据对象。In the implementation, the for loop method may be used to traverse the first data list, take a data object in each loop body, and call the getid() instruction and the getMd5() instruction of the data object to obtain the identity information of the data object and The summary information is compared with the identity information and the summary information of each data object in the second data list to detect whether the data object having the same identity information and the summary information exists in the second data list. .
其中,获取第二列表中各数据对象的身份信息及摘要信息的方式与获取第一数据列表中各数据对象的身份信息及摘要信息的方式类似。The manner of obtaining the identity information and the digest information of each data object in the second list is similar to the manner of obtaining the identity information and the digest information of each data object in the first data list.
步骤S104,根据对比结果,将所述第二数据列表中所述第一数据列表包括的数据对象同步至所述第一数据列表中,得到一目标数据列表,并对所述目标数据列表进行展示。Step S104: Synchronize the data objects included in the first data list in the second data list to the first data list according to the comparison result, obtain a target data list, and display the target data list. .
在本实施例中,所述步骤S104可以有多种实现方式,例如,可通过如下方式实现:In this embodiment, the step S104 may have multiple implementation manners, for example, by implementing the following manners:
建立一目标数据列表,针对所述第一数据列表中的每一数据对象,若所述第二数据列表中包括该数据对象,则将所述第二数据列表中的该数据对象添加至所述目标数据列表中;若所述第二数据列表中不包括该数据对象,则将所述第一数据列表中的该数据对象添加至所述目标数据列表中。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 In the target data list; if the data object is not included in the second data list, the data object in the first data list is added to the target data list.
又如,可以直接将第二数据列表中所述第一数据列表包括的数据对象同步至所述第一数据列表中。比如,假设第一数据列表中存在数据对象X,经对比发现第二数据列表中也存在数据对象X,则将第二数据列表中的数据对象X同步到所述第一数据列表中,也即,用第二数据列表中的数据对象X覆盖第一数据列表中的数据对象X。如此,最终得到的第一数据列表本质上与所述目标数据列表等同,因而,经处理得到的第一数据列表即为所述目标数据列表。For another example, the data object included in the first data list in the second data list may be directly synchronized into the first data list. For example, assuming that the data object X exists in the first data list, and the data object X is also found in the second data list by comparison, 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 overwritten with the data object X in the second data list. Thus, the finally obtained first data list is essentially equivalent to the target data list, and thus the processed first data list is the target data list.
在本实施例中,对所述目标数据列表进行展示,是指将所述目标数据列表发送到所述APP的应用界面进行展示。In this embodiment, displaying the target data list means that the target data list is sent to an application interface of the APP for display.
可选地,在所述用户终端100展示所述目标数据列表之后,所述方法还可以包括步骤S105、步骤S106以及步骤S107。Optionally, after the user terminal 100 displays the target data list, the method may further include step S105, step S106, and step S107.
步骤S105,响应用户对所述目标数据列表中各数据对象的选取操作,根据被选取的数据对象的状态标记判断该数据对象对应的待显示数据是否已被下载。若是,则执 行步骤S106;若否,则执行步骤S107。Step S105, in response to the user selecting operation of each data object in the target data list, 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, then Go to step S106; if no, go to step S107.
步骤S106,对该数据对象的数据元素中存储的待显示数据进行展示。Step S106, displaying the data to be displayed stored in the data element of the data object.
步骤S107,从所述服务器200下载该数据对象对应的待显示数据。Step S107, downloading data to be displayed corresponding to the data object from the server 200.
通过上述设计,当用户执行选取操作后,可以立即准确地得知被选取的数据对象是否被下载,进而执行相应的操作,改善了用户体验。Through the above design, when the user performs the selection operation, the user can immediately and accurately know whether the selected data object is downloaded, and then perform corresponding operations, thereby improving the user experience.
可选地,所述方法还可以包括如下步骤:Optionally, the method may further include the following steps:
在从所述服务器200获取该数据对象对应的待显示数据之后,将获取到的待显示数据存储至该数据对象的数据元素中,将该数据对象的状态标记设置为已下载;将该数据对象存储至指定的目标文件中。After the data to be displayed corresponding to the data object is obtained from the server 200, the acquired data to be displayed is stored in a data element of the data object, and the status flag of the data object is set to be downloaded; the data object is Stored in the specified target file.
其中,将该数据对象存储至指定的目标文件中的步骤可通过如下方式实现:The step of storing the data object in the specified object file can be implemented as follows:
调用共享参数获取指令getsharedPreferences(),获取所述目标文件在所述用户终端100中的存储路径,并返回包括该存储路径的共享参数对象;调用所述共享参数对象的编辑指令Edit(),获取用于编辑所述目标文件的编辑对象;调用所述编辑对象的数据写指令putString(),以键值对的形式写该数据对象;调用所述编辑对象的提交指令commit(),将数据写指令putString()所写的内容提交给所述目标文件。Calling the shared parameter acquisition instruction getsharedPreferences(), obtaining 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 obtain An edit object for editing the target file; calling the data write instruction putString() of the edit object to write the data object in the form of a key value pair; calling the commit instruction commit() of the edit object to write the data The content written by the instruction putString() is submitted to the target file.
其中,共享参数获取指令getsharedPreferences()是SharedPreferences工具类中的一种集成指令。Among them, the shared parameter acquisition instruction getsharedPreferences() is an integrated instruction in the SharedPreferences utility class.
如图4所示,本发明实施例还提供一种数据同步装置110,应用于图2所示的用户终端100。所述装置包括列表获取模块111、数据处理模块112、列表对比模块113以及数据同步模块114。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. The device includes a list acquisition module 111, a data processing module 112, a list comparison module 113, and a data synchronization module 114.
其中,所述列表获取模块111用于从所述服务器200获取第一数据列表,所述第一数据列表包括多个待显示数据的标识信息。The list obtaining module 111 is configured to obtain a first data list from the server 200, where the first data list includes identifier information of a plurality of data to be displayed.
在本实施例中,关于所述列表获取模块111的描述具体可参考对图3所示步骤S101的详细描述,也即,所述步骤S101可以由所述列表获取模块111执行。In the present embodiment, the description about the list obtaining module 111 can be specifically referred to the detailed description of step S101 shown in FIG. 3, that is, the step S101 can be performed by the list obtaining module 111.
所述数据处理模块112用于在所述第一数据列表中,为每个标识信息建立包括数据元素及状态标记的数据对象,将该标识信息存储至所述数据元素中,将所述状态标记设置为未下载。 The data processing module 112 is configured to: in the first data list, establish a data object including a data element and a status tag for each identification information, and store the identification information into the data element, and mark the status Set to not downloaded.
在本实施例中,关于所述数据处理模块112的描述具体可参考对图3所示步骤S102的详细描述,也即,所述步骤S102可以由所述数据处理模块112执行。In the present embodiment, the description of the data processing module 112 may be specifically referred to the detailed description of step S102 shown in FIG. 3, that is, the step S102 may be performed by the data processing module 112.
所述列表对比模块113用于将所述第一数据列表与所述用户终端100中的第二数据列表进行对比,所述第二数据列表包括已下载相应待显示数据的数据对象,下载的待显示数据存储在该数据对象的数据元素中,该数据对象的状态标记为已下载。The list comparison 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 that has been downloaded corresponding to the data to be displayed, and the downloaded data is to be displayed. Display data is stored in the data element of the data object whose status is marked as downloaded.
在本实施例中,关于所述列表对比模块113的描述具体可参考对图3所示步骤S102的详细描述,也即,所述步骤S102可以由所述列表对比模块113执行。In the present embodiment, the description about the list comparison module 113 can be specifically referred to the detailed description of the step S102 shown in FIG. 3, that is, the step S102 can be performed by the list comparison module 113.
可选地,在本实施例中,所述列表对比模块113将所述第一数据列表与所述用户终端100中的第二数据列表进行对比的方式,可以包括: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 obtaining, for each data object in the first data list, identifier information and summary information in the data object, and detecting whether a data object having the same identifier information and summary information exists in the second data list.
所述数据同步模块114用于根据对比结果,将所述第二数据列表中所述第一数据列表包括的数据对象同步至所述第一数据列表中,得到一目标数据列表,并对所述目标数据列表进行展示。The data synchronization module 114 is configured to synchronize, according to the comparison result, the data objects included in the first data list in the second data list into the first data list, to obtain a target data list, and The target data list is displayed.
在本实施例中,关于所述数据同步模块114的描述具体可参考对图3所示步骤S104的详细描述,也即,所述步骤S104可由所述数据同步模块114执行。In the present embodiment, the description of the data synchronization module 114 may be specifically referred to the detailed description of step S104 shown in FIG. 3, that is, the step S104 may be performed by the data synchronization module 114.
可选地,在本实施例中,所述数据同步模块114将所述第二数据列表中所述第一数据列表包括的数据对象同步至所述第一数据列表中,得到一目标数据列表的方式,可以包括:Optionally, in this embodiment, the data synchronization module 114 synchronizes the data objects included in the first data list in the second data list to the first data list to obtain a target data list. Ways can 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 In the data list; if the data object is not included in the second data list, the data object in the first data list is added to the target data list.
可选地,所述装置还可以包括判断模块115、展示模块116以及下载模块117。Optionally, the device may further include a determining module 115, a display module 116, and a downloading module 117.
其中,所述判断模块115用于在所述用户终端100展示所述目标数据列表之后,响应用户对所述目标数据列表中各数据对象的选取操作,根据被选取的数据对象的状态标记判断该数据对象对应的待显示数据是否已被下载。 The determining module 115 is configured to: after the user terminal 100 displays the target data list, respond to a user selecting a data object in the target data list, and determine the status according to the status flag of the selected data object. Whether the data to be displayed corresponding to the data object has been downloaded.
在本实施例中,关于所述判断模块115的描述具体可参考对图3所示步骤S105的详细描述。也即,所述步骤S105可以由所述判断模块115执行。In the embodiment, the description about the determining module 115 may refer to the detailed description of step S105 shown in FIG. 3 . That is, the step S105 can be performed by the determination module 115.
所述展示模块116用于当该数据对象对应的待显示数据是否已被下载时,对该数据对象的数据元素中存储的待显示数据进行展示。The display module 116 is configured to display the data to be displayed stored in the data element of the data object when the data to be displayed corresponding to the data object has been downloaded.
在本实施例中,关于所述展示模块116的描述具体可参考对图3所示步骤S106的详细描述。也即,所述步骤S106可以由所述展示模块116执行。In this embodiment, for a description of the display module 116, a detailed description of the step S106 shown in FIG. 3 may be specifically referred to. That is, the step S106 can be performed by the display module 116.
所述下载模块117用于当该数据对象对应的待显示数据未被下载时,从所述服务器200下载该数据对象对应的待显示数据。The downloading module 117 is configured to download 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.
在本实施例中,关于所述下载模块117的描述具体可参考对图3所示步骤S107的详细描述。也即,所述步骤S107可以由所述下载模块117执行。In the present embodiment, the description about the download module 117 can be specifically referred to the detailed description of step S107 shown in FIG. 3. That is, the step S107 can be performed by the download module 117.
可选地,所述装置还可以包括状态修改模块118及数据对象存储模块119。Optionally, the device may further include a state modification module 118 and a data object storage module 119.
所述状态修改模块118用于在从所述服务器200获取该数据对象对应的待显示数据之后,将获取到的待显示数据存储至该数据对象的数据元素中,将该数据对象的状态标记设置为已下载。The state modification module 118 is configured to store 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 200, and set the status flag of the data object. It has been downloaded.
在本实施例中,关于所述状态修改模块118的描述具体可参考上述内容中对相关步骤的描述。In the present embodiment, the description of the state modification module 118 can be specifically referred to the description of the relevant steps in the above content.
所述数据对象存储模块119用于将该数据对象存储至指定的目标文件中。The data object storage module 119 is configured to store the data object in a specified target file.
在本实施例中,关于所述数据对象存储模块119的描述具体可参考上述内容中对相关步骤的详细描述。In the present embodiment, the description of the data object storage module 119 can be specifically referred to the detailed description of the relevant steps in the above content.
综上所述,本发明实施例提供的数据同步方法及装置,从服务器200获取包括多个待显示数据的标识信息的第一数据列表,将第一数据列表中的各标识信息组装成包括状态标记的数据对象,并将每个数据对象中的状态标记设置为未下载。将第一数据列表与用户终端100中的第二数据列表对比,第二数据列表包括已下载相应待显示数据的数据对象,且该数据对象的状态标记为已下载。根据对比结果,将第二数据列表中第一数据列表包括的数据对象同步至第二数据列表中,形成一目标数据列表,并对该目标数据列表进行展示。如此,用户终端100可以直接根据状态标记确定对应的待显示数据是否已经被下载,而不必遍历本地的目录文件夹,提高了响应速度和准确性, 改善了用户体验。In summary, the data synchronization method and apparatus provided by the embodiment of the present invention acquires, from the server 200, a first data list including identification information of a plurality of data to be displayed, and assembles each identification information in the first data list into a status including Marked data objects and set the status flags in each data object to 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 to which the corresponding data to be displayed has been downloaded, and the status of the data object is marked as downloaded. According to the comparison result, the data objects included in the first data list in the second data list are synchronized into the second data list to form a target data list, and the target data list is displayed. 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 having to traverse the local directory folder, thereby improving the response speed and accuracy. Improved user experience.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above description is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.
工业实用性Industrial applicability
本发明实施例提供的数据同步方法及装置,从服务器获取包括多个待显示数据的标识信息的第一数据列表,将第一数据列表中的各标识信息组装成包括状态标记的数据对象,并将每个数据对象中的状态标记设置为未下载。将第一数据列表与用户终端中的第二数据列表对比,第二数据列表包括已下载相应待显示数据的数据对象,且该数据对象的状态标记为已下载。根据对比结果,将第二数据列表中第一数据列表包括的数据对象同步至第二数据列表中,形成一目标数据列表,并对该目标数据列表进行展示。如此,用户终端可以直接根据状态标记确定对应的待显示数据是否已经被下载,而不必遍历本地的目录文件夹,提高了响应速度和准确性,改善了用户体验。 The data synchronization method and device provided by the embodiment of the present invention acquires, from a server, a first data list including identification information of a plurality of data to be displayed, and assembles each identification information in the first data list into a data object including a status tag, and Set the status flag in each data object to not downloaded. The first data list is compared with a second data list in the user terminal, the second data list includes a data object to which the corresponding data to be displayed has been downloaded, and the status of the data object is marked as downloaded. According to the comparison result, the data objects included in the first data list in the second data list are synchronized into the second data list to form a target data list, and the target data list is displayed. In this way, the user terminal can directly determine whether the corresponding data to be displayed has been downloaded according to the status flag, without having to traverse the local directory folder, improve the response speed and accuracy, and improve the user experience.

Claims (17)

  1. 一种数据同步方法,其特征在于,配置成与服务器通信的用户终端,所述方法包括:A data synchronization method, characterized by a user terminal configured to communicate with a server, the method comprising:
    从所述服务器获取第一数据列表,所述第一数据列表包括多个待显示数据的标识信息;Acquiring, by the server, a first data list, where the first data list includes identifier information of multiple to-be-displayed data;
    在所述第一数据列表中为每个标识信息建立包括数据元素及状态标记的数据对象,将该标识信息存储至所述数据元素中,将所述状态标记设置为未下载;Generating, in the first data list, a data object including a data element and a status tag for each identification information, storing the identification information in the data element, and setting the status flag to not downloaded;
    将所述第一数据列表与所述用户终端中的第二数据列表进行对比,所述第二数据列表包括已下载相应待显示数据的数据对象,下载的待显示数据存储在该数据对象的数据元素中,该数据对象的状态标记为已下载;Comparing the first data list with a second data list in the user terminal, where the second data list includes a data object that has been downloaded corresponding to the data to be displayed, and the downloaded data to be displayed is stored in the data of the data object. In the element, the status of the data object is marked as downloaded;
    根据对比结果,将所述第二数据列表中所述第一数据列表包括的数据对象同步至所述第一数据列表中,得到一目标数据列表,并对所述目标数据列表进行展示。According to the comparison result, the data objects included in the first data list in the second data list are synchronized into the first data list to obtain a target data list, and the target data list is displayed.
  2. 根据权利要求1所述的方法,其特征在于,在所述用户终端展示所述目标数据列表的步骤之后,所述方法还包括:The method according to claim 1, wherein after the step of displaying the target data list by the user terminal, the method further comprises:
    响应用户对所述目标数据列表中各数据对象的选取操作,根据被选取的数据对象的状态标记判断该数据对象对应的待显示数据是否已被下载;Responding to the user selecting operation of each data object in the target data list, determining, according to the status flag of the selected data object, whether the data to be displayed corresponding to the data object has been downloaded;
    若已被下载,则对该数据对象的数据元素中存储的待显示数据进行展示;If it has been downloaded, the data to be displayed stored in the data element of the data object is displayed;
    若未被下载,则从所述服务器下载该数据对象对应的待显示数据。If not downloaded, the data to be displayed corresponding to the data object is downloaded from the server.
  3. 根据权利要求1或2所述的方法,其特征在于,在从所述服务器获取该数据对象对应的待显示数据的步骤之后,所述方法还包括:The method according to claim 1 or 2, wherein after the step of obtaining the data to be displayed corresponding to the data object from the server, the method further comprises:
    将获取到的待显示数据存储至该数据对象的数据元素中,将该数据对象的状态标记设置为已下载;The obtained data to be displayed is stored in a data element of the data object, and the status flag of the data object is set to be downloaded;
    将该数据对象存储至指定的目标文件中。Store the data object in the specified target file.
  4. 根据权利要求1~3任一项所述的方法,其特征在于,所述待显示数据的标识信息包括所述待显示数据的身份信息及摘要信息;将所述第一数据列表与所述用户终端中的第二数据列表进行对比的步骤,包括:The method according to any one of claims 1 to 3, wherein the identification information of the data to be displayed includes identity information and summary information of the data to be displayed; and the first data list and the user The step of comparing the second data list in the terminal includes:
    针对所述第一数据列表中的每个数据对象,获取该数据对象中的身份信息及摘要信息,检测所述第二数据列表中是否存在具有相同身份信息及摘要信息的数据对象。And obtaining, for each data object in the first data list, identity information and summary information in the data object, and detecting whether a data object having the same identity information and summary information exists in the second data list.
  5. 根据权利要求1~3任一项所述的方法,其特征在于,将所述第二数据列表中所述第一数据列表包括的数据对象同步至所述第一数据列表中,得到一目标数据列表的步骤,包括:The method according to any one of claims 1 to 3, wherein the data object included in the first data list in the second data list is synchronized to the first data list to obtain a target data. The steps of the list, including:
    建立目标数据列表; Establish a target data list;
    针对所述第一数据列表中的每一数据对象,若所述第二数据列表中包括该数据对象,则将所述第二数据列表中的该数据对象添加至所述目标数据列表中;And 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;
    若所述第二数据列表中不包括该数据对象,则将所述第一数据列表中的该数据对象添加至所述目标数据列表中。If the data object is not included in the second data list, the data object in the first data list is added to the target data list.
  6. 根据权利要求1~3中任一项所述的方法,其特征在于,所述用户终端通过网络与所述服务器通信,以实现数据交互。The method according to any one of claims 1 to 3, wherein the user terminal communicates with the server through a network to implement data interaction.
  7. 根据权利要求1~3中任一项所述的方法,其特征在于,所述服务器提供供所述用户终端下载并安装的应用程序,用户通过所述应用程序获取所述服务器提供的服务。The method according to any one of claims 1 to 3, wherein the server provides an application for downloading and installing by the user terminal, and the user acquires a service provided by the server through the application.
  8. 根据权利要求1~3任一项所述的方法,其特征在于,所述用户终端是个人电脑、智能手机、平板电脑和/或穿戴式移动设备。The method according to any one of claims 1 to 3, wherein the user terminal is a personal computer, a smart phone, a tablet computer and/or a wearable mobile device.
  9. 根据权利要求1~3任一项所述的方法,其特征在于,所述用户终端包括数据同步装置、存储器、处理器、通信单元以及显示单元;所述存储器、处理器、通信单元以及显示单元各元件相互之间直接或间接地电性连接,以实现数据的交互。The method according to any one of claims 1 to 3, wherein the user terminal comprises a data synchronization device, a memory, a processor, a communication unit, and a display unit; the memory, the processor, the communication unit, and the display unit The components are electrically connected directly or indirectly to each other to effect data interaction.
  10. 根据权利要求9所述的方法,其特征在于,所述存储器是随机存取存储器、只读存储器、可编程只读存储器、可擦除只读存储器和/或电可擦除只读存储器。The method of claim 9, wherein the memory is a random access memory, a read only memory, a programmable read only memory, an erasable read only memory, and/or an electrically erasable read only memory.
  11. 根据权利要求9所述的方法,其特征在于,所述处理器是集成电路芯片,具有信号的处理能力。The method of claim 9 wherein said processor is an integrated circuit chip having signal processing capabilities.
  12. 一种数据同步装置,其特征在于,配置成与服务器通信的用户终端,所述装置包括:A data synchronization device, characterized by a user terminal configured to communicate with a server, the device comprising:
    列表获取模块,配置成从所述服务器获取第一数据列表,所述第一数据列表包括多个待显示数据的标识信息;a list obtaining module, configured to acquire a first data list from the server, where the first data list includes identifier information of a plurality of data to be displayed;
    数据处理模块,配置成在所述第一数据列表中,为每个标识信息建立包括数据元素及状态标记的数据对象,将该标识信息存储至所述数据元素中,将所述状态标记设置为未下载;a data processing module, configured to: in the first data list, establish a data object including a data element and a status tag for each identification information, store the identification information in the data element, and set the status flag to Not downloaded
    列表对比模块,配置成将所述第一数据列表与所述用户终端中的第二数据列表进行对比,所述第二数据列表包括已下载相应待显示数据的数据对象,下载的待显示数据存储在该数据对象的数据元素中,该数据对象的状态标记为已下载;a list comparison module configured to compare the first data list with a second data list in the user terminal, where the second data list includes a data object that has been downloaded corresponding to the data to be displayed, and the downloaded data storage to be displayed In the data element of the data object, the status of the data object is marked as downloaded;
    数据同步模块,配置成根据对比结果,将所述第二数据列表中所述第一数据列表包括的数据对象同步至所述第一数据列表中,得到一目标数据列表,并对所述目标数据列表进行展示。a data synchronization module, configured to synchronize, according to the comparison result, 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 to the target data The list is displayed.
  13. 根据权利要求12所述的装置,其特征在于,所述装置还包括: The device of claim 12, wherein the device further comprises:
    判断模块,配置成在所述用户终端展示所述目标数据列表之后,响应用户对所述目标数据列表中各数据对象的选取操作,根据被选取的数据对象的状态标记判断该数据对象对应的待显示数据是否已被下载;The determining module is configured to: after the user terminal displays the target data list, respond to the user selecting operation of each data object in the target data list, and determine, according to the status flag of the selected data object, the corresponding data object Show if the data has been downloaded;
    展示模块,配置成当该数据对象对应的待显示数据是否已被下载时,对该数据对象的数据元素中存储的待显示数据进行展示;a display module configured to display, when the data to be displayed corresponding to the data object has been downloaded, the data to be displayed stored in the data element of the data object;
    下载模块,配置成当该数据对象对应的待显示数据未被下载时,从所述服务器下载该数据对象对应的待显示数据。The downloading module is configured to download data to be displayed corresponding to the data object from the server when the data to be displayed corresponding to the data object is not downloaded.
  14. 根据权利要求13所述的装置,其特征在于,所述装置还包括:The device according to claim 13, wherein the device further comprises:
    状态修改模块,配置成在从所述服务器获取该数据对象对应的待显示数据之后,将获取到的待显示数据存储至该数据对象的数据元素中,将该数据对象的状态标记设置为已下载;The state modification module is configured to: after acquiring the to-be-displayed data corresponding to the data object from the server, store the acquired data to be displayed into a data element of the data object, and set the status flag of the data object to be downloaded. ;
    数据对象存储模块,将该数据对象存储至指定的目标文件中。A data object storage module that stores the data object in a specified object file.
  15. 根据权利要求12~14任一项所述的装置,其特征在于,所述列表对比模块针对所述第一数据列表中的每个数据对象,获取该数据对象中的标识信息及摘要信息,检测所述第二数据列表中是否存在具有相同标识信息及摘要信息的数据对象,以实现将所述第一数据列表与所述用户终端中的第二数据列表进行对比。The device according to any one of claims 12 to 14, wherein the list comparison module acquires identification information and summary information in the data object for each data object in the first data list, and detects Whether there is a data object having the same identification information and summary information in the second data list, so as to compare the first data list with the second data list in the user terminal.
  16. 根据权利要求12~14任一项所述的装置,其特征在于,所述数据同步模块根据对比结果,将所述第二数据列表中所述第一数据列表包括的数据对象同步至所述第一数据列表中,得到一目标数据列表,并对所述目标数据列表进行展示。The device according to any one of claims 12 to 14, wherein the data synchronization module synchronizes the data objects included in the first data list in the second data list to the first In a data list, a target data list is obtained, and the target data list is displayed.
  17. 根据权利要求12~14任一项所述的装置,其特征在于,所述数据同步模块建立目标数据列表,并针对所述第一数据列表中的每一数据对象,在所述第二数据列表中包括该数据对象时,将所述第二数据列表中的该数据对象添加至所述目标数据列表中;以及在所述第二数据列表中不包括该数据对象时,将所述第一数据列表中的该数据对象添加至所述目标数据列表中,以实现将所述第二数据列表中所述第一数据列表包括的数据对象同步至所述第一数据列表中。 The apparatus according to any one of claims 12 to 14, wherein the data synchronization module establishes a target data list, and for each data object in the first data list, in the second data list When the data object is included, the data object in the second data list is added to the target data list; and when the data object is not included in the second data list, the first data is The data object in the list is added to the target data list to synchronize the data objects included in the first data list in the second data list into the first data list.
PCT/CN2017/115314 2017-09-06 2017-12-08 Data synchronizing method and device WO2019047406A1 (en)

Applications Claiming Priority (2)

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

Publications (1)

Publication Number Publication Date
WO2019047406A1 true WO2019047406A1 (en) 2019-03-14

Family

ID=60351735

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/115314 WO2019047406A1 (en) 2017-09-06 2017-12-08 Data synchronizing 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
CN112464691A (en) * 2019-09-06 2021-03-09 北京字节跳动网络技术有限公司 Image processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050076094A1 (en) * 2003-06-30 2005-04-07 Takeshi Sasaki Method and apparatus for synchronizing data between multiple memories
CN104426924A (en) * 2013-08-21 2015-03-18 腾讯科技(深圳)有限公司 Method, apparatus, client, server and system for updating application software
CN105847430A (en) * 2016-05-20 2016-08-10 北京小米移动软件有限公司 Hybrid 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
CN107395770A (en) * 2017-09-06 2017-11-24 武汉斗鱼网络科技有限公司 Method of data synchronization and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100546260C (en) * 2007-06-27 2009-09-30 中国移动通信集团四川有限公司 The inconsistent detection processing method of data
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
CN104346479A (en) * 2014-11-26 2015-02-11 北京奇虎科技有限公司 Database synchronization method and database synchronization device
CN106888252A (en) * 2017-01-17 2017-06-23 深圳市金立通信设备有限公司 The method and terminal of a kind of refresh data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050076094A1 (en) * 2003-06-30 2005-04-07 Takeshi Sasaki Method and apparatus for synchronizing data between multiple memories
CN104426924A (en) * 2013-08-21 2015-03-18 腾讯科技(深圳)有限公司 Method, apparatus, client, server and system for updating application software
CN105847430A (en) * 2016-05-20 2016-08-10 北京小米移动软件有限公司 Hybrid 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
CN107395770A (en) * 2017-09-06 2017-11-24 武汉斗鱼网络科技有限公司 Method of data synchronization and device

Also Published As

Publication number Publication date
CN107395770A (en) 2017-11-24
CN107395770B (en) 2020-08-04

Similar Documents

Publication Publication Date Title
CN107688664B (en) Chart generation method and device, computer equipment and storage medium
WO2020082558A1 (en) Function name-based breakpoint setting method, device, computer apparatus, and storage medium
CN110955416A (en) Interface document generation method, device, equipment and computer storage medium
WO2019091017A1 (en) Method and device for processing buried points in dynamic pages, and computer device
AU2019461393B2 (en) Screen sharing processing method, apparatus and device, and storage medium
JP2017084334A (en) Method and device for extracting virtual machine image file
JP5319133B2 (en) Document management system, document management method and program
WO2019047406A1 (en) Data synchronizing method and device
BR112014032398B1 (en) METHOD AND DEVICE TO DISPLAY PUSH MESSAGE
CN107992537B (en) Service attribute transmission method, device, computer equipment and storage medium
CN110245069A (en) The methods of exhibiting and device of the test method and device of page versions, the page
CN111488088B (en) Equipment state identification method and device and intelligent terminal
JP2015026207A (en) File management program, file management device and file management method
CN110262948B (en) Page data monitoring method, device and equipment
WO2017185889A1 (en) Application installation package detection method and detection device, and computer readable storage medium
US9462033B2 (en) Proofing electronic publications on portable devices
CN113641936A (en) Method and device for page jump, electronic equipment and storage medium
EP3035217A1 (en) Computer-readable storage medium and method for cross-platform synchronizing attributes of files
CN114285839B (en) File transmission method and device, computer storage medium and electronic equipment
CN114327548A (en) Software upgrading method and related device
CN112199529A (en) Picture processing method and device, electronic equipment and storage medium
CN112765600A (en) Control method for collecting automatic synchronization CMDB based on HIDS intrusion detection
CN113157306A (en) Resource packaging management method, device, equipment and storage medium
CN107528896B (en) Access information processing method and device and computer storage medium
WO2019114133A1 (en) Method and apparatus for altering color of editing page content, terminal, and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17924604

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17924604

Country of ref document: EP

Kind code of ref document: A1