Data verification methods, devices, electronic equipment and storage media

CN115374154BActive Publication Date: 2026-09-01BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210938215.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-05
Publication Date
2026-09-01
Estimated Expiration
2042-08-05

AI Technical Summary

Technical Problem

[0003]本公开提供一种数据验证方法、装置、电子设备及存储介质,以至少解决相关技术中无法快速、灵活地验证缓存数据的动态变化的问题

Benefits of technology

[0073] This disclosure determines target data filtering fields based on target application cache data verification requests; determines a target dataset based on a preset database and the target data filtering fields; the preset database stores target cache fields corresponding to the target cache data; the target cache fields include the target data filtering fields and target cache values; the target dataset includes the target cache values ​​corresponding to the target data filtering fields; and matches the target dataset with the operation data of the target application to obtain the verification result of the target cache data. This disclosure achieves rapid acquisition of cache values ​​corresponding to cache data by storing cache fields corresponding to cache data in a preset database and filtering cache values ​​from the cache fields according to the data filtering fields to obtain the target dataset, thereby enabling rapid verification of cache data. This disclosure also achieves cache data verification by matching the target dataset with the operation data of the target application to obtain the verification result of the target cache data, thus avoiding interruption of the cache data operation process in the target application, effectively avoiding frequent switching between cache data operation and cache data verification, and improving the operation and verification efficiency of cache data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115374154B_ABST
    Figure CN115374154B_ABST
Patent Text Reader

Abstract

This disclosure relates to a data verification method, apparatus, electronic device, and storage medium. The method includes: determining target data filtering fields based on a target application's target cached data verification request; determining a target dataset based on a preset database and the target data filtering fields; the preset database is used to store target cache fields corresponding to the target cached data; the target cache fields include target data filtering fields and target cache values; the target dataset includes target cache values ​​corresponding to the target data filtering fields; and matching the target dataset with the operation data of the target application to obtain a verification result of the target cached data. This disclosure achieves rapid retrieval of cache values ​​corresponding to cached data by storing cache fields corresponding to cached data in a preset database and filtering cache values ​​from the cache fields according to the data filtering fields to obtain the target dataset, thereby enabling rapid verification of cached data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a data verification method, apparatus, electronic device, and storage medium. Background Technology

[0002] In related technologies, verifying the addition, modification, and deletion of cached data is quite cumbersome. Cached data retrieved directly from the cache is often garbled, requiring decoding before it can be read. Although logging can avoid interference from garbled characters and save time logging into the cache, logs are cleared during service redeployment and machine restarts. Therefore, with a log-based solution, real-time monitoring of logs is necessary to verify dynamic changes in cached data. Summary of the Invention

[0003] This disclosure provides a data verification method, apparatus, electronic device, and storage medium to at least solve the problem in related technologies of the inability to quickly and flexibly verify dynamic changes in cached data. The technical solution of this disclosure is as follows:

[0004] According to a first aspect of the present disclosure, a data verification method is provided, comprising:

[0005] Based on the target application's target cached data verification request, determine the target data filtering fields;

[0006] Based on a preset database and the target data filtering fields, a target dataset is determined; the preset database is used to store the target cache fields corresponding to the target cache data; the target cache fields include the target data filtering fields and target cache values; the target dataset includes the target cache values ​​corresponding to the target data filtering fields.

[0007] The target dataset is matched with the operation data of the target application to obtain the verification result of the target cache data.

[0008] In one exemplary embodiment, the target data filtering field includes at least one of a target application identifier and a target cache key, and the method for constructing the preset database includes:

[0009] Obtain cached data corresponding to a preset application, wherein the preset application includes the target application; the cached data is data from a cache database.

[0010] The cached data is parsed to obtain the cache fields corresponding to the cached data; the cache fields include the application identifier, the cache key, and the cache value.

[0011] The preset database is constructed based on the correspondence between the application identifier, the cache key, and the cache value.

[0012] In one exemplary embodiment, the target data filtering field includes at least one of a target application identifier and a target cache key, and the method for constructing the preset database includes:

[0013] Obtain cached data corresponding to a preset application, wherein the preset application includes the target application;

[0014] The cached data is parsed to obtain the cache fields corresponding to the cached data; the cache fields include the application identifier, the cache key, and the cache value.

[0015] The preset database is constructed based on the correspondence between the application identifier, the cache key, and the cache value.

[0016] In one exemplary implementation, the target data filtering field includes the target application identifier and the target cache key. The step of determining the target dataset based on a preset database and the target data filtering field includes:

[0017] Search the preset database for a first dataset that matches the target application identifier; the first dataset includes the correspondence between cache keys and cache values.

[0018] The target dataset is obtained by searching for a cache value in the first dataset that matches the target cache key.

[0019] In one exemplary embodiment, the target data filtering field further includes a data sorting strategy, the caching field further includes data operation time, and the first dataset includes a correspondence between cache keys, cache values, and data operation times; the step of finding a cache value matching the target cache key in the first dataset to obtain the target dataset includes:

[0020] Find a second dataset from the first dataset that matches the target cache key; the second dataset includes the correspondence between the target cache value and the data operation time.

[0021] Based on the data sorting strategy and the data operation time corresponding to each target cache value in the second dataset, the target cache values ​​in the second dataset are sorted to obtain the target dataset.

[0022] In one exemplary embodiment, the target data filtering field further includes target scenario information of the target application, the cache field further includes scenario information of the preset application, and the first dataset includes a correspondence between cache keys, cache values, and scenario information; the step of finding a cache value matching the target cache key in the first dataset to obtain the target dataset includes:

[0023] Find a third dataset from the first dataset that matches the target cache key, wherein the third dataset includes the correspondence between cache values ​​and scene information;

[0024] The target dataset is obtained by searching for cached values ​​in the third dataset that match the target scene information.

[0025] In one exemplary embodiment, the target data filtering field further includes a target operation type identifier, the cache field further includes an operation type identifier, and the first dataset includes a correspondence between cache keys, cache values, and operation type identifiers; the step of searching for a cache value matching the target cache key in the first dataset to obtain the target dataset includes:

[0026] Find a fourth dataset from the first dataset that matches the target cache key; the fourth dataset includes the correspondence between operation type identifiers and cache values;

[0027] The target dataset is obtained by finding a cached value in the fourth dataset that matches the target operation type identifier.

[0028] In one exemplary embodiment, after constructing the preset database based on the correspondence between the application identifier, the data filtering field, and the cached value, the method further includes:

[0029] Obtain the update cache data corresponding to the preset application;

[0030] The updated cache data is parsed to obtain the updated cache field;

[0031] Based on the updated data filter field in the updated cache field, the original cache field corresponding to the updated data filter field is searched in the preset database;

[0032] Replace the original cache field with the updated cache field.

[0033] In one exemplary implementation, determining the target data filtering field based on the target application's target cached data verification request includes:

[0034] The system receives a target cache data verification request from the target application, sent in response to a command triggered by a target cache data filtering control. The target cache data verification request carries the target data filtering field.

[0035] The method further includes:

[0036] The target dataset and the verification result of the target cached data are sent to the client; the client is used to display the target dataset and the verification result.

[0037] According to a second aspect of the present disclosure, a data verification apparatus is provided, comprising:

[0038] The target field determination module is configured to execute a target cached data verification request based on the target application to determine the target data filtering fields;

[0039] The target dataset determination module is configured to determine the target dataset based on a preset database and the target data filtering fields; the preset database is used to store the target cache fields corresponding to the target cache data; the target cache fields include the target data filtering fields and target cache values; the target dataset includes the target cache values ​​corresponding to the target data filtering fields.

[0040] The verification result determination module is configured to perform a matching operation between the target dataset and the target application's operation data to obtain the verification result of the target cache data.

[0041] In one exemplary embodiment, the target data filtering field includes at least one of a target application identifier and a target cache key, and the apparatus further includes:

[0042] The cache data acquisition module is configured to acquire cache data corresponding to a preset application, wherein the preset application includes the target application;

[0043] The data parsing module is configured to parse the cached data to obtain the cache fields corresponding to the cached data; the cache fields include an application identifier, a cache key, and a cache value;

[0044] The preset database construction module is configured to construct the preset database based on the correspondence between the application identifier, the cache key, and the cache value.

[0045] In one exemplary implementation, the target data filtering field includes the target application identifier and the target cache key, and the target dataset determination module includes:

[0046] The first dataset lookup unit is configured to search the preset database for a first dataset that matches the target application identifier; the first dataset includes a mapping between cache keys and cache values.

[0047] The target dataset determination unit is configured to perform a search in the first dataset for a cache value that matches the target cache key, thereby obtaining the target dataset.

[0048] In one exemplary embodiment, the target data filtering field further includes a data sorting strategy, the caching field further includes data operation time, and the first dataset includes a correspondence between cache keys, cache values, and data operation times; the target dataset determination unit includes:

[0049] The second dataset lookup subunit is configured to perform a search in the first dataset for a second dataset that matches the target cache key; the second dataset includes a correspondence between the target cache value and the data operation time.

[0050] The first target dataset determination subunit is configured to sort the target cache values ​​in the second dataset according to the data sorting strategy and the data operation time corresponding to each target cache value in the second dataset, thereby obtaining the target dataset.

[0051] In one exemplary embodiment, the target data filtering field further includes target scenario information of the target application, the cache field further includes scenario information of the preset application, and the first dataset includes a correspondence between cache keys, cache values, and scenario information; the target dataset determining unit includes:

[0052] The third dataset lookup subunit is configured to perform a search in the first dataset for a third dataset that matches the target cache key, the third dataset including the correspondence between cache values ​​and scene information;

[0053] The second target dataset determination subunit is configured to perform a search for a cached value that matches the target scene information in the third dataset to obtain the target dataset.

[0054] In one exemplary embodiment, the target data filtering field further includes a target operation type identifier, the cache field further includes an operation type identifier, and the first dataset includes a correspondence between cache keys, cache values, and operation type identifiers; the target dataset determining unit includes:

[0055] The fourth dataset lookup subunit is configured to perform a search in the first dataset for a fourth dataset that matches the target cache key; the fourth dataset includes a mapping between operation type identifiers and cache values;

[0056] The third target dataset determination subunit is configured to perform a search in the fourth dataset for a cached value that matches the target operation type identifier, thereby obtaining the target dataset.

[0057] In one exemplary embodiment, the apparatus further includes:

[0058] The update cache data acquisition module is configured to acquire the update cache data corresponding to the preset application.

[0059] The update cache field determination module is configured to parse the update cache data to obtain the update cache field;

[0060] The original cache field lookup module is configured to perform an operation based on the updated data filtering field in the updated cache field to search for the original cache field corresponding to the updated data filtering field in the preset database;

[0061] The field replacement module is configured to perform the replacement of the original cached field with the updated cached field.

[0062] In one exemplary embodiment, the target field determination module includes:

[0063] The data verification request sending unit is configured to receive a target cache data verification request from the target application sent by the client in response to an instruction triggered based on a target cache data filtering control; the target cache data verification request carries the target data filtering field.

[0064] In one exemplary embodiment, the apparatus further includes:

[0065] The verification result sending unit is configured to send the verification result of the target dataset and the target cached data to the client; the client is used to display the target dataset and the verification result.

[0066] According to a third aspect of the present disclosure, an electronic device is provided, comprising:

[0067] processor;

[0068] Memory used to store the processor's executable instructions;

[0069] The processor is configured to execute the instructions to implement the data verification method described above.

[0070] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided that, when instructions in the computer-readable storage medium are executed by an electronic device processor, enables the electronic device to perform the data verification method as described above.

[0071] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the data verification method described above.

[0072] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:

[0073] This disclosure determines target data filtering fields based on target application cache data verification requests; determines a target dataset based on a preset database and the target data filtering fields; the preset database stores target cache fields corresponding to the target cache data; the target cache fields include the target data filtering fields and target cache values; the target dataset includes the target cache values ​​corresponding to the target data filtering fields; and matches the target dataset with the operation data of the target application to obtain the verification result of the target cache data. This disclosure achieves rapid acquisition of cache values ​​corresponding to cache data by storing cache fields corresponding to cache data in a preset database and filtering cache values ​​from the cache fields according to the data filtering fields to obtain the target dataset, thereby enabling rapid verification of cache data. This disclosure also achieves cache data verification by matching the target dataset with the operation data of the target application to obtain the verification result of the target cache data, thus avoiding interruption of the cache data operation process in the target application, effectively avoiding frequent switching between cache data operation and cache data verification, and improving the operation and verification efficiency of cache data.

[0074] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0075] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0076] Figure 1 This is an application environment diagram illustrating a data verification method according to an exemplary embodiment.

[0077] Figure 2 This is a flowchart illustrating a data verification method according to an exemplary embodiment.

[0078] Figure 3 This is a flowchart illustrating a method for constructing a preset database according to an exemplary embodiment.

[0079] Figure 4 This is a flowchart illustrating a method for determining a target dataset based on a preset database and the target data filtering fields, according to an exemplary embodiment.

[0080] Figure 5 This is an example flowchart illustrating a method for finding a cached value matching the target cache key in the first dataset to obtain the target dataset, according to an exemplary embodiment.

[0081] Figure 6 This is a flowchart example two illustrating a method for finding a cached value matching the target cache key in the first dataset to obtain the target dataset, according to an exemplary embodiment.

[0082] Figure 7 Example 3 is a flowchart illustrating a method for finding a cached value matching the target cache key in the first dataset to obtain the target dataset, according to an exemplary embodiment.

[0083] Figure 8 This is a flowchart illustrating a method for updating a cached field according to an exemplary embodiment.

[0084] Figure 9 This is a flowchart illustrating a method for verifying cached data according to an exemplary embodiment.

[0085] Figure 10 This is a block diagram illustrating a data verification apparatus according to an exemplary embodiment.

[0086] Figure 11 This is a block diagram illustrating an electronic device for data verification according to an exemplary embodiment. Detailed Implementation

[0087] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0088] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0089] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0090] In related technologies, the verification of adding, modifying, and deleting cached data involves the following process:

[0091] 1. [Cache Verification] First, check the cache to confirm that the corresponding data does not exist;

[0092] 2. [Business Operations] Perform new business operations;

[0093] 3. [Cache Verification] First, check the cache to see if the corresponding data exists; if it exists, the addition was successful.

[0094] 4. [Business Operation] First, record the existing cached value, for example, value = A, and then continue to modify the business operation;

[0095] 5. [Cache Verification] First, go directly to the cache and check the corresponding data value; if the value becomes the expected value B, it means the modification was successful;

[0096] 6. [Business Operations] Perform a business deletion operation;

[0097] 7. [Cache Verification] First, go directly to the cache and check if the corresponding data exists; if it does not exist, it means the deletion was successful.

[0098] It is evident that cache verification requires continuous interruption of business operations. For example, in order to verify the addition, modification, and deletion of the entire cache, business operations (2, 4, 6) are constantly interrupted by cache verification (1, 3, 5, 7), and the versatility is poor. If the cached data is retrieved directly from the cache, many garbled characters will be seen, and the cache verification (steps 1, 3, 5, 7) also need to add decoding and conversion of the cached data.

[0099] To enable rapid retrieval of cached values ​​corresponding to cached data, thereby facilitating fast and flexible verification of cached data, this disclosure provides a data verification method, apparatus, electronic device, and storage medium.

[0100] Please see Figure 1 The diagram illustrates an application environment for a data verification method according to an exemplary embodiment. The application environment may include a server 01 and a client 02.

[0101] Specifically, in the embodiments of this specification, server 01 may include a standalone server, a distributed server, or a server cluster composed of multiple servers. It may also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Server 01 may include a network communication unit, a processor, and a memory, etc. Specifically, server 01 can be used to determine a target dataset based on a preset database and the target data filtering fields; the preset database is used to store the target cache fields corresponding to the target cache data; the target cache fields include the target data filtering fields and target cache values; the target dataset includes the target cache values ​​corresponding to the target data filtering fields; the target dataset is matched with the operation data of the target application to obtain the verification result of the target cache data.

[0102] Specifically, in the embodiments of this specification, the client 02 may include physical devices such as smartphones, desktop computers, tablets, laptops, digital assistants, smart wearable devices, and in-vehicle terminals, and may also include software running on the physical device, such as web pages provided to users by some service providers, or applications provided to users by such service providers. Specifically, the client 02 can be used to display the verification results of the target dataset and the target cached data.

[0103] Figure 2 This is a flowchart illustrating a data verification method according to an exemplary embodiment, such as... Figure 2 As shown, this method can be applied to Figure 1 The server 01 shown includes the following steps.

[0104] In step S201, the target data filtering fields are determined based on the target application's target cached data verification request.

[0105] In this embodiment of the disclosure, determining the target data filtering field based on the target application's target cached data verification request includes:

[0106] The system receives a target cache data verification request from the target application, sent in response to a command triggered by a target cache data filtering control. The target cache data verification request carries the target data filtering field.

[0107] In this embodiment of the disclosure, a target cached data filtering control can be displayed on the client's display interface. The control may include a field filtering control, which can include at least one of the following: a cache key filtering control, an application identifier filtering control, a scene information filtering control, a data operation type filtering control, and a data sorting strategy filtering control. The cache key filtering control is used to determine the target cache key, the application identifier filtering control is used to determine the target application identifier, the scene information filtering control is used to determine the target scene information, the data operation type filtering control is used to determine the target data operation type, and the data sorting strategy filtering control is used to determine the target data sorting strategy. Data filtering can be performed using one or more fields in combination; for example, the target dataset can be filtered using the target cache key, or the target dataset can be filtered by combining the target cache key and the target data operation type.

[0108] In step S203, a target dataset is determined based on a preset database and the target data filtering field; the preset database is used to store the target cache field corresponding to the target cache data; the target cache field includes the target data filtering field and the target cache value; the target dataset includes the target cache value corresponding to the target data filtering field.

[0109] In this embodiment of the disclosure, the target data filtering field includes at least one of the target application identifier and the target cache key, such as... Figure 3 As shown, the method for constructing the preset database includes:

[0110] In step S301, cache data corresponding to a preset application is obtained, wherein the preset application includes the target application;

[0111] In this embodiment of the disclosure, the cached data is data in a cache database; cached data corresponding to a preset application can be obtained through the cache database; the cache database stores the correspondence between cache keys and cache value fields. The cache database can store information in the form of encrypted bytes.

[0112] In this embodiment of the disclosure, the preset server may include a message service module, and the cache database may actively report data to the message service module.

[0113] In this embodiment of the disclosure, the method may further include:

[0114] Determine the application whitelist; the application whitelist is used to store preset application identifiers;

[0115] In this embodiment of the disclosure, obtaining the cached data corresponding to the preset application includes:

[0116] Obtain the preset application identifier corresponding to the preset application;

[0117] Determine whether the preset application identifier is in the application whitelist;

[0118] If the preset application identifier is in the application whitelist, obtain the cached data corresponding to the preset application.

[0119] In this embodiment of the disclosure, by setting an application whitelist, only the cache fields corresponding to the whitelisted applications can be stored in the server; thereby, the cache fields of some applications can be selectively stored, realizing on-demand storage and improving the storage flexibility of cache fields.

[0120] In step S303, the cached data is parsed to obtain the cache fields corresponding to the cached data; the cache fields include an application identifier, a cache key, and a cache value;

[0121] In this embodiment of the disclosure, there can be multiple cached data sets, which constitute a cached dataset. It is possible to parse the data corresponding to some or all cache keys in the cached data. After parsing the cached data, the memory size of the cached value can be detected. If the memory size of the cached value is greater than a preset value, the cached value is filtered or reported multiple times. If the cached value involves confidential information such as user personal information, the cached value is encrypted before storage.

[0122] In this embodiment of the disclosure, the cache field includes at least a cache key and a cache value; when the preset database only stores the cache fields corresponding to the cached data in the target application, it may only store the cache key and cache value fields.

[0123] In a specific embodiment, the cached fields may include fields such as business identifier, cache operation behavior identifier, cache key, cache value, and operation time; wherein, the business identifier is an application identifier, and the cache operation behavior identifier can be specifically defined according to business needs. For example:

[0124] If it's just a matter of adding, deleting, or modifying data for business operations, the value of the cache operation behavior identifier can be: add, delete, or update. If there are further distinctions in the business logic, the value of the cache operation behavior identifier can also be a more specific value.

[0125] In a specific embodiment, the method for reporting cached fields is as follows: the input parameter is the cached field, and the output parameter is whether the reporting was successful or failed.

[0126] In step S305, the preset database is constructed based on the correspondence between the application identifier, the cache key, and the cache value.

[0127] In this embodiment of the disclosure, cached data can be parsed in advance to obtain cached fields, and a preset database can be built separately based on the cached fields. This facilitates the rapid verification of cached data in the cache database based on the preset database, avoiding the need to decode the cached data when retrieving it from the cache database, thus improving the efficiency of retrieving cached data.

[0128] In this embodiment of the disclosure, during the construction of the preset database, a first data storage strategy can be set, namely, the cache key will not be rewritten after deletion; based on the cache operation method (add, delete, modify) and the cache key query to see if the data exists, if it does not exist, it is stored in the preset database; if it exists, the data in the preset database is updated. For example, for user 1, the corresponding cache key is account 1. If this account needs to be deleted, then account 1 will be deleted from the cache, and this cache key will not be assigned to any user again. For the next user request, account 2 will be assigned, and so on.

[0129] In this embodiment of the disclosure, during the construction of the preset database, a second data storage strategy can be set, that is, the cache key can be re-added after deletion; based on the cache operation method (add, delete, modify) and whether the cache key query data exists, it is stored in the preset database regardless of whether it exists. For example, for user 1, the corresponding cache key is account 1. If account 1 needs to be deleted, then account 1 will be deleted from the cache, and this cache key can be reassigned to any user later.

[0130] In this embodiment of the disclosure, after constructing the preset database based on the correspondence between the application identifier, the data filtering field, and the cached value, the method further includes:

[0131] Obtain the update cache data corresponding to the preset application;

[0132] The updated cache data is parsed to obtain the updated cache field;

[0133] Based on the updated data filter field in the updated cache field, the original cache field corresponding to the updated data filter field is searched in the preset database;

[0134] Replace the original cache field with the updated cache field.

[0135] In this embodiment of the disclosure, if it is only necessary to view the latest updated cache value corresponding to the cache key, such as Figure 8 As shown, Figure 8 A flowchart of a method for updating a cached field, including:

[0136] S801: Parse the update cache data to obtain the update cache field;

[0137] S803: Determine whether the original cached field corresponding to the updated data filter field exists in the preset database;

[0138] In this embodiment of the disclosure, for example, if the updated data filtering field is a cache key, then the previously stored cache field corresponding to the cache key is obtained, that is, the original cache field.

[0139] S805: If it exists, replace the original cache field with the updated cache field;

[0140] S807: If it does not exist, the update cache data is directly stored in the preset database.

[0141] In this embodiment of the disclosure, if an original cache field exists, it means that the updated cache data is not the first time the field is stored, and the previously stored cache field needs to be deleted before the updated cache field is stored; if an original cache field does not exist, it means that the updated cache data is the first time the field is stored, and the field can be stored directly in the preset database.

[0142] In this embodiment of the disclosure, if only the most recently updated data (added, deleted, or modified data) in the cache data needs to be viewed, only the most recently updated data can be stored in the preset database, realizing on-demand data storage, avoiding the storage of redundant data, and saving server storage space.

[0143] In this embodiment of the disclosure, if it is necessary to view the complete dynamic changes of the data corresponding to the same cache key, the updated cache field is directly stored after obtaining the updated cache field.

[0144] In this embodiment of the disclosure, the target data filtering field includes the target application identifier and the target cache key, such as... Figure 4 As shown, determining the target dataset based on the preset database and the target data filtering fields includes:

[0145] In step S2031, a first dataset matching the target application identifier is searched from the preset database; the first dataset includes the correspondence between cache keys and cache values.

[0146] In this embodiment of the disclosure, the application identifier can be used to distinguish different applications, and cached data corresponding to different applications can be stored in a preset database; the first dataset is used to store the cached fields corresponding to the target application.

[0147] In step S2033, the target dataset is obtained by searching for a cache value that matches the target cache key in the first dataset.

[0148] In this embodiment of the disclosure, after determining the first dataset, the corresponding cache value can be quickly determined according to the target cache key, thereby obtaining the target dataset.

[0149] In this embodiment of the disclosure, the preset database can store cache fields corresponding to different applications. The first matching dataset can be determined first based on the target application identifier, and then the cache fields can be filtered out based on the target cache key, thereby quickly obtaining the target dataset that matches the target cache key in the target application.

[0150] In this embodiment of the disclosure, the target data filtering field further includes a data sorting strategy, the cache field further includes data operation time, and the first dataset includes a correspondence between cache keys, cache values, and data operation times; for example Figure 5 As shown, the step of finding a cached value matching the target cache key in the first dataset to obtain the target dataset includes:

[0151] In step S20331, a second dataset matching the target cache key is searched from the first dataset; the second dataset includes the correspondence between the target cache value and the data operation time.

[0152] In this embodiment of the disclosure, a data sorting strategy, cache key, cache value, and the corresponding relationship of data operation time can be stored in a preset database. The data operation time can be the time corresponding to the cached data; for added cached data, the data operation time is the data addition time; for deleted cached data, the data operation time is the data deletion time; for modified cached data, the data operation time is the data modification time. The data sorting strategy can include chronological order or reverse order. A corresponding second dataset can be determined based on the target cache key.

[0153] In step S20333, the target cache values ​​in the second dataset are sorted according to the data sorting strategy and the data operation time corresponding to each target cache value in the second dataset to obtain the target dataset.

[0154] In this embodiment of the disclosure, the target dataset may include data arranged in chronological or reverse order; the target dataset may be used to characterize the dynamic changes of cached data.

[0155] In this embodiment of the disclosure, after determining the second dataset corresponding to the target cache value based on the target cache key, the data in the second dataset can be sorted according to the data sorting strategy, so as to determine the dynamic change process of the cache data based on the sorted data.

[0156] In this embodiment of the disclosure, the target data filtering field further includes target scenario information of the target application, the cache field further includes scenario information of the preset application, and the first dataset includes a correspondence between cache keys, cache values, and scenario information; for example Figure 6 As shown, the step of finding a cached value matching the target cache key in the first dataset to obtain the target dataset includes:

[0157] In step S203301, a third dataset matching the target cache key is searched from the first dataset. The third dataset includes the correspondence between cache values ​​and scene information.

[0158] In this embodiment of the disclosure, the first dataset may include the correspondence between cache keys, cache values ​​and scenario information; the scenario information may be used to characterize the application scenario corresponding to the cache data, for example, it may include test scenarios, online scenarios, etc., and the cache fields may be stored according to the application scenario corresponding to the cache data.

[0159] In step S203303, a cached value matching the target scene information is searched from the third dataset to obtain the target dataset.

[0160] In this embodiment of the disclosure, cached values ​​in different scenarios can be quickly filtered based on the scenario information corresponding to the cached data, thereby determining the dynamic changes of cached data in different scenarios.

[0161] In this embodiment of the disclosure, the target data filtering field further includes a target operation type identifier, the cache field further includes an operation type identifier, and the first dataset includes a correspondence between cache keys, cache values, and operation type identifiers; for example Figure 7 As shown, the step of finding a cached value matching the target cache key in the first dataset to obtain the target dataset includes:

[0162] In step S2033001, a fourth dataset matching the target cache key is searched from the first dataset; the fourth dataset includes the correspondence between operation type identifiers and cache values;

[0163] In this embodiment of the disclosure, the operation type identifier can represent the operation type of the cached data, and the operation type can include data addition, deletion, modification, and other types.

[0164] In this embodiment of the disclosure, the business code reports the cached data, that is, wherever cache operations are needed, the cached data is reported as required. For example, during business processing, data is written to the cache, updated to the cache, or deleted from the cache.

[0165] In step S2033003, a cached value matching the target operation type identifier is searched from the fourth dataset to obtain the target dataset.

[0166] In this embodiment of the disclosure, cached values ​​in different scenarios can be quickly filtered out according to the operation type corresponding to the cached data, thereby determining the dynamic changes of cached data in different scenarios.

[0167] In this embodiment of the disclosure, the target data filtering fields in the above embodiments can be randomly combined to filter the target dataset, thereby improving the flexibility of data filtering.

[0168] In step S205, the target dataset is matched with the operation data of the target application to obtain the verification result of the target cache data.

[0169] In this embodiment of the disclosure, the operation data of the target application may include operation information such as adding, deleting, and modifying data in the target application. During the operation of the target application, the target dataset can be matched with the operation data of the target application to obtain the verification result of the target cached data. This realizes the verification of cached data, avoids interrupting the operation process of cached data in the target application, effectively avoids frequent switching between cached data operation and cached data verification, and improves the operation efficiency and verification efficiency of cached data.

[0170] In this embodiment of the disclosure, the method further includes:

[0171] The target dataset and the verification result of the target cached data are sent to the client; the client is used to display the target dataset and the verification result.

[0172] In this embodiment of the disclosure, the dynamically changing target dataset can be intuitively displayed to the user on the client side, that is, the dynamically changing cached data can be displayed to the user at any time. The user can also view the verification results of the cached data.

[0173] In this embodiment of the disclosure, during the operation of the target application, the dynamic change process of the target cached data in the target application can be displayed through the client without interrupting the operation of the cached data in the target application; this effectively avoids frequent switching between cached data operation and cached data verification, and improves the operation efficiency of cached data.

[0174] In a specific embodiment, such as Figure 9 As shown, Figure 9 Here is a flowchart of a method for validating cached data, including:

[0175] In step S901, the cache database sends cached data to the server to report the cached data;

[0176] Methods for reporting cached data include:

[0177] ① Consider the environment in which the cached data resides (support both test and production environments, or only support one of the test and production environments); when sending cached data, also send the environment information where the data resides;

[0178] ② Size of cached value field (if too large, assess whether filtering or multiple reporting is needed, etc.)

[0179] ③ Does the cached value field contain confidential information such as user personal information? If it does, it needs to be encrypted before being reported.

[0180] In step S903, the server parses the cached data to obtain the cached fields and their values;

[0181] During the parsing of cached data, you can choose to parse all data or only parse certain required cache keys to obtain the cached fields and their values.

[0182] In step S905, the server stores the cache field and the cache field value;

[0183] (1) The cache key will not be rewritten after deletion; according to the cache operation method (add, delete, modify) and the cache key, query whether the data exists. If it does not exist, store it in the preset database. If it exists, update the data in the preset database.

[0184] (2) The cache key can be added again after it is deleted; the cache key is added according to the cache operation method (add, delete, modify) to query whether the data exists, and it is stored in the preset database regardless of whether it exists.

[0185] In step S907, the server sends the cached field and the cached field value to the client;

[0186] The client-side page can provide various filtering conditions for easy querying of cached data. Filtering conditions include: operation type identifier, cache key, and cache data operation time. For example, to verify the dynamic change process of the cache key corresponding to a certain business operation, the cache key control can be directly triggered, and the cache data operation time can be used for sorting.

[0187] This disclosure allows for the one-time verification of the dynamic changes in cached data after all business scenarios have been completed, effectively reducing business operation interruptions during cache verification. The cached data is parsed and stored, and can be quickly retrieved via a webpage. Subsequent service redeployment, cache cluster changes, etc., will not affect the cache verification process, saving overall cache data verification time. Furthermore, this disclosure decouples the cache data verification process from business operations, effectively improving cache data verification efficiency.

[0188] This disclosure determines target data filtering fields based on target application cache data verification requests; determines a target dataset based on a preset database and the target data filtering fields; the preset database stores target cache fields corresponding to the target cache data; the target cache fields include the target data filtering fields and target cache values; the target dataset includes the target cache values ​​corresponding to the target data filtering fields; and matches the target dataset with the operation data of the target application to obtain the verification result of the target cache data. This disclosure achieves rapid acquisition of cache values ​​corresponding to cache data by storing cache fields corresponding to cache data in a preset database and filtering cache values ​​from the cache fields according to the data filtering fields to obtain the target dataset, thereby enabling rapid verification of cache data. This disclosure also achieves cache data verification by matching the target dataset with the operation data of the target application to obtain the verification result of the target cache data, thus avoiding interruption of the cache data operation process in the target application, effectively avoiding frequent switching between cache data operation and cache data verification, and improving the operation and verification efficiency of cache data.

[0189] Figure 10 This is a block diagram illustrating a data verification apparatus according to an exemplary embodiment. (Refer to...) Figure 10 The device includes:

[0190] The target field determination module 1010 is configured to execute a target cached data verification request based on the target application to determine the target data filtering fields.

[0191] The target dataset determination module 1020 is configured to determine a target dataset based on a preset database and the target data filtering fields; the preset database is used to store the target cache fields corresponding to the target cache data; the target cache fields include the target data filtering fields and target cache values; the target dataset includes the target cache values ​​corresponding to the target data filtering fields.

[0192] The verification result determination module 1030 is configured to perform a matching operation between the target dataset and the target application's operation data to obtain the verification result of the target cache data.

[0193] In one exemplary embodiment, the target data filtering field includes at least one of a target application identifier and a target cache key, and the apparatus further includes:

[0194] The cache data acquisition module is configured to acquire cache data corresponding to a preset application, wherein the preset application includes the target application;

[0195] The data parsing module is configured to parse the cached data to obtain the cache fields corresponding to the cached data; the cache fields include an application identifier, a cache key, and a cache value;

[0196] The preset database construction module is configured to construct the preset database based on the correspondence between the application identifier, the cache key, and the cache value.

[0197] In one exemplary implementation, the target data filtering field includes the target application identifier and the target cache key, and the target dataset determination module includes:

[0198] The first dataset lookup unit is configured to search the preset database for a first dataset that matches the target application identifier; the first dataset includes a mapping between cache keys and cache values.

[0199] The target dataset determination unit is configured to perform a search in the first dataset for a cache value that matches the target cache key, thereby obtaining the target dataset.

[0200] In one exemplary embodiment, the target data filtering field further includes a data sorting strategy, the caching field further includes data operation time, and the first dataset includes a correspondence between cache keys, cache values, and data operation times; the target dataset determination unit includes:

[0201] The second dataset lookup subunit is configured to perform a search in the first dataset for a second dataset that matches the target cache key; the second dataset includes a correspondence between the target cache value and the data operation time.

[0202] The first target dataset determination subunit is configured to sort the target cache values ​​in the second dataset according to the data sorting strategy and the data operation time corresponding to each target cache value in the second dataset, thereby obtaining the target dataset.

[0203] In one exemplary embodiment, the target data filtering field further includes target scenario information of the target application, the cache field further includes scenario information of the preset application, and the first dataset includes a correspondence between cache keys, cache values, and scenario information; the target dataset determining unit includes:

[0204] The third dataset lookup subunit is configured to perform a search in the first dataset for a third dataset that matches the target cache key, the third dataset including the correspondence between cache values ​​and scene information;

[0205] The second target dataset determination subunit is configured to perform a search for a cached value that matches the target scene information in the third dataset to obtain the target dataset.

[0206] In one exemplary embodiment, the target data filtering field further includes a target operation type identifier, the cache field further includes an operation type identifier, and the first dataset includes a correspondence between cache keys, cache values, and operation type identifiers; the target dataset determining unit includes:

[0207] The fourth dataset lookup subunit is configured to perform a search in the first dataset for a fourth dataset that matches the target cache key; the fourth dataset includes a mapping between operation type identifiers and cache values;

[0208] The third target dataset determination subunit is configured to perform a search in the fourth dataset for a cached value that matches the target operation type identifier, thereby obtaining the target dataset.

[0209] In one exemplary embodiment, the apparatus further includes:

[0210] The update cache data acquisition module is configured to acquire the update cache data corresponding to the preset application.

[0211] The update cache field determination module is configured to parse the update cache data to obtain the update cache field;

[0212] The original cache field lookup module is configured to perform an operation based on the updated data filtering field in the updated cache field to search for the original cache field corresponding to the updated data filtering field in the preset database;

[0213] The field replacement module is configured to perform the replacement of the original cached field with the updated cached field.

[0214] In one exemplary embodiment, the target field determination module includes:

[0215] The data verification request sending unit is configured to receive a target cache data verification request from the target application sent by the client in response to an instruction triggered based on a target cache data filtering control; the target cache data verification request carries the target data filtering field.

[0216] In one exemplary embodiment, the apparatus further includes:

[0217] The verification result sending unit is configured to send the verification result of the target dataset and the target cached data to the client; the client is used to display the target dataset and the verification result.

[0218] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0219] In one exemplary embodiment, an electronic device is also provided, including a processor; a memory for storing processor-executable instructions; wherein, when the processor is configured to execute the instructions stored in the memory, it implements the data verification method provided in any of the above embodiments.

[0220] The electronic device can be a terminal, a server, or a similar computing device. Taking a server as an example... Figure 11 This is a block diagram illustrating an electronic device according to an exemplary embodiment, such as... Figure 11As shown, the server 1100 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1110 (CPUs 1110 may include, but are not limited to, microprocessors such as MCUs or programmable logic devices such as FPGAs), a memory 1130 for storing data, and one or more storage media 1120 (e.g., one or more mass storage devices) for storing application programs 1123 or data 1122. The memory 1130 and storage media 1120 may be temporary or persistent storage. The program stored in the storage media 1120 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the CPU 1110 may be configured to communicate with the storage media 1120 and execute the series of instruction operations stored in the storage media 1120 on the server 1100. Server 1100 may also include one or more power supplies 1160, one or more wired or wireless network interfaces 1150, one or more input / output interfaces 1140, and / or one or more operating systems 1121, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0221] The input / output interface 1140 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 1100. In one example, the input / output interface 1140 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 1140 may be a radio frequency (RF) module for wireless communication with the Internet.

[0222] Those skilled in the art will understand that Figure 11 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 1100 may also include... Figure 11 The more or fewer components shown, or having the same Figure 11 The different configurations shown.

[0223] In one exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 1130 including instructions, which can be executed by a processor 1110 of device 1100 to perform the above-described method. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0224] In one exemplary embodiment, a computer program product is also provided, including a computer program that, when executed by a processor, implements the data verification method provided in any of the above embodiments.

[0225] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0226] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0227] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A data verification method, characterized by, include: After the cache data operation of the target application is completed, a target cache data verification request for the target application sent by the client is received; The target cached data verification request carries the target data filtering field; The target data filtering fields include the target operation type identifier, the data sorting strategy, and the target scenario information of the target application. Based on a preset database and the target data filtering fields, a target dataset is determined; the preset database is used to store the target cache fields corresponding to the target cache data. The target cache field includes the target data filtering field and the target cache value; The target dataset includes the target cache values ​​corresponding to the target data filtering fields; The target dataset is matched with the operation data of the target application to obtain the verification result of the target cache data.

2. The method according to claim 1, characterized in that, The target data filtering fields include at least one of the target application identifier and the target cache key, and the method for constructing the preset database includes: Obtain cached data corresponding to a preset application, wherein the preset application includes the target application; The cached data is parsed to obtain the cache fields corresponding to the cached data; the cache fields include the application identifier, the cache key, and the cache value. The preset database is constructed based on the correspondence between the application identifier, the cache key, and the cache value.

3. The method according to claim 2, characterized in that, The target data filtering fields include the target application identifier and the target cache key. Determining the target dataset based on the preset database and the target data filtering fields includes: Search the preset database for a first dataset that matches the target application identifier; the first dataset includes the correspondence between cache keys and cache values. The target dataset is obtained by finding the cache value that matches the target cache key in the first dataset.

4. The method according to claim 3, characterized in that, The cache field also includes data operation time, and the first dataset includes the correspondence between cache key, cache value and data operation time; The step of finding the cached value matching the target cache key in the first dataset to obtain the target dataset includes: Find a second dataset from the first dataset that matches the target cache key; the second dataset includes the correspondence between the target cache value and the data operation time. Based on the data sorting strategy and the data operation time corresponding to each target cache value in the second dataset, the target cache values ​​in the second dataset are sorted to obtain the target dataset.

5. The method according to claim 3, characterized in that, The cache field also includes the scenario information of the preset application, and the first dataset includes the correspondence between cache keys, cache values ​​and scenario information; The step of finding the cached value matching the target cache key in the first dataset to obtain the target dataset includes: Find a third dataset from the first dataset that matches the target cache key, wherein the third dataset includes the correspondence between cache values ​​and scene information; The target dataset is obtained by searching for cached values ​​in the third dataset that match the target scene information.

6. The method according to claim 3, characterized in that, The cache field also includes an operation type identifier, and the first dataset includes the correspondence between cache keys, cache values ​​and operation type identifiers; The step of finding the cached value matching the target cache key in the first dataset to obtain the target dataset includes: Find a fourth dataset from the first dataset that matches the target cache key; the fourth dataset includes the correspondence between operation type identifiers and cache values; The target dataset is obtained by finding a cached value in the fourth dataset that matches the target operation type identifier.

7. The method according to claim 2, characterized in that, After constructing the preset database based on the correspondence between the application identifier, the data filtering field, and the cached value, the method further includes: Obtain the update cache data corresponding to the preset application; The updated cache data is parsed to obtain the updated cache field; Based on the updated data filter field in the updated cache field, the original cache field corresponding to the updated data filter field is searched in the preset database; Replace the original cache field with the updated cache field.

8. The method according to claim 1, characterized in that, The step of receiving a target cache data verification request from the client after the cache data operation of the target application is completed includes: After the cache data operation of the target application is completed, the target application's target cache data verification request is received from the client in response to the instruction triggered by the target cache data filtering control. The method further includes: The target dataset and the verification result of the target cached data are sent to the client; the client is used to display the target dataset and the verification result.

9. A data verification device, characterized in that, include: The target field determination module is configured to receive a target cache data verification request from the client after the cache data operation of the target application is completed; the target cache data verification request carries a target data filtering field. The target data filtering fields include the target operation type identifier, the data sorting strategy, and the target scenario information of the target application. The target dataset determination module is configured to determine the target dataset based on a preset database and the target data filtering fields; the preset database is used to store the target cache fields corresponding to the target cache data. The target cache field includes the target data filtering field and the target cache value; The target dataset includes the target cache values ​​corresponding to the target data filtering fields; The verification result determination module is configured to perform a matching operation between the target dataset and the target application's operation data to obtain the verification result of the target cache data.

10. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the data verification method as described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of an electronic device, the electronic device is able to perform the data verification method as described in any one of claims 1-8.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the data verification method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • A Data Synchronization Method and System for Distributed In-Memory Databases

    CN102262674A

  • Method for realizing data format verification based on Flink

    CN110781647A