A data update checking method, device, equipment and storage medium
By determining the target number of bytes and generating a bitmap snapshot for comparison, the problems of low efficiency and poor accuracy in traditional data update methods are solved, and efficient and accurate data update checks are achieved.
Patent Information
- Application Number
- CN202211501303.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-28
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-11-28
AI Technical Summary
Traditional methods are inefficient and cannot accurately capture data update information during the data update process, especially when uploading in batches, as network latency and inconsistent time spans can lead to data disorder.
By obtaining the target number of bytes in the newly added array set, an initial array is created, the target array is determined, a bitmap snapshot is generated, and a comparison is made to obtain the data update check results.
It enables efficient and accurate determination of data update status, solving the problems of low efficiency and poor accuracy in traditional methods.
Smart Images

Figure CN115757051B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to a data update checking method and device, equipment and a storage medium. BACKGROUND
[0002] In many technical fields, there is a process of collecting data and updating data, wherein the collected data is inevitably too large, so generally a batch uploading method is used for data updating. However, the time length of different batches of data may be different, and there may be network delays, so the data uploaded in the original order may be disturbed after updating, or the old data may be uploaded after the new data is uploaded, so the data updating situation cannot be determined.
[0003] In the traditional way, the user can write a log to record the uploading time of each batch of data. The latest update record is obtained according to the log, but this way is low in efficiency and cannot accurately obtain the data updating situation. SUMMARY
[0004] Therefore, the present application provides a data update checking method and device, equipment and a storage medium to solve the problem that in the traditional way, the user can write a log to record the uploading time of each batch of data. The latest update record is obtained according to the log, but this way is low in efficiency and cannot accurately obtain the data updating situation.
[0005] To achieve the above purpose, the present scheme is as follows:
[0006] In a first aspect, a data update checking method comprises:
[0007] In response to a user's request instruction for data update checking, an added array set is obtained;
[0008] A target byte number corresponding to the added array set is determined;
[0009] An initial array is established based on the target byte number and a first preset threshold;
[0010] According to the initial array, a target array corresponding to each added array in the added array set is determined;
[0011] According to each target array, a bitmap snapshot corresponding to each added array is generated;
[0012] The bitmap snapshots are compared to obtain a target comparison result, so as to complete the data update checking process.
[0013] Preferably, the target byte number corresponding to the added array set is determined by:
[0014] Obtain the first time, the second time, and the minimum time granularity corresponding to the newly added data set;
[0015] Subtract the first time from the second time to obtain the time difference;
[0016] Divide the time difference by the minimum time granularity to obtain the first parameter;
[0017] Divide the first parameter by the first preset threshold to obtain the second parameter;
[0018] The integer corresponding to the second parameter is selected based on the first preset rule, and the integer corresponding to the second parameter is used as the target number of bytes.
[0019] Preferably, determining the target arrays corresponding to each new array in the set of new arrays based on the initial array includes:
[0020] For each newly added array in the set of newly added arrays, determine the start byte and end byte of the newly added array relative to the initial array;
[0021] A first start bit is determined from the start byte and a first end bit is determined from the end byte;
[0022] Create an assignment array corresponding to the initial array;
[0023] Based on the first start position and the first end position, determine the second start position and the second end position of the assignment array.
[0024] The second preset threshold is assigned to the second start position, the second end position, and all positions between the second start position and the second end position to obtain the second array;
[0025] Perform a first target operation on the second array and the initial array to obtain the target array corresponding to the newly added array.
[0026] Preferably, determining the start and end bytes of the newly added array relative to the initial array includes:
[0027] Obtain the first time, minimum time granularity, start time, and end time corresponding to the newly added data set;
[0028] The first time, the minimum time granularity, and the start time corresponding to the newly added array are calculated according to the first rule to determine the initial byte;
[0029] The first time, the minimum time granularity, and the end time corresponding to the new array are subjected to a first rule calculation to determine the end byte.
[0030] Preferably, the determining of the first start bit from the start byte comprises:
[0031] The first time, the minimum time granularity, and the end time corresponding to the new array are subjected to a first rule calculation to determine the end byte.
[0032] The first time is subtracted from the start time to obtain a first calculation result.
[0033] The time difference is divided by the minimum time granularity to obtain a second calculation result.
[0034] The first calculation result is subjected to a remainder calculation with a first preset threshold to obtain a third calculation result.
[0035] The third calculation result corresponding to an integer is selected based on a first preset rule to determine the first start bit of the initial byte.
[0036] Preferably, the comparison of the bitmap snapshots obtains a target comparison result, which comprises:
[0037] The target times corresponding to the bitmap snapshots are obtained.
[0038] The target times are sorted in a chronological order to obtain a target order.
[0039] All the bitmap snapshots are subjected to an exclusive OR operation in the target order to obtain updated bits and updated times corresponding to the updated bits.
[0040] The updated bits and the updated times corresponding to the updated bits are integrated to obtain the target comparison result.
[0041] In a second aspect, a data update checking device comprises:
[0042] A response module is configured to obtain a new array set in response to a request instruction of a user for data update checking.
[0043] A target byte number determination module is configured to determine a target byte number corresponding to the new array set.
[0044] An initial array establishment module is configured to establish an initial array based on the target byte number and a first preset threshold.
[0045] A target array determination module is configured to determine target arrays corresponding to each new array in the new array set based on the initial array.
[0046] a bitmap snapshot generation module configured to generate, according to each target array, each bitmap snapshot corresponding to each new array;
[0047] a comparison module configured to compare each bitmap snapshot to obtain a target comparison result, so as to complete the process of checking data update.
[0048] Preferably, the target byte number determination module comprises:
[0049] a first parameter acquisition module configured to acquire a first time, a second time and a minimum time granularity corresponding to the new data set;
[0050] a time difference value calculation module configured to subtract the first time from the second time to obtain a time difference value;
[0051] a first parameter calculation module configured to divide the time difference value by the minimum time granularity to obtain a first parameter;
[0052] a second parameter calculation module configured to divide the first parameter by a first preset threshold to obtain a second parameter;
[0053] a selection module configured to select an integer corresponding to the second parameter based on a first preset rule, and take the integer corresponding to the second parameter as the target byte number.
[0054] In a third aspect, a checking device for data update is provided, comprising a memory and a processor.
[0055] The memory is configured to store a program.
[0056] The processor is configured to execute the program to implement each step of the checking method for data update according to any one of the first aspect.
[0057] In a fourth aspect, a storage medium is provided, which stores a computer program. When the computer program is executed by a processor, each step of the checking method for data update according to the first aspect is implemented.
[0058] From the above technical solution can be seen, the present application is by responding to the user data update check request instruction, obtain the new array set; determine the target byte number corresponding to the new array set; based on the target byte number and the first preset threshold to establish the initial array; according to the initial array, determine the target array corresponding to each new array in the new array set; according to each target array, generate each bitmap snapshot corresponding to each new array; each bitmap snapshot is compared, the target comparison result is obtained, to complete the process of data update check. The scheme determines the target byte number of each new array set, and then establishes the initial array to determine the target array corresponding to each new array, so as to compare each target array to obtain the target comparison result, which can accurately obtain the update of the data. BRIEF DESCRIPTION OF DRAWINGS
[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only a part of the embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of the provided drawings.
[0060] Figure 1 An optional flowchart of a data update checking method provided by the embodiment of the present application;
[0061] Figure 2 A schematic diagram of a new array provided by the embodiment of the present application;
[0062] Figure 3 An array comparison schematic diagram provided by the embodiment of the present application;
[0063] Figure 4 A structure schematic diagram of a data update checking device provided by the embodiment of the present application;
[0064] Figure 5 A structure schematic diagram of a data update checking device provided by the embodiment of the present application. DETAILED DESCRIPTION
[0065] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0066] There is a process of collecting data and updating data in many technical fields, wherein the collected data is inevitably too large, so that a batch uploading manner is generally used for data updating, but different batches of data may span different lengths of time, and in addition, there is network delay, so that the data uploaded in the original order may be disturbed after updating, or the old data may be uploaded after the new data is uploaded, so that the updating of the data cannot be clearly determined.
[0067] In the traditional manner, a user can write a log to record the uploading time of each batch of data. The latest updating record is obtained according to the log, but this manner is relatively low in efficiency, and the updating of the data cannot be accurately obtained.
[0068] In order to solve the above defects, an embodiment of the present application provides a data updating checking method, which can be applied to various computer terminals or intelligent terminals, and the execution subject can be a processor or a server of the computer terminal or the intelligent terminal, and the method flowchart of the method is as shown in Figure 1 , and specifically includes:
[0069] S1: In response to a request instruction of a user for data updating checking, a new array set is obtained.
[0070] In the present application, when data is generated, because the data amount is large, the data is divided into multiple batches or multiple files, so that first, in response to a request instruction of a user for data updating checking, all data generated in a period of time is obtained, and the all data is composed into a new array set.
[0071] S2: A target byte number corresponding to the new array set is determined.
[0072] For the new array set, a target byte number is determined. In an example, the new array set includes multiple new arrays, and the byte number of each new array is the same, so that there is a target byte number corresponding to the new array set.
[0073] S3: An initial array is established based on the target byte number and a first preset threshold.
[0074] It can be understood that an array includes multiple bytes, and each byte is divided into multiple bits. In an example, the expression of a new array is as shown in Figure 2 , please refer to Figure 2 , the byte number of the new array is 3, including a first byte, a second byte and a third byte; each byte includes 8 bits, and the new array includes 24 bits. Therefore, the target byte number of the new array is 3, and the first preset threshold can be set to 0. In another example, an initial array including only one byte can be expressed as: 00000000.
[0075] S4: determining each target array corresponding to each new array in the new array set according to the initial array.
[0076] For each new array, if the initial array is 00000000, then the new array is operated with the initial array, such as XOR operation, and each bit of the target array corresponding to the new array obtained is the same as each bit of the new array.
[0077] S5: generating each bitmap snapshot corresponding to each new array according to each target array.
[0078] S6: comparing each bitmap snapshot to obtain a target comparison result, so as to complete the process of data update checking.
[0079] From the above technical solution, it can be seen that the application obtains a new array set in response to a user's request instruction for data update checking; determines a target byte number corresponding to the new array set; establishes an initial array based on the target byte number and a first preset threshold; determines each target array corresponding to each new array in the new array set according to the initial array; generates each bitmap snapshot corresponding to each new array according to each target array; compares each bitmap snapshot to obtain a target comparison result, so as to complete the process of data update checking. The scheme determines the target byte number of each new array set, then establishes an initial array, to determine the target array corresponding to each new array, and then compares each target array to obtain a target comparison result, so as to accurately obtain the update of the data.
[0080] In the method provided by the embodiment of the application, the process of determining the target byte number corresponding to the new array set is specifically described as follows:
[0081] S21: obtaining a first time, a second time and a minimum time granularity corresponding to the new data set.
[0082] S22: subtracting the first time from the second time to obtain a time difference value.
[0083] S23: dividing the time difference value by the minimum time granularity to obtain a first parameter.
[0084] S24: dividing the first parameter by a first preset threshold to obtain a second parameter.
[0085] S25: selecting an integer corresponding to the second parameter based on a first preset rule, and taking the integer corresponding to the second parameter as the target byte number.
[0086] In the above scheme, the total data time corresponding to each new array can be obtained, the new array with the shortest total data time is selected, and the total data time of the new array is taken as the minimum time granularity of the new array set. In addition, the first time corresponding to the new data set can be set as the start collection time of the new array set, such as 8 am in the morning, and the second time corresponding to the new data set can be set as the end collection time of the new array set, such as 6 pm in the afternoon. This embodiment is not limited in this regard.
[0087] Specifically, the first time is denoted as ST, the second time is denoted as ET, the minimum time granularity is denoted as UT, and the first preset threshold is set as 8. Then, steps S21, S23 and S24 are expressed by the formula: (ET-ST) / UT / 8, and the first preset rule is to take the integer part, i.e., the total formula is ceil((ET-ST) / UT / 8), where ceil represents taking the integer part.
[0088] In one example, if the calculated second parameter is 1.8, the integer corresponding to 1.8 is 2, and thus the target byte number is 2.
[0089] In one example, if the minimum time granularity is 1 minute, and if a vehicle collects 24 hours of data, the number of bytes represented by the collected data is 60*24.
[0090] The above scheme describes the process of determining the target byte number corresponding to the new array set in the present application. The process of determining each target array corresponding to each new array in the new array set according to the initial array in the present application is described in detail as follows.
[0091] S41: For each new array in the new array set, determine the start byte and the end byte corresponding to the new array relative to the initial array.
[0092] Specifically, determining the start byte and the end byte corresponding to the new array relative to the initial array can be understood as the start byte and the end byte of the new array if placed in the initial array, i.e., the positions of the start byte and the end byte in the initial array, such as the position of the start byte in the initial array and the position of the end byte in the initial array.
[0093] The process can specifically include:
[0094] obtaining a first time corresponding to the new data set, a minimum time granularity, a start time corresponding to the new data set, and an end time corresponding to the new data set; performing first rule calculation on the first time, the minimum time granularity, and the start time corresponding to the new data set to determine the initial byte; and performing first rule calculation on the first time, the minimum time granularity, and the end time corresponding to the new data set to determine the end byte.
[0095] In one example, the start time of the new data set is represented as NST, the end time is represented as NET, the first preset threshold is 8, and the first rule calculation is performed by using the formula: floor((NST-ST) / UT / 8) to calculate the start byte, where floor represents rounding down. For example, if 1.8 is calculated, the integer corresponding to 1.8 is 1. In calculating the end byte, the first rule calculation is performed by using the first formula: floor((NET-ST) / UT / 8).
[0096] S42: determining a first start bit from the start byte and a first end bit from the end byte.
[0097] Specifically, a first time corresponding to the new data set, a minimum time granularity, and a start time corresponding to the new data set are obtained; the first time is subtracted by the start time to obtain a first calculation result; the time difference is divided by the minimum time granularity to obtain a second calculation result; the first calculation result is taken modulo a first preset threshold to obtain a third calculation result; and an integer corresponding to the third calculation result is selected based on a first preset rule to determine a first start bit of the initial byte.
[0098] The calculation formula is: first start bit floor((NST-ST) / UT)%8, and the first number of bytes is floor((NET-ST) / UT)%8, where % represents modulo.
[0099] S43: establishing an assignment array corresponding to the initial array.
[0100] It can be understood that the assignment array has the same number of bytes as the initial array.
[0101] S44: determining a second start bit and a second end bit of the assignment array according to the first start bit and the first end bit.
[0102] S45: assigning a second preset threshold to the second start bit, the second end bit, and all bits between the second start bit and the second end bit to obtain a second array.
[0103] The second start bit and the second end bit and all bits between the second start bit and the second end bit are assigned a second preset threshold value, which can be set to 1.
[0104] In one example, the start byte and the end byte are the same byte, and if the second start bit is the third bit and the second end bit is the fifth bit, the byte can be represented as 00011100, which can also be referred to as a taste mask. In another example, if the start byte and the end byte are not the same byte, for example, the start byte is the second byte and the end byte is the fourth byte, and if the second start bit is the third bit and the second end bit is the fifth bit, the three bytes can be represented together as: 000111111111111111111100.
[0105] S46: Perform a first target operation on the second array and the initial array to obtain a target array corresponding to the new array.
[0106] The first target operation can be an XOR operation.
[0107] The process of comparing each bit map snapshot in the present application to obtain a target comparison result is described below.
[0108] Obtain each target time corresponding to each bit map snapshot; sort each target time in chronological order to obtain a target order; perform an XOR operation on all bit map snapshots in the target order to obtain each update bit and each update time corresponding to each update bit; and integrate each update bit and each update time corresponding to each update bit to obtain a target comparison result.
[0109] Optionally, the target time can be the generation time of the new array or file corresponding to the bit map snapshot. Although the XOR operation can not consider the chronological order, if the XOR operation is performed according to the target time, it can be known which part is updated and the update time of each batch or each file compared to the previous batch or the previous file.
[0110] In one example, please refer to Figure 3 , Figure 3For array contrast chart, the first time of the new array set is 8:00, the minimum time granularity is half an hour, between 8:00-8:30, one of the new array bitmap is 8 bits, respectively as the first bit, the second bit, …, the eighth bit, then if the second new array start time is 8:45, it is considered that the second bit of the previous new array is updated. In a special case, if the first time and the second time of the first new array are 8:15 and 8:45 respectively, then after the XOR operation of the first new array and the second new array, the first bit and the second bit of the new array are both 1. If the first time of the second new array is 8:45, since each bit represents a time interval of the minimum time granularity, the end time of the second new array must be more than 9:15.
[0111] With Figure 1 Corresponding to the method, the embodiment of the application also provides a data update checking device for checking Figure 1 The data update checking device provided by the embodiment of the application can be in a computer terminal or various mobile devices, and in combination with Figure 4 The data update checking device is introduced as follows, as shown in the figure, the device can include: Figure 4 The response module 10 is used for responding to the request instruction of the user for data update checking, and acquiring a new array set;
[0112] The target byte number determination module 20 is used for determining a target byte number corresponding to the new array set;
[0113] The initial array establishment module 30 is used for establishing an initial array based on the target byte number and a first preset threshold;
[0114] The target array determination module 40 is used for determining each target array corresponding to each new array in the new array set according to the initial array;
[0115] The bitmap snapshot generation module 50 is used for generating each bitmap snapshot corresponding to each new array according to each target array;
[0116] The comparison module 60 is used for comparing each bitmap snapshot to obtain a target comparison result, so as to complete the process of data update checking.
[0117]
[0118] It can be seen from the technical solution that the application obtains a new array set in response to a request instruction of a user for data update checking, determines a target byte number corresponding to the new array set, establishes an initial array based on the target byte number and a first preset threshold, determines each target array corresponding to each new array in the new array set according to the initial array, generates each bitmap snapshot corresponding to each new array according to each target array, compares each bitmap snapshot to obtain a target comparison result, and completes the process of data update checking. The scheme determines the target byte number of each new array set, then establishes an initial array to determine the target array corresponding to each new array, compares each target array to obtain a target comparison result, and can accurately obtain the update of data.
[0119] In one example, the target byte number determination module 20 can include:
[0120] A first parameter acquisition module is configured to acquire a first time, a second time, and a minimum time granularity corresponding to the new data set;
[0121] A time difference calculation module is configured to subtract the first time from the second time to obtain a time difference;
[0122] A first parameter calculation module is configured to divide the time difference by the minimum time granularity to obtain a first parameter;
[0123] A second parameter calculation module is configured to divide the first parameter by a first preset threshold to obtain a second parameter;
[0124] A selection module is configured to select an integer corresponding to the second parameter based on a first preset rule, and take the integer corresponding to the second parameter as the target byte number.
[0125] In one example, the target array determination module 40 can include:
[0126] A byte determination module is configured to determine, for each new array in the new array set, a start byte and an end byte of the new array relative to the initial array;
[0127] A first bit determination module is configured to determine a first start bit from the start byte and a first end bit from the end byte;
[0128] An assignment array establishment module is configured to establish an assignment array corresponding to the initial array;
[0129] A second bit determination module is configured to determine a second start bit and a second end bit of the assignment array according to the first start bit and the first end bit,
[0130] The second array determination module is configured to assign a second preset threshold value to the second start bit, the second end bit, and all bits between the second start bit and the second end bit to obtain a second array.
[0131] The first target operation module is configured to perform a first target operation on the second array and the initial array to obtain a target array corresponding to the new array.
[0132] In one example, the byte determination module can include:
[0133] The second acquisition module is configured to acquire a first time corresponding to the new data set, a minimum time granularity, a start time corresponding to the new array, and an end time corresponding to the new array.
[0134] The initial byte calculation module is configured to perform a first rule calculation on the first time, the minimum time granularity, and the start time corresponding to the new array to determine the initial byte.
[0135] The end byte module is configured to perform a first rule calculation on the first time, the minimum time granularity, and the end time corresponding to the new array to determine the end byte.
[0136] In one example, the first bit determination module can include:
[0137] The third acquisition module is configured to acquire a first time corresponding to the new data set, a minimum time granularity, and a start time corresponding to the new array.
[0138] The first calculation module is configured to subtract the start time from the first time to obtain a first calculation result.
[0139] The second calculation module is configured to divide the time difference by the minimum time granularity to obtain a second calculation result.
[0140] The remainder module is configured to perform a remainder calculation on the first calculation result and a first preset threshold value to obtain a third calculation result.
[0141] The second rounding module is configured to select an integer corresponding to the third calculation result based on a first preset rule to determine a first start bit of the initial byte.
[0142] In one example, the comparison module 60 can include:
[0143] The target time determination module is configured to acquire respective target times corresponding to respective bit map snapshots.
[0144] The sorting module is configured to sort the respective target times in chronological order to obtain a target order.
[0145] an update determining module, configured to perform XOR operation on all bitmap snapshots in sequence according to the target order to obtain each update bit and each update time corresponding to the update bit;
[0146] an integrating module, configured to integrate each update bit and each update time corresponding to the update bit to obtain a target comparison result.
[0147] Further, the embodiment of the present application provides a data update checking device. Figure 5 A hardware structure block diagram of the data update checking device is shown, referring to Figure 5 The hardware structure of the data update checking device can include at least one processor 01, at least one communication interface 02, at least one memory 03 and at least one communication bus 04.
[0148] In the embodiment of the present application, the number of the processor 01, the communication interface 02, the memory 03 and the communication bus 04 is at least one, and the processor 01, the communication interface 02 and the memory 03 complete the communication with each other through the communication bus 04.
[0149] The processor 01 can be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiment of the present application, etc.
[0150] The memory 03 can include a high-speed RAM memory, and can also include a non-volatile memory, etc., such as at least one disk memory.
[0151] The memory stores a program, and the processor can call the program stored in the memory, and the program is used to execute the following data update checking method, which includes:
[0152] In response to a request instruction of the user for data update checking, an added array set is acquired;
[0153] A target byte number corresponding to the added array set is determined;
[0154] An initial array is established based on the target byte number and a first preset threshold;
[0155] According to the initial array, each target array corresponding to each added array in the added array set is determined;
[0156] According to each target array, each bitmap snapshot corresponding to each added array is generated;
[0157] Comparing each bitmap snapshot to obtain a target comparison result, so as to complete the process of the data update check.
[0158] Optionally, the refinement function and the extension function of the program can refer to the description of the data update check method in the method embodiment.
[0159] The embodiment of the present application further provides a storage medium which can store a program suitable for processor execution, and when the program runs, controls a device where the storage medium is located to execute the following data update check method, comprising:
[0160] In response to a request instruction of a user for data update check, obtaining a new array set;
[0161] Determining a target byte number corresponding to the new array set;
[0162] Based on the target byte number and a first preset threshold, establishing an initial array;
[0163] According to the initial array, determining each target array corresponding to each new array in the new array set;
[0164] According to each target array, generating each bitmap snapshot corresponding to each new array;
[0165] Comparing each bitmap snapshot to obtain a target comparison result, so as to complete the process of the data update check. Specifically, the storage medium can be a computer readable storage medium, which can be an electronic storage such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk or a ROM.
[0166] Optionally, the refinement function and the extension function of the program can refer to the description of the data update check method in the method embodiment.
[0167] In addition, each functional module in each embodiment of the present disclosure can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part. If the function is realized in the form of a software functional module and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present disclosure essentially or say the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions to make a computer device (which can be a personal computer, a live device or a network device, etc.) execute all or part of the steps of the method of each embodiment of the present disclosure.
[0168] Finally, it should be noted that the terms "first", "second", and the like, herein do not denote any order, quantity, combination, or importance, but rather are used to distinguish one element from another, and are not intended to denote the presence of any such actual relationship or order. Moreover, the terms "comprises", "comprising", or any other variations 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 can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0169] The various embodiments in the specification are described in progressive order with reference to each embodiment, each embodiment highlighting differences from other embodiments, and the same or similar elements in the various embodiments are described with reference to each other where possible.
[0170] The above description of disclosed embodiments provides enabling concepts for a person skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for checking data updates, characterized in that, include: In response to a user's request to check for data updates, retrieve the newly added array collection; Determining the target number of bytes corresponding to the newly added array set includes: obtaining a first time, a second time, and a minimum time granularity corresponding to the newly added array set; subtracting the first time from the second time to obtain a time difference; dividing the time difference by the minimum time granularity to obtain a first parameter; dividing the first parameter by a first preset threshold to obtain a second parameter; selecting the integer corresponding to the second parameter based on a first preset rule, and using the integer corresponding to the second parameter as the target number of bytes. An initial array is established based on the target number of bytes and a first preset threshold; the number of bytes in the initial array is the same as the target number of bytes, and each bit in each byte of the initial array is the first preset threshold. Determining each target array corresponding to each newly added array in the set of newly added arrays based on the initial array includes: for each newly added array in the set of newly added arrays, determining the start byte and end byte of the newly added array relative to the initial array; determining a first start position from the start byte and a first end position from the end byte; establishing an assignment array corresponding to the initial array, wherein the assignment array has the same number of bytes as the initial array; determining a second start position and a second end position of the assignment array based on the first start position and the first end position, assigning a second preset threshold to the second start position, the second end position, and all bits between the second start position and the second end position to obtain a second array; and performing an XOR operation between the second array and the initial array to obtain the target array corresponding to the newly added array. Based on each target array, generate a bitmap snapshot corresponding to each newly added array; The various bitmap snapshots are compared to obtain the target comparison result, thus completing the process of checking data updates.
2. The method according to claim 1, characterized in that, Determining the start and end bytes of the newly added array relative to the initial array includes: Obtain the first time, minimum time granularity, start time, and end time corresponding to the newly added array set; The first time, the minimum time granularity, and the start time corresponding to the newly added array are calculated using the first rule to determine the start byte; The first time, the minimum time granularity, and the end time corresponding to the newly added array are calculated using the first rule to determine the end byte.
3. The method according to claim 1, characterized in that, Determining the first start bit from the start byte includes: Obtain the first time, minimum time granularity, and start time corresponding to the newly added array set; Subtract the start time from the first time to obtain the first calculation result; Divide the first calculation result by the minimum time granularity to obtain the second calculation result; The first calculation result is moduloed by the first preset threshold to obtain the third calculation result; The integer corresponding to the third calculation result is selected based on the first preset rule to determine the first start bit of the start byte.
4. The method according to claim 1, characterized in that, By comparing the various bitmap snapshots, the target comparison results are obtained, including: Obtain the target time corresponding to each bitmap snapshot; The target times are sorted in chronological order to obtain the target sequence; Perform an XOR operation on all bitmap snapshots sequentially according to the target order to obtain each update bit and the corresponding update time for each update bit; The update bits and their corresponding update times are integrated to obtain the target comparison results.
5. A data update checking device, characterized in that, include: The response module is used to respond to user requests for data update checks and to retrieve the newly added array collection; A target byte count determination module is used to determine the target byte count corresponding to the newly added array set; it includes: a first parameter acquisition module, used to acquire a first time, a second time, and a minimum time granularity corresponding to the newly added array set; a time difference calculation module, used to subtract the first time from the second time to obtain a time difference; a first parameter calculation module, used to divide the time difference by the minimum time granularity to obtain a first parameter; a second parameter calculation module, used to divide the first parameter by a first preset threshold to obtain a second parameter; and a selection module, used to select the integer corresponding to the second parameter based on a first preset rule, and use the integer corresponding to the second parameter as the target byte count; An initial array creation module is used to create an initial array based on the target number of bytes and a first preset threshold; the number of bytes in the initial array is the same as the target number of bytes, and each bit in each byte of the initial array is the first preset threshold; A target array determination module is used to determine each target array corresponding to each newly added array in the set of newly added arrays based on the initial array; including: for each newly added array in the set of newly added arrays, determining the start byte and end byte of the newly added array relative to the initial array; determining a first start position from the start byte and a first end position from the end byte; establishing an assignment array corresponding to the initial array, wherein the assignment array has the same number of bytes as the initial array; determining a second start position and a second end position of the assignment array based on the first start position and the first end position, assigning a second preset threshold to the second start position, the second end position, and all bits between the second start position and the second end position to obtain a second array; and performing an XOR operation between the second array and the initial array to obtain the target array corresponding to the newly added array; The bitmap snapshot generation module is used to generate bitmap snapshots corresponding to each newly added array based on each target array. The comparison module is used to compare the various bitmap snapshots to obtain the target comparison result, thereby completing the data update check process.
6. A data update inspection device, characterized in that, Including memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement the steps of the data update checking method as claimed in any one of claims 1-4.
7. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the data update checking method as claimed in any one of claims 1-4.
Citation Information
Patent Citations
Data filtering method, and device and data reading system
CN105938457A
Time period duplicate removal processing method and device, terminal equipment and storage medium
CN115168320A