Attack defense method, device and storage medium for data query system

By setting structural requirements and signature information to verify the validity of the index, and combining Bloom filters and signature key version rotation, the query pressure problem caused by invalid indexes in the data query system is solved, achieving efficient attack defense and improving system security.

CN113971242BActive Publication Date: 2025-10-03ALIBABA (CHINA) CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111088933.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-16
Publication Date
2025-10-03
Estimated Expiration
2041-09-16

AI Technical Summary

Technical Problem

When the data query system receives a large number of invalid indexes, it will cause excessive query pressure and may even cause the system to become unavailable. Existing defense methods can be easily cracked by malicious attackers, causing the interception function to fail.

Method used

The validity of the index is verified by setting structural requirements and signature information, and the validity of the existing index is determined by using Bloom filters. Combined with the rotation and update of the signature key version, the security and defense efficiency of the index structure are improved.

Benefits of technology

Effectively intercept invalid indexes, reduce the attack defense cost of the data query system, and improve the response efficiency and security of the query system, with an interception rate of up to 99.99%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113971242B_ABST
    Figure CN113971242B_ABST
Patent Text Reader

Abstract

The present application provides an attack defense method, device and storage medium for a data query system. Among them, after receiving a query request, the structure of the index in the query request can be judged first. If the structure of the index meets the set structural requirements, then it is judged whether it is a valid index based on the information contained in the structure. Otherwise, it is judged whether the index is a valid index based on the stock index saved in the filter. This method of verifying the validity of the index based on the structural information of the index and the filter can not only filter and intercept the indexes that meet the set structural requirements, but also filter and intercept the stock indexes that do not meet the set structural requirements. On the one hand, it is conducive to good compatibility with the query process of the stock indexes in the data query system that do not follow the set format requirements, and reduce the probability of the data query system being maliciously attacked. On the other hand, the efficiency of determining invalid indexes can be accelerated based on the filter, thereby reducing the attack defense cost of the data query system.
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 query systems, and in particular to an attack defense method, device, and storage medium for a data query system. Background Art

[0002] A query system typically consists of an application service and a data query system. The data query system may store mappings between query identifiers and information. For example, the mapping between order numbers and order information, or between card numbers and asset information, etc. The application service provides a portal for query operations. When a user needs to query certain information, the query system's application service provides a query index. If the data query system contains information corresponding to the index, the query result is returned.

[0003] Typically, the searched index is valid, but sometimes it doesn't actually exist, for example, when the searched index is an invalid order number or an invalid card number. When the query system receives a large number of invalid indexes, it places significant pressure on the query system and may even render it unavailable. Therefore, a new solution is needed. Summary of the Invention

[0004] Various aspects of the present application provide a method, device, and storage medium for defending against attacks on a data query system, for defending against malicious query requests directed to the data query system.

[0005] An embodiment of the present application provides an attack defense method for a data query system, comprising: receiving a query request, the query request including an index of data to be queried; determining whether a structure of the index meets set structure requirements; if the structure of the index meets the set structure requirements, determining whether the index is a valid index based on signature information included in the index; if the structure of the index does not meet the set structure requirements, determining whether the index is a valid index through a preset filter; the filter stores existing indexes that do not comply with the set structure requirements; if the index is a valid index, performing a data query operation based on the index.

[0006] An embodiment of the present application provides an attack defense method, including: receiving a query request, the query request including an index of data to be queried; determining whether the structure of the index meets set structure requirements; if the structure of the index meets the set structure requirements, determining whether the index is a valid index based on the encrypted timestamp information contained in the index; if the structure of the index does not meet the set structure requirements, determining whether the index is a valid index through a preset filter; the filter stores a full index generated by a data server before constructing the filter; if the index is a valid index, sending the query request to the corresponding data server.

[0007] An embodiment of the present application also provides a server, comprising: a memory and a processor; the memory is used to store one or more computer instructions; the processor is used to execute the one or more computer instructions to: execute the steps in the method provided in the embodiment of the present application.

[0008] An embodiment of the present application also provides a gateway device, comprising: a memory and a processor; the memory is used to store one or more computer instructions; the processor is used to execute the one or more computer instructions to: execute the steps in the method provided in the embodiment of the present application.

[0009] An embodiment of the present application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can execute the steps of the method provided in the embodiment of the present application.

[0010] In the attack defense method provided by the embodiment of the present application, after receiving the query request, the structure of the index in the query request can be judged first. If the structure of the index meets the set structural requirements, then it is judged whether it is a valid index based on the information contained in the structure. Otherwise, it is judged whether the index is a valid index based on the stock index saved in the filter. This method of verifying the validity of the index based on the structural information of the index and the filter can not only filter and intercept the indexes that meet the set structural requirements, but also filter and intercept the stock indexes that do not meet the set structural requirements. On the one hand, it is conducive to good compatibility with the query process of the stock indexes in the data query system that do not follow the set format requirements, and reduce the probability of the data query system being maliciously attacked. On the other hand, the efficiency of determining invalid indexes can be accelerated based on the filter, thereby reducing the attack defense cost of the data query system. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0012] Figure 1 A flowchart of an attack defense method for a data query system provided by an exemplary embodiment of the present application;

[0013] Figure 2 A schematic diagram of a data server performing pre-verification on a query key provided by an exemplary embodiment of the present application;

[0014] Figure 3 A flowchart of an attack defense method for a data query system provided by another exemplary embodiment of the present application;

[0015] Figure 4 A schematic diagram of a rich client performing pre-verification on a query key according to an exemplary embodiment of the present application;

[0016] Figure 5 A schematic diagram of a data server and a rich client performing two-level pre-verification on a query key according to an exemplary embodiment of the present application;

[0017] Figure 6 A schematic diagram of the structure of a server provided for an exemplary embodiment of the present application;

[0018] Figure 7 A schematic diagram of the structure of a gateway device provided as an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0019] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part 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 creative efforts are within the scope of protection of this application.

[0020] A query system typically consists of an application service and a data query system. The data query system may store mappings between query identifiers and information. For example, the mapping between order numbers and order information, or between card numbers and asset information, etc. The application service provides a portal for query operations. When a user needs to query certain information, the query system's application service provides a query index. If the data query system contains information corresponding to the index, the query result is returned.

[0021] Typically, the index being queried is valid, but there are also cases where the index being queried does not actually exist, such as when the index being queried is an invalid order number or an invalid card number. When the query system receives a large number of invalid indexes, it will cause a large query pressure on the query system and may even cause the query system to become unavailable.

[0022] In one attack defense method for a data query system, some malicious access can be blocked by restricting the character set used to generate the key (index) or designing the structure of the generated key. For example, one can restrict the use of Base64 encoding to generate the key, specify a fixed beginning for the key, or specify the key structure. While this method can effectively block some randomly forged keys, if a malicious attacker learns the character set or structure of the key, they can forge a key that can evade interception, rendering the interception function ineffective.

[0023] In response to the above technical problems, a solution is provided in some embodiments of the present application. The technical solutions provided in each embodiment of the present application are described in detail below with reference to the accompanying drawings.

[0024] Figure 1 A flowchart of an attack defense method for a data query system provided by an exemplary embodiment of the present application is shown as follows: Figure 1 As shown, the method includes:

[0025] Step 101: Receive a query request, where the query request includes an index of data to be queried.

[0026] Step 102: Determine whether the structure of the index meets the set structure requirements.

[0027] Step 103: If the structure of the index meets the set structure requirement, determine whether the index is a valid index based on the signature information included in the index.

[0028] Step 104: If the structure of the index does not meet the set structure requirements, determine whether the index is a valid index through a preset filter; the filter stores the stock indexes that do not comply with the set structure requirements.

[0029] Step 105: If the index is a valid index, perform a data query operation according to the index.

[0030] The execution subject of this embodiment may be a data server, which may be implemented as a server deployed with a data query system. The server may be implemented in the form of a conventional server device, a cloud server, a cloud host, an elastic computing instance, etc., and this embodiment does not impose any restrictions.

[0031] In this embodiment, the query request can be sent by a user through a client device, or by another upstream device or application system, without limitation in this embodiment. The query request includes the index of the data to be queried. The index of the data to be queried and the information mapping relationship between the data to be queried can be represented by a key-value pair. The index of the data to be queried is the key in the key-value pair.

[0032] In this embodiment, to identify invalid indexes, an index that is easy to identify can be generated according to set structural requirements. The set structural requirements can specify the different elements contained in the index and the combination of different elements. In particular, to prevent malicious attackers from generating a large number of invalid indexes after the index structure is exposed, the set structural requirements can specify that the index must include signature information obtained by signing with an agreed signature key.

[0033] After receiving a query request, the data server can parse the structure of the index in the query request and determine whether the index structure meets the set structural requirements. If the index structure meets the set structural requirements, the data server can determine whether the index is valid based on the signature information contained in the index. For example, the signature information can be verified. If the signature information passes the verification, the index is determined to be valid. Conversely, if the signature information fails the verification, the index is determined to be invalid.

[0034] In this embodiment, in addition to indexes generated according to the set structural requirements, the data query system also includes existing indexes that were not generated according to the set structural requirements (i.e., indexes generated according to the historical index generation method). Therefore, when the index generation method is changed, a filter can be set to avoid affecting the query function of the existing indexes. The filter stores the existing indexes that do not comply with the set structural requirements.

[0035] Optionally, the filter can be implemented as a Bloom filter. A Bloom filter is a probabilistic data structure that returns the probability that a key is definitely absent or possibly present. The penetration probability of a Bloom filter depends on the probability set during initialization.

[0036] In some embodiments, before determining whether the index is a valid index through a preset filter, the full data in the data server may be further scanned to obtain a full index corresponding to the full data, and the full index may be added to the filter. The full index may be cached in a HashMap table.

[0037] Based on this, when the structure of the index does not meet the set structure requirements, the data server can use a preset filter to determine whether the index is a valid index. If the filter determines that the index does not hit any pre-stored index, the index can be considered an invalid index. If the filter determines that the index hits a pre-stored index, the index can be considered a valid index.

[0038] If the index is determined to be a valid index based on the signature information contained in the index, or if the index is determined to be a valid index through a preset filter, data query operations can be performed based on the index.

[0039] In this embodiment, when the data server receives a query request, it can first determine the structure of the index in the query request. If the structure of the index meets the set structural requirements, it can determine whether the index is a valid index based on the signature information contained in the index. If the structure of the index does not meet the set requirements, it can determine whether the index is a valid index based on the existing indexes that do not comply with the set structural requirements stored in the filter. This method of verifying the validity of the index based on the signature information in the structure of the index and the filter can filter and intercept indexes that meet the set structural requirements, as well as filter and intercept existing indexes that do not meet the set structural requirements. On the one hand, it is conducive to good compatibility with the query process of existing indexes in the data query system that do not comply with the set format requirements, thereby reducing the probability of the data query system being maliciously attacked. On the other hand, the efficiency of determining invalid indexes can be accelerated based on the filter, thereby reducing the attack and defense costs of the data query system.

[0040] Optionally, after the scheme provided by the above and following embodiments of this application is initiated to intercept and filter the access request, an index can be generated according to the set structure requirements. In some optional embodiments, the index can be obtained by combining the base string (baseString) and the signature information according to the set structure. The base string includes at least: data identification characters and the signature key version number used by the signature information. That is:

[0041] baseString=combination mode 1 (data identifier, signature key version number);

[0042] IndexKey = Combination2(baseString, signature_signKey(baseString))

[0043] Among them, signature_signKey(baseString) represents the signature information obtained by signing baseString with the signature key corresponding to the signature key version number.

[0044] Among them, combination mode 1 and combination mode 2 may include any combination with certain rules, which may be simple string concatenation, bytecode concatenation, or other combination modes. This embodiment includes but is not limited to these.

[0045] Based on the above, in some exemplary embodiments, when the data server determines whether the structure of the index in the query request meets the set structure requirements, it may determine whether the index is obtained by combining the base string and the signature information according to the set structure. The base string includes at least: a data identifier character and the signature key version number used by the signature information. If the index is obtained by combining the base string and the signature information according to the set structure, it is determined whether the signature key version number in the base string is a valid signature key version number. If the signature key version number is a valid signature key version number, it is determined that the structure of the index meets the set structure requirements.

[0046] The valid key version number may be determined by the data server based on the key version. For example, the data server may use the key version number with the highest version number as the valid key version number. Alternatively, the valid key version number may be the version number of a new version generated within a specified time period close to the current time, which is not limited in this embodiment.

[0047] In some exemplary embodiments, to further improve the security of the defense strategy, the version of the signing key used in the process of generating the index may be rotated and updated.

[0048] Optionally, the data server may respond to a key update event when generating a new index by updating the signature key version to obtain an updated target signature key version number. The key update event may be a timed event, a periodic arrival event, or an event resulting from receiving a key update instruction from a user, and this embodiment does not impose any limitations thereon.

[0049] After updating the signing key version, the data server may use the obtained target signing key version number to update the effective signing key version number. That is, the target signing key version number may replace the existing old effective signing key version number, or the target signing key version number may be added to the existing effective signing key version number. After updating the effective signing key version number, the data server may add existing indexes with signature key version numbers lower than the target signing key version number to the filter, so that access requests corresponding to these existing indexes can be filtered through the filter.

[0050] In this implementation, the signature key version number can dynamically change as the signature key version is rotated, further increasing the difficulty of cracking the index structure. Even if the index structure is attacked, the defense filtering performance can be improved by updating the signature key version.

[0051] In this implementation, when a signature key version is updated, the index using the old signature key version becomes a stored historical index. This historical index can be added to a filter, which then determines its validity. This implementation supports real-time updates of the index structure, improving security. Furthermore, by using filters to determine the validity of historical, stored indexes, the filter can speed up the determination process and reduce the system overhead required for structure-based determinations, thereby improving query response efficiency.

[0052] In some exemplary embodiments, if the structure of the index meets the set structure requirements, the data server may determine whether the index is a valid index based on the signature information contained in the index. In the embodiments of the present application, for ease of description and distinction, the signature information contained in the index is described as first signature information. The data server may obtain from the index the base string, the first signature information, and the signature key version number used for the first signature information. The first signature information is obtained by the requester signing the base string. The data server may use the signature key corresponding to the signature key version number and the same signing method as the requester to sign the base string, thereby obtaining second signature information. Next, the data server may determine whether the first signature information and the second signature information in the index are consistent. If the first signature information and the second signature information are consistent, the index is considered to be a non-forged index and the data server may determine that the index is a valid index. If the first signature information and the second signature information are inconsistent, the index is considered to be a forged index and the data server may block the index.

[0053] It should be noted that in some embodiments, users can set up an index whitelist based on actual needs. This whitelist can contain valid indexes that require special processing. When the structure of an index does not meet the set structure requirements and the index is determined to be invalid by the filter, the data server can use this whitelist to determine whether the index requires special processing. If the index passes the whitelist matching operation, the data server can perform data query operations based on the index. If the index does not pass the whitelist matching operation, the data server can return a message that the index query failed.

[0054] The following will be combined Figure 2 , further illustrating the attack defense methods provided by the above embodiments. First, the data server can load all the keys in the data query system into the Bloom filter by scanning all tables in the data query system, and provide a whitelist of keys that need not be intercepted for special reasons. Figure 2As shown, during the data server's pre-verification process, when a query key is received, the key's structure is first parsed to determine whether it meets the specified structural requirements. If the key meets the specified structural requirements, it is considered to be generated using the new version of the signing key. A signature can then be calculated to verify the key's validity. During the signature calculation and verification operation, the signature portion of the key is repeatedly calculated using the symmetric signing key signKey and compared with the signature portion of the key. If the key's structure does not meet the specified structural requirements, it is considered to be an existing key, and a filter can be used to verify the key's validity. If the key is determined to be valid based on the above two methods, it can be used to query the data query system. If the key is determined to be invalid based on the above two methods, the key whitelist can be used to determine whether it requires special processing. If it is a valid key requiring special processing, the data query system can be queried. Otherwise, a query failure message is returned.

[0055] When the data server intercepts malicious access based on the above-mentioned implementation methods, in the test of actual application scenarios, the interception rate of malicious access based on the signature information contained in the structure can reach more than 99.99%; the interception rate of malicious access requests based on the filter can also reach 99.99%, that is, the overall interception rate of the data server can reach 99.99%.

[0056] In addition to the data query system defense attack method that can be executed by the data server as described in the aforementioned embodiment, the embodiment of the present application also provides a data query system defense attack method that can be executed by a rich client. Among them, the rich client (Rich Internet Applications, RIA) refers to the client of the query system provided by the data server. In addition to being able to connect to the query system for querying, the rich client can also provide other additional functions, such as caching, validity verification, message notification awareness, and other enhanced functions that are linked to the query system. The implementation form of the rich client may include: a gateway device, a database proxy device, etc. An exemplary description will be given below.

[0057] Figure 3 A flowchart of a method for defending against attacks in a data query system provided by another exemplary embodiment of the present application is shown in FIG. Figure 3 As shown, the method includes:

[0058] Step 301: Receive a query request, where the query request includes an index of data to be queried.

[0059] Step 302: Determine whether the structure of the index meets the set structure requirements.

[0060] Step 303: If the structure of the index meets the set structure requirement, determine whether the index is a valid index based on the encrypted timestamp information contained in the index.

[0061] Step 304: If the structure of the index does not meet the set structure requirements, determine whether the index is a valid index through a preset filter; the filter stores the full index generated by the data server before constructing the filter.

[0062] Step 305: If the index is a valid index, the query request is sent to the corresponding data server.

[0063] In this embodiment, the rich client is located between the query user's client and the data server, and can intercept the query request and perform pre-verification on the query request.

[0064] In this embodiment, to identify invalid indexes, an index that is easily identifiable may be generated according to set structural requirements. The set structural requirements may specify the different elements included in the index and how the different elements are combined. After receiving a query request, the rich client may parse the structure of the index in the query request and determine whether the index structure meets the set structural requirements.

[0065] To prevent malicious attackers from generating a large number of invalid indexes after the index structure is exposed, the specified structure requires that the index include an encrypted timestamp. The encrypted timestamp is obtained by encrypting the specified timestamp using an agreed-upon encryption key. This specified timestamp can be a fixed timestamp or the timestamp of index generation, which is not a limitation in this embodiment. Encrypting the timestamp using the agreed-upon encryption key prevents tampering during transmission.

[0066] Based on this, if the structure of the index meets the set structure requirements, the index can be judged as valid based on the encrypted timestamp contained in the index. The rich client can attempt to decrypt the encrypted timestamp using the agreed decryption key to obtain the timestamp and then judge the validity of the index based on the timestamp.

[0067] In addition to indexes generated according to the specified structure, the data query system also includes existing indexes that were not generated according to the specified structure (i.e., indexes generated according to the historical index generation method). Therefore, when the index generation method is changed, a filter can be set to avoid affecting the query function of the existing indexes. This filter stores the existing indexes generated by the data server before the filter was constructed.

[0068] The filters are sent by the data server. The data server can send the latest filters to the rich client according to a set period (such as 12 hours, 24 hours, 3 days) to meet the real-time updated defense filtering needs.

[0069] In some embodiments, before determining whether the index is a valid index using a preset filter, the rich client may request the filter from the data server. The data server may scan the full data currently stored in the data query system, obtain the full index corresponding to the full data, and send the full index to the rich client for use in the rich client's filter. The full index may be cached in a HashMap table.

[0070] Optionally, the filter can be implemented as a Bloom filter. A Bloom filter is a probabilistic data structure that returns the probability that a key is definitely absent or possibly present. The penetration probability of a Bloom filter depends on the probability set during initialization.

[0071] Based on this, when the structure of the index does not meet the set structure requirements, the rich client can use a preset filter to determine whether the index is a valid index. If the filter determines that the index does not hit any pre-stored index, the index can be considered invalid. If the filter determines that the index hits a pre-stored index, the index can be considered valid.

[0072] If the index is determined to be valid based on the encrypted timestamp information contained in the index, or if the index is determined to be valid based on a preset filter, the rich client can send a request corresponding to the index to the data server, so that the data server can perform a data query operation based on the index. If the index is invalid, the rich client can intercept the query request corresponding to the index.

[0073] In this embodiment, when the rich client receives a query request, it can first judge the structure of the index in the query request. If the structure of the index meets the set structural requirements, then the index is judged to be a valid index based on the encrypted timestamp contained in the index. If the structure of the index does not meet the set requirements, then the index is judged to be a valid index based on the stock index saved in the filter. This method of verifying the validity of the index based on the encrypted timestamp in the index structure and the filter can filter and intercept indexes that meet the set structural requirements, and can also filter and intercept stock indexes that do not meet the set structural requirements. On the one hand, it is conducive to good compatibility with the query process of stock indexes in the data query system that do not comply with the set format requirements, thereby reducing the probability of the data query system being maliciously attacked. On the other hand, the efficiency of determining invalid indexes can be accelerated based on the filter, thereby reducing the attack and defense costs of the data query system.

[0074] Furthermore, in this embodiment, since the validity of an index can be determined using the encrypted timestamp in the index, the requirement for strong consistency between the index cached in the filter and the index actually stored in the data server is less stringent. Even if the set of indexes cached in the filter is smaller than the set of indexes actually stored in the data server, the rich client can still determine the validity of the index by verifying the encrypted information in the index.

[0075] Optionally, after initiating the schemes provided in the above and following embodiments of this application to intercept and filter access requests, an index may be generated according to the set structure requirements. In some optional embodiments, the base string (baseString) in the index may be obtained by combining at least the data identifier character, the encrypted timestamp information, and the encryption key version number according to the set structure. That is:

[0076] baseString = combination mode 1 (data identifier, encryption key version number, encryption_encKey (ramdonString, timeStamp));

[0077] Index Key = Combination 2 (baseString)

[0078] Where timeStamp can be the timestamp of index generation. encKey represents the symmetric encryption key, and encryption_encKey(ramdonString,timeStamp) represents the encrypted timestamp obtained by encrypting the random string and the timestamp of index generation using the encryption key corresponding to the key version number of the encryption key.

[0079] Among them, combination mode 1 and combination mode 2 may include any combination with certain rules, which may be simple string concatenation, bytecode concatenation, or other combination modes. This embodiment includes but is not limited to these.

[0080] Based on this, in some exemplary embodiments, when the rich client determines whether the structure of the index meets the set structure requirements, it can determine whether the basic string in the index is obtained by combining the data identification characters, the encrypted timestamp information and the encryption key version number according to the set structure; if so, the rich client can determine whether the key version number in the basic string is a valid encryption key version number; if so, the rich client can determine that the structure of the index meets the set structure requirements.

[0081] The rich client may periodically receive a decryption key corresponding to a valid encryption key version number sent by the data server. The valid encryption key version number may be determined by the data server based on the key version. For example, the data server may use a key version number with a higher version number as the valid encryption key version number. Alternatively, the valid encryption key version number may be the version number of a new version generated within a specified time period close to the current time, although this embodiment does not impose any limitation thereto.

[0082] In some exemplary embodiments, if the structure of the index meets the set structure requirements, the rich client can obtain the encrypted timestamp information and encryption key version number from the index when determining whether the index is a valid index based on the encrypted timestamp information contained in the index; and use the decryption key corresponding to the encryption key version number to decrypt the encrypted timestamp information to obtain the generation timestamp of the index.

[0083] If the generation timestamp of the index is less than or equal to the construction timestamp of the filter, the rich client uses the filter to determine whether the index is a valid index.

[0084] If the index's generation timestamp is greater than the filter's construction timestamp and less than the current timestamp, the rich client determines the index to be valid. This means the index is likely recently generated. A timestamp less than the current timestamp can include a time difference greater than a set time threshold. This can mitigate misjudgments caused by clock inaccuracies between different devices.

[0085] If the generation timestamp of the index is greater than or equal to the timestamp of the current moment, the index is determined to be an invalid index.

[0086] In some embodiments, an index whitelist can be set up based on actual needs. This whitelist can store valid indexes that require special processing. When the structure of an index does not meet the set structural requirements and the index is determined to be invalid by the filter, the whitelist can be used to determine whether the index requires special processing. If the index passes the whitelist matching operation, the data server can perform data query operations based on the index. If the index does not pass the whitelist matching operation, the data server can return a message that the index query failed.

[0087] The following will be combined Figure 4 , further illustrating the attack defense methods provided by the above embodiments. First, the rich client obtains the filter, the whitelist of keys, and the symmetric encryption key from the data server.

[0088] like Figure 4As shown, during the pre-verification process of the rich client, when a query key is received, the key structure can be first parsed to determine whether it meets the set structural requirements. If the key does not meet the set structural requirements, the validity of the index can be determined through the filter. If the key does meet the set structural requirements, the encrypted timestamp can be decrypted using the corresponding decryption key based on the key structure and encryption key version information.

[0089] If the decrypted timestamp indicates that the key's construction time is after the filter's construction time but before the current time, the query key can be sent to the data server for query. If the key meets the set structure requirements, but the key's construction time is after the current time, it can be determined to be invalid and blocked. If the key meets the set structure requirements, but the key's construction time is before the filter's construction time, the key's validity can be determined through the filter.

[0090] If the filter determines that the key is invalid, the key whitelist can be used to determine its validity. If the whitelist determines that the key is a valid key that requires special processing, the data query system will be queried. Otherwise, a query failure message will be returned.

[0091] When the data server intercepts malicious access based on the above implementations, in real-world testing, the higher the filter update efficiency and penetration rate, the higher the rich client's interception rate of malicious access requests. In some scenarios, if the filter is updated on a daily basis and the filter penetration probability is set to 99.99%, the rich client's overall interception rate can reach 99.99%.

[0092] It should also be noted that, in order to facilitate the data server or rich client to pre-verify the access request using the above embodiment, the pre-verification information required by the above various implementation methods can be comprehensively considered when designing the index structure. That is, the index can be generated based on elements such as a random string (ramdonString), the index generation timestamp (timeStamp), the encryption key (encKey), the signature key (signKey), the key version number of the signature key, and the encryption key version number. That is:

[0093] baseString = combination mode 1 (data identifier, signature key version number, encryption key version number, encryption_encKey(ramdonString, timeStamp));

[0094] IndexKey = Combination2(baseString, signature_signKey(baseString))

[0095] Among them, combination mode 1 and combination mode 2 may include any combination with certain rules, which may be simple string concatenation, bytecode concatenation, or other combination modes. This embodiment includes but is not limited to these.

[0096] After the index is formed based on the above structure, the defense interception on the rich client side can be started, or the defense interception on the data server side can be started, or the rich client and the data server can be started at the same time to perform two-layer defense interception.

[0097] While the index verification logic differs between the rich client and the data server, the computational complexity is the same. Specifically, the rich client focuses only on the encrypted portion of the information and only needs to perform a single decryption calculation, skipping the signature calculation. This ensures that the signature key is not leaked and could create a systemic compromise risk. The data server focuses only on the signed portion of the information and only needs to perform a single signature calculation, skipping the decryption calculation, achieving the same computational complexity as the rich client.

[0098] Among them, such as Figure 5 As shown, if both the rich client and the data server are enabled simultaneously for two-tiered defense interception, the rich client performs pre-verification before the query request reaches the data query system service, and the data server performs pre-verification after the query request reaches the data server. That is, before the access request reaches the data server, the rich client verifies the validity of the index based on the index structure and encrypted timestamp. After the access request reaches the data server, the data server verifies the validity of the index based on the index structure and signature information. For details, please refer to the description of the aforementioned embodiment and will not be repeated here.

[0099] Optionally, when performing two-tier interception based on the rich client and the data server, the filters in the rich client and the data server can share the same index cache data. Specifically, the rich client and the data server can share a cache instance that stores a set of valid indexes, which the data server manages. During pre-verification, both the rich client and the data server can query and determine the validity of the indexes using this shared cache instance. This will not be further detailed.

[0100] In this implementation, two-layer interception based on the rich client and the data server can further improve the interception rate and reduce the probability of the data query system being maliciously attacked.

[0101] It should be noted that the execution entity of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution entity of steps 101 to 103 can be device A; for another example, the execution entity of steps 101 and 102 can be device A, and the execution entity of step 103 can be device B; and so on.

[0102] In addition, some of the processes described in the above embodiments and the accompanying drawings include multiple operations that appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order in which they appear in this document or may be executed in parallel. The sequence numbers of the operations, such as 101, 102, etc., are merely used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel.

[0103] Figure 6 The schematic diagram of the structure of the server provided by an exemplary embodiment of the present application is shown, and a data query system is deployed on the server. Figure 6 As shown, the server includes: a memory 601 , a processor 602 and a communication component 603 .

[0104] Memory 601 is used to store computer programs and can be configured to store various other data to support operations on the server. Examples of such data include instructions for any application or method operating on the server, contact data, phone book data, messages, pictures, videos, etc.

[0105] Among them, the memory 601 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0106] Processor 602 is coupled to memory 601 and is used to execute a computer program in memory 601, so as to: receive a query request, the query request including an index of data to be queried; determine whether the structure of the index meets the set structure requirements; if the structure of the index meets the set structure requirements, determine whether the index is a valid index based on the signature information included in the index; if the structure of the index does not meet the set structure requirements, determine whether the index is a valid index through a preset filter; the filter stores existing indexes that do not comply with the set structure requirements; if the index is a valid index, perform a data query operation based on the index.

[0107] Further optionally, when determining whether the structure of the index meets the set structure requirements, the processor 602 is specifically used to: determine whether the index is obtained by combining a basic string and the signature information according to a set structure; the basic string includes at least: a data identification character and a signature key version number used by the signature information; if the index is obtained by combining the basic string and the signature information according to a set structure, then determine whether the signature key version number is a valid signature key version number; if the signature key version number is a valid signature key version number, then determine that the structure of the index meets the set structure requirements.

[0108] Further optionally, if the structure of the index meets the set structure requirements, the processor 602, when determining whether the index is a valid index based on the signature information contained in the index, is specifically used to: obtain the basic string, the signature information, and the signature key version number used for the signature information from the index; use the signature key corresponding to the signature key version number to sign the basic string to obtain new signature information; determine whether the signature information in the index is consistent with the new signature information; if they are consistent, determine that the index is a valid index.

[0109] Further optionally, after determining whether the signature key version number is a valid signature key version number, the processor 602 is further used to: respond to a key update event when a new index is generated, update the signature key version to obtain an updated target signature key version number; use the target signature key version number to update the valid signature key version number; and add the existing indexes whose signature key version numbers are lower than the target signature key version number to the filter, so as to filter access requests corresponding to the existing indexes through the filter.

[0110] Further optionally, before determining whether the index is a valid index through a preset filter, the processor 602 is also used to: scan the full data in the data server to obtain a full index corresponding to the full data; and add the full index to the filter so that the filter determines the validity of the index in the received query request based on the full index.

[0111] Further, if Figure 6 As shown, the server also includes: a communication component 603, a power supply component 604 and other components. Figure 6 Only some components are shown schematically, which does not mean that the server only includes Figure 6 Components shown.

[0112] Among them, the communication component 603 is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component can be implemented based on near field communication (NFC) technology, radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0113] The power supply component 604 provides power to various components of the device in which the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply component is located.

[0114] In this embodiment, after the data server receives a query request, it can first determine the structure of the index in the query request. If the structure of the index meets the set structural requirements, it can determine whether the index is a valid index based on the signature information contained in the index. If the structure of the index does not meet the set requirements, it can determine whether the index is a valid index based on the existing indexes that do not comply with the set structural requirements stored in the filter. This method of verifying the validity of the index based on the signature information in the structure of the index and the filter can filter and intercept indexes that meet the set structural requirements, as well as filter and intercept existing indexes that do not meet the set structural requirements. On the one hand, it is conducive to good compatibility with the query process of existing indexes in the data query system that do not comply with the set format requirements, thereby reducing the probability of the data query system being maliciously attacked. On the other hand, the efficiency of determining invalid indexes can be accelerated based on the filter, thereby reducing the attack and defense costs of the data query system.

[0115] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be executed by the server in the above embodiment.

[0116] Accordingly, an embodiment of the present application also provides a computer program product, including a computer program / instructions, wherein, when the computer program is executed by a processor, the processor is caused to implement the steps that can be executed by the server in the above embodiment.

[0117] Figure 7 The schematic diagram of the structure of a gateway device provided by an exemplary embodiment of the present application is shown, and the gateway device is deployed between the client and the data server. Figure 7 As shown, the gateway device includes: a memory 701 , a processor 702 and a communication component 703 .

[0118] Memory 701 is used to store computer programs and can be configured to store various other data to support operations on the server. Examples of such data include instructions for any application or method operating on the server, contact data, phone book data, messages, pictures, videos, etc.

[0119] Among them, the memory 701 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0120] The processor 702 is coupled to the memory 701 and is used to execute the computer program in the memory 701, so as to: receive a query request through the communication component 703, the query request including the index of the data to be queried; determine whether the structure of the index meets the set structure requirements; if the structure of the index meets the set structure requirements, determine whether the index is a valid index based on the encrypted timestamp information contained in the index; if the structure of the index does not meet the set structure requirements, determine whether the index is a valid index through a preset filter; the filter stores the full index generated by the data server before constructing the filter; if the index is a valid index, send the query request to the corresponding data server.

[0121] Further optionally, when the processor 702 determines whether the structure of the index meets the set structure requirements, it is specifically used to: determine whether the basic character string in the index is obtained by combining the data identification characters, the encrypted timestamp information and the encryption key version number according to the set structure; if the basic character string in the index is obtained by combining the data identification characters, the encrypted timestamp information and the encryption key version number according to the set structure, then determine whether the encryption key version number is a valid encryption key version number; if the encryption key version number is a valid encryption key version number, then determine that the structure of the index meets the set structure requirements.

[0122] Further optionally, if the structure of the index meets the set structure requirements, the processor 702, when determining whether the index is a valid index based on the encrypted timestamp information contained in the index, is specifically used to: obtain the encrypted timestamp information and the encryption key version number from the index; use the decryption key corresponding to the encryption key version number to decrypt the encrypted timestamp information to obtain the generation timestamp of the index; if the generation timestamp of the index is less than or equal to the construction timestamp of the filter, use the filter to determine whether the index is a valid index; if the generation timestamp of the index is greater than the construction timestamp of the filter and less than the timestamp of the current moment, determine that the index is a valid index; if the generation timestamp of the index is greater than the construction timestamp of the filter and less than the timestamp of the current moment, determine that the index is an invalid index.

[0123] Further optionally, before determining whether the structure of the index meets the set structure requirement, the processor 702 further includes: receiving the filter sent by the data server and the decryption key corresponding to the valid encryption key version number.

[0124] Further, if Figure 7 As shown, the gateway device also includes other components such as a display component 704 , a power component 705 , and an audio component 706 . Figure 7 Only some components are shown schematically, which does not mean that the gateway device only includes Figure 7 Components shown.

[0125] Among them, the communication component 703 is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component can be implemented based on near field communication (NFC) technology, radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0126] The display component 704 includes a liquid crystal display (LCD) and a touch panel (TP). If the display component 704 includes a touch panel, the display component 704 can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor can not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

[0127] The power supply component 705 provides power to various components of the device in which the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply component is located.

[0128] Among them, the audio component 706 is stored as output and / or input audio signals. For example, the audio component 706 includes a microphone (MIC), and when the device where the audio component 706 is located is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in a memory or sent via a communication component. In some embodiments, the audio component 706 also includes a speaker for outputting audio signals.

[0129] In this embodiment, when the rich client receives a query request, it can first judge the structure of the index in the query request. If the structure of the index meets the set structural requirements, then the index is judged to be a valid index based on the encrypted timestamp contained in the index. If the structure of the index does not meet the set requirements, then the index is judged to be a valid index based on the stock index saved in the filter. This method of verifying the validity of the index based on the encrypted timestamp in the index structure and the filter can filter and intercept indexes that meet the set structural requirements, and can also filter and intercept stock indexes that do not meet the set structural requirements. On the one hand, it is conducive to good compatibility with the query process of stock indexes in the data query system that do not comply with the set format requirements, thereby reducing the probability of the data query system being maliciously attacked. On the other hand, the efficiency of determining invalid indexes can be accelerated based on the filter, thereby reducing the attack and defense costs of the data query system.

[0130] Furthermore, in this embodiment, since the validity of an index can be determined using the encrypted timestamp in the index, the requirement for strong consistency between the index cached in the filter and the index actually stored in the data server is less stringent. Even if the set of indexes cached in the filter is smaller than the set of indexes actually stored in the data server, the rich client can still determine the validity of the index by verifying the encrypted information in the index.

[0131] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be executed by the server in the above embodiment.

[0132] Accordingly, an embodiment of the present application also provides a computer program product, including a computer program / instructions, wherein, when the computer program is executed by a processor, the processor is caused to implement the steps that can be executed by the server in the above embodiment.

[0133] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0134] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts 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 produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0135] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0136] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.

[0137] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0138] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0139] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0140] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0141] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims

1. A method for defending against attacks on a data query system, characterized in that: include: Receive a query request, wherein the query request includes an index of the data to be queried; Determining whether the structure of the index meets the set structure requirements; If the structure of the index meets the set structure requirements, determining whether the index is a valid index based on the signature information contained in the index; If the structure of the index does not meet the set structure requirements, a preset filter is used to determine whether the index is a valid index; the filter stores existing indexes that do not comply with the set structure requirements; the version of the signature key used to generate the signature information is rotated and updated, and the existing index refers to the index of the signature key using the old version after the signature key version is rotated and updated; If the index is a valid index, a data query operation is performed according to the index.

2. The method according to claim 1, characterized in that Determining whether the structure of the index meets the set structure requirements includes: Determine whether the index is obtained by combining a basic character string and the signature information according to a set structure; the basic character string includes at least: a data identification character and a signature key version number used by the signature information; If the index is obtained by combining the basic character string and the signature information according to a set structure, determining whether the signature key version number is a valid signature key version number; If the signature key version number is a valid signature key version number, it is determined that the structure of the index meets the set structure requirements.

3. The method according to claim 2, characterized in that If the structure of the index meets the set structure requirements, determining whether the index is a valid index based on the signature information contained in the index includes: Obtain the base string, the signature information, and the signature key version number used by the signature information from the index; Using the signature key corresponding to the signature key version number, the basic string is signed to obtain new signature information; Determining whether the signature information in the index is consistent with the new signature information; If they are consistent, the index is determined to be a valid index.

4. The method according to claim 2, characterized in that After determining whether the signature key version number is a valid signature key version number, the method further includes: In response to the key update event when a new index is generated, the signature key is updated to obtain the updated target signature key version number; Updating the valid signing key version number using the target signing key version number; The stock index whose signature key version number is lower than the target signature key version number is added to the filter, so as to filter the access request corresponding to the stock index through the filter.

5. The method according to any one of claims 1 to 4, characterized in that Before determining whether the index is a valid index through a preset filter, the method further includes: Scan the full amount of data in the data server to obtain the full amount of index corresponding to the full amount of data; The full index is added to the filter, so that the filter determines the validity of the index in the received query request based on the full index.

6. A method for defending against attacks on a data query system, characterized in that: Applied to a rich client, the method includes: Receive a query request, wherein the query request includes an index of the data to be queried; Determining whether the structure of the index meets the set structure requirements; If the structure of the index meets the set structure requirements, determining whether the index is a valid index based on the encrypted timestamp information contained in the index; If the structure of the index does not meet the set structure requirements, a preset filter is used to determine whether the index is a valid index; the filter stores the full index generated by the data server before constructing the filter; the filter is sent to the rich client by the data server according to a set period to meet the real-time updated defense filtering requirements; If the index is a valid index, the query request is sent to the corresponding data server.

7. The method according to claim 6, characterized in that Determining whether the structure of the index meets the set structure requirements includes: Determining whether a basic character string in the index is obtained by combining a data identification character, encrypted timestamp information, and an encryption key version number according to a set structure; If the basic character string in the index is obtained by combining the data identification character, the encrypted timestamp information and the encryption key version number according to a set structure, then determining whether the encryption key version number is a valid encryption key version number; If the encryption key version number is a valid encryption key version number, it is determined that the structure of the index meets the set structure requirement.

8. The method according to claim 7, characterized in that If the structure of the index meets the set structure requirements, determining whether the index is a valid index based on the encrypted timestamp information contained in the index includes: Obtaining the encrypted timestamp information and the encryption key version number from the index; Decrypting the encrypted timestamp information using the decryption key corresponding to the encryption key version number to obtain a generation timestamp for the index; If the generation timestamp of the index is less than or equal to the construction timestamp of the filter, then the filter is used to determine whether the index is a valid index; If the generation timestamp of the index is greater than the construction timestamp of the filter and less than the timestamp of the current moment, the index is determined to be a valid index; If the generation timestamp of the index is greater than or equal to the timestamp of the current moment, the index is determined to be an invalid index.

9. The method according to claim 7 or 8, characterized in that Before determining whether the structure of the index meets the set structure requirement, the method further includes: receiving the filter sent by the data server and the decryption key corresponding to the valid encryption key version number.

10. A server, characterized in that: include: memory and processor; The memory is used to store one or more computer instructions; The processor is configured to execute the one or more computer instructions to perform the steps of the method according to any one of claims 1 to 5.

11. A gateway device, characterized in that: include: memory and processor; The memory is used to store one or more computer instructions; The processor is configured to execute the one or more computer instructions to perform the steps of the method according to any one of claims 6 to 9.

12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 can be implemented.

Citation Information

Patent Citations

  • Method, device, server and system for inquiring data

    CN103593419A

  • Data query method and apparatus

    CN105718455A