[go: up one dir, main page]

CN110147380B - Data update method, device, server and storage medium - Google Patents

Data update method, device, server and storage medium Download PDF

Info

Publication number
CN110147380B
CN110147380B CN201910436055.XA CN201910436055A CN110147380B CN 110147380 B CN110147380 B CN 110147380B CN 201910436055 A CN201910436055 A CN 201910436055A CN 110147380 B CN110147380 B CN 110147380B
Authority
CN
China
Prior art keywords
characteristic value
data
target object
target
terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910436055.XA
Other languages
Chinese (zh)
Other versions
CN110147380A (en
Inventor
冯锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Chengdu Co Ltd
Original Assignee
Tencent Technology Chengdu Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Chengdu Co Ltd filed Critical Tencent Technology Chengdu Co Ltd
Priority to CN201910436055.XA priority Critical patent/CN110147380B/en
Publication of CN110147380A publication Critical patent/CN110147380A/en
Application granted granted Critical
Publication of CN110147380B publication Critical patent/CN110147380B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating

Landscapes

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

Abstract

本发明公开了一种数据更新方法、装置、服务器以及存储介质,属于图像处理技术领域。本发明通过在接收到数据获取请求时,均将该数据获取请求所携带的特征值与基于服务器上的数据变更操作所维护的多个特征值匹配,从而确定匹配成功的特征值所对应的数据变更记录,而数据变更记录可以代表该终端上数据与服务器上数据的差异,因此,只需基于该数据变更记录进行增量式的数据下发,每次只向终端返回增量变化的部分,也就避免了数据流量的浪费。

The invention discloses a data updating method, device, server and storage medium, and belongs to the technical field of image processing. When receiving a data acquisition request, the present invention matches the characteristic value carried by the data acquisition request with multiple characteristic values maintained based on the data change operation on the server, thereby determining the data corresponding to the successfully matched characteristic value. Change record, and the data change record can represent the difference between the data on the terminal and the data on the server. Therefore, only incremental data delivery is required based on the data change record, and only the incremental changes are returned to the terminal each time. This also avoids the waste of data traffic.

Description

数据更新方法、装置、服务器以及存储介质Data update method, device, server and storage medium

技术领域Technical field

本发明涉及网络技术领域,特别涉及一种数据更新方法、装置、服务器以及存储介质。The present invention relates to the field of network technology, and in particular to a data update method, device, server and storage medium.

背景技术Background technique

随着网络技术的发展,越来越多的应用可以为用户提供各种数据服务,例如,当用户使用直播应用时,可能需要获取如赛事列表等直播信息时,则可以从服务器拉取赛事列表。当然,还可以基于不同的使用需求拉取例如好友关系链、战绩列表等数据。这些数据通常是体量较大、结构较复杂的数据包,其更新不算频繁,如果每次都重新拉取的话,会造成大量的无用流量浪费。With the development of network technology, more and more applications can provide users with various data services. For example, when users use live broadcast applications and may need to obtain live broadcast information such as event lists, they can pull the event list from the server. . Of course, you can also pull data such as friend relationship chains, record lists, etc. based on different usage requirements. These data are usually large and complex data packets that are not updated frequently. If they are re-pulled every time, a large amount of useless traffic will be wasted.

为了节省流量,一般的做法是针对这些数据包进行哈希运算,将计算得到的哈希值下发到客户端,客户端在拉取的时候,先判断客户端请求中的哈希值和服务器保存的哈希值是否一样,一样则表明这个数据在距离上次拉取过后并无更新,所以服务器不需要返回重复的数据,节省了本次请求的流量。In order to save traffic, the general approach is to perform a hash operation on these data packets and send the calculated hash value to the client. When the client pulls it, it first determines the hash value in the client request and the server Whether the saved hash values are the same, if so, it means that the data has not been updated since the last pull, so the server does not need to return duplicate data, saving the traffic of this request.

然而,上述的做法在一定程度上减少了重复更新所消耗的流量,但仍存在一些不足。当数据只是发生了局部或细小变化,比如好友关系链里面增加、减少了一个好友,这种局部或细小的变化也会导致整个数据的哈希值发生变化,导致服务器仍然会判定需要重新下发整个数据,也即是,会重复下发其余大部分相同的数据,造成大量的流量浪费。However, the above approach reduces the traffic consumed by repeated updates to a certain extent, but there are still some shortcomings. When the data only undergoes partial or minor changes, such as adding or removing a friend in the friend relationship chain, such partial or minor changes will also cause the hash value of the entire data to change, causing the server to still determine that it needs to be re-issued. The entire data, that is, most of the other identical data will be distributed repeatedly, causing a lot of waste of traffic.

发明内容Contents of the invention

本发明实施例提供了一种数据更新方法、装置、服务器以及可读存储介质,能够实现增量更新,避免流量的浪费。该技术方案如下:Embodiments of the present invention provide a data update method, device, server and readable storage medium, which can realize incremental updates and avoid waste of traffic. The technical solution is as follows:

一方面,提供了一种数据更新方法,所述方法包括:On the one hand, a data updating method is provided, and the method includes:

接收终端的数据获取请求,所述数据获取请求携带第一特征值,所述第一特征值为终端已存储的目标对象的特征值;Receive a data acquisition request from the terminal, where the data acquisition request carries a first characteristic value, and the first characteristic value is a characteristic value of a target object that has been stored by the terminal;

根据所述第一特征值,在服务器的至少一个第二特征值中进行匹配,所述第二特征值为所述目标对象在至少一次数据变更操作后的特征值;According to the first characteristic value, matching is performed on at least one second characteristic value of the server, where the second characteristic value is the characteristic value of the target object after at least one data modification operation;

将目标第二特征值对应的至少一条数据变更记录下发至所述终端,其中,所述目标第二特征值为与所述第一特征值匹配成功的第二特征值。Send at least one data change record corresponding to the target second feature value to the terminal, where the target second feature value is a second feature value that successfully matches the first feature value.

一方面,提供了一种数据更新装置,所述方法包括:On the one hand, a data updating device is provided, and the method includes:

接收模块,用于接收终端的数据获取请求,所述数据获取请求携带第一特征值,所述第一特征值为终端已存储的目标对象的特征值;A receiving module, configured to receive a data acquisition request from the terminal, where the data acquisition request carries a first characteristic value, and the first characteristic value is a characteristic value of a target object that has been stored by the terminal;

匹配模块,用于根据所述第一特征值,在服务器的至少一个第二特征值中进行匹配,所述第二特征值为所述目标对象在至少一次数据变更操作后的特征值;A matching module, configured to match at least one second characteristic value of the server according to the first characteristic value, where the second characteristic value is the characteristic value of the target object after at least one data change operation;

下发模块,用于将目标第二特征值对应的至少一条数据变更记录下发至所述终端,其中,所述目标第二特征值为与所述第一特征值匹配成功的第二特征值。A delivery module configured to deliver at least one data change record corresponding to a target second feature value to the terminal, wherein the target second feature value is a second feature value that successfully matches the first feature value. .

在一种可能实现方式中,所述匹配模块用于根据所述第一特征值,确定所述第一特征值的生成时间;根据所述第一特征值的生成时间,在所述至少一个第二特征值中生成时间晚于所述第一特征值的生成时间的第二特征值中,按照生成时间从前到后的顺序依次进行匹配。In a possible implementation, the matching module is configured to determine the generation time of the first feature value according to the first feature value; according to the generation time of the first feature value, in the at least one first Among the two eigenvalues, the second eigenvalue whose generation time is later than the generation time of the first eigenvalue is matched sequentially in order of generation time from front to back.

一方面,提供了一种服务器,所述服务器包括处理器和存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现如上述的数据更新方法所执行的操作。In one aspect, a server is provided. The server includes a processor and a memory. At least one instruction is stored in the memory. The instruction is loaded and executed by the processor to implement the above data update method. operate.

一方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一条指令,所述指令由所述处理器加载并执行以实现如上述的数据更新方法所执行的操作。In one aspect, a computer-readable storage medium is provided. At least one instruction is stored in the computer-readable storage medium, and the instruction is loaded and executed by the processor to implement the operations performed by the above-mentioned data update method. .

本发明实施例提供的技术方案,通过在接收到数据获取请求时,均将该数据获取请求所携带的特征值与基于服务器上的数据变更操作所维护的多个特征值匹配,从而确定匹配成功的特征值所对应的数据变更记录,而数据变更记录可以代表该终端上数据与服务器上数据的差异,因此,只需基于该数据变更记录进行增量式的数据下发,每次只向终端返回增量变化的部分,也就避免了数据流量的浪费。The technical solution provided by the embodiment of the present invention matches the characteristic value carried by the data acquisition request with multiple characteristic values maintained based on the data change operation on the server when receiving a data acquisition request, thereby determining that the match is successful. The data change record corresponding to the characteristic value of Returning the incremental changes avoids wasting data traffic.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without exerting creative efforts.

图1示出了本申请一个示例性实施例提供的应用服务系统100的结构框图;Figure 1 shows a structural block diagram of an application service system 100 provided by an exemplary embodiment of the present application;

图2是本发明实施例提供的一种数据更新方法的流程图;Figure 2 is a flow chart of a data update method provided by an embodiment of the present invention;

图3是本发明实施例提供的一种数据更新方法的流程图;Figure 3 is a flow chart of a data update method provided by an embodiment of the present invention;

图4是本发明实施例提供的一种数据存储方式的示意图;Figure 4 is a schematic diagram of a data storage method provided by an embodiment of the present invention;

图5是本发明实施例提供的一种记录数据变更操作的方法的流程图;Figure 5 is a flow chart of a method for recording data change operations provided by an embodiment of the present invention;

图6是本发明实施例提供的一种数据更新装置的结构示意图;Figure 6 is a schematic structural diagram of a data update device provided by an embodiment of the present invention;

图7是本发明实施例提供的一种服务器的结构示意图;Figure 7 is a schematic structural diagram of a server provided by an embodiment of the present invention;

图8是本发明实施例提供的一种终端的结构示意图。Figure 8 is a schematic structural diagram of a terminal provided by an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。In order to make the purpose, technical solutions and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

图1示出了本申请一个示例性实施例提供的应用服务系统100的结构框图。该应用服务系统100包括:终端110和应用服务平台140。Figure 1 shows a structural block diagram of an application service system 100 provided by an exemplary embodiment of the present application. The application service system 100 includes: a terminal 110 and an application service platform 140.

终端110通过无线网络或有线网络与应用服务平台110相连。终端110可以是智能手机、游戏主机、台式计算机、平板电脑、电子书阅读器、MP3播放器、MP4播放器和膝上型便携计算机中的至少一种。终端110安装和运行有支持应用服务的应用程序。该应用程序可以是游戏程序、社交应用程序、即时通讯应用程序、视频程序例如直播程序中的任意一种。示意性的,终端110是第一用户使用的终端,终端110中运行的应用程序内可以登录有用户账号。The terminal 110 is connected to the application service platform 110 through a wireless network or a wired network. The terminal 110 may be at least one of a smart phone, a game console, a desktop computer, a tablet computer, an e-book reader, an MP3 player, an MP4 player, and a laptop computer. The terminal 110 installs and runs applications supporting application services. The application can be any one of a game program, a social networking application, an instant messaging application, a video program such as a live broadcast program. Illustratively, the terminal 110 is a terminal used by the first user, and a user account can be logged into the application program running in the terminal 110 .

终端110通过无线网络或有线网络与应用服务平台140相连。The terminal 110 is connected to the application service platform 140 through a wireless network or a wired network.

应用服务平台140包括一台服务器、多台服务器、云计算平台和虚拟化中心中的至少一种。可选地,应用服务平台140包括:逻辑服务器、记录数据库以及内容数据库。逻辑服务器用于提供终端110提供请求处理服务。逻辑服务器可以是一台或多台。当逻辑服务器是多台时,存在至少两台逻辑服务器用于提供不同的服务,和/或,存在至少两台逻辑服务器用于提供相同的服务,比如以负载均衡方式提供同一种服务,本申请实施例对此不加以限定。该内容数据库用于存储应用服务平台的数据内容,还可以提供终端的全量更新功能,该记录数据库用于记录该内容数据库中数据变更操作,并基于数据变更操作之后的数据来生成对应的特征值,并维护数据变更记录以及特征值之间的对应关系,以便后续为终端提供增量更新的功能。The application service platform 140 includes at least one of a server, multiple servers, a cloud computing platform, and a virtualization center. Optionally, the application service platform 140 includes: a logical server, a record database, and a content database. The logical server is used to provide the terminal 110 with request processing services. There can be one or more logical servers. When there are multiple logical servers, there are at least two logical servers used to provide different services, and/or there are at least two logical servers used to provide the same service, such as providing the same service in a load balancing manner. This application The examples are not limiting. The content database is used to store the data content of the application service platform, and can also provide the full update function of the terminal. The record database is used to record data change operations in the content database, and generate corresponding feature values based on the data after the data change operation. , and maintain data change records and the correspondence between feature values, so as to provide incremental update functions for the terminal in the future.

终端110可以泛指多个终端中的一个,本实施例仅以终端110来举例说明。本领域技术人员可以知晓,上述终端的数量可以更多或更少。比如上述终端可以仅为一个,或者上述终端为几十个或几百个,或者更多数量,此时上述应用服务系统还包括其他终端。本申请实施例对终端的数量和设备类型不加以限定。The terminal 110 may generally refer to one of multiple terminals. This embodiment only takes the terminal 110 as an example. Those skilled in the art will know that the number of the above terminals may be more or less. For example, there may be only one terminal, or there may be dozens, hundreds, or more terminals. In this case, the application service system may also include other terminals. The embodiments of this application do not limit the number of terminals and device types.

图2是本发明实施例提供的一种数据更新方法的流程图。参见图2,以终端、逻辑服务器、记录服务器以及内容服务器之间的交互为例进行说明,该过程具体可以包括终端向逻辑服务器请求数据、逻辑服务器与记录数据库之间基于请求来进行增量数据的获取的过程,当然,为了实现上述增量数据的获取,对于内容数据库来说,还需要涉及在数据发生变更时通知记录数据库的过程。下面,结合图2和图3所示的流程,对本发明实施例的交互流程进行具体说明。Figure 2 is a flow chart of a data update method provided by an embodiment of the present invention. Referring to Figure 2, the interaction between the terminal, the logical server, the recording server and the content server is used as an example to illustrate. This process may specifically include the terminal requesting data from the logical server, and incremental data based on the request between the logical server and the recording database. Of course, in order to achieve the above incremental data acquisition, for the content database, it also needs to involve the process of notifying the recording database when the data changes. Next, the interactive process of the embodiment of the present invention will be described in detail with reference to the processes shown in FIG. 2 and FIG. 3 .

301、终端向逻辑服务器发送数据获取请求,该数据获取请求携带第一特征值,该第一特征值为终端已存储的目标对象的特征值。301. The terminal sends a data acquisition request to the logical server. The data acquisition request carries a first characteristic value. The first characteristic value is a characteristic value of the target object that has been stored by the terminal.

对于终端来说,该目标对象的数据获取请求可以是周期性触发或者是在该目标对象所在网页进行更新时触发,当终端触发了数据获取流程时,则可以从终端已存储数据中获取第一特征值,也即是,该目标对象的特征值,将该第一特征值携带在数据获取请求中发送。For the terminal, the data acquisition request for the target object can be triggered periodically or when the web page where the target object is located is updated. When the terminal triggers the data acquisition process, the first data acquisition request can be obtained from the data stored in the terminal. The characteristic value, that is, the characteristic value of the target object, is sent by carrying the first characteristic value in the data acquisition request.

在对目标对象的任一次更新过程中,终端均可以获取到用于表示该目标对象的当前数据内容的特征值,该特征值可以由终端在更新过程中通过逻辑服务器获取,也可以是在进行了数据更新后基于终端本地更新后的数据生成,本发明实施例对此不做限定。During any update process of the target object, the terminal can obtain the characteristic value used to represent the current data content of the target object. The characteristic value can be obtained by the terminal through the logical server during the update process, or it can be obtained during the update process. After the data is updated, it is generated based on the locally updated data of the terminal, which is not limited in the embodiment of the present invention.

其中,该目标对象可以为任一对象,例如,某个列表数据、某个常用场景数据、某个常用页面等,也即是,当终端接收到任意列表加载指令,则获取该列表标识以及列表哈希值,将该列表标识和列表哈希值携带在数据获取请求中发出,其他情况与此过程同理。该特征值可以是数据的哈希值,用于唯一标识该数据的数据内容,可以理解的是,特征值不同则数据内容不同,因此,特征值之间的比较可以确定出数据内容是否发生了变化。Among them, the target object can be any object, for example, a certain list data, a certain common scene data, a certain common page, etc. That is, when the terminal receives any list loading instruction, it obtains the list identifier and the list Hash value, carry the list ID and list hash value in the data acquisition request, and the process is the same in other cases. The feature value can be a hash value of the data, used to uniquely identify the data content of the data. It can be understood that different feature values mean different data contents. Therefore, comparison between feature values can determine whether the data content has occurred. Variety.

在一些实施例中,该终端在发送数据获取请求时,还可以携带上一次数据更新的时间戳或版本号,以标识上一次更新的时间或版本,当然,版本号也可以采用时间戳的表示形式,本发明实施例对此不做限定。In some embodiments, when sending a data acquisition request, the terminal can also carry the timestamp or version number of the last data update to identify the time or version of the last update. Of course, the version number can also be represented by a timestamp. Form, the embodiment of the present invention does not limit this.

需要说明的是,该逻辑服务器可以预先设置目标列表,用于存储能够进行特征值匹配的对象,则在接收到数据获取请求时,逻辑服务器可以检测该数据获取请求的目标对象;当该目标对象存在于目标列表中时,则执行该根据该第一特征值,在服务器的至少一个第二特征值中进行匹配的步骤;当该目标对象不存在于该目标列表中,则将该第一特征值与第三特征值进行匹配,该第三特征值为该目标对象当前在该服务器上所存储的特征值。It should be noted that the logical server can pre-set a target list to store objects that can match characteristic values. When receiving a data acquisition request, the logical server can detect the target object of the data acquisition request; when the target object When the target object exists in the target list, the step of matching in at least one second feature value of the server according to the first feature value is performed; when the target object does not exist in the target list, the first feature value is matched The third characteristic value is matched with the characteristic value of the target object currently stored on the server.

302、该逻辑服务器在接收到的数据获取请求后,向记录数据库发送匹配请求,该匹配请求携带该第一特征值。302. After receiving the data acquisition request, the logical server sends a matching request to the record database, where the matching request carries the first characteristic value.

记录数据库用于记录内容数据库中数据变更操作,并基于数据变更操作之后的数据来生成对应的特征值,并维护数据变更操作以及特征值之间的对应关系。当然,对于各个目标对象来说,该记录数据库可以根据对象标识来分别为各个目标对象维护对应的数据。因此,该逻辑服务器可以基于接收到的数据获取请求,向记录数据库发起匹配过程,以便确定该目标对象的哪些数据发生了变化。The record database is used to record data change operations in the content database, generate corresponding feature values based on the data after the data change operation, and maintain the correspondence between data change operations and feature values. Of course, for each target object, the record database can maintain corresponding data for each target object according to the object identifier. Therefore, the logical server can initiate a matching process to the record database based on the received data retrieval request in order to determine which data of the target object has changed.

在本发明实施例中,逻辑服务器主要负责对接收到的请求进行处理,将请求对应的数据获取任务通过匹配请求的方法分发给对应的数据库进行处理,从而避免了单一服务器实现各个功能所产生的负载过大的情况,可以保证整个系统的正常稳定的运行。In the embodiment of the present invention, the logic server is mainly responsible for processing the received request, and distributes the data acquisition task corresponding to the request to the corresponding database for processing by matching the request, thereby avoiding the problems caused by a single server implementing various functions. In the event of excessive load, the normal and stable operation of the entire system can be guaranteed.

303、该记录数据库在接收到匹配请求后,根据该第一特征值,在至少一个第二特征值中进行匹配,确定目标第二特征值,该第二特征值为该目标对象在至少一次数据变更操作后的特征值,该目标第二特征值为与该第一特征值匹配成功的第二特征值。303. After receiving the matching request, the record database performs matching in at least one second characteristic value according to the first characteristic value to determine the target second characteristic value. The second characteristic value is the target object in at least one data. After the change operation, the characteristic value is the second characteristic value of the target that successfully matches the first characteristic value.

该记录数据库在接收到匹配请求时,可以根据匹配请求携带的目标对象的对象标识,确定该对象标识对应的至少一个第二特征值,再基于该至少一个第二特征值与该匹配请求所携带的第一特征值进行匹配,来确定匹配成功的第二特征值。When receiving a matching request, the record database can determine at least one second characteristic value corresponding to the object identifier based on the object identifier of the target object carried in the matching request, and then based on the at least one second characteristic value and the object identifier carried in the matching request. The first feature value is matched to determine the second feature value that matches successfully.

在一种可能实现方式中,该匹配过程可以包括:根据该第一特征值,在该至少一个第二特征值中按照生成时间从前到后的顺序依次进行匹配,当该第一特征值与任一个第二特征值相同,则确定匹配成功。其中,生成时间是指第二特征值的生成时间,对于任一个第二特征值来说,其是根据内容数据库中所发生的数据变更操作来生成,因此,其生成时间可以表示数据内容之间发生变化的时间,从而按照生成时间从前到后的顺序进行匹配,可以使得匹配过程更加有序,不会造成匹配错乱的情况。In a possible implementation, the matching process may include: according to the first feature value, matching the at least one second feature value in order from front to back in generation time. When the first feature value matches any of the second feature values, If a second feature value is the same, it is determined that the match is successful. The generation time refers to the generation time of the second feature value. For any second feature value, it is generated according to the data change operation that occurs in the content database. Therefore, its generation time can represent the time between data content. The time of change can be matched in order from front to back of the generation time, which can make the matching process more orderly and avoid confusing matching.

在一些实施例中,在按照生成时间从前到后的顺序依次进行匹配时,还可以基于第一特征值的生成时间来提高匹配的效率,也即是,根据该第一特征值,确定该第一特征值的生成时间;根据该第一特征值的生成时间,在该至少一个第二特征值中生成时间晚于该第一特征值的生成时间的第二特征值中,按照生成时间从前到后的顺序依次进行匹配。其中,第一特征值的生成时间可以表示终端进行更新的数据内容在服务器的更新时间,因此,也就说明终端已存储的该目标对象的数据已经更新到了该生成时间,那么,在该生成时间之前的数据对于该终端来说,是已经更新完成的数据,因此无需对这部分数据进行匹配,仅需要对生成时间晚于该第一特征值的生成时间的第二特征值进行比较,大大降低了匹配的计算量,提高了匹配的效率。In some embodiments, when matching in order from front to back of generation time, the efficiency of matching can also be improved based on the generation time of the first feature value, that is, based on the first feature value, the third feature value is determined. The generation time of a feature value; according to the generation time of the first feature value, among the second feature values whose generation time is later than the generation time of the first feature value in the at least one second feature value, according to the generation time from before to Matching is performed in the following order. Among them, the generation time of the first characteristic value can represent the update time of the data content updated by the terminal in the server. Therefore, it also means that the data of the target object stored by the terminal has been updated to the generation time. Then, at the generation time For this terminal, the previous data is data that has been updated, so there is no need to match this part of the data. It is only necessary to compare the second feature value whose generation time is later than the generation time of the first feature value, which greatly reduces Reduces the amount of matching calculations and improves matching efficiency.

在一些实施例中,该数据获取请求还可以携带版本号,则匹配请求也可以携带该版本号,在记录数据库侧可以确定该版本号之后的更新版本所对应的第二特征值,再基于这部分更新版本所对应的第二特征值进行匹配,以降低匹配的计算量,提高匹配的效率。In some embodiments, the data acquisition request can also carry a version number, and the matching request can also carry the version number. The record database side can determine the second characteristic value corresponding to the updated version after the version number, and then based on this The second feature values corresponding to the partially updated versions are matched to reduce the calculation amount of matching and improve the efficiency of matching.

304、该记录数据库获取该目标第二特征值对应的至少一条数据变更记录。304. The record database obtains at least one data change record corresponding to the second characteristic value of the target.

其中,数据变更记录包括数据变更类型以及变更数据,例如,对于数据修改操作,该数据变更类型可以为修改,变更数据可以为修改后的数据,对于数据删除操作,该数据变更类型可以为删除,变更数据可以为待删除数据的信息,例如待删除数据的数据名称、数据标识等。该数据变更记录基于内容数据库的任一次数据变更操作生成,具体地,一条数据变更记录可以对应于至少一次数据变更操作,本发明实施例对此不做限定。Among them, the data change record includes data change type and change data. For example, for a data modification operation, the data change type can be modification, and the change data can be modified data. For a data deletion operation, the data change type can be deletion. The changed data may be information about the data to be deleted, such as the data name, data identification, etc. of the data to be deleted. The data change record is generated based on any data change operation of the content database. Specifically, one data change record may correspond to at least one data change operation, which is not limited in the embodiment of the present invention.

在一些实施例中,记录数据库对于数据变更记录可以采用键值型数据库进行存储。例如,参见图4所示,对于不同的对象,可以对应存储有其各个数据变更记录以及哈希值。In some embodiments, the record database may use a key-value database to store data change records. For example, as shown in Figure 4, for different objects, their respective data change records and hash values can be stored correspondingly.

305、该记录数据库将该至少一条数据变更记录发送至逻辑服务器。305. The record database sends the at least one data change record to the logical server.

306、该逻辑服务器将接收到的至少一条数据变更记录下发至该终端。306. The logical server delivers at least one received data change record to the terminal.

在上述步骤305至306中,当记录数据库获取到数据变更记录后,则可以通过逻辑服务器将该数据变更记录下发至该终端,使得终端可以进行相应更新。In the above steps 305 to 306, after the recording database obtains the data change record, the data change record can be sent to the terminal through the logical server, so that the terminal can perform corresponding updates.

307、终端在接收到该至少一条数据变更记录后,基于该至少一条数据变更记录更新终端已存储的目标对象。307. After receiving the at least one data change record, the terminal updates the target object stored in the terminal based on the at least one data change record.

终端在接收到该至少一条数据变更记录后,可以基于数据变更记录中的数据变更类型以及变更数据,在终端上对已存储的目标对象进行对应的更新,例如,当数据变更类型为数据修改操作时,则将已存储的目标对象中的对应数据更新为该变更数据,当数据变更类型为数据删除操作时,则将已存储的目标对象中的对应数据删除。After receiving the at least one data change record, the terminal can perform corresponding updates to the stored target object on the terminal based on the data change type and change data in the data change record. For example, when the data change type is a data modification operation When the data change type is a data deletion operation, the corresponding data in the stored target object is deleted.

在一些实施例中,终端在进行了相应更新后,可以基于更新后的目标对象生成特征值,用新生成的特征值覆盖原有特征值,以便在下次需要进行数据获取时能够应用新生成的特征值来进行如上述过程所示的增量获取。In some embodiments, after performing corresponding updates, the terminal can generate feature values based on the updated target object and overwrite the original feature values with the newly generated feature values, so that the newly generated feature values can be applied the next time data acquisition is required. Feature values are obtained incrementally as shown in the above process.

在一些实施例中,当记录数据库在发送至少一条数据变更记录时,还可以将目标第二特征值一同发送,以便终端能够接收到至少一条数据变更记录和目标第二特征值,用该目标第二特征值覆盖原有特征值,则无需终端重新生成特征值,减少了终端的计算量。In some embodiments, when the recording database sends at least one data change record, it can also send the target second characteristic value together, so that the terminal can receive at least one data change record and the target second characteristic value, and use the target second characteristic value. If the two eigenvalues cover the original eigenvalue, there is no need for the terminal to regenerate the eigenvalue, which reduces the calculation amount of the terminal.

本发明实施例提供的技术方案,通过在接收到数据获取请求时,均将该数据获取请求所携带的特征值与基于服务器上的数据变更操作所维护的多个特征值匹配,从而确定匹配成功的特征值所对应的数据变更记录,而数据变更记录可以代表该终端上数据与服务器上数据的差异,因此,只需基于该数据变更记录进行增量式的数据下发,每次只向终端返回增量变化的部分,也就避免了数据流量的浪费。The technical solution provided by the embodiment of the present invention matches the characteristic value carried by the data acquisition request with multiple characteristic values maintained based on the data change operation on the server when receiving a data acquisition request, thereby determining that the match is successful. The data change record corresponding to the characteristic value of Returning the incremental changes avoids wasting data traffic.

在上述实施例中提供了如何为终端进行数据更新的过程,而为了实现上述数据更新过程,记录数据库需要对内容数据库中的数据变更进行记录,下面针对该记录过程进行说明,参见图5,该记录过程可以包括:The above embodiment provides a process of how to update data for the terminal. In order to implement the above data update process, the recording database needs to record the data changes in the content database. The recording process will be described below. See Figure 5. The recording process can include:

501、当检测到内容数据库中的目标对象发生任一数据变更操作时,该内容数据库向记录数据库发送数据变更通知,该数据变更通知携带该数据变更操作。501. When it is detected that any data change operation occurs on the target object in the content database, the content database sends a data change notification to the record database, and the data change notification carries the data change operation.

502、记录数据库在接收到该数据变更通知后,基于该数据变更操作生成数据变更记录,基于该数据变更操作和已存储的数据内容,生成第二特征值。502. After receiving the data change notification, the record database generates a data change record based on the data change operation, and generates a second characteristic value based on the data change operation and the stored data content.

503、记录数据库将该目标对象的数据变更记录与第二特征值对应存储。503. The record database stores the data change record of the target object in correspondence with the second characteristic value.

对于任意对象,可以将该对象的数据变更记录和对应的第二特征值存储在该对象的操作序列中,当相关数据在内容数据库中有变更,则基于上述过程,记录数据库会记录该变更,从而保证数据的一致性。For any object, the data change record and the corresponding second characteristic value of the object can be stored in the operation sequence of the object. When the relevant data is changed in the content database, based on the above process, the record database will record the change. This ensures data consistency.

上述记录数据变更操作的过程可以是每次发生数据变更操作时进行,也可以是基于预设数目的数据变更操作进行,记录数据库在接收到任意数据变更通知时,可以先获取数据变更操作,并将数据变更操作存储至缓存队列中,当该缓存队列已满时,则将缓存队列中所存储的数据变更操作生成数据变更记录,避免数据读写过于频繁。The above process of recording data change operations can be performed every time a data change operation occurs, or it can be performed based on a preset number of data change operations. When the recording database receives any data change notification, it can first obtain the data change operations, and Store the data change operations in the cache queue. When the cache queue is full, the data change operations stored in the cache queue will generate data change records to avoid too frequent data reading and writing.

上述实施例可以应用于任一种应用场景中,本发明实施例对此不做限定。另外,需要说明的是,上述实施例可以应用于包括了记录数据库的系统架构中,而在一些实施例中,该记录数据库可以作为内容数据库的一部分,本发明实施例对具体应用于何种系统架构不做具体限定。The above embodiments can be applied to any application scenario, and the embodiments of the present invention do not limit this. In addition, it should be noted that the above embodiments can be applied to a system architecture including a record database, and in some embodiments, the record database can be used as a part of the content database. The embodiments of the present invention are specific to what kind of system they are applied to. The architecture is not specifically limited.

本发明实施例在系统中增加了记录数据库,对于任意对象,可以将该对象的数据变更记录和对应的第二特征值存储在该对象的操作序列中,当相关数据在内容数据库中有变更,则基于上述过程,记录数据库会记录该变更,从而保证数据的一致性。The embodiment of the present invention adds a record database to the system. For any object, the data change record and the corresponding second characteristic value of the object can be stored in the operation sequence of the object. When the relevant data is changed in the content database, Based on the above process, the recording database will record the change to ensure data consistency.

图6是本发明实施例提供的一种数据更新装置的结构示意图,参见图6,所述装置包括:Figure 6 is a schematic structural diagram of a data update device provided by an embodiment of the present invention. Referring to Figure 6, the device includes:

接收模块601,用于接收终端的数据获取请求,所述数据获取请求携带第一特征值,所述第一特征值为终端已存储的目标对象的特征值;The receiving module 601 is configured to receive a data acquisition request from the terminal, where the data acquisition request carries a first characteristic value, and the first characteristic value is a characteristic value of a target object that has been stored by the terminal;

匹配模块602,用于根据所述第一特征值,在服务器的至少一个第二特征值中进行匹配,所述第二特征值为所述目标对象在至少一次数据变更操作后的特征值;The matching module 602 is configured to perform matching on at least one second characteristic value of the server according to the first characteristic value, where the second characteristic value is the characteristic value of the target object after at least one data change operation;

下发模块603,用于将目标第二特征值对应的至少一条数据变更记录下发至所述终端,其中,所述目标第二特征值为与所述第一特征值匹配成功的第二特征值。The delivery module 603 is configured to deliver at least one data change record corresponding to a target second feature value to the terminal, wherein the target second feature value is a second feature that successfully matches the first feature value. value.

在一种可能实现方式中,所述匹配模块602用于根据所述第一特征值,在所述至少一个第二特征值中按照生成时间从前到后的顺序依次进行匹配,当所述第一特征值与任一个第二特征值相同,则确定匹配成功。In a possible implementation, the matching module 602 is configured to perform matching on the at least one second characteristic value in order from front to back of generation time according to the first characteristic value. When the first characteristic value If the feature value is the same as any second feature value, it is determined that the match is successful.

在一种可能实现方式中,所述匹配模块用于根据所述第一特征值,确定所述第一特征值的生成时间;根据所述第一特征值的生成时间,在所述至少一个第二特征值中生成时间晚于所述第一特征值的生成时间的第二特征值中,按照生成时间从前到后的顺序依次进行匹配。In a possible implementation, the matching module is configured to determine the generation time of the first feature value according to the first feature value; according to the generation time of the first feature value, in the at least one first Among the two eigenvalues, the second eigenvalue whose generation time is later than the generation time of the first eigenvalue is matched sequentially in order of generation time from front to back.

在一种可能实现方式中,所述装置还包括:In a possible implementation, the device further includes:

变更处理模块,用于当所述目标对象发生任一数据变更操作时,基于所述数据变更操作生成数据变更记录;基于经过所述数据变更操作的目标对象,生成与所述数据变更记录对应的第二特征值。A change processing module, configured to generate a data change record based on the data change operation when any data change operation occurs on the target object; and generate a data change record corresponding to the data change record based on the target object that has undergone the data change operation. second eigenvalue.

图7是本发明实施例提供的一种服务器的结构示意图,该服务器700可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(central processingunits,CPU)701和一个或一个以上的存储器702,其中,该存储器702中存储有至少一条指令,该至少一条指令由该处理器701加载并执行以实现上述各个方法实施例提供的数据更新方法。当然,该服务器还可以具有有线或无线网络接口、键盘以及输入输出接口等部件,以便进行输入输出,该服务器还可以包括其他用于实现设备功能的部件,在此不做赘述。Figure 7 is a schematic structural diagram of a server provided by an embodiment of the present invention. The server 700 may vary greatly due to different configurations or performance, and may include one or more central processing units (CPUs) 701 and one or more More than one memory 702, wherein at least one instruction is stored in the memory 702, and the at least one instruction is loaded and executed by the processor 701 to implement the data update method provided by each of the above method embodiments. Of course, the server can also have components such as wired or wireless network interfaces, keyboards, and input and output interfaces to facilitate input and output. The server can also include other components for implementing device functions, which will not be described again here.

上述实施例中所涉及的终端可以采用如图8的架构,图8是本发明实施例提供的一种终端的结构示意图。该终端800可以是便携式移动终端,比如:智能手机、平板电脑、MP3播放器(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、笔记本电脑、台式电脑、头戴式设备,或其他任意智能终端。终端800还可能被称为用户设备、便携式终端、膝上型终端、台式终端等其他名称。The terminal involved in the above embodiments may adopt the architecture as shown in Figure 8. Figure 8 is a schematic structural diagram of a terminal provided by an embodiment of the present invention. The terminal 800 can be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, moving picture experts compression standard audio layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic Imaging experts compress standard audio levels 4) players, laptops, desktop computers, head-mounted devices, or any other smart terminals. The terminal 800 may also be called a user equipment, a portable terminal, a laptop terminal, a desktop terminal, and other names.

通常,终端800包括有:处理器801和存储器802。Generally, the terminal 800 includes: a processor 801 and a memory 802.

处理器801可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器801可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器801也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central ProcessingUnit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器801可以在集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器801还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 801 can adopt at least one hardware form among DSP (Digital Signal Processing, digital signal processing), FPGA (Field-Programmable Gate Array, field programmable gate array), and PLA (Programmable Logic Array, programmable logic array). accomplish. The processor 801 may also include a main processor and a co-processor. The main processor is a processor used to process data in the wake-up state, also called CPU (Central Processing Unit, central processing unit); the co-processor is A low-power processor used to process data in standby mode. In some embodiments, the processor 801 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is responsible for rendering and drawing content to be displayed on the display screen. In some embodiments, the processor 801 may also include an AI (Artificial Intelligence, artificial intelligence) processor, which is used to process computing operations related to machine learning.

存储器802可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器802还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器802中的非暂态的计算机可读存储介质用于存储至少一个指令,该至少一个指令用于被处理器801所具有以实现本申请中方法实施例提供的数据更新方法。Memory 802 may include one or more computer-readable storage media, which may be non-transitory. Memory 802 may also include high-speed random access memory, and non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 802 is used to store at least one instruction, and the at least one instruction is used to be possessed by the processor 801 to implement the data update provided by the method embodiments in this application. method.

在一些实施例中,终端800还可选包括有:外围设备接口803和至少一个外围设备。处理器801、存储器802和外围设备接口803之间可以通过总线或信号线相连。各个外围设备可以通过总线、信号线或电路板与外围设备接口803相连。具体地,外围设备包括:射频电路804、触摸显示屏805、摄像头806、音频电路807和电源809中的至少一种。In some embodiments, the terminal 800 optionally further includes: a peripheral device interface 803 and at least one peripheral device. The processor 801, the memory 802 and the peripheral device interface 803 may be connected through a bus or a signal line. Each peripheral device can be connected to the peripheral device interface 803 through a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 804, a touch display screen 805, a camera 806, an audio circuit 807 and a power supply 809.

外围设备接口803可被用于将I/O(Input/Output,输入/输出)相关的至少一个外围设备连接到处理器801和存储器802。在一些实施例中,处理器801、存储器802和外围设备接口803被集成在同一芯片或电路板上;在一些其他实施例中,处理器801、存储器802和外围设备接口803中的任意一个或两个可以在单独的芯片或电路板上实现,本实施例对此不加以限定。The peripheral device interface 803 may be used to connect at least one I/O (Input/Output, input/output) related peripheral device to the processor 801 and the memory 802 . In some embodiments, the processor 801, the memory 802, and the peripheral device interface 803 are integrated on the same chip or circuit board; in some other embodiments, any one of the processor 801, the memory 802, and the peripheral device interface 803 or Both of them can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

射频电路804用于接收和发射RF(Radio Frequency,射频)信号,也称电磁信号。射频电路804通过电磁信号与通信网络以及其他通信设备进行通信。射频电路804将电信号转换为电磁信号进行发送,或者,将接收到的电磁信号转换为电信号。可选地,射频电路804包括:天线系统、RF收发器、一个或多个放大器、调谐器、振荡器、数字信号处理器、编解码芯片组、用户身份模块卡等等。射频电路804可以通过至少一种无线通信协议来与其它终端进行通信。该无线通信协议包括但不限于:城域网、各代移动通信网络(2G、3G、4G及8G)、无线局域网和/或WiFi(Wireless Fidelity,无线保真)网络。在一些实施例中,射频电路804还可以包括NFC(Near Field Communication,近距离无线通信)有关的电路,本申请对此不加以限定。The radio frequency circuit 804 is used to receive and transmit RF (Radio Frequency, radio frequency) signals, also called electromagnetic signals. Radio frequency circuit 804 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 804 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 804 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. Radio frequency circuitry 804 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: metropolitan area network, mobile communication networks of all generations (2G, 3G, 4G and 8G), wireless local area network and/or WiFi (Wireless Fidelity, wireless fidelity) network. In some embodiments, the radio frequency circuit 804 may also include NFC (Near Field Communication) related circuits, which is not limited in this application.

显示屏805用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。当显示屏805是触摸显示屏时,显示屏805还具有采集在显示屏805的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器801进行处理。此时,显示屏805还可以用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏805可以为一个,设置终端800的前面板;在另一些实施例中,显示屏805可以为至少两个,分别设置在终端800的不同表面或呈折叠设计;在再一些实施例中,显示屏805可以是柔性显示屏,设置在终端800的弯曲表面上或折叠面上。甚至,显示屏805还可以设置成非矩形的不规则图形,也即异形屏。显示屏805可以采用LCD(LiquidCrystal Display,液晶显示屏)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。The display screen 805 is used to display UI (User Interface, user interface). The UI can include graphics, text, icons, videos, and any combination thereof. When display screen 805 is a touch display screen, display screen 805 also has the ability to collect touch signals on or above the surface of display screen 805 . The touch signal can be input to the processor 801 as a control signal for processing. At this time, the display screen 805 can also be used to provide virtual buttons and/or virtual keyboards, also called soft buttons and/or soft keyboards. In some embodiments, there may be one display screen 805, which is provided on the front panel of the terminal 800; in other embodiments, there may be at least two display screens 805, which are respectively provided on different surfaces of the terminal 800 or have a folding design; in In some embodiments, the display screen 805 may be a flexible display screen disposed on a curved or folded surface of the terminal 800 . Even the display screen 805 can be set into a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 805 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

摄像头组件806用于采集图像或视频。可选地,摄像头组件806包括前置摄像头和后置摄像头。通常,前置摄像头设置在终端的前面板,后置摄像头设置在终端的背面。在一些实施例中,后置摄像头为至少两个,分别为主摄像头、景深摄像头、广角摄像头、长焦摄像头中的任意一种,以实现主摄像头和景深摄像头融合实现背景虚化功能、主摄像头和广角摄像头融合实现全景拍摄以及VR(Virtual Reality,虚拟现实)拍摄功能或者其它融合拍摄功能。在一些实施例中,摄像头组件806还可以包括闪光灯。闪光灯可以是单色温闪光灯,也可以是双色温闪光灯。双色温闪光灯是指暖光闪光灯和冷光闪光灯的组合,可以用于不同色温下的光线补偿。The camera assembly 806 is used to capture images or videos. Optionally, the camera assembly 806 includes a front camera and a rear camera. Usually, the front camera is set on the front panel of the terminal, and the rear camera is set on the back of the terminal. In some embodiments, there are at least two rear cameras, one of which is a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, so as to realize the integration of the main camera and the depth-of-field camera to realize the background blur function. Integrated with a wide-angle camera to achieve panoramic shooting and VR (Virtual Reality, virtual reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 806 may also include a flash. The flash can be a single color temperature flash or a dual color temperature flash. Dual color temperature flash refers to a combination of warm light flash and cold light flash, which can be used for light compensation under different color temperatures.

音频电路807可以包括麦克风和扬声器。麦克风用于采集用户及环境的声波,并将声波转换为电信号输入至处理器801进行处理,或者输入至射频电路804以实现语音通信。出于立体声采集或降噪的目的,麦克风可以为多个,分别设置在终端800的不同部位。麦克风还可以是阵列麦克风或全向采集型麦克风。扬声器则用于将来自处理器801或射频电路804的电信号转换为声波。扬声器可以是传统的薄膜扬声器,也可以是压电陶瓷扬声器。当扬声器是压电陶瓷扬声器时,不仅可以将电信号转换为人类可听见的声波,也可以将电信号转换为人类听不见的声波以进行测距等用途。在一些实施例中,音频电路807还可以包括耳机插孔。Audio circuitry 807 may include a microphone and speakers. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals that are input to the processor 801 for processing, or to the radio frequency circuit 804 to implement voice communication. For the purpose of stereo collection or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 800 . The microphone can also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert electrical signals from the processor 801 or the radio frequency circuit 804 into sound waves. The loudspeaker can be a traditional membrane loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves that are audible to humans, but also convert electrical signals into sound waves that are inaudible to humans for purposes such as ranging. In some embodiments, audio circuitry 807 may also include a headphone jack.

电源809用于为终端800中的各个组件进行供电。电源809可以是交流电、直流电、一次性电池或可充电电池。当电源809包括可充电电池时,该可充电电池可以支持有线充电或无线充电。该可充电电池还可以用于支持快充技术。The power supply 809 is used to power various components in the terminal 800 . Power source 809 may be AC, DC, disposable batteries, or rechargeable batteries. When the power supply 809 includes a rechargeable battery, the rechargeable battery may support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

在一些实施例中,终端800还包括有一个或多个传感器810。该一个或多个传感器810包括但不限于:加速度传感器811、陀螺仪传感器812、压力传感器813、光学传感器815以及接近传感器816。In some embodiments, terminal 800 also includes one or more sensors 810. The one or more sensors 810 include, but are not limited to: an acceleration sensor 811 , a gyroscope sensor 812 , a pressure sensor 813 , an optical sensor 815 and a proximity sensor 816 .

加速度传感器811可以检测以终端811建立的坐标系的三个坐标轴上的加速度大小。比如,加速度传感器811可以用于检测重力加速度在三个坐标轴上的分量。处理器801可以根据加速度传感器811采集的重力加速度信号,控制触摸显示屏805以横向视图或纵向视图进行用户界面的显示。加速度传感器811还可以用于游戏或者用户的运动数据的采集。The acceleration sensor 811 can detect the acceleration on the three coordinate axes of the coordinate system established by the terminal 811 . For example, the acceleration sensor 811 can be used to detect the components of gravity acceleration on three coordinate axes. The processor 801 can control the touch display screen 805 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 811 . The acceleration sensor 811 can also be used to collect game or user motion data.

陀螺仪传感器812可以检测终端800的机体方向及转动角度,陀螺仪传感器812可以与加速度传感器811协同采集用户对终端800的3D动作。处理器801根据陀螺仪传感器812采集的数据,可以实现如下功能:动作感应(比如根据用户的倾斜操作来改变UI)、拍摄时的图像稳定、游戏控制以及惯性导航。The gyro sensor 812 can detect the body direction and rotation angle of the terminal 800 , and the gyro sensor 812 can cooperate with the acceleration sensor 811 to collect the user's 3D movements on the terminal 800 . Based on the data collected by the gyro sensor 812, the processor 801 can implement the following functions: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

压力传感器813可以设置在终端800的侧边框和/或触摸显示屏805的下层。当压力传感器813设置在终端800的侧边框时,可以检测用户对终端800的握持信号,由处理器801根据压力传感器813采集的握持信号进行左右手识别或快捷操作。当压力传感器813设置在触摸显示屏805的下层时,由处理器801根据用户对触摸显示屏805的压力操作,实现对UI界面上的可操作性控件进行控制。可操作性控件包括按钮控件、滚动条控件、图标控件、菜单控件中的至少一种。The pressure sensor 813 may be provided on the side frame of the terminal 800 and/or on the lower layer of the touch display screen 805 . When the pressure sensor 813 is disposed on the side frame of the terminal 800, it can detect the user's grip signal on the terminal 800, and the processor 801 performs left and right hand identification or quick operation based on the grip signal collected by the pressure sensor 813. When the pressure sensor 813 is provided on the lower layer of the touch display screen 805, the processor 801 controls the operability controls on the UI interface according to the user's pressure operation on the touch display screen 805. The operability control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.

光学传感器815用于采集环境光强度。在一个实施例中,处理器801可以根据光学传感器815采集的环境光强度,控制触摸显示屏805的显示亮度。具体地,当环境光强度较高时,调高触摸显示屏805的显示亮度;当环境光强度较低时,调低触摸显示屏805的显示亮度。在另一个实施例中,处理器801还可以根据光学传感器815采集的环境光强度,动态调整摄像头组件806的拍摄参数。Optical sensor 815 is used to collect ambient light intensity. In one embodiment, the processor 801 can control the display brightness of the touch display screen 805 according to the ambient light intensity collected by the optical sensor 815 . Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 805 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 805 is decreased. In another embodiment, the processor 801 can also dynamically adjust the shooting parameters of the camera assembly 806 according to the ambient light intensity collected by the optical sensor 815 .

接近传感器816,也称距离传感器,通常设置在终端800的前面板。接近传感器816用于采集用户与终端800的正面之间的距离。在一个实施例中,当接近传感器816检测到用户与终端800的正面之间的距离逐渐变小时,由处理器801控制触摸显示屏805从亮屏状态切换为息屏状态;当接近传感器816检测到用户与终端800的正面之间的距离逐渐变大时,由处理器801控制触摸显示屏805从息屏状态切换为亮屏状态。The proximity sensor 816, also called a distance sensor, is usually provided on the front panel of the terminal 800. The proximity sensor 816 is used to collect the distance between the user and the front of the terminal 800 . In one embodiment, when the proximity sensor 816 detects that the distance between the user and the front of the terminal 800 gradually becomes smaller, the processor 801 controls the touch display 805 to switch from the bright screen state to the closed screen state; when the proximity sensor 816 detects When the distance between the user and the front of the terminal 800 gradually increases, the processor 801 controls the touch display screen 805 to switch from the screen off state to the screen on state.

本领域技术人员可以理解,图8中示出的结构并不构成对终端800的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。Those skilled in the art can understand that the structure shown in FIG. 8 does not constitute a limitation on the terminal 800, and may include more or fewer components than shown, or combine certain components, or adopt different component arrangements.

在示例性实施例中,还提供了一种计算机可读存储介质,例如包括指令的存储器,上述指令可由终端或服务器中的处理器执行以完成上述实施例中的数据更新方法。例如,该计算机可读存储介质可以是只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions, and the instructions can be executed by a processor in a terminal or server to complete the data update method in the above embodiment. For example, the computer-readable storage medium can be read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), read-only compact disc (Compact Disc Read-Only Memory, CD-ROM), Tapes, floppy disks and optical data storage devices, etc.

本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,该程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by instructing the relevant hardware through a program. The program can be stored in a computer-readable storage medium. As mentioned above, The storage medium can be read-only memory, magnetic disk or optical disk, etc.

上述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention. Inside.

Claims (6)

1. A method of data updating, the method comprising:
receiving a data acquisition request of a terminal, wherein the data acquisition request carries a first characteristic value, the first characteristic value is a characteristic value of a target object stored by the terminal, and the characteristic value of the target object is used for identifying the data content of the data of the target object;
detecting a target object of the data acquisition request;
when the target object exists in a target list, determining the generation time of the first characteristic value according to the first characteristic value; according to the generation time of the first characteristic value, in at least one second characteristic value of the server, the generation time of the second characteristic value is later than the generation time of the first characteristic value, and matching is sequentially carried out according to the sequence from front to back of the generation time; the target list is used for storing objects capable of performing characteristic value matching, and the second characteristic value is a characteristic value of the target object after at least one data change operation;
transmitting a target second characteristic value and at least one data change record corresponding to the target second characteristic value to the terminal, wherein the target second characteristic value is a second characteristic value which is not successfully matched with the first characteristic value, when the first characteristic value is the same as any one of the second characteristic values, the data change record comprises a data change type and change data, and the terminal is used for covering the first characteristic value with the target second characteristic value after receiving the target second characteristic value;
and when the target object does not exist in the target list, matching the first characteristic value with a third characteristic value, wherein the third characteristic value is the characteristic value of the target object currently stored on the server.
2. The method of claim 1, wherein prior to receiving the data acquisition request by the terminal, the method further comprises:
when any data change operation occurs to the target object, generating a data change record based on the data change operation;
and generating a second characteristic value corresponding to the data change record based on the target object subjected to the data change operation.
3. A data updating apparatus, the apparatus comprising:
the receiving module is used for receiving a data acquisition request of the terminal, wherein the data acquisition request carries a first characteristic value, the first characteristic value is a characteristic value of a target object stored by the terminal, and the characteristic value of the target object is used for identifying the data content of the data of the target object;
the matching module is used for detecting a target object of the data acquisition request; when the target object exists in a target list, determining the generation time of the first characteristic value according to the first characteristic value; according to the generation time of the first characteristic value, in at least one second characteristic value of the server, the generation time of the second characteristic value is later than the generation time of the first characteristic value, and matching is sequentially carried out according to the sequence from front to back of the generation time; the target list is used for storing objects capable of performing characteristic value matching, and the second characteristic value is a characteristic value of the target object after at least one data change operation;
the issuing module is used for issuing a target second characteristic value and at least one data change record corresponding to the target second characteristic value to the terminal, wherein the target second characteristic value is a second characteristic value successfully matched with the first characteristic value, when the first characteristic value is the same as any one of the second characteristic values, the successful matching is determined, the data change record comprises a data change type and change data, and the terminal is used for covering the first characteristic value with the target second characteristic value after receiving the target second characteristic value;
and the matching module is further configured to match the first feature value with a third feature value when the target object does not exist in the target list, where the third feature value is a feature value that is currently stored on the server by the target object.
4. A device according to claim 3, characterized in that the device further comprises:
the change processing module is used for generating a data change record based on any data change operation when the target object generates the data change operation; and generating a second characteristic value corresponding to the data change record based on the target object subjected to the data change operation.
5. A server comprising a processor and a memory having stored therein at least one instruction that is loaded and executed by the processor to perform the operations performed by the data update method of any one of claims 1 to 2.
6. A computer readable storage medium having stored therein at least one instruction that is loaded and executed by a processor to implement the operations performed by the data update method of any one of claims 1 to 2.
CN201910436055.XA 2019-05-23 2019-05-23 Data update method, device, server and storage medium Active CN110147380B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910436055.XA CN110147380B (en) 2019-05-23 2019-05-23 Data update method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910436055.XA CN110147380B (en) 2019-05-23 2019-05-23 Data update method, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN110147380A CN110147380A (en) 2019-08-20
CN110147380B true CN110147380B (en) 2023-11-24

Family

ID=67592783

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910436055.XA Active CN110147380B (en) 2019-05-23 2019-05-23 Data update method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN110147380B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110569311B (en) * 2019-10-30 2020-07-10 上海商魁信息科技有限公司 Data synchronization method and device for database and computer storage medium
CN110825762A (en) * 2019-11-14 2020-02-21 北京融易做科技有限公司 Data storage method, device and system
CN111339107B (en) * 2020-02-10 2023-07-28 支付宝(杭州)信息技术有限公司 Method and device for synchronizing comparison source data, electronic equipment and storage medium
CN111708335A (en) * 2020-06-03 2020-09-25 深圳前海禾盈科技有限公司 Equipment data acquisition method based on smart factory
CN111752240A (en) * 2020-06-03 2020-10-09 深圳前海禾盈科技有限公司 Construction method of automatic production control framework
CN113821707A (en) * 2020-06-19 2021-12-21 腾讯科技(深圳)有限公司 A data pulling method, device and computer-readable storage medium
CN117312321A (en) * 2023-10-11 2023-12-29 松灵机器人(深圳)有限公司 Data pulling method and device, storage medium and electronic equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1790266A (en) * 2004-12-14 2006-06-21 微软公司 Method and system for downloading updates
CN102904887A (en) * 2012-09-26 2013-01-30 东软集团股份有限公司 Method and system for data synchronization of Web client and server
CN103108024A (en) * 2012-11-14 2013-05-15 福建联迪商用设备有限公司 Incremental downloading method for multi-media self-service terminal
CN103164422A (en) * 2011-12-09 2013-06-19 百度在线网络技术(北京)有限公司 Method, equipment and system for conducting data synchronism by adopting general data storage format
CN105468623A (en) * 2014-09-03 2016-04-06 阿里巴巴集团控股有限公司 Data processing method and apparatus
CN105740259A (en) * 2014-12-09 2016-07-06 阿里巴巴集团控股有限公司 Method and device for processing incremental data
CN105808373A (en) * 2014-12-30 2016-07-27 中兴通讯股份有限公司 Incremental backup method and device of data, and NAS (Network Attached Storage) equipment
CN105868361A (en) * 2016-03-29 2016-08-17 中国银行股份有限公司 Data updating method and device
CN109597717A (en) * 2018-12-07 2019-04-09 北京金山云网络技术有限公司 A kind of data backup, restoration methods, device, electronic equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9430543B2 (en) * 2013-03-15 2016-08-30 Wal-Mart Stores, Inc. Incrementally updating a large key-value store
US9613527B2 (en) * 2014-09-26 2017-04-04 Here Global B.V. Method and apparatus for providing smaller incremental updates to a navigational database

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1790266A (en) * 2004-12-14 2006-06-21 微软公司 Method and system for downloading updates
CN103164422A (en) * 2011-12-09 2013-06-19 百度在线网络技术(北京)有限公司 Method, equipment and system for conducting data synchronism by adopting general data storage format
CN102904887A (en) * 2012-09-26 2013-01-30 东软集团股份有限公司 Method and system for data synchronization of Web client and server
CN103108024A (en) * 2012-11-14 2013-05-15 福建联迪商用设备有限公司 Incremental downloading method for multi-media self-service terminal
CN105468623A (en) * 2014-09-03 2016-04-06 阿里巴巴集团控股有限公司 Data processing method and apparatus
CN105740259A (en) * 2014-12-09 2016-07-06 阿里巴巴集团控股有限公司 Method and device for processing incremental data
CN105808373A (en) * 2014-12-30 2016-07-27 中兴通讯股份有限公司 Incremental backup method and device of data, and NAS (Network Attached Storage) equipment
CN105868361A (en) * 2016-03-29 2016-08-17 中国银行股份有限公司 Data updating method and device
CN109597717A (en) * 2018-12-07 2019-04-09 北京金山云网络技术有限公司 A kind of data backup, restoration methods, device, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
New Results on Competitive Analysis of Move To Middle(MTM) List Update Algorithm using Doubly Linked List;Mohanty Rakesh 等;《Procedia Computer Science》;762-769 *
电信级企业网的安全加密系统的设计;杨晓云;《中国优秀硕士学位论文全文数据库信息科技辑》;I139-68 *

Also Published As

Publication number Publication date
CN110147380A (en) 2019-08-20

Similar Documents

Publication Publication Date Title
CN110147380B (en) Data update method, device, server and storage medium
CN108762881B (en) Interface drawing method and device, terminal and storage medium
CN110569220B (en) Game resource file display method and device, terminal and storage medium
CN111694834A (en) Method, device and equipment for putting picture data into storage and readable storage medium
CN110189137A (en) Method, device, equipment and storage medium for facial recognition payment
CN111881423B (en) Restricting function use authorization methods, devices, and systems
CN111198922B (en) Game resource management method and device based on block chain
CN107896337B (en) Information popularization method and device and storage medium
CN110189771A (en) Sound quality detection method, device and storage medium for homologous audio
CN110769174A (en) Video viewing method and electronic device
CN114785766A (en) Control method of intelligent equipment, terminal and server
CN114296824A (en) Page information configuration method, device, equipment and computer readable storage medium
CN116320582A (en) Video display method, device, electronic device and storage medium
CN115883807A (en) Method, device, terminal, medium and product for adjusting working mode
CN110213437B (en) Editing method and mobile terminal
CN111324293B (en) Storage system, data storage method, data reading method and device
CN109922256B (en) Shooting method and terminal device
JP7625149B2 (en) Module processing method, device and storage medium for use in foreground/background separation system
CN110971840A (en) Video mapping method and device, computer equipment and storage medium
CN113407741B (en) Material management method, device, electronic equipment and storage medium
CN113220935B (en) Video data storage and query method and device
CN112711636B (en) Data synchronization method, device, equipment and medium
CN112181938B (en) Database cleaning method, device and computer readable storage medium
CN110597923B (en) Block chain resource management method, device and storage medium
CN115730573A (en) Processing method, device and equipment of table data and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TG01 Patent term adjustment
TG01 Patent term adjustment