Data caching method and device and server
A data cache and server technology, applied in the computer field, can solve problems such as system crash and slow system response
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0035] like figure 1 As shown, in order to solve the problem of slow system response or system crash in a high-concurrency environment when calling the API to request data, this embodiment proposes a data caching method, including the following steps:
[0036] receiving a data request from the client, obtaining a POST request or a non-POST request according to the data request, the POST request including at least one remote API address and its parameters, and the non-POST request including at least one remote API address;
[0037] Each API address and parameter of the POST request are combined and hashed to obtain each hash value, or each API address of the non-POST request is hashed to obtain each hash value, and each hash Value as an index into the data cache entry.
[0038] The data request in this step can be a commodity request, including one or more of commodity information, commodity inventory, or commodity discount; at least one remote API address request, such as com...
Embodiment 2
[0047] Corresponding to Embodiment 1, this embodiment provides a data cache device, such as figure 2 As shown, the device includes:
[0048] A receiving module, configured to receive a data request from a client, obtain a POST request or a non-POST request according to the data request, the POST request includes at least one remote API address and its parameters, and the non-POST request includes at least one remote API address;
[0049] The operation module is used to combine the API addresses and parameters of the POST request to perform hash operation to obtain each hash value, or to perform hash operation to each API address of the non-POST request to obtain each hash value , using each hash value as an index of the data cache item;
[0050] A query module, configured to query whether the data exists in the local database;
[0051] A request module, configured to send a normal request API to obtain data if the data does not exist;
[0052] The cache module is used to c...
Embodiment 3
[0063] A server such as image 3 As shown, it includes a processor and a machine-readable storage medium, the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and when the processor executes the machine-executable instructions, the following step:
[0064] receiving a data request from the client, obtaining a POST request or a non-POST request according to the data request, the POST request including at least one remote API address and its parameters, and the non-POST request including at least one remote API address;
[0065] The API addresses and parameters of the POST request are combined and hashed to obtain each hash value, or each API address of the non-POST request is hashed to obtain each hash value, and each hash value as an index into said data cache entry;
[0066] Query whether the data exists in the local database. If the data does not exist, send a normal request to the API to obtain the data. If the ...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com