Data verification method, device, program product, computer equipment and medium

By obtaining the hash position of the data in the local cache system and verifying the cache status of the data in the remote cache system, the crash problem caused by excessive database access in the cache system is solved, and more efficient and accurate data verification is achieved.

CN114461684BActive Publication Date: 2025-08-19TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210129663.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-11
Publication Date
2025-08-19
Estimated Expiration
2042-02-11

AI Technical Summary

Technical Problem

In the prior art, the verification operation of the data cache status in the cache system results in excessive database access, which can easily lead to database crashes, affecting the accuracy and efficiency of data verification.

Method used

By obtaining the hash position of the data in the local cache system, the first cache state is determined, and the second cache state of the data is further verified in the remote cache system in the cached state, combining the local and remote cache systems to improve the accuracy and efficiency of the verification.

Benefits of technology

It improves the accuracy and efficiency of data cache status verification, reduces the pressure on remote systems, and enhances system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114461684B_ABST
    Figure CN114461684B_ABST
Patent Text Reader

Abstract

The present application discloses a data verification method, apparatus, program product, computer equipment and medium. The method can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc. The method comprises: obtaining verification data; obtaining the hash position of the verification data in the local cache system, and obtaining the first cache state of the verification data in the local cache system according to the hash position of the verification data; if the first cache state is a cached state, obtaining the second cache state of the verification data in the remote cache system; if the second cache state is a cached state, determining that the verification data belongs to cached data in the cache system; the cache system comprises a local cache system and a remote cache system. By adopting the present application, the accuracy and efficiency of verifying the cache state of the verification data can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data processing, and in particular to a data verification method, apparatus, program product, computer equipment, and medium. Background Art

[0002] With the continuous development of computer networks, more and more data is cached on the network, and even more data has reached trillions. Usually, the business logic for cached data and uncached data is different. Therefore, it is increasingly important to verify the cache status of data (such as whether it is cached) in the cache system.

[0003] In existing applications, when it is necessary to verify whether data S is cached in the cache system, the existence of data S is usually directly retrieved from the DB (database). However, when the cache status of a large amount of data needs to be verified at the same time, the DB is accessed too much, and the DB is prone to crash, which in turn causes the cache status verification of data S to fail, and also affects other cache services. Summary of the Invention

[0004] The present application provides a data verification method, apparatus, program product, computer equipment, and medium, which can improve the accuracy and efficiency of verifying the cache status of verification data.

[0005] On one hand, the present application provides a data verification method, the method comprising:

[0006] Get verification data;

[0007] Obtaining a hash position of the verification data in the local cache system, and obtaining a first cache state of the verification data in the local cache system according to the hash position of the verification data;

[0008] If the first cache state is the cached state, obtaining a second cache state of the verification data in the remote cache system;

[0009] If the second cache state is the cached state, it is determined that the verification data belongs to the cached data in the cache system; the cache system includes a local cache system and a remote cache system.

[0010] On one hand, the present application provides a data verification device, which includes:

[0011] An acquisition module, used to obtain verification data;

[0012] A first verification module is configured to obtain a hash position of the verification data in the local cache system, and obtain a first cache state of the verification data in the local cache system according to the hash position of the verification data;

[0013] A second verification module is configured to obtain a second cache state of the verification data in the remote cache system if the first cache state is the cached state;

[0014] The determination module is configured to determine, if the second cache state is the cached state, whether the verification data belongs to cached data in the cache system; the cache system includes a local cache system and a remote cache system.

[0015] Optionally, the above device is further used for:

[0016] If the first cache state is an uncached state, determining that the verification data belongs to uncached data of the cache system;

[0017] Perform business processing on the verification data according to the business logic of the uncached data.

[0018] Optionally, the cache system further includes a backup cache system; the above device is further configured to:

[0019] If the second cache state is an uncached state, obtaining a third cache state of the verification data in the backup cache system;

[0020] If the third cache state is the cached state, confirming that the verification data belongs to the cached data of the cache system;

[0021] If the third cache state is the uncached state, it is confirmed that the verification data belongs to the uncached data of the cache system.

[0022] Optionally, the above device is further used for:

[0023] If the third cache state is an uncached state, it is determined that there is a misjudgment operation on the cache state of the verification data in the local cache system;

[0024] According to the misjudgment operation on the cache status of the verification data in the local cache system, the misjudgment rate of the cache status of the data in the local cache system is updated.

[0025] Optionally, the above device is further used for:

[0026] If the misjudgment rate of the local cache system is greater than the misjudgment rate threshold, the local cache system is expanded.

[0027] Optionally, the first verification module obtains the hash position of the verification data in the local cache system in the following manner:

[0028] Calculate the verification data according to the hash fingerprint algorithm to obtain the fingerprint data of the verification data;

[0029] The fingerprint data is operated according to the hash position algorithm to obtain the hash position of the verification data.

[0030] Optionally, the first verification module obtains the first cache state of the verification data in the local cache system according to the hash position of the verification data, including:

[0031] If the hash position of the verification data in the local cache system has fingerprint data of the verification data, confirming that the first cache state of the verification data in the local cache system is an uncached state;

[0032] If the hash position of the verification data in the local cache system does not have the fingerprint data of the verification data, it is determined that the first cache state of the verification data in the local cache system is a cached state.

[0033] Optionally, the second verification module obtains the second cache state of the verification data in the remote cache system in the following manner:

[0034] Sending a data verification request to the remote cache system, so that the remote cache system obtains the second cache state of the verification data in the remote cache system according to the data verification request; the data verification request carries the verification data;

[0035] Gets the second cache status returned by the remote cache system.

[0036] Optionally, the acquisition module obtains verification data in the following ways:

[0037] Get network request;

[0038] Parse the verification data from the network request.

[0039] Optionally, the cached data includes at least one cached illegal domain name data; the verification data is any domain name data;

[0040] The above device is also used for:

[0041] If at least one cached illegal domain name data includes verification data, the network request is intercepted.

[0042] Optionally, the above device is further used for:

[0043] If the verification data is cached data, the verification data is processed according to the business logic of the cached data.

[0044] In one aspect, the present application provides a computer device including a memory and a processor, wherein the memory stores a computer program. When the computer program is executed by the processor, the processor executes the method in one aspect of the present application.

[0045] In one aspect, the present application provides a computer-readable storage medium storing a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the method in the above aspect.

[0046] According to one aspect of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method provided in various optional embodiments such as the above-mentioned aspect.

[0047] The present application can obtain verification data; obtain the hash position of the verification data in the local cache system, and obtain the first cache state of the verification data in the local cache system based on the hash position of the verification data; if the first cache state is a cached state, obtain the second cache state of the verification data in the remote cache system; if the second cache state is a cached state, determine that the verification data belongs to cached data in the cache system; the cache system includes a local cache system and a remote cache system. It can be seen that the method proposed in the present application can first quickly determine whether the verification data belongs to cached data through the hash position in the local cache system, and then further determine whether the verification data belongs to cached data through the remote cache system, thereby improving the accuracy of verifying the cache state of the verification data. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the present application or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0049] Figure 1 This is a schematic diagram of a network architecture provided by an embodiment of the present application;

[0050] Figure 2 This is a schematic diagram of a data verification scenario provided by this application;

[0051] Figure 3 This is a flow chart of a data verification method provided by this application;

[0052] Figure 4a This is a schematic diagram of a scenario of adding data to a local cache system provided by this application;

[0053] Figure 4bThis is a flowchart of deleting data in a local cache system provided by this application;

[0054] Figure 5 This is a flowchart of a local cache system verification data provided by this application;

[0055] Figure 6 This is a flow chart of a first-level verification of data provided by this application;

[0056] Figure 7 This is a flow chart of a secondary verification process for data provided by this application;

[0057] Figure 8 This is a schematic diagram of a process for performing three-level verification of data provided by this application;

[0058] Figure 9 This is a flowchart of data processing provided by this application;

[0059] Figure 10 This is a flowchart of deleting data in a cache system provided by this application;

[0060] Figure 11 This is a flowchart of expanding the local cache system provided by this application;

[0061] Figure 12 This is a structural diagram of a data verification device provided by this application;

[0062] Figure 13 This is a structural diagram of a computer device provided by this application. DETAILED DESCRIPTION

[0063] The following will be combined with the accompanying drawings to clearly and completely describe the technical solutions in this application. Obviously, the embodiments described are only some of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.

[0064] This application relates to cloud technology, which refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.

[0065] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. It can form a resource pool for on-demand, flexible and convenient use. Cloud computing technology will become a key support. Backend services of technical network systems, such as video websites, image websites, and more portals, require extensive computing and storage resources. With the rapid development and application of the internet industry, every item will likely have its own unique identification mark, which will need to be transmitted to backend systems for logical processing. Different levels of data will be processed separately. All types of industry data require strong system support, which can only be achieved through cloud computing.

[0066] The cloud technology involved in this application mainly refers to the ability to exchange information with a remote cache system through the "cloud" so that the remote cache system can verify the cache status of verification data through the "cloud".

[0067] First of all, it needs to be explained that if the relevant data (such as verification data) obtained by this application is user data, then the relevant data must be obtained with the user's consent and authorization, and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0068] See Figure 1 , Figure 1 This is a schematic diagram of a network architecture provided by an embodiment of the present application. Figure 1 As shown, the network architecture may include a server 200 and a terminal device cluster, and the terminal device cluster may include one or more terminal devices, and the number of terminal devices is not limited here. Figure 1 As shown, the multiple terminal devices may specifically include terminal device 100a, terminal device 101a, terminal device 102a, ..., terminal device 103a; Figure 1 As shown, the terminal device 100a, the terminal device 101a, the terminal device 102a, ..., the terminal device 103a can all be connected to the server 200 through a network, so that each terminal device can exchange data with the server 200 through the network connection.

[0069] like Figure 1The server 200 shown can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal device can be: a smart phone, tablet computer, laptop computer, desktop computer, intelligent voice interaction device, smart home appliance, vehicle-mounted terminal, aircraft and other intelligent terminals. The following takes the communication between the terminal device 100a and the server 200 as an example to describe the embodiment of the present application in detail. The present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc.

[0070] Please also see Figure 2 , Figure 2 This is a schematic diagram of a data verification scenario provided by this application. Figure 2 As shown, the service end here may refer to the server 200, which is used to verify the data and perform corresponding business processing on the data. The requesting end may be the above-mentioned terminal device 100a, which is used to initiate a business request. The business request may contain data that needs to be verified (such as verification data. Verifying the data may refer to verifying the cache status of the data).

[0071] First, the requester can initiate any service request to the server (e.g., "① Initiate service request"). This service request can contain data that needs to be verified, which is called verification data. The server can include a data verification module, a cuckoo filter module, and a service logic processing module.

[0072] Among them, the above-mentioned cuckoo filter module is installed locally on the server side. The cuckoo filter module can be called a local cache system. The cuckoo filter module is composed of cuckoo filters. Cuckoo mainly verifies the cache status of data through hash position. The cuckoo filter does not cache the original data. Therefore, by installing the cuckoo filter locally, the cache status of the data can be verified with extremely high efficiency.

[0073] Therefore, after the server obtains the verification data in the business request, it can first call the cuckoo filter module through the data verification module to check the cache status of the verification data (such as "② local data verification"), such as determining whether the verification data has been cached. If the cache status of the verification data cannot be fully verified through the cuckoo filter, the server can also sequentially request the remote cache system (such as "③ remote data verification") or / and the backup cache system to cooperate (such as "④ backup data verification") to verify the cache status of the verification data to obtain the most accurate cache status of the verification data in the cache system. The cache status may be cached in the cache system or not cached in the cache system. The cache system can be a three-level cache system composed of the above-mentioned cuckoo filter module (i.e., local cache system), remote cache system, and backup cache system. Among them, the specific process of verifying the cache status of the verification data through the local cache system, the remote cache system, and the backup cache system can also be referred to below. Figure 3 Corresponding description in the corresponding embodiment.

[0074] After the cache status of the verification data in the cache system is verified by the data verification module, the business logic processing module can perform corresponding business processing on the verification data using corresponding business logic according to the cache status of the verified verification data.

[0075] By using the method provided by this application, the cache status of verification data is verified by combining local (such as a local cache system) and remote (such as a remote cache system and a backup cache system), which can improve the response speed to business requests (first responded locally) and improve the efficiency of verification of verification data, so that most data can be quickly verified and responded to locally. This application can reduce the pressure of remote data verification and improve system stability. This application is applicable to all scenarios where software systems need to determine the existence of parameters.

[0076] See Figure 3 , Figure 3 This is a flow chart of a data verification method provided by the present application. The execution subject in the embodiment of the present application can be a computer device or a computer device cluster composed of multiple computer devices. The computer device can be a server or a terminal device. Therefore, the execution subject in the embodiment of the present application can be a server, a terminal device, or a combination of a server and a terminal device. Here, the execution subject in the embodiment of the present application is a server as an example for explanation. Figure 3 As shown, the method may include:

[0077] Step S101, obtaining verification data.

[0078] Optionally, the server can obtain verification data. Since this application can be applied to any scenario where the cache status of data (such as whether it is cached) needs to be verified, the verification data here can refer to any data that needs to be verified for the cache status.

[0079] For example, in a network request scenario, the verification data may be parsed from the network request, such as a domain name data (which may be referred to as a domain name, or any domain name data) parsed from the network request. Subsequently, the cache status of the domain name data may be verified to determine whether the domain name data exists in the cached whitelist domain name data (which may include at least one legal domain name data) or blacklist domain name data (which may include at least one illegal domain name data). Therefore, in this scenario, if the verification data is found to exist in the at least one illegal domain name data, the network request to which the verification data belongs may be intercepted and processed to interrupt or reject the network request; and if the verification data is found to exist in the at least one legal domain name data, the network request to which the verification data belongs may be processed normally, such as responding to the network request normally.

[0080] For example, in a data browsing scenario, the verification data may be target data (such as short video data) to be recommended to a user (which may be referred to as an object) for browsing. Subsequently, the cache status of the target data may be verified to determine whether the target data is to be recommended to the user. For example, it may be verified whether the target data belongs to cached data that the user has browsed. If the cached data that the user has browsed contains the target data, the target data does not need to be repeatedly recommended to the user. If the cached data that the user has browsed does not contain the target data, the target data may be recommended to the user for browsing.

[0081] Step S102: Obtain a hash position of the verification data in the local cache system, and obtain a first cache state of the verification data in the local cache system according to the hash position of the verification data.

[0082] Optionally, the server may be a device for processing services. The server may include a local cache system, which may reside on the server's local disk and be operated by the server running corresponding code. The local cache system may be used to record the cache status of data.

[0083] The local cache system may be composed of a cuckoo filter, which may be described in detail below.

[0084] The local cache system may not cache the original data itself, but instead record whether the corresponding data is cached at the corresponding location (such as the hash location).

[0085] Therefore, the server can obtain the hash location of the verification data in the local cache system: there are two hash algorithms used to obtain the hash location of the data in the local cache system: one is the hash fingerprint algorithm (a hash algorithm used to calculate the fingerprint of the data, the number of hash fingerprint algorithms is determined according to the actual application scenario), and the other is the hash location algorithm (a hash algorithm used to calculate the storage location of the data, the number of hash location algorithms is also determined according to the actual application scenario). The specific hash algorithms used can be determined according to the actual application scenario and are not limited to this.

[0086] Optionally, the server can use a hash fingerprint algorithm to operate on the verification data, and the result of the operation can be used as the fingerprint data of the verification data (which can be simply referred to as fingerprint). Then the server can use a hash position algorithm to operate on the fingerprint data of the verification data, and the result of the operation can be used as the hash position of the verification data.

[0087] It should be noted that the local cache system may include an array for recording whether there is cached data at each hash position (several hash positions that can be obtained by calculating any data through the above-mentioned hash fingerprint algorithm and hash position algorithm). A hash position in the array can correspond to a fingerprint entry area. If the fingerprint entry area corresponding to a certain hash position records the fingerprint data of a certain data (which can be calculated through the above-mentioned hash fingerprint algorithm), then it can be considered that the data in the local cache system belongs to the data that has been cached. Conversely, if the fingerprint entry area corresponding to a certain hash position is empty (that is, it does not have fingerprint data of any data), then it can be considered that there is no cached data corresponding to the hash position.

[0088] The cache state of the verification data verified in the local cache system can be called the first cache state. The first cache state can be a cached state or an uncached state. If the first cache state is a cached state, it indicates that the verification data verified in the local cache system has been cached, and the verification data is not new data; if the first cache state is an uncached state, it indicates that the verification data verified in the local cache system has not been cached, and the verification data is new data.

[0089] Therefore, the server can verify whether the hash position of the verification data in the array of the local cache system has the fingerprint data of the verification data. If the hash position of the verification data has the fingerprint data of the verification data (such as the fingerprint data of the verification data in the fingerprint entry area corresponding to the hash position of the verification data), it indicates that there is corresponding cached data at the hash position of the verification data, which means that the first cache state of the verification data in the local cache system is a cached state, and the cached state also indicates that the verification data verified in the local cache system has been cached.

[0090] Furthermore, if the hash position of the verification data does not contain fingerprint data of the verification data (such as the fingerprint entry area corresponding to the hash position of the verification data is empty), it indicates that there is no corresponding cached data at the hash position of the verification data, which means that the first cache state of the verification data in the local cache system is an uncached state, and the uncached state indicates that the verification data verified in the local cache system has not yet been cached.

[0091] See Figure 4a , Figure 4a This is a schematic diagram of a scenario of adding data in a local cache system provided by the present application. As shown in Figure 4, the server can insert data S0 into the local cache system. The above-mentioned hash position algorithm can include two hash algorithms, hash1 and hash2. The array of the local cache system here can contain 8 hash positions (including hash position 1, hash position 2, hash position 3, hash position 4, hash position 5, hash position 6, hash position 7, and hash position 8). A hash position of data S0 (i.e., hash address, here is hash position 2) can be calculated through hash1, and another hash position of data S0 (here is hash position 6) can be calculated through hash2. It can be judged that hash position 2 and hash position 6 in the array both indicate that no corresponding data has been cached, because the fingerprint entry areas corresponding to hash position 2 and hash position 6 are empty. Here, hash position 1 indicates that there is cached data S1 (but the original data of data S1 is not actually stored in the array, because the fingerprint entry area corresponding to hash position 1 in the array has the fingerprint data of data S1 recorded); here, hash position 7 indicates that there is cached data S2 (but the original data of data S2 is not actually stored in the array, because the fingerprint entry area corresponding to hash position 7 in the array has the fingerprint data of data S2 recorded).

[0092] Since the fingerprint entry areas at hash position 2 and hash position 6 are both empty, the server can select any hash position between hash position 2 and hash position 6 to record the status that data S0 has been cached. Here, hash position 6 is selected to record the status that data S0 has been cached. Therefore, the fingerprint data of data S0 is finally filled in the fingerprint entry area corresponding to hash position 6.

[0093] See Figure 4b , Figure 4b This is a flow chart of deleting data in a local cache system provided by this application. Figure 4b As shown, step S201: prepare to query data X (which can be any data); step S202: the server can calculate the fingerprint of data X (that is, the fingerprint data of data X, which can be recorded as fingerprint f); step S203: here, the above-mentioned hash position algorithm can also include two hash algorithms, hash1 and hash2, and a hash position (that is, address 1) of data X can be calculated by operating hash1 on data X (that is, hash1(X)); step S204: another hash position (that is, address 2) of data X can be calculated by performing an XOR operation between hash1(X) and the result of operating hash2 on the fingerprint f of data X (that is, hash2(f)); step S205: the server can check the array of the local cache system Does f exist at address 1 (i.e., does the fingerprint f of data X exist in the fingerprint entry area corresponding to address 1)? If not, execute step S206; if yes, execute step S208; Step S206: Check in the array whether f exists at address 2 (i.e., does the fingerprint f of data X exist in the fingerprint entry area corresponding to address 2); if not, execute step S207; if yes, execute step S208; Step S207: Return false (error), indicating that data X has not been queried in the local cache system; Step S208: Delete the fingerprint f at the hash position where the fingerprint f of data X is found; Step S209: Return true (correct), indicating that the cached status of the recorded data X has been successfully removed in the local cache system.

[0094] It should be noted that in addition to the above-mentioned local cache system, the cache system can also include a remote cache system. The remote cache system can be composed of redis (an open source middleware for fast access to data). The remote cache system does not belong to the local system. If the server needs to communicate with the remote cache system, it needs to communicate by calling the remote network.

[0095] If the first cache state of the verification data is found to be uncached in the local cache system, it can be assumed that the verification data is uncached in the cache system because the data cache state at the hash position of the verification data is empty (i.e., there is no corresponding cached data). In other words, the verification data is uncached in the cache system, which means that the uncached data is data that is not cached in the cache system.

[0096] If the first cache status of the verification data verified in the local cache system is a cached status, the cache status of the verification data needs to be verified again through the remote cache system, because the cached status of the verification data verified by the cuckoo filter of the local cache system is usually not 100% accurate for the entire cache system. This is because there is still a very low probability that the hash positions calculated by the above-mentioned hash fingerprint algorithm and hash position algorithm for different data are the same. Therefore, if the data cache status at the hash position of the verification data in the local cache system is not empty, it may also mean that there is other cached data with the same hash position as the verification data at the hash position, rather than cached verification data. Therefore, the cache status of the verification data needs to be further verified through the remote cache system.

[0097] See Figure 5 , Figure 5 This is a flow chart of a local cache system verification data provided by this application. Figure 5As shown, step S301: prepare to query data X (which can be any data); step S302: the server can calculate the fingerprint of data X (that is, the fingerprint data of data X, which can be recorded as fingerprint f); step S303: here, the above-mentioned hash position algorithm can also include two hash algorithms, hash1 and hash2, and a hash position of data X can be calculated through hash1 (that is, address 1); step S304: another hash position of data X (that is, address 2) can be calculated through hash2; step S305: the server can check whether f exists at address 1 in the array of the local cache system (that is, whether data exists in the fingerprint entry area corresponding to address 1). According to the fingerprint f of data X), if it does not exist, execute step S306; if it exists, execute step S308; step S306: check whether f exists at address 2 in the array (that is, whether the fingerprint f of data X exists in the fingerprint entry area corresponding to address 2), if not, execute step S307; if it exists, execute step S308; step S307: return false (error), indicating that data X is not queried in the local cache system; step S308: return true (correct), indicating that the fingerprint f of data X is queried at address 1 or address 2, indicating that the result of verification of data X in the local cache system is cached, that is, the first cache state is the cached state.

[0098] See Figure 6 , Figure 6 This is a flow chart of a first-level verification of data provided by this application. Figure 6As shown, step S401: input data X (which can be any data), use data X as verification data, and prepare to perform a first-level verification on data X, that is, prepare to verify the cache status of data X in the local cache system; step S402: perform a first-level verification on data X, that is, verify the cache status of data X in the local cache system to obtain a first cache status of data X; step S403: the server can verify whether X exists in the local cache system (for example, whether the fingerprint data of data X is at the hash position of data X). If not, step S404 is executed; if so, step S406 is executed; step S404: false (error) is returned, indicating that data X is not found in the local cache system (that is, the fingerprint data of data X is not found), that is, the first cache status of data X is an uncached state; step S405: based on the verified first cache status of data X being an uncached state (at this time, data X belongs to the uncached data of the cache system), the server can perform business processing corresponding to the business logic on data X. Step S406: Returns true (correct), indicating that data X is found in the local cache system (i.e., the fingerprint data of data X is found), and the first cache state of data X is the cached state; Step S407: Performs a second-level cache check on data X, i.e., verifies the cache state of data X in the remote cache system.

[0099] Step S103: If the first cache state is the cached state, obtain the second cache state of the verification data in the remote cache system.

[0100] Optionally, the cache state of the verification data verified in the remote cache system can be called the second cache state. The second cache state can also be a cached state or an uncached state. If the second cache state is the cached state, it indicates that the verification data verified in the remote cache system has been cached, and the verification data is not new data; if the second cache state is the uncached state, it indicates that the verification data verified in the remote cache system has not been cached, and the verification data is new data.

[0101] Among them, the remote cache system caches the original data (that is, the original data, that is, the data itself, rather than just recording the cache status of the data).

[0102] Therefore, the server may obtain the second cache state of the verification data in the remote cache system by sending a data verification request (which may be referred to as a first data verification request) for the verification data to the remote cache system, thereby requesting the remote cache system to verify the cache state of the verification data through the data verification request. The remote cache system may be located in a remote verification device, and therefore, the operations performed by the remote cache system described below may be performed by a remote backend device located in the remote cache system.

[0103] The data verification request can carry verification data. When the remote cache system obtains the data verification request, it can parse the verification data from the data verification request, and then traverse the data already cached in the remote cache system (or traverse through the key corresponding to the data) to determine whether the verification data is cached in the remote cache system through the traversal result. If the remote cache system traverses and finds that the cached data contains verification data, it can be confirmed that the second cache state of the verification data is a cached state, indicating that the verification data has been cached in the remote cache system; and if the remote cache system traverses and finds that the cached data does not contain verification data, it can be considered that the second cache state of the verification data is an uncached state, indicating that the verification data has not been cached in the remote cache system. The remote cache system can send the second cache state of the obtained verification data to the server, and the server can obtain the second cache state of the verification data sent by the remote cache system.

[0104] Step S104: If the second cache state is the cached state, it is determined that the verification data belongs to the cached data in the cache system; the cache system includes a local cache system and a remote cache system.

[0105] Optionally, if the cache system includes the aforementioned secondary cache system (i.e., a local cache system and a remote cache system), then when the second cache state is a cached state, the verification data may be considered to belong to cached data in the cache system, where the cached data refers to data that has already been cached in the cache system. At this point, when the second cache state is an uncached state, the verification data may also be considered not to belong to cached data in the cache system, but to belong to uncached data in the cache system, and in this case, it may also be considered that the local cache system has misjudged the cache state of the verification data.

[0106] Optionally, if the cache system includes a three-level cache system (i.e., including the aforementioned local cache system, the aforementioned remote cache system, and a backup cache system), then when the second cache is in a cached state, the verification data may be considered cached data in the cache system. However, in this case, when the second cache state is an uncached state, the cache state of the verification data needs to be further verified by the backup cache system. The backup cache system may be composed of a DB (database), and the backup cache system also caches the original data.

[0107] Among them, the cache state of the verification data verified in the backup cache system can be called a third cache state, and the third cache state can also be a cached state or an uncached state. If the third cache state is a cached state, it indicates that the verification data verified in the backup cache system has been cached, and the verification data is not new data; if the third cache state is an uncached state, it indicates that the verification data verified in the backup cache system has not been cached, and the verification data is new data.

[0108] Among them, the backup cache system is also a remote cache system, so the way the server obtains the third cache state for the verification data from the backup cache system is the same as the way the server obtains the second cache state for the verification data from the remote cache system, such as: the server can send a data verification request (which can be called a second data verification request) to the backup cache system. The data verification request carries verification data. Therefore, when the backup cache system obtains the data verification request, it can also extract the verification data from the data verification request and traverse whether the data it has cached contains the verification data. If it does, the third cache state of the verification data can be considered to be a cached state. If not, the third cache state of the verification data can be considered to be an uncached state. The backup cache system can send the third cache state of the verification data obtained to the server, and the server can obtain the third cache state of the verification data sent by the backup cache system.

[0109] See Figure 7 , Figure 7 This is a flow chart of a secondary verification process for data provided by this application. Figure 7As shown, step S501: data X is used as verification data (which can be any data). If the first cache state of data X is the cached state, data X is input and a second-level verification is prepared for data X, that is, the cache state of data X is prepared to be verified in the remote cache system; step S502: a third-level verification is performed on data X, that is, the cache state of data X is verified in the remote cache system to obtain a second cache state of data X; step S503: the server can verify whether data X is cached in the remote cache system. If not, step S504 is executed; if so, step S506 is executed; step S504: false (error) is returned, indicating that data X is not found in the remote cache system, that is, the second cache state of data X is the uncached state; step S505: the server can perform a third-level verification on data X, that is, the cache state of data X is verified through the backup cache system. Step S506: Returns true (correct), indicating that data X is found in the remote cache system and the second cache state of data X is the cached state; Step S507: Confirms that data X has been cached in the cache system, and data X belongs to the cached data of the cache system, and business processing of the corresponding business logic can be performed on data X.

[0110] See Figure 8 , Figure 8 This is a flow chart of a three-level verification of data provided by this application. Figure 8 As shown, step S601: data X is used as verification data (which can be any data). If the first cache state of data X is the cached state and the second cache state is the uncached state, data X is input and a three-level verification is prepared for data X, that is, the cache state of data X is prepared to be verified in the backup cache system. Step S602: the three-level verification is performed on data X, that is, the cache state of data X is verified in the backup cache system to obtain the third cache state of data X. Step S603: the server can verify whether data X is cached in the backup cache system. If not, step S604 is executed. If so, step S606 is executed. Step S604: false (error) is returned, indicating that data X is not found in the backup cache system, that is, the third cache state of data X is the uncached state. Step S605: the server can confirm that data X is not cached in the cache system and that data X is uncached data in the cache system. Step S606: Return true (correct), indicating that data X is found in the backup cache system and the third cache state of data X is cached; Step S607: Confirm that data X is cached in the cache system and data X belongs to cached data in the cache system.

[0111] Therefore, when the third cache state is the cached state, the verification data can be considered to be cached data in the cache system. At this time, when the third cache state is the uncached state, the verification data can also be considered not to be cached data in the cache system, but to be uncached data in the cache system. In this case, it is also considered that there is an erroneous judgment operation on the cache state of the verification data in the local cache system (because the verification results of the cache state of the verification data by the local cache system and the backup cache system are inconsistent).

[0112] Furthermore, the server may also update the misjudgment rate of the cache status of all historically verified data in the local cache system according to the misjudgment operations on the cache status of the verification data in the local cache system. For example, the calculation formula of the misjudgment rate w may be w=e / sum, wherein e represents the sum of the number of misjudgment operations on the verified data in the history of the local cache system, and sum represents the total number of verifications on the verified data in the history of the local cache system. For example, when the third cache state is the uncached state, before the local cache system verifies the verification data, e is equal to e1, and sum is equal to sum1. After the verification data is verified, e is equal to e1 plus 1, and sum is equal to sum1 plus 1. At this time, the misjudgment rate w of the local cache system is equal to w=(e1+1) / (sum1+1).

[0113] When the local cache system's false positive rate w exceeds the false positive rate threshold, the system is deemed to have a high false positive rate and cannot effectively support the service. The local cache system can then be expanded. This expansion may include increasing the length of an array used to record the data cache status at each hash position in the local cache system, or increasing the number of hash position algorithms used to calculate the hash position of data. The false positive rate threshold can be determined based on the actual application scenario. For example, the false positive rate threshold can be 5%.

[0114] See Figure 9 , Figure 9 This is a flow chart of data processing provided by this application. Figure 9 As shown, the process includes: step S701: inputting data Y (which can be any data), using data Y as verification data, and preparing to verify the cache status of data Y; step S702: performing a first-level cache verification on data Y, that is, verifying the cache status of data Y through a local cache system; step S703: the server can determine whether data Y is cached in the local cache system. If it is not cached (that is, the first cache status is an uncached state), step S704 is executed; if it is cached (that is, the first cache status is a cached state), step S710 is executed;

[0115] Step S704: In this case, if it is verified that data Y is uncached data in the cache system, business processing corresponding to the business logic can be performed on data Y; Step S705: Determine whether the business processing of data Y is successful. If successful, steps S707, S708, and S709 can be performed in parallel or sequentially; Step S706: Confirm that the business processing of data Y is abnormal; Step S707: Record data Y in the local cache system, such as recording the fingerprint data of data Y at the hash position of data Y in the array of the local cache system; Step S708: Cache data Y in the remote cache system; Step S709: Cache data Y in the backup cache system;

[0116] Step S710: Data Y is verified for the secondary cache, i.e., the cache status of data Y is verified in the remote cache system. Step S711: The server can determine whether data Y is cached in the remote cache system. If it is not cached (i.e., the second cache status is the uncached state), step S713 is executed; if it is cached (i.e., the second cache status is the cached state), step S712 is executed. Step S712: true is output, indicating that data X has been cached in the remote cache system and that data Y has been cached in the cache system. Step S713: Data Y is verified for the tertiary cache, i.e., the cache status of data Y is verified in the backup cache system.

[0117] Step S714: The server can determine whether the data Y verified in the backup cache system is cached. If not (i.e., the third cache state is the uncached state), step S717 is executed; if cached (i.e., the third cache state is the cached state), step S715 is executed; Step S715: outputs true (correct), indicating that the data Y verified in the backup cache system is cached, and also indicating that the data Y is verified to be cached in the cache system; Step S716: Since the data Y is cached in both the local cache system and the backup cache system at this time, but the data Y is not cached in the remote cache system, it is possible that the remote cache system has been mistakenly deleted. At this time, the data Y can be updated in the remote cache system, such as caching the data Y in the remote cache system; Step S717: returns false, indicating that the data Y is not cached in the cache system; Step S718: The error rate w of the local cache system can be updated and calculated; Step S719: If the error rate w is greater than 5% (the error rate threshold can be 5% at this time), the local cache system can be expanded.

[0118] Among them, if the verification data belongs to the cached data of the cache system, the verification data can be processed according to the business logic of the cached data. For example, if the verification data is a user name set by the user, and the newly set username cannot be the same as the existing (such as cached) username, and the verification data belongs to the cached data of the cache system (which may include the cached username), then the server's business logic at this time may be to let the user re-enter the username that needs to be set. For another example, if the verification data is the domain name data parsed by the server from the network request, the cached data of the cache system includes at least one illegal domain name data that has been cached, and it is verified that the verification data belongs to one of the at least one illegal domain name data that has been cached (that is, it is verified that the verification data belongs to the cached data of the cache system), then the server's business logic at this time may be to intercept the network request to terminate the network service requested by the network request.

[0119] Furthermore, if the verification data is uncached data in the cache system, the verification data can be processed according to the business logic of the uncached data. For example, if the verification data is a username set by the user, and the newly set username cannot be the same as an existing username (such as one that has already been cached), and the verification data is not cached data in the cache system (which may include already cached usernames), the server's business logic at this time may be to successfully set the verification data entered by the user as the user's username.

[0120] See Figure 10 , Figure 10 This is a flow chart of deleting data in a cache system provided by this application. Figure 10 As shown, step S801: prepare to delete data X; step S802: calculate the fingerprint f of data X; step S803: calculate the two hash locations of data X (i.e., the two storage addresses in the local cache system, such as calculated by hash1 and hash2); step S804: query whether there is the fingerprint f of data X at the two hash locations, if yes, execute step S806, if not, execute step S805; step S805: return true, indicating that the fingerprint of data X is found in the local cache system, indicating that the data is in the local cache. The system verifies that data X is cached. Step S806: Delete the fingerprint f of data X recorded in the local cache system. Step S807: Determine whether the fingerprint of data X is successfully deleted in the local cache system. If so, execute step S809. If not, and the deletion action has been attempted less than or equal to three times (or other number thresholds), execute step S806. If not, and the deletion action has been attempted more than three times, execute step S808. Step S808: Return false, indicating that the deletion of data X in the local cache system has failed.

[0121] Step S809: Delete data X from the backup cache system (DB); Step S810: Determine whether the deletion of data X from the backup cache system is successful. If successful, execute step S812. If unsuccessful and the deletion action has been attempted less than or equal to three times (or other number thresholds), execute step S809. If unsuccessful and the deletion action has been attempted more than three times, execute step S811. Step S811: Return false, indicating that the deletion of data X from the backup cache system has failed.

[0122] Step S812: Delete data X in the remote cache system (redis); Step S813: Determine whether the deletion of data X in the remote cache system is successful. If successful, execute step S815; if unsuccessful and the deletion action has been attempted less than or equal to 3 times (or other number thresholds), execute step S812; if unsuccessful and the deletion action has been attempted more than 3 times, execute step S814; Step S814: Return false, indicating that the deletion of data X in the remote cache system failed; Step S815: Return true, indicating that the data X is successfully deleted in the cache system.

[0123] See Figure 11 , Figure 11 This is a flow chart of expanding the local cache system provided by this application. Figure 11 As shown, step S901: input data X, use data X as verification data, and start verifying the cache status of data X; step S902: verify the cache status of data X in the first-level cache (i.e., the local cache system); step S903: confirm that the data X is cached in the local cache system, i.e., the first cache status is the cached state;

[0124] Step S904: The cache status of data X is verified in the second-level cache (i.e., the remote cache system); Step S905: Confirming that the data X is not cached in the remote cache system, i.e., the second cache status is the uncached state; Step S906: The cache status of data X is verified in the third-level cache (i.e., the backup cache system); Step S907: Confirming that the data X is not cached in the backup cache system, i.e., the third cache status is the uncached state;

[0125] Step S908: Update the calculated number of misjudgments e of the local cache system to be equal to the historical number of misjudgments + 1; Step S909: Update the calculated misjudgment rate w of the local cache system by updating the calculated number of misjudgments = misjudgment rate * 100 / sum (in percentage form), where sum is the total number of data verifications at present; Step S910: Determine the relationship between the misjudgment rate w and 5% (i.e., the misjudgment rate threshold). If the misjudgment rate w is greater than 5%, the local cache system can be expanded. If the misjudgment rate w is less than or equal to 5%, the current process ends.

[0126] By adopting the method provided in the present application, first, the cache status of the verification data can be quickly verified locally through the local cache system, and a large amount of new data (i.e., uncached data) can be screened out through the local cache system, so that only the cache status of a small part of the data can be verified subsequently through the remote cache system or the backup cache system. The data access volume of the remote cache system or the backup cache system is greatly reduced, and the remote cache system or the backup cache system is less likely to crash.

[0127] In addition, since remote network calls do not need to be made locally, this application can reduce remote network calls and I / O (data reading operations) reading operations. The verification of the cache status of large amounts of data does not need to rely on the service requirements of a third-party system (such as a remote cache system or a backup cache system), so that this application can verify the cache status of data more reliably and quickly.

[0128] The present application can obtain verification data; obtain the hash position of the verification data in the local cache system, and obtain the first cache state of the verification data in the local cache system based on the hash position of the verification data; if the first cache state is a cached state, obtain the second cache state of the verification data in the remote cache system; if the second cache state is a cached state, determine that the verification data belongs to cached data in the cache system; the cache system includes a local cache system and a remote cache system. It can be seen that the method proposed in the present application can first quickly determine whether the verification data belongs to cached data through the hash position in the local cache system, and then further determine whether the verification data belongs to cached data through the remote cache system, thereby improving the accuracy of verifying the cache state of the verification data.

[0129] See Figure 12 , Figure 12 This is a structural diagram of a data verification device provided by the present application. The data verification device can be a computer program (including program code) running on a computer device. For example, the data verification device is an application software. The data verification device can be used to execute the corresponding steps of the method provided in the embodiment of the present application. Figure 12As shown, the data verification device 1 may include:

[0130] An acquisition module 11 is used to acquire verification data;

[0131] A first verification module 12 is configured to obtain a hash position of the verification data in the local cache system, and obtain a first cache state of the verification data in the local cache system according to the hash position of the verification data;

[0132] A second verification module 13 is configured to obtain a second cache state of the verification data in the remote cache system if the first cache state is the cached state;

[0133] The determination module 14 is configured to determine, if the second cache state is the cached state, whether the verification data belongs to cached data in the cache system; the cache system includes a local cache system and a remote cache system.

[0134] Optionally, the device 1 is further used for:

[0135] If the first cache state is an uncached state, determining that the verification data belongs to uncached data of the cache system;

[0136] Perform business processing on the verification data according to the business logic of the uncached data.

[0137] Optionally, the cache system further includes a backup cache system; the above-mentioned device 1 is further used for:

[0138] If the second cache state is an uncached state, obtaining a third cache state of the verification data in the backup cache system;

[0139] If the third cache state is the cached state, confirming that the verification data belongs to the cached data of the cache system;

[0140] If the third cache state is the uncached state, it is confirmed that the verification data belongs to the uncached data of the cache system.

[0141] Optionally, the device 1 is further used for:

[0142] If the third cache state is an uncached state, it is determined that there is a misjudgment operation on the cache state of the verification data in the local cache system;

[0143] According to the misjudgment operation on the cache status of the verification data in the local cache system, the misjudgment rate of the cache status of the data in the local cache system is updated.

[0144] Optionally, the device 1 is further used for:

[0145] If the misjudgment rate of the local cache system is greater than the misjudgment rate threshold, the local cache system is expanded.

[0146] Optionally, the first verification module 12 obtains the hash position of the verification data in the local cache system by:

[0147] Calculate the verification data according to the hash fingerprint algorithm to obtain the fingerprint data of the verification data;

[0148] The fingerprint data is operated according to the hash position algorithm to obtain the hash position of the verification data.

[0149] Optionally, the first verification module 12 obtains the first cache state of the verification data in the local cache system according to the hash position of the verification data, including:

[0150] If the hash position of the verification data in the local cache system has fingerprint data of the verification data, confirming that the first cache state of the verification data in the local cache system is an uncached state;

[0151] If the hash position of the verification data in the local cache system does not have the fingerprint data of the verification data, it is determined that the first cache state of the verification data in the local cache system is a cached state.

[0152] Optionally, the second verification module 13 obtains the second cache state of the verification data in the remote cache system in the following manner:

[0153] Sending a data verification request to the remote cache system, so that the remote cache system obtains the second cache state of the verification data in the remote cache system according to the data verification request; the data verification request carries the verification data;

[0154] Gets the second cache status returned by the remote cache system.

[0155] Optionally, the acquisition module 11 acquires the verification data in the following manner:

[0156] Get network request;

[0157] Parse the verification data from the network request.

[0158] Optionally, the cached data includes at least one cached illegal domain name data; the verification data is any domain name data;

[0159] The above device 1 is also used for:

[0160] If at least one cached illegal domain name data includes verification data, the network request is intercepted.

[0161] Optionally, the device 1 is further used for:

[0162] If the verification data is cached data, the verification data is processed according to the business logic of the cached data.

[0163] According to one embodiment of the present application, Figure 3 The steps involved in the data verification method shown can be Figure 12 The data verification device 1 shown in FIG. 1 is executed by each module. For example, Figure 3 The step S101 shown in FIG. Figure 12 The acquisition module 11 is executed, Figure 3 The step S102 shown in FIG. Figure 12 The first verification module 12 is executed; Figure 3 The step S103 shown in FIG. Figure 12 The second verification module 13 is executed, Figure 3 The step S104 shown in FIG. Figure 12 The determination module 14 is executed.

[0164] The present application can obtain verification data; obtain the hash position of the verification data in the local cache system, and obtain the first cache state of the verification data in the local cache system based on the hash position of the verification data; if the first cache state is a cached state, obtain the second cache state of the verification data in the remote cache system; if the second cache state is a cached state, determine that the verification data belongs to cached data in the cache system; the cache system includes a local cache system and a remote cache system. It can be seen that the method proposed in the present application can first quickly determine whether the verification data belongs to cached data through the hash position in the local cache system, and then further determine whether the verification data belongs to cached data through the remote cache system, thereby improving the accuracy of verifying the cache state of the verification data.

[0165] According to one embodiment of the present application, Figure 12 The various modules in the data verification device 1 shown can be separately or all combined into one or several units to constitute, or one (some) of the units can be further split into multiple smaller sub-units in function, and the same operation can be achieved without affecting the realization of the technical effects of the embodiments of the present application. The above modules are divided based on logical functions. In actual applications, the functions of a module can also be implemented by multiple units, or the functions of multiple modules can be implemented by one unit. In other embodiments of the present application, the data verification device 1 can also include other units. In actual applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0166] According to one embodiment of the present application, the program can be executed by running on a general computer device such as a computer including a central processing unit (CPU), a random access memory (RAM), a read-only memory (ROM) and other processing elements and storage elements. Figure 3A computer program (including program code) for each step involved in the corresponding method shown in Figure 12 The data verification device 1 shown in the embodiment of the present application is used to implement the data verification method of the embodiment of the present application. The above computer program can be recorded on a computer readable recording medium, for example, and loaded into the above computing device through the computer readable recording medium and run therein.

[0167] See Figure 13 , Figure 13 This is a schematic diagram of the structure of a computer device provided by this application. Figure 13 As shown, the computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Figure 13 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.

[0168] exist Figure 13 In the computer device 1000 shown, the network interface 1004 can provide network communication functions; the user interface 1003 is mainly used to provide an interface for user input; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:

[0169] Get verification data;

[0170] Obtaining a hash position of the verification data in the local cache system, and obtaining a first cache state of the verification data in the local cache system according to the hash position of the verification data;

[0171] If the first cache state is the cached state, obtaining a second cache state of the verification data in the remote cache system;

[0172] If the second cache state is the cached state, it is determined that the verification data belongs to the cached data in the cache system; the cache system includes a local cache system and a remote cache system.

[0173] It should be understood that the computer device 1000 described in the embodiment of the present application can execute the above Figure 3 The description of the data verification method in the corresponding embodiment can also be performed as described above. Figure 12 The description of the data verification device 1 in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here either.

[0174] In addition, it should be pointed out that: the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the data verification device 1 mentioned above, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the above-mentioned Figure 3 The description of the data verification method in the corresponding embodiment will therefore not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated here. For technical details not disclosed in the computer storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.

[0175] As an example, the above program instructions may be deployed on a computer device for execution, or deployed on multiple computer devices located at one location for execution, or executed on multiple computer devices distributed at multiple locations and interconnected by a communication network. Multiple computer devices distributed at multiple locations and interconnected by a communication network may constitute a blockchain network.

[0176] The computer-readable storage medium may be the data verification device provided in any of the aforementioned embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Furthermore, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0177] The present application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned Figure 3 The description of the above-mentioned data verification method in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.

[0178] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or device comprising a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.

[0179] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0180] The methods and related devices provided by the embodiments of the present application are described with reference to the method flow charts and / or structural diagrams provided by the embodiments of the present application. Specifically, each process and / or block in the method flow charts and / or structural diagrams, as well as the combination of processes and / or blocks in the flow charts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 Schematic diagram of one or more processes and / or structures Figure 1These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including the instruction device, which implements the function specified in the process. Figure 1 Schematic diagram of one or more processes and / or structures Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the process. Figure 1 The flow or flows and / or structures illustrate the steps of the functions specified in one block or multiple blocks.

[0181] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A data verification method, characterized in that: The method comprises: Get verification data; Obtaining a hash position of the verification data in a local cache system, and obtaining a first cache state of the verification data in the local cache system based on the hash position of the verification data; the first cache state includes a cached state and an uncached state; the local cache system is used to record the cache state of the corresponding data at the hash position and does not cache the original data; If the first cache state is a cached state, obtaining a second cache state of the verification data in the remote cache system; the second cache state includes a cached state and an uncached state; the remote cache system caches the original data; If the second cache state is a cached state, determining that the verification data belongs to cached data in the cache system; the cache system includes the local cache system and the remote cache system; Wherein, obtaining the hash position of the verification data in the local cache system includes: operating the verification data according to a hash fingerprint algorithm to obtain fingerprint data of the verification data, and operating the fingerprint data according to a hash position algorithm to obtain the hash position of the verification data; The obtaining of the first cache state of the verification data in the local cache system according to the hash position of the verification data includes: if the hash position of the verification data in the local cache system has the fingerprint data of the verification data, confirming that the first cache state of the verification data in the local cache system is a cached state; if the hash position of the verification data in the local cache system does not have the fingerprint data of the verification data, confirming that the first cache state of the verification data in the local cache system is an uncached state.

2. The method according to claim 1, characterized in that The method further comprises: If the first cache state is an uncached state, determining that the verification data belongs to uncached data of the cache system; The verification data is subjected to business processing according to the business logic of the uncached data.

3. The method according to claim 1, characterized in that The cache system further includes a backup cache system; and the method further includes: If the second cache state is an uncached state, obtaining a third cache state of the verification data in the backup cache system; If the third cache state is a cached state, confirming that the verification data belongs to the cached data of the cache system; If the third cache state is an uncached state, it is confirmed that the verification data belongs to uncached data of the cache system.

4. The method according to claim 3, characterized in that The method further comprises: If the third cache state is an uncached state, determining that there is a misjudgment operation on the cache state of the verification data in the local cache system; According to the misjudgment operation on the cache status of the verification data in the local cache system, the misjudgment rate of the cache status of the data in the local cache system is updated.

5. The method according to claim 4, characterized in that The method further comprises: If the misjudgment rate of the local cache system is greater than the misjudgment rate threshold, the local cache system is expanded.

6. The method according to claim 1, characterized in that The obtaining of the second cache status of the verification data in the remote cache system includes: Sending a data verification request to the remote cache system, so that the remote cache system obtains the second cache state of the verification data in the remote cache system according to the data verification request; the data verification request carries the verification data; The second cache state returned by the remote cache system is obtained.

7. The method according to claim 1, characterized in that The obtaining of verification data includes: Get network request; The verification data is obtained by parsing the network request.

8. The method according to claim 7, characterized in that The cached data includes at least one cached illegal domain name data; the verification data is any domain name data; The method further comprises: If the cached at least one illegal domain name data includes the verification data, the network request is intercepted.

9. The method according to claim 1, characterized in that The method further comprises: If the verification data belongs to the cached data, business processing is performed on the verification data according to the business logic of the cached data.

10. A data verification device, characterized in that: The device comprises: An acquisition module, used to obtain verification data; a first verification module, configured to obtain a hash position of the verification data in a local cache system, and obtain a first cache state of the verification data in the local cache system based on the hash position of the verification data; the first cache state includes a cached state and an uncached state; the local cache system is configured to record the cache state of the corresponding data at the hash position and not cache the original data; a second verification module configured to obtain a second cache state of the verification data in a remote cache system if the first cache state is a cached state; the second cache state includes a cached state and an uncached state; and the remote cache system caches the original data; a determination module, configured to determine, if the second cache state is a cached state, that the verification data belongs to cached data in a cache system; the cache system comprising the local cache system and the remote cache system; Wherein, obtaining the hash position of the verification data in the local cache system includes: operating the verification data according to a hash fingerprint algorithm to obtain fingerprint data of the verification data, and operating the fingerprint data according to a hash position algorithm to obtain the hash position of the verification data; The obtaining of the first cache state of the verification data in the local cache system according to the hash position of the verification data includes: if the hash position of the verification data in the local cache system has the fingerprint data of the verification data, confirming that the first cache state of the verification data in the local cache system is a cached state; if the hash position of the verification data in the local cache system does not have the fingerprint data of the verification data, confirming that the first cache state of the verification data in the local cache system is an uncached state.

11. A computer program product comprising a computer program / instruction, which implements the steps of the method according to any one of claims 1 to 9 when executed by a processor.

12. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 9.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Verification method and apparatus for data and state in multi-level cache

    CN106933750A

  • Dynamic picture caching method and device, equipment and storage medium

    CN113849753A