CN115982183A - Data difference updating method and device based on custom path - Google Patents

Data difference updating method and device based on custom path Download PDF

Info

Publication number
CN115982183A
CN115982183A CN202211610353.4A CN202211610353A CN115982183A CN 115982183 A CN115982183 A CN 115982183A CN 202211610353 A CN202211610353 A CN 202211610353A CN 115982183 A CN115982183 A CN 115982183A
Authority
CN
China
Prior art keywords
data
identification information
data block
path
end equipment
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.)
Pending
Application number
CN202211610353.4A
Other languages
Chinese (zh)
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202211610353.4A priority Critical patent/CN115982183A/en
Publication of CN115982183A publication Critical patent/CN115982183A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a data difference updating method and device based on a user-defined path. In the embodiment of the application, the data is marked when the back-end device acquires the data every time, and each data has the unique identifier corresponding to the data, so that after the first identifier sent by the front-end device is received, the data different from the data corresponding to the first identifier is updated data, the front-end device only needs to acquire the updated data and does not need to acquire repeated data, and further the utilization efficiency of network resources can be improved.

Description

Data difference updating method and device based on user-defined path
Technical Field
The invention relates to the technical field of internet application, in particular to a data difference updating method and device based on a user-defined path.
Background
In the prior art, in order to normally display content, a front-end device needs to obtain content data corresponding to the displayed content through a content service interface of a back-end device. In addition, the display content may be updated, and therefore, the acquired content data may also be updated, but the updated content is only a part of the content, and further, a part of the content data that has a change (hereinafter, this part is referred to as an updated part) is not large, for example, when the display content is an episode, after the episode is updated, one episode may be updated every day, so that the updated content is only the latest episode, and only the content data of the latest episode in the content data has a change. However, when acquiring content data each time, all content data needs to be acquired, which causes network resources to be wasted in acquiring repeated content data when acquiring content data, and the actual utilization efficiency of network resources is not high.
Disclosure of Invention
The embodiment of the invention aims to provide a data difference updating method and device based on a user-defined path so as to improve the actual utilization efficiency of network resources. The specific technical scheme is as follows:
in a first aspect of the embodiment of the present invention, a data delta updating method based on a custom path is provided, and is characterized in that the method is applied to a back-end device, where custom path information for indicating a specified path is configured in advance in the back-end device, and based on the custom path information, acquired data is divided into multiple data blocks under the specified path, all data under each specified path is divided into one data block, and identification information is allocated to each data block in advance, where the identification information is used to characterize whether data changes; the method comprises the following steps:
receiving a data request sent by front-end equipment, wherein the data request comprises historical identification information of each data block requested by the front-end equipment;
acquiring current identification information of each data block stored by the back-end equipment; the current identification information is the latest identification information of each acquired data block;
determining a data block with the current identification information different from the historical identification information from each data block as an update data block;
and sending the update data block to the front-end equipment, so that the front-end equipment obtains the latest data corresponding to the data request based on the update data block and the historical data stored in the front-end equipment.
In one possible implementation, the method further includes:
and dividing the data under the paths except the designated path into a data block according to the preset granularity.
In a possible implementation manner, the identification information is used to indicate the number of times of updating the data block; when the back-end equipment acquires the current identification information of the data block under each path each time, and the data block is updated, the current identification information is the identification information updated on the basis of the identification information of the data block acquired last time.
In one possible implementation, the method further includes:
and sending the current identification information of the updated data block to the front-end equipment.
In a second aspect of the present invention, a data delta updating apparatus based on a user-defined path is further provided, where the apparatus is applied to a back-end device, where user-defined path information used to indicate a specified path is configured in advance in the back-end device, and based on the user-defined path information, the obtained data is divided into multiple data blocks under the specified path, all data under each specified path is divided into one data block, and identification information is pre-allocated to each data block, where the identification information is used to represent whether data changes; the device comprises:
a receiving module, configured to receive a data request sent by a front-end device, where the data request includes history identification information of each data block requested by the front-end device;
an obtaining module, configured to obtain current identification information of each data block stored in the backend device; the current identification information is the latest identification information of each acquired data block;
a determining module, configured to determine, from each of the data blocks, a data block in which the current identification information is different from the historical identification information as an updated data block;
and the sending module is used for sending the update data block to the front-end equipment so that the front-end equipment obtains the latest data corresponding to the data request based on the update data block and the historical data stored in the front-end equipment.
In a possible implementation manner, the apparatus further includes a dividing module, configured to divide data in other paths except the specified path into one data block according to a preset granularity;
the identification information is used for representing the updating times of the data block; when the back-end equipment acquires the current identification information of the data block under each path each time, when the data block is updated, the current identification information is the identification information updated on the basis of the identification information of the data block acquired last time;
the sending module is further configured to send the current identification information of the updated data block to the front-end device.
In another aspect of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, where the processor, the communication interface and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the video clipping method of the first aspect when executing the program stored in the memory.
In yet another aspect of the present invention, there is also provided a computer-readable storage medium having stored therein a computer program which, when executed by a processor, implements the method steps of the first aspect described above.
According to the data difference updating method and device based on the user-defined path, user-defined path information is configured in the back-end equipment in advance, then the back-end equipment is used for marking the acquired data according to the path, when the front-end equipment requests the data, the back-end equipment only returns the data block which is different from the historical identification information locally stored by the front-end equipment through the identification information, and all data do not need to be returned every time. In the embodiment of the application, once the identification information of the data block of the path changes, it indicates that the data block under the path changes, the back-end device can determine the changed data block through the identification information of the data block under each path, and only needs to send the changed data block to the front-end device, and does not need to send complete data every time, so that repeated data can be avoided, and the utilization efficiency of network resources is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a schematic flowchart illustrating a method for updating a data difference based on a custom path according to an embodiment of the present invention;
fig. 2 is an interaction diagram of a data difference updating method based on a custom path according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data delta updating apparatus based on a custom path according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
In the prior art, data needs to be acquired from a content service interface at a back end for front-end display content, so for the content interface at the back end, there are many contents accessed each time, that is, there are many content data that need to be acquired, and there are few portions with changed contents, that is, there are few portions with updated content data that need to be acquired. Therefore, most of the content data is actually duplicated each time, which results in a low actual utilization of network resources.
Based on this, the present application provides a data delta updating method based on a custom path, which is applied to a backend device, where the backend device in the present application may be any electronic device capable of responding to a data request and acquiring data, including but not limited to a personal computer, a mobile device, and the like, where custom path information is configured in advance in the backend device, the custom path information is used to represent a designated path, the backend device divides the acquired data into a plurality of data blocks under the designated path based on the custom path information, all data under each designated path is divided into one data block, and identification information is pre-allocated to each data block, and the identification information is used to represent whether data changes, as shown in fig. 1, the method includes:
s101, receiving a data request sent by front-end equipment, wherein the data request comprises history identification information of each data block requested by the front-end equipment.
S102, current identification information of each data block stored in the back-end equipment is obtained, and the current identification information is the latest identification information of each obtained data block.
S103, determining a data block with current identification information different from the historical identification information from the data blocks as an updating data block.
And S104, sending the update data block to the front-end equipment, so that the front-end equipment obtains the latest data corresponding to the data request based on the update data block and the historical data stored in the front-end equipment.
In this embodiment, by configuring the self-defined path information in the back-end device in advance, and then marking the acquired data according to the path by using the back-end device, when the front-end device requests data, the back-end device only returns a data block different from the history identification information locally stored in the front-end device through the identification information, and does not need to return all data each time. In the embodiment of the application, once the identification information of the data block in the path changes, it indicates that the data block in the path has changed, the back-end device can determine the changed data block through the identification information of the data block in each path, and only needs to send the changed data block to the front-end device, and complete data does not need to be sent every time, so that repeated data can be avoided, and the utilization efficiency of network resources is improved.
The foregoing steps S101-S104 will be described in detail below:
before the back-end equipment acquires data, custom path information is configured in advance and used for identifying a specified path. Therefore, the back-end device can divide the acquired data into a plurality of data blocks under the specified path according to the configured custom path information.
In S101, the front-end device locally stores history data corresponding to each history data request, and identification information of each history data. Each time the front-end device sends a data request, the history identification information of the history data corresponding to the data request is included in the data request.
The marking value of the identification information in the embodiment of the application is not a globally unique value, and only needs to be unique within a path range, that is, the marking values of the same identification information can be used under different paths. Illustratively, the identification information of the data blocks under the paths 1, 2 and 3 is 0, 0 and 0. That is, data under different paths may be represented by the same identification information.
In a possible implementation manner, if the data requested by the data request of the front-end device is completely new data, the front-end device does not store the historical data identification information of each data requested by the data request, and at this time, the data request sent by the front-end device does not include the historical identification information.
In one possible implementation, to improve the identification information comparison efficiency, the identification information may be used to indicate the number of updates of the data block. When the back-end equipment acquires the current identification information of the data block under each path each time, when the data block is updated, the current identification information is the identification information updated on the basis of the identification information of the data block acquired last time. Because the identification information in the application is used for marking the data of the data block, namely one database is distributed with one identification information, the identification information and the data block are in one-to-one correspondence, and the data block is updated integrally when the data block is updated. Therefore, only by comparing whether the historical identification information and the current identification information of each data block are the same, whether the data block is changed can be determined.
For example, if the history identification information of the data block a is 1 and the history identification information of the data block B is 0, and when the backend device acquires the data block A, B again, the current identification information of the data block a is 2 and the current identification information of the data block B is 0, it indicates that the data block a is updated on the basis of the last acquisition and the data block B is not updated.
In S102, after receiving a data request from a front-end device, a back-end device obtains a data block corresponding to the data request, where the data block is stored in a custom path, and when the data block changes, identification information of the data block also changes. The current identification information of the data block is updated identification information corresponding to the data block corresponding to the data request acquired by the back-end device. In the embodiment of the present application, the data in the data block under the path may include single data, may also include array data, and may also include both single data and array data. The application does not limit the type of data represented by the data block.
In a possible embodiment, the identification information of the data block may be updated according to a preset rule, for example, the identification information of the data block may be updated in a form of + 1. Assuming that the identification information of the data block is 1, when the data block changes, the identification information may be updated with +1 on the basis of the original identification information, that is, the current identification information is 2. The identification information in the present application does not need to use a globally unique value, and only needs to be unique within a path range. The identification information of the data block may also be updated in a known order, and assuming that the identification information of the data block is a, when the data block changes, the identification information may be updated by 26 letters on the basis of the original identification information, and when the identification information of the data block changes, the current identification information is b. In the present application, the manner of updating the identification information of the data block is not limited. In order to better describe the embodiments of the present application, the identification information of each data block is updated in a form of +1 after the data block is changed. The identification information in the present application is used to identify the number of updates of the data block. Assuming that the initial identification information of the data block is 0, the identification information of the data block is +1 every time the data block is updated, and assuming that the current identification information of the data block is 5, the data block is updated 5 times.
For example, assume that the data blocks requested by the headend data request 1 are: a data block under path 1, a data block under path 2, a data block under path 3, a data block under path 4, a data block under path 5, and a data block under path 6, where the history identification information of the data block under each path is: 1. 1,1,1, 1; after receiving the data request, the back-end device obtains the latest data of each data block requested by the data request, and assuming that the data under paths 1, 3, and 5 have changed, the current identification information of the data block under each path obtained by the back-end device is respectively: 2. 1, 2, 1, 2 and 1.
In a possible embodiment, it is assumed that the history identification information stored locally at the front-end device is empty, i.e. the front-end device first obtains the content data from the back-end device. After the back-end device receives the data request with the empty identification information sent by the front-end device, it can be determined that the front-end device does not store any content data, and then the back-end device sends all the currently acquired content data to the front-end device. For example, after the back-end device receives a data request with empty identification information, the back-end device divides the data into a plurality of data blocks under a specified path according to the path after acquiring the data corresponding to the data request. Assume that all the acquired content data are content data a: a1, A2, A3, content data B: b1, B2, and B3, dividing the content data a and the content data B into a data block A1 under path 1, a data block A2 under path 2, a data block A3 under path 3, a data block B1 under path 4, a data block B2 under path 5, and a data block B3 under path 6 according to paths, and then allocating identification information to each data block, wherein the identification information of the data block A1 under path 1, the data block A2 under path 2, the data block A3 under path 3, the data block B1 under path 4, the data block B2 under path 5, and the data block B3 under path 6 are respectively: 0. 0, 0. The identification information is the original identification information of the data corresponding to the data request, and subsequently, the back-end equipment can update the identification information on the basis of the original identification information along with the continuous update of the data to obtain the current identification information. In S103, it is only necessary to compare whether the current identification information and the historical identification information of the data block under each path are the same, and it is determined whether the data block under the path has changed, and the changed database is determined as an updated data block, that is, a data block with the current identification information different from the historical identification information is determined as an updated data block.
Still taking the data request 1 as an example, the current identification information of the data block of the data request 1 obtained by the back-end device is respectively: 2. 1, 2, 1, 2 and 1. The back-end equipment identifies the history identification information of the data blocks under each path in the received data request 1: 1. 1,1 and 1. And respectively comparing whether the data identification information of the data blocks under each path changes. Namely, the historical identification information of the data block under the path 1 is: and 1, if the current identification information is 2, determining that the data block under the path 1 changes, and so on, and finally determining that the data blocks under the paths 1, 3 and 5 change. The data blocks under path 1, 3, 5 are taken as update data blocks.
In S104, after determining the updated data block, the back-end device only needs to send the updated data block to the front-end device, after obtaining the updated data block, the front-end device merges with other data blocks that are not updated and are locally stored in the front-end device, so as to obtain the latest data, and after obtaining the latest data, the front-end device caches the latest data locally to the front-end device again.
Still taking the data request 1 as an example, the back-end device sends the data blocks under the paths 1, 3, and 5 to the front-end device, and after receiving the updated data block, the front-end device replaces the locally stored data blocks under the paths 1, 3, and 5 with the updated data block based on the path. Then, the data block under the path 2, the data block under the path 4 and the data block under the path 6 which are locally stored in the front-end equipment are merged to jointly obtain the latest content data: content data a: a1', A2, A3', content data B: b1, B2' and B3.
In one possible implementation, the data in the designated path is frequently changed, and the data in the paths other than the designated path is not changed for a long time. And dividing the data under the paths except the data under the designated path, namely the data under the paths which do not change for a long time, into a plurality of data blocks according to the preset granularity.
In order to improve the detection efficiency of whether the data in the paths other than the specified path is updated, the data in the paths other than the specified path may be divided into a plurality of data blocks according to a preset granularity. Therefore, when determining whether the data under other paths are updated, only the preset times are needed to be detected, and the detection efficiency can be further improved.
The preset granularity in this embodiment is set by a person skilled in the art according to the actual comparison of the identification information without affecting the calculation rate of the identification information comparison. For example, if the preset granularity is 2, the other data are divided into two data blocks, which may also be 3, 4, 5, and so on, as long as the size of the granularity does not affect the calculation rate of the identification information comparison.
In order to realize that the data sent by the back-end equipment is the updated data every time, the probability of the repetition of the data corresponding to the data request obtained by the front-end equipment every time is reduced, namely, the accuracy of data updating is improved, the data sent by the back-end equipment is more accurately ensured to be the data completely different from the data locally stored by the front-end equipment, and the locally stored historical identification information can be updated in time after the updated data sent by the back-end equipment is received every time. The method further comprises the following steps:
and S105, sending the current identification information of the updated data block to the front-end equipment.
In this step, after the back-end device obtains the data corresponding to the data request, the back-end device marks the data according to the path in the user-defined path information. The back-end equipment can compare historical identification information and current identification information of the data block to determine whether the data block required by the front-end equipment is updated or not, then the updated data block is sent to the front-end equipment, the back-end equipment also sends the identification information of the updated data to the front-end equipment, and the front-end equipment updates the identification information of the updated data block into the historical identification information stored under the local path after receiving the identification information of the updated data block.
Illustratively, still taking the data request 1 as an example, after the front-end device receives the update data block, the locally stored data blocks under the paths 1, 3, and 5 are replaced with the update data block based on the path. Then, the data block under the path 2, the data block under the path 4 and the data block under the path 6 which are locally stored in the front-end equipment are merged to jointly obtain the latest content data: content data a: a1', A2, A3', content data B: b1, B2' and B3. The back-end equipment sends the identification information of the updated data block, namely the current identification information 2, 2 and 2 of the paths 1, 3 and 5 to the front-end equipment, the front-end equipment updates the history identification information stored locally, and the updated history identification information is as follows: 2. 1, 2, 1, 2 and 1.
For more clearly explaining the delta data updating method provided by the embodiment of the present invention, an exemplary description will be given below with reference to specific scenarios, and referring to fig. 2, fig. 2 is a schematic diagram of an overall system architecture of the delta data updating method provided by the embodiment of the present invention.
The system comprises front-end equipment and back-end equipment.
Initially, one skilled in the art would configure the paths of the backend device as a specified path according to the data characteristics, so as to facilitate subsequent data marking by the backend device. After receiving the data request of the front-end device, the back-end device obtains complete data corresponding to the data request and marks the obtained data according to a specified path configured in advance in the back-end device paths to generate corresponding identification information.
When the front-end equipment requests data from the back-end equipment for the first time, the front-end equipment obtains complete data and identification information corresponding to the data request from the back-end equipment and caches the complete data and the identification information. When the front-end equipment requests data next time, the front-end equipment carries the identification information, after the back-end equipment acquires the complete data corresponding to the data request and marks the data, the identification information acquired by the data request is compared with the identification information acquired by marking the data at present, change information can be obtained with extremely low calculation amount, and the back-end equipment returns a change part to the front-end equipment. And after the front-end equipment acquires the change information, the change information is merged with the previously stored data to obtain complete updated data, and then the updated data is displayed and cached again.
In the whole delta data updating method, the involved data operation mainly comprises three parts:
1) Comparing the identification information of the historical data sent back by the front-end equipment with the identification information of the latest new data of the back-end equipment:
firstly, comparing the identification information of other data, and if the identification information of other data is different, returning the updated data block corresponding to other data by the back-end equipment;
then, one compares the identification information of the data block under the appointed path, and for the single data, the change is added to the returned data as place; for array data in the data, three cases of insert, delete and replace can be judged according to the prior art, and the calculation amount is very small because the marks of the new and old array data are compared.
For example, (1) insert case, assuming that the front-end device requests the back-end device to obtain data a, the front-end device stores the identification information of data a stored before: and the data block identifier 1 of the path 1, the data block identifier 1 of the path 2 and the data block identifier 1 of the path 3 are also sent to the back-end equipment. The back-end device determines which path identification information of the data block under the path changes according to the latest full data a' acquired by the data request sent by the front-end device, and if the path identification information changes, the path identification information +1 is assumed to be the following path identification information: data block identification 1 of path 1, data block identification 1 of path 2, data block identification 1 of path 3, and data block identification 1 of path 4, and identification information in the received data request: and comparing the data block identifier 1 of the path 1, the data block identifier 1 of the path 2 and the data block identifier 1 of the path 3, determining that the updated data block is the data block added with the path 4, and if the data blocks under other paths are not changed, the back-end equipment sends the updated data block under the path 4 to the front-end equipment, so that the front-end equipment inserts the data block of the path 4 into the previously stored data A to obtain data A'.
(2) In the delete case, assuming that the front-end device requests the back-end device to acquire the data a, the front-end device stores the identification information of the previously stored data a: and the data block identifier 1 of the path 1, the data block identifier 1 of the path 2 and the data block identifier 1 of the path 3 are also sent to the back-end equipment. The back-end device obtains the latest full data a 'according to the data request sent by the front-end device, and the identification information of a' is assumed to be: data block identification 1 for path 1, data block identification 1 for path 2, and the received identification: and comparing the data block identifier 1 of the path 1, the data block identifier 1 of the path 2 and the data block identifier 1 of the path 3, determining that the updated data block is the data block with the reduced path 3, and if the data blocks under other paths do not change, the back-end equipment sends the data block under the path 3 to the front-end equipment, so that the front-end equipment deletes the data block under the path 3 from the previously stored data A to obtain data A'.
(3) In the place case, it is assumed that the front-end device requests the back-end device to obtain data a, and the front-end device stores the identification information of the previously stored data a: and the data block identifier 1 of the path 1, the data block identifier 1 of the path 2 and the data block identifier 1 of the path 3 are also sent to the back-end equipment. The back-end device obtains the latest full data a 'according to the data request sent by the front-end device, and the identification information of a' is assumed to be: data block identification 1 for path 1, data block identification 1 for path 2, data block identification 1 for path 4, and the received identification: and comparing the data block identifier 1 of the path 1, the data block identifier 1 of the path 2 and the data block identifier 1 of the path 3, determining that the changed data is the data block changing the data block under the path 3 into the data block under the path 4, and if the data blocks under other paths are not changed, the back-end equipment sends the data block under the path 3 and the data block under the path 4 to the front-end equipment, so that the front-end equipment replaces the data block under the path 3 with the updated data block under the path 4 to obtain data A'.
2) The back-end equipment judges the original data updating part to update the identification information of the back-end equipment:
because of the custom paths (which are designated paths), the data blocks that need to be compared are limited, i.e., the data blocks of the designated paths and other data blocks. So that the identification information of these data blocks can be directly compared to obtain that these data blocks need to be updated or not. And in the content data scene of the love art, whether the single data is changed or not can be compared based on tvid (identity identification) and time-stamp (time stamp), so that the calculation amount can be further reduced.
3) Allocating identification information for each data block in advance:
the aforementioned identification information is sent to the front-end device by the back-end device, and the front-end device also sends back to the back-end device when requesting data, and needs to go through the network, so the shorter the identification information is, the better, the traditional identification generally adopts a hash value, and the calculation of the hash value by one data block is more consumption calculation, and the too short hash value also has the possibility of collision, and the too long hash value is not favorable for the network transceiving efficiency. Since the identification information does not need to be globally unique and only needs to be unique within a path range, the conversion based on accumulation can be directly adopted, for example, the conversion is started from 1 and is added by 1 each time, and if the network transceiving is based on character strings, the network transceiving can also be transcoded into shorter character strings. Therefore, the identification information in the application can achieve very short and short drying.
In the embodiment of the application, by means of the method for configuring the designated path through the custom path information, in combination with the characteristic that a small number of designated paths of content data are frequently updated, the data blocks under the designated paths are configured through the custom path information, identification information is distributed to each data block in advance, and differential quantity updating is carried out.
Corresponding to the embodiment of the method for updating the data difference based on the custom path, the embodiment of the invention also provides a device for updating the data difference based on the custom path, which is characterized in that the device is applied to back-end equipment, custom path information used for indicating the designated path is configured in the back-end equipment in advance, the obtained data is divided into a plurality of data blocks under the designated path based on the custom path information, all data under each designated path is divided into one data block, identification information is distributed to each data block in advance, and the identification information is used for representing whether the data is changed or not; as shown in fig. 3, the apparatus includes:
a receiving module 301, configured to receive a data request sent by a front-end device, where the data request includes history identification information of each data block requested by the front-end device;
an obtaining module 302, configured to obtain current identification information of each data block stored in a backend device; the current identification information is the latest identification information of each acquired data block;
a determining module 303, configured to determine, from the data blocks, a data block whose current identification information is different from the historical identification information as an updated data block;
a sending module 304, configured to send the update data block to the front-end device, so that the front-end device obtains the latest data corresponding to the data request based on the update data block and the historical data stored in the front-end device.
In a possible embodiment, the apparatus further includes a dividing module 305, configured to divide data in paths other than the specified path into one data block according to a preset granularity;
the identification information is used for representing the updating times of the data block; when the back-end equipment acquires the current identification information of the data block under each path each time, when the data block is updated, the current identification information is the identification information updated on the basis of the identification information of the data block acquired last time;
the sending module is further configured to send the current identification information of the update data block to the front-end device.
In this embodiment, by configuring the self-defined path information in the back-end device in advance, and then marking the acquired data according to the path by using the back-end device, when the front-end device requests data, the back-end device only returns a data block different from the history identification information locally stored in the front-end device through the identification information, and does not need to return all data each time. In the embodiment of the application, once the identification information of the data block of the path changes, it indicates that the data block under the path changes, the back-end device can determine the changed data block through the identification information of the data block under each path, and only needs to send the changed data block to the front-end device, and does not need to send complete data every time, so that repeated data can be avoided, and the utilization efficiency of network resources is improved.
An embodiment of the present invention further provides an electronic device, as shown in fig. 4, including a processor 401, a communication interface 402, a memory 403, and a communication bus 404, where the processor 401, the communication interface 402, and the memory 403 complete mutual communication through the communication bus 404,
a memory 403 for storing a computer program;
the processor 401, when executing the program stored in the memory 403, implements the following steps:
receiving a data request sent by front-end equipment, wherein the data request comprises historical identification information of each data block requested by the front-end equipment;
acquiring current identification information of each data block stored by the back-end equipment; the current identification information is the latest identification information of each acquired data block;
determining a data block with the current identification information different from the historical identification information from each data block as an update data block;
and sending the update data block to the front-end equipment, so that the front-end equipment obtains the latest data corresponding to the data request based on the update data block and the historical data stored in the front-end equipment.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this is not intended to represent only one bus or type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components.
In another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the delta data updating method described in any of the above embodiments.
In yet another embodiment, a computer program product containing instructions is provided, which when run on a computer causes the computer to perform the delta data updating method described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (8)

1. A data delta updating method based on a user-defined path is characterized in that the method is applied to a back-end device, user-defined path information used for indicating a specified path is configured in advance in the back-end device, the obtained data is divided into a plurality of data blocks under the specified path based on the user-defined path information, all data under each specified path are divided into one data block, identification information is distributed to each data block in advance, and the identification information is used for representing whether the data changes or not; the method comprises the following steps:
receiving a data request sent by front-end equipment, wherein the data request comprises historical identification information of each data block requested by the front-end equipment;
acquiring current identification information of each data block stored by the back-end equipment; the current identification information is the latest identification information of each acquired data block;
determining a data block with the current identification information different from the historical identification information from each data block as an update data block;
and sending the update data block to the front-end equipment, so that the front-end equipment obtains the latest data corresponding to the data request based on the update data block and the historical data stored in the front-end equipment.
2. The method of claim 1, further comprising:
and dividing data in other paths except the designated path into a data block according to a preset granularity.
3. The method of claim 1, wherein the identification information is used to indicate the number of updates of the data block; when the back-end equipment acquires the current identification information of the data block under each path each time, when the data block is updated, the current identification information is the identification information updated on the basis of the identification information of the data block acquired last time.
4. The method of claim 1, further comprising:
and sending the current identification information of the updated data block to the front-end equipment.
5. A data delta updating device based on a user-defined path is characterized in that the device is applied to a back-end device, user-defined path information used for indicating a specified path is configured in advance in the back-end device, the obtained data is divided into a plurality of data blocks under the specified path based on the user-defined path information, all data under each specified path are divided into one data block, identification information is distributed to each data block in advance, and the identification information is used for representing whether the data changes or not; the device comprises:
a receiving module, configured to receive a data request sent by a front-end device, where the data request includes history identification information of each data block requested by the front-end device;
an obtaining module, configured to obtain current identification information of each data block stored in the backend device; the current identification information is the latest identification information of each acquired data block;
a determining module, configured to determine, from each of the data blocks, a data block in which the current identification information is different from the historical identification information as an updated data block;
and the sending module is used for sending the update data block to the front-end equipment so that the front-end equipment obtains the latest data corresponding to the data request based on the update data block and the historical data stored in the front-end equipment.
6. The apparatus according to claim 5, further comprising a dividing module, configured to divide data in paths other than the specified path into one data block according to a preset granularity;
the identification information is used for representing the updating times of the data block; when the back-end equipment acquires the current identification information of the data block under each path each time, when the data block is updated, the current identification information is the identification information updated on the basis of the identification information of the data block acquired last time;
the sending module is further configured to send the current identification information of the updated data block to the front-end device.
7. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 4 when executing a program stored in the memory.
8. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
CN202211610353.4A 2022-12-14 2022-12-14 Data difference updating method and device based on custom path Pending CN115982183A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211610353.4A CN115982183A (en) 2022-12-14 2022-12-14 Data difference updating method and device based on custom path

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211610353.4A CN115982183A (en) 2022-12-14 2022-12-14 Data difference updating method and device based on custom path

Publications (1)

Publication Number Publication Date
CN115982183A true CN115982183A (en) 2023-04-18

Family

ID=85958438

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211610353.4A Pending CN115982183A (en) 2022-12-14 2022-12-14 Data difference updating method and device based on custom path

Country Status (1)

Country Link
CN (1) CN115982183A (en)

Similar Documents

Publication Publication Date Title
CN109741060A (en) Information inquiry system, method, device, electronic equipment and storage medium
CN110083475B (en) Abnormal data detection method and device
CN112437148B (en) Service request processing method and device, service server and system
CN108154024B (en) Data retrieval method and device and electronic equipment
CN111382206A (en) Data storage method and device
CN115757406A (en) Data storage method and device, electronic equipment and storage medium
CN109600254B (en) Method for generating full-link log and related system
CN111198885A (en) Data processing method and device
CN112650692A (en) Heap memory allocation method, device and storage medium
CN110427538B (en) Data query method, data storage method, data query device, data storage device and electronic equipment
CN111078773A (en) Data processing method and device
CN110955460A (en) Service process starting method and device, electronic equipment and storage medium
CN110727895A (en) Sensitive word sending method and device, electronic equipment and storage medium
CN115982183A (en) Data difference updating method and device based on custom path
CN113037420B (en) Reading time stamp obtaining method and device, electronic equipment and storage medium
CN113411364B (en) Resource acquisition method and device and server
CN115118583A (en) Log query method and device, electronic equipment and computer readable storage equipment
CN112783843A (en) Data reading method and device and electronic equipment
CN113163027A (en) Data identifier generation method, device, equipment and storage medium
CN111291127A (en) Data synchronization method, device, server and storage medium
CN111680014A (en) Shared file acquisition method and device, electronic equipment and storage medium
CN112035498A (en) Data block scheduling method and device, scheduling layer node and storage layer node
CN111104528A (en) Picture obtaining method and device and client
CN111163088B (en) Message processing method, system and device and electronic equipment
CN112543213B (en) Data processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination