CN111563216A - Local data caching method and device and related equipment - Google Patents

Local data caching method and device and related equipment Download PDF

Info

Publication number
CN111563216A
CN111563216A CN202010685262.1A CN202010685262A CN111563216A CN 111563216 A CN111563216 A CN 111563216A CN 202010685262 A CN202010685262 A CN 202010685262A CN 111563216 A CN111563216 A CN 111563216A
Authority
CN
China
Prior art keywords
data
target
interface
preset
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010685262.1A
Other languages
Chinese (zh)
Other versions
CN111563216B (en
Inventor
刘君操
伍志强
曹帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ping An Smart Healthcare Technology Co ltd
Original Assignee
Ping An International Smart City Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An International Smart City Technology Co Ltd filed Critical Ping An International Smart City Technology Co Ltd
Priority to CN202010685262.1A priority Critical patent/CN111563216B/en
Publication of CN111563216A publication Critical patent/CN111563216A/en
Application granted granted Critical
Publication of CN111563216B publication Critical patent/CN111563216B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Abstract

The application relates to the field of data processing, and provides a local data caching method, a local data caching device and related equipment, wherein the method comprises the following steps: extracting target parameters corresponding to the data access request and extracting a target interface corresponding to the data access request according to the input data access request; receiving response data corresponding to the data access request returned by the server through the target interface; comparing the target interface with a preset interface list; and if the target interface is not matched with any interface in the preset interface list, acquiring the access times and the average response time of the target parameter in a time window before the current time point. In addition, the application also relates to a block chain technology, and the preset interface list is stored in the block chain. According to the technical scheme, on the basis of saving unnecessary calculation operation of a trusted interface, the technical effect that data with access times and average response time length meeting preset conditions are stored in a local browser for caching is achieved.

Description

Local data caching method and device and related equipment
Technical Field
The present application relates to the field of data processing, and in particular, to a local data caching method, a local data caching apparatus, an electronic device, and a readable storage medium.
Background
With the high-speed development of the internet, the number of users is increasing continuously, and the performance of the system faces a huge challenge, wherein an important measure for improving the performance of the website is to cache hot spot data, and when the hot spot data is taken out from the cache and then directly respond, the cache is one or more small high-speed connected memories, when a processor reads or writes, whether target data exists in the cache is checked firstly, if so, the processor firstly points to the cache instead of other memories (such as a memory), so that downstream services or disk databases are avoided being accessed, the request time is reduced, and the concurrency capability and the throughput are improved.
Disclosure of Invention
Embodiments of the present application provide a local data caching method, a local device caching apparatus, an electronic device, and a readable storage medium, which solve, at least to a certain extent, the problems of too many operations of a trusted interface, cache of only hotspot parameters, and no consideration of access time and average response time.
Wherein, the technical scheme who adopts that this application provided does:
extracting target parameters corresponding to the data access request and extracting a target interface corresponding to the data access request according to the input data access request; receiving response data corresponding to the data access request returned by the server through the target interface; comparing the target interface with a preset interface list, wherein the preset interface list comprises a white list and a black list, if the target interface is matched with any interface in the white list, displaying response data and storing the target data in the response data into a local browser cache, and if the target interface is matched with any interface in the black list, displaying the response data; if the target interface is not matched with any interface in the preset interface list, acquiring the access times and the average response time of the target parameter in a time window before the current time point; and if the access times and the average response time meet preset conditions, storing the target data in the response data into a local browser for caching.
In some embodiments of the present application, based on the foregoing solution, before obtaining the number of accesses to the target parameter in a time window before the current time point and the average response time length, the method includes: and constructing an identification parameter according to the target parameter, wherein the identification parameter is used for recording the access times and the average response time length of the target parameter in a time window before the current time point.
In some embodiments of the present application, based on the foregoing solution, constructing the identification parameter according to the target parameter includes: sequencing the target parameters to form a target parameter sequence; constructing a character string according to the target parameter sequence; and taking the character string as an identification parameter corresponding to the target parameter.
In some embodiments of the present application, based on the foregoing scheme, if the number of accesses and the average response time meet a preset condition, storing target data in the response data into a local browser cache, includes: monitoring the access times of the target parameters; if the access times reach a preset threshold value, acquiring an average response time length corresponding to the target parameter; comparing the average response time length with a preset response time length; and if the average response time length is greater than or equal to the preset response time length, storing the target data in the response data into a local browser cache.
In some embodiments of the present application, based on the foregoing solution, the method further includes: and updating the local browser cache according to a preset rule, wherein the preset rule comprises automatic expiration, active clearing and timing scanning.
In some embodiments of the present application, based on the foregoing scheme, the local browser cache is updated according to a preset rule, where the preset rule includes active purging, and the method includes: receiving an instruction for deleting specified target data in the local browser cache; according to the instruction, the specified target data is deleted.
In some embodiments of the present application, based on the foregoing scheme, the local browser cache is updated according to a preset rule, where the preset rule includes timing scanning, and the method includes: when a preset time point is reached, obtaining the use frequency of each cached target data; and clearing the target data with the use frequency less than the preset frequency according to the use frequency of each target data.
The present application further provides a local data caching device, which is applied to a client browser, and the device includes: the extraction unit is used for extracting target parameters corresponding to the data access request and extracting a target interface corresponding to the data access request according to the input data access request; the receiving unit is used for receiving response data which are returned by the server and correspond to the data access request through the target interface; the processing unit is used for comparing the target interface with a preset interface list, the preset interface list comprises a white list and a black list, if the target interface is matched with any interface in the white list, the response data is displayed and stored in a local browser cache, and if the target interface is matched with any interface in the black list, the response data is displayed; the acquisition unit is used for acquiring the access times and the average response time length of the target parameter in a time window before the current time point if the target interface is not matched with any interface in the preset interface list; and the determining unit is used for storing the response data into the local browser for caching if the access times and the average response time meet preset conditions.
The present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the local data caching method as described above when executing the program.
The present application also provides a readable storage medium, which stores a computer program, which, when executed by a processor, may implement the steps of the local data caching method as described above.
The technical scheme provided by the application embodiment can have the following beneficial effects:
according to the technical scheme, on the basis of saving unnecessary calculation operation of a trusted interface, the technical effect that data with access times and average response time length meeting preset conditions are stored in a local browser for caching is achieved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 shows a schematic diagram of an implementation environment in which embodiments of the present application may be applied.
FIG. 2 shows a flow diagram of a local data caching method according to one embodiment of the present application.
FIG. 3 shows a flow diagram of a local data caching method according to another embodiment of the present application.
Fig. 4 shows a flowchart of an embodiment of the step S250 of the local data caching method of the embodiment shown in fig. 2.
FIG. 5 shows a block diagram of a local data caching device 500 according to one embodiment of the present application.
FIG. 6 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of the systems and methods of the present application as detailed in the appended claims.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating an implementation environment in which embodiments of the present application may be applied. As shown in fig. 1, the implementation environment includes at least a terminal 101 and a server 102.
Illustratively, the terminal 101 has a browser, which is an application program used to retrieve, present, and deliver Web information resources. Web information resources are tagged by a Uniform Resource Identifier (URI). Illustratively, when a Uniform Resource Locator (URL) is entered in the search bar of the browser, the corresponding response content is displayed in the page of the browser. In fact, in the process, the terminal 101 sends a data access request to the server where the website is located, the website server receives the data access request, processes and analyzes the data access request, then returns response data corresponding to the data access request, and sends the response data to the browser in the terminal 101, where the response data includes content such as a source code, and the browser analyzes the response data to present a corresponding webpage.
The browser in the terminal 101 has a local browser cache, and can store part of data locally, and when the data is stored locally, the browser does not need to request the server 102 for the data, so that the transmission of the data between the browser and the server can be reduced, and the consumption of the CPU performance is reduced.
It should be noted that, according to actual needs, the capacity of any local browser cache may be set, and the effective time of the target data stored in the local browser cache may be determined arbitrarily, which is not limited herein.
It should be understood that the terminal 101 may be any intelligent device that can be installed with a browser application. The number of the terminals 101 and the servers 102 is only illustrative, and the terminals 101 may be any number, and the servers 102 may also be a server cluster composed of a plurality of servers according to actual needs.
Fig. 2 shows a flowchart of a local data caching method according to an embodiment of the present application, where the method may be specifically executed by a browser in the terminal 101 in the implementation environment shown in fig. 1, and may also be specifically executed by the server 102, which is not limited herein.
As shown in fig. 2, in an exemplary embodiment, the local data caching method may include steps S210 to S250.
Step S210, according to the input data access request, extracting a target parameter corresponding to the data access request, and extracting a target interface corresponding to the data access request.
The data access request is sent to the server by the browser in the terminal and used for requesting response data. An access request comprises four parts of a request mode, a request link, a request head and a request body. The request mode includes GET for acquiring the resource, POST for transmitting the entity, and so on. Illustratively, a GET request is a request for directly entering a URL in a browser and returning, i.e., representing that a GET request was issued.
A complete URL includes a protocol portion, a domain name portion, a port portion, a virtual target portion, a file name portion, an anchor portion, and a parameter portion. Again taking the request mode as GET for example, where the parameter part is from the URL "
Figure 147076DEST_PATH_IMAGE001
The portion between "start and" # ".
If the request mode is a POST request, the parameters are located in a request body of the data access request.
Therefore, the target parameter corresponding to the data access request can be easily obtained according to the input data access request.
And the target interface is provided by the server, points to a certain file of the server, can acquire the corresponding target interface according to the content of the data access request sent by the browser, and returns response data requested by the data access request through the target interface.
Step S220, receiving response data corresponding to the data access request returned by the server through the target interface.
And after receiving the data access request sent by the terminal, the server returns response data to the terminal sending the data access request through the target interface. The response data comprises a response line, a response head and a response body. The response head includes the time used by the response, and the response body includes the requested data. Illustratively, if an HTML page is requested, then the response body is HTML code.
Step S230, comparing the target interface with a preset interface list, where the preset interface list includes a white list and a black list, if the target interface matches with any interface in the white list, displaying the response data and storing the target data in the response data in a local browser cache, and if the target interface matches with any interface in the black list, displaying the response data.
And comparing the obtained target interface with a preset interface list, wherein the preset interface list comprises a white list and a black list. Specifically, when a user inputs a URL at a client, if a target interface pointed by the URL is an interface in a white list, target data in response data returned by the target interface is stored in a browser cache, and if the URL is pointed to an interface in an interface black list, the returned response data is not cached after the interface displays the response data, so that unnecessary calculation operations of a part of trusted interfaces can be omitted. The white list and the black list may be set by the user according to a preference or an actual situation, or may be set by a system developer, where the setting is not limited, and it should be noted that, since the response data includes data that is unrelated to the service and is included in order to present the relevant page, only the target data in the response data needs to be stored in the local browser cache.
Step S240, if the target interface is not matched with any interface in the preset interface list, acquiring the access times and the average response time of the target parameter in a time window before the current time point.
If the target interface is not matched with any interface in the preset interface list, the access times of each data access request which is not in the interface white list or the interface black list in a time window and the access time of each access need to be saved.
The access time may be extracted from each access time of a response header of the response data, after the access time and the access time of each access are extracted, a cached identification parameter may be constructed by the extracted target parameter, the access time of the same target parameter in a certain time window and the access time of each access are recorded in a value of the identification parameter, illustratively, a character string may be constructed by the extracted parameter, the character string is used as the identification parameter, a parameter set may also be constructed by the extracted parameter, and the parameter set is used as the identification parameter, which is not limited herein.
And recording the access times of the access requests corresponding to the identification parameters with the same target parameters and the access time of each time into a cache database. Specifically, the identification parameter constructed from the extracted target parameter may be stored in the cache database as a key, and the number of accesses and the time for each access may be recorded by the value of the key.
It should be noted that, since the access time is related to the network state of each client, the access time may be recorded in the identification parameter constructed by the target parameter by using the time from the time point when the data access request is received to the time point when the response data is transmitted, or by using the time from the time point when the data access request is transmitted to the time point when the first byte of the response data is received as the access time.
It should be noted that, the data requested by the data access request may also be stored in the disk database, and therefore, the access time may also be the time of querying the disk database according to the actual situation.
The average response time length is added for each access and divided by the number of accesses. In this embodiment, the average response time length is used as a condition for determining whether to store the target data in the response data into the browser cache, and is used for filtering out the request with slower response.
And step S250, if the access times and the average response time length meet preset conditions, storing target data in the response data into a local browser for caching.
And the access times and the average response time are used as conditions for judging the cache necessity, so that data which are accessed at high frequency and have long access time are screened out and stored in a cache database of the local browser.
On the basis of the local data caching method according to an embodiment of the present application shown in fig. 2, in step S240, before obtaining the number of accesses of the target parameter in a time window before the current time point and the average response time, in an exemplary embodiment, the local data caching method may further include:
and constructing an identification parameter according to the target parameter, wherein the identification parameter is used for recording the access times and the average response time length of the target parameter in a time window before the current time point.
Specifically, if the number of the target parameters is one, the target parameters may be used as identification parameters for recording the number of access times and the average response time duration.
FIG. 3 shows a flow diagram of a local data caching method according to another embodiment of the present application.
In this embodiment, if there are multiple target parameters, the local data caching method may further include steps S310 to S330.
Step S310, sequencing the target parameters to form a target parameter sequence.
In particular, the plurality of target parameters may be ordered in the order of the alphabets A-Z to ensure that the same sequence of target parameters may be constructed regardless of the order in which the target parameters were obtained.
Step S320, constructing a character string according to the target parameter sequence.
It is easy to understand that string type data is easy to store and read. Thus, a character string can be constructed from the target parameter sequence.
Specifically, a character string S for recording parameters is declared, when the request is a GET request, a target parameter in the data access request is analyzed, if the parameter name to be judged is one, S is a parameter name = a parameter value, if the parameter name to be judged is multiple, S is a parameter name 1= a parameter value 1& a parameter name 2= a parameter value 2, and so on, splicing is performed, and before splicing, the parameter name 1 and the parameter name 2 are sorted in a lexicographic order, so that the parameter character string constructed when the parameters are combined is fixed.
In a further embodiment, when the request method is a POST request, the multiple levels are represented in the form of parameter name 1, parameter name 2= parameter value 1& parameter name 3, parameter name 4= parameter value 2, due to the hierarchical relationship involving the parameters.
In step S330, the character string is used as an identification parameter corresponding to the target parameter.
The character string obtained in step S320 is used as an identification parameter for storing the number of accesses of the target parameter in a time window before the current time point and the average response time length.
Illustratively, the manner of storing includes: splicing the service identifier which needs to be recorded in the cache and the uri and the S of the request, wherein the service identifier and the uri and the S are used as the unique identifier of the cache key of each request parameter of each interface under a certain service, such as: the runningTime-/hello-parameter name 1= parameter value 1& parameter value 2= parameter value 2, which represents the interface with uri/hello, and in the case that the key value of two request parameters is parameter name 1= parameter value 1& parameter value 2= parameter value 2, the number of accesses in a time window and the average response time length are recorded, and the character string will be used as the identification parameter of the cache storing the running time.
In an exemplary embodiment, on the basis of the local data caching method according to an embodiment of the present application shown in fig. 2, fig. 4 shows a flowchart of an embodiment of step S250 of the local data caching method shown in fig. 2.
Specifically, step S250 may include the following step S410 and step S440.
Step S410, monitoring the number of accesses to the target parameter.
As mentioned above, the identification parameter records the access times of the corresponding target parameter within a time window, and the access times of the target parameter of the high-frequency request can be set in advance, illustratively, 10 times/hour. And when a certain identification number reaches a threshold value of 10 times/hour, triggering a program for acquiring the average response time length.
In step S420, if the access times reach a preset threshold, an average response duration corresponding to the target parameter is obtained.
The average response time length stored in the identification parameter is obtained, and the average response time length can be calculated successively or calculated from each access time after reaching the access time threshold.
In step S430, the average response time length is compared with a preset response time length.
It is easy to understand that the preset response time is predetermined in advance, and may be adjusted in time according to the actual situation, and is not limited herein. If the average response duration is greater than the predetermined response duration, it can be confirmed that the response process is slow.
In step S440, if the average response duration is greater than or equal to the preset response duration, storing the target data in the response data into the local browser for caching.
And if the average response time length is greater than or equal to the preset response time length, confirming that the target parameter with the lower average response speed is screened out from the target parameters of the high-frequency request, and storing the target data in the response data corresponding to the data access request containing the target parameter into a local browser cache.
Therefore, the target data which are accessed at high frequency and have long average response time are stored in the cache of the local browser, so that the data transmission time is reduced, and the processing efficiency is improved.
On the basis of the embodiment shown in fig. 2, the local data caching method may further include the following steps:
and updating the local browser cache according to a preset rule, wherein the preset rule comprises automatic expiration, active clearing and timing scanning.
In one embodiment, if the preset rule is automatic expiration, when target data is written into the cache, the expiration time of the target data in the cache is determined according to different frequencies, and the data are automatically cleared after the respective designated expiration time through a data expiration mechanism of the cache database.
In one embodiment, if the predetermined rule is active clear, the method may include the following steps:
receiving an instruction for deleting specified target data;
and deleting the specified target data according to the instruction.
It is easy to understand that, because the construction rule of the identification parameter of the cache is defined, the identification parameter of the cache can be assembled according to the query condition, and the instruction deletion is sent to the cache database, so that the cache data can be cleaned in time when the content of the cache data is outdated or the content of the data needs to be corrected.
In one embodiment, if the preset rule is a timing scan, the following steps may be included:
when a preset time point is reached, obtaining the use frequency of each cached target data;
and clearing the target data with the use frequency less than the preset frequency according to the use frequency of each target data.
The cached identification parameters in the cache database are scanned at regular time (such as zero point every day), and since the number of the cached data contains the information of the query condition, the cache hit condition of the interface or the interface under a certain parameter condition can be determined, for example, the access frequency is too low and the cache time is longer, the cached data is cleared, and the judgment threshold values of the too low frequency and the too long cache time can be specified through the configuration file.
It should be emphasized that, in order to further ensure the privacy and security of the white list and the black list in the default interface list, in some embodiments of the present application, the default interface list may also be stored in a node of a block chain.
The following describes embodiments of an apparatus of the present application, which may be used to implement the local data caching method in the foregoing embodiments of the present application. For details that are not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the local data caching method described above in the present application.
FIG. 5 shows a block diagram of a local data caching device 500 according to one embodiment of the present application.
Referring to fig. 5, a data caching apparatus 500 according to an embodiment of the present application includes:
an extracting unit 501, configured to extract, according to an input data access request, a target parameter corresponding to the data access request, and an target interface corresponding to the data access request;
a receiving unit 502, configured to receive response data corresponding to the data access request returned by the server through the target interface;
a matching unit 503, configured to compare the target interface with a preset interface list, where the preset interface list includes a white list and a black list, and if the target interface is matched with any interface in the white list, display the response data and store the target data in the response data in a local browser cache, and if the target interface is matched with any interface in the black list, display the response data;
an obtaining unit 504, configured to obtain, if the target interface is not matched with any interface in the preset interface list, the number of accesses and an average response time of the target parameter in a time window before the current time point;
and the processing unit 505 is configured to store the target data in the response data into the local browser cache if the access times and the average response time meet preset conditions.
In a further embodiment, before the obtaining unit 504, the method may further include: and the construction unit is used for constructing an identification parameter according to the target parameter, wherein the identification parameter is used for recording the access times and the average response time length of the target parameter in a time window before the current time point.
In another embodiment, based on the foregoing scheme, the constructing unit is further configured to sort the target parameters to form a target parameter sequence; constructing a character string according to the target parameter sequence; and taking the character string as an identification parameter corresponding to a target parameter.
In further embodiments, the processing unit 505 is further configured to monitor the number of accesses to the target parameter; if the access times reach a preset threshold value, acquiring an average response time length corresponding to the target parameter; comparing the average response time length with a preset response time length; and if the average response time length is greater than or equal to the preset response time length, storing the target data in the response data into a local browser cache.
In further embodiments, the method may further include: and the updating unit is used for updating the local browser cache according to preset rules, wherein the preset rules comprise automatic expiration, active clearing and timing scanning.
In another embodiment, based on the foregoing method, the updating unit is further configured to receive an instruction to delete specified target data in the local browser cache when the preset rule is active clear; according to the instruction, the specified target data is deleted.
In another embodiment, based on the foregoing method, the updating unit is further configured to, when the preset rule is a timing scan, obtain a usage frequency of each target data that has been cached when a preset time point is reached; and clearing the target data with the use frequency less than the preset frequency according to the use frequency of each target data.
In another exemplary embodiment, the present application further provides an apparatus comprising a processor and a memory, wherein the memory has stored thereon computer readable instructions which, when executed by the processor, implement the steps of the previous local data caching method.
It should be noted that the computer system 600 of the electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU) 601, which can perform various appropriate actions and processes, such as executing the methods in the above-described embodiments, according to a program stored in a Read-Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for system operation are also stored. The CPU 601, ROM602, and RAM 603 are connected to each other via a bus 604. An Input/Output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output section 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a Network interface card such as a LAN (local area Network) card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a readable storage medium, on which a computer program is carried, containing a computer program for executing the method shown in the flowchart. Further, the readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. When the computer program is executed by a Central Processing Unit (CPU) 601, various functions defined in the system of the present application are executed.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. The block chain, which is essentially a decentralized database, is a string of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, which is used for verifying the validity (anti-counterfeiting) of the information and generating a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
It should be noted that the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with a computer program embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
Furthermore, the present application can also be implemented by hardware circuits or hardware circuits in combination with software instructions, and thus, the implementation of the present application is not limited to any specific hardware circuits, software, or a combination of the two.
In the description of the present specification, the description of the term "one embodiment" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above description is only a preferred exemplary embodiment of the present application, and is not intended to limit the embodiments of the present application, and those skilled in the art can easily make various changes and modifications according to the main concept and spirit of the present application, so that the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A local data caching method is applied to a client browser, and the method comprises the following steps:
extracting a target parameter corresponding to the data access request and extracting a target interface corresponding to the data access request according to the input data access request;
receiving response data corresponding to the data access request returned by the server through the target interface;
comparing the target interface with a preset interface list, wherein the preset interface list comprises a white list and a black list, if the target interface is matched with any interface in the white list, displaying the response data and storing the target data in the response data into a local browser cache, and if the target interface is matched with any interface in the black list, displaying the response data;
if the target interface is not matched with any interface in the preset interface list, acquiring the access times and the average response time length of the target parameter in a time window before the current time point;
and if the access times and the average response time length meet preset conditions, storing target data in the response data into the local browser for caching.
2. The method of claim 1, wherein before the obtaining the number of accesses and the average response time of the target parameter in a time window before the current time point, the method comprises:
and constructing an identification parameter according to the target parameter, wherein the identification parameter is used for recording the access times and the average response time length of the target parameter in a time window before the current time point.
3. The method of claim 2, wherein said constructing identification parameters from said target parameters comprises:
sequencing the target parameters to form a target parameter sequence;
constructing a character string according to the target parameter sequence;
and taking the character string as an identification parameter corresponding to the target parameter.
4. The method of claim 1, wherein if the number of access times and the average response duration satisfy a preset condition, storing target data in the response data into the local browser cache comprises:
monitoring the number of visits by the target parameter;
if the access times reach a preset threshold value, acquiring an average response time corresponding to the target parameter;
comparing the average response time length with a preset response time length;
and if the average response time length is greater than or equal to the preset response time length, storing the target data in the response data into the local browser cache.
5. The method of claim 1, further comprising:
and updating the local browser cache according to a preset rule, wherein the preset rule comprises automatic expiration, active clearing and timing scanning.
6. The method according to claim 5, wherein the updating the local browser cache according to the preset rule comprises:
when the preset rule is active clearing, receiving an instruction for deleting specified target data in the local browser cache;
and deleting the specified target data according to the instruction.
7. The method according to claim 5, wherein the updating the local browser cache according to the preset rule further comprises:
when the preset rule is timing scanning, and when a preset time point is reached, obtaining the use frequency of each cached target data;
and clearing the target data with the use frequency less than the preset frequency according to the use frequency of each target data.
8. A local data caching apparatus, applied to a client browser, the apparatus comprising:
the extraction unit is used for extracting a target parameter corresponding to the data access request and extracting a target interface corresponding to the data access request according to the input data access request;
the receiving unit is used for receiving response data which is returned by the server and corresponds to the data access request through the target interface;
the processing unit is used for comparing the target interface with a preset interface list, the preset interface list comprises a white list and a black list, if the target interface is matched with any interface in the white list, target data in the response data is displayed and stored in a local browser cache, and if the target interface is matched with any interface in the black list, the response data is displayed;
the acquisition unit is used for acquiring the access times and the average response time length of the target parameter in a time window before the current time point if the target interface is not matched with any interface in the preset interface list;
and the determining unit is used for storing the target data in the response data into the local browser cache if the access times and the average response time meet preset conditions.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the local data caching method as claimed in any one of claims 1 to 7 when executing the program.
10. A readable storage medium, characterized in that it stores a computer program which, when being executed by a processor, is adapted to carry out the steps of the local data caching method according to any one of claims 1 to 7.
CN202010685262.1A 2020-07-16 2020-07-16 Local data caching method and device and related equipment Active CN111563216B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010685262.1A CN111563216B (en) 2020-07-16 2020-07-16 Local data caching method and device and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010685262.1A CN111563216B (en) 2020-07-16 2020-07-16 Local data caching method and device and related equipment

Publications (2)

Publication Number Publication Date
CN111563216A true CN111563216A (en) 2020-08-21
CN111563216B CN111563216B (en) 2020-11-06

Family

ID=72072852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010685262.1A Active CN111563216B (en) 2020-07-16 2020-07-16 Local data caching method and device and related equipment

Country Status (1)

Country Link
CN (1) CN111563216B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110677494A (en) * 2019-10-14 2020-01-10 腾讯科技(深圳)有限公司 Access response method and device
CN112015674A (en) * 2020-08-27 2020-12-01 平安科技(深圳)有限公司 Cache resource access method and device based on multiple hierarchies and computer equipment
CN112076464A (en) * 2020-09-04 2020-12-15 腾讯科技(深圳)有限公司 Data request processing method and device, computer equipment and storage medium
CN112540811A (en) * 2020-12-15 2021-03-23 平安科技(深圳)有限公司 Cache data detection method and device, computer equipment and storage medium
CN113515530A (en) * 2021-03-30 2021-10-19 贵州白山云科技股份有限公司 Cache object updating method, device, equipment and storage medium
CN113806651A (en) * 2021-09-18 2021-12-17 深圳市酷开网络科技股份有限公司 Data caching method, device, server and storage medium
CN114490465A (en) * 2021-12-28 2022-05-13 北京奕斯伟计算技术有限公司 Data transmission method and device for direct memory access
CN114490465B (en) * 2021-12-28 2024-04-26 北京奕斯伟计算技术股份有限公司 Data transmission method and device for direct memory access

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722589A (en) * 2012-06-15 2012-10-10 青岛海信传媒网络技术有限公司 Data querying method and system based on tri-networks integration
WO2014101737A1 (en) * 2012-12-24 2014-07-03 Tencent Technology (Shenzhen) Company Limited Searching method and system
CN105302801A (en) * 2014-05-27 2016-02-03 腾讯科技(深圳)有限公司 Resource caching method and apparatus
CN108536617A (en) * 2018-03-30 2018-09-14 网易宝有限公司 Buffer memory management method, medium, system and electronic equipment
CN109413159A (en) * 2018-09-27 2019-03-01 平安普惠企业管理有限公司 Cache file update method, device, computer equipment and storage medium
CN111190655A (en) * 2019-12-30 2020-05-22 中国银行股份有限公司 Processing method, device, equipment and system for application cache data

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722589A (en) * 2012-06-15 2012-10-10 青岛海信传媒网络技术有限公司 Data querying method and system based on tri-networks integration
WO2014101737A1 (en) * 2012-12-24 2014-07-03 Tencent Technology (Shenzhen) Company Limited Searching method and system
CN105302801A (en) * 2014-05-27 2016-02-03 腾讯科技(深圳)有限公司 Resource caching method and apparatus
CN108536617A (en) * 2018-03-30 2018-09-14 网易宝有限公司 Buffer memory management method, medium, system and electronic equipment
CN109413159A (en) * 2018-09-27 2019-03-01 平安普惠企业管理有限公司 Cache file update method, device, computer equipment and storage medium
CN111190655A (en) * 2019-12-30 2020-05-22 中国银行股份有限公司 Processing method, device, equipment and system for application cache data

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110677494A (en) * 2019-10-14 2020-01-10 腾讯科技(深圳)有限公司 Access response method and device
CN112015674A (en) * 2020-08-27 2020-12-01 平安科技(深圳)有限公司 Cache resource access method and device based on multiple hierarchies and computer equipment
CN112015674B (en) * 2020-08-27 2023-05-30 平安科技(深圳)有限公司 Multi-level-based cache resource access method and device and computer equipment
CN112076464A (en) * 2020-09-04 2020-12-15 腾讯科技(深圳)有限公司 Data request processing method and device, computer equipment and storage medium
CN112540811A (en) * 2020-12-15 2021-03-23 平安科技(深圳)有限公司 Cache data detection method and device, computer equipment and storage medium
CN112540811B (en) * 2020-12-15 2022-03-18 平安科技(深圳)有限公司 Cache data detection method and device, computer equipment and storage medium
CN113515530A (en) * 2021-03-30 2021-10-19 贵州白山云科技股份有限公司 Cache object updating method, device, equipment and storage medium
CN113806651A (en) * 2021-09-18 2021-12-17 深圳市酷开网络科技股份有限公司 Data caching method, device, server and storage medium
CN114490465A (en) * 2021-12-28 2022-05-13 北京奕斯伟计算技术有限公司 Data transmission method and device for direct memory access
CN114490465B (en) * 2021-12-28 2024-04-26 北京奕斯伟计算技术股份有限公司 Data transmission method and device for direct memory access

Also Published As

Publication number Publication date
CN111563216B (en) 2020-11-06

Similar Documents

Publication Publication Date Title
CN111563216B (en) Local data caching method and device and related equipment
KR100619178B1 (en) Method and apparatus for detecting invalid clicks on the internet search engine
US11088995B2 (en) Client/server security by an intermediary rendering modified in-memory objects
CN109189857B (en) Data sharing system, method and device based on block chain
US9106607B1 (en) Browser based feedback for optimized web browsing
CN107329963B (en) Method and device for accelerating webpage access
CN108429777B (en) Data updating method based on cache and server
CN107547548B (en) Data processing method and system
CN1234086C (en) System and method for high speed buffer storage file information
WO2021114454A1 (en) Method and apparatus for detecting crawler request
CN109522501B (en) Page content management method and device
RU2701040C1 (en) Method and a computer for informing on malicious web resources
US9843559B2 (en) Method for determining validity of command and system thereof
WO2023184831A1 (en) Method and apparatus for determining target object, and method and apparatus for constructing identifier association graph
JP2007140709A (en) Web page patrol device and web page patrol program
CN113839940B (en) URL pattern tree-based defense method, device, electronic equipment and readable storage medium
Noskov Smart City Webgis Applications: Proof of Work Concept For High-Level Quality-Of-Service Assurance
CN112948733B (en) Interface maintenance method, device, computing equipment and medium
KR100619179B1 (en) Method and apparatus for detecting invalid clicks on the internet search engine
CN114218586A (en) Business data intelligent management method and device, electronic equipment and storage medium
CN113918857A (en) Three-level cache acceleration method for improving performance of distributed WEB application system
CN112527293A (en) Method and device for rendering first screen page, computer equipment and storage medium
US20210173729A1 (en) Systems and methods of application program interface (api) parameter monitoring
CN111865576A (en) Method and device for synchronizing URL classification data
CN112748960A (en) Process control method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231109

Address after: Room 2601 (Unit 07), Qianhai Free Trade Building, No. 3048, Xinghai Avenue, Nanshan Street, Qianhai Shenzhen-Hong Kong Cooperation Zone, Shenzhen, Guangdong 518000

Patentee after: Shenzhen Ping An Smart Healthcare Technology Co.,Ltd.

Address before: 1-34 / F, Qianhai free trade building, 3048 Xinghai Avenue, Mawan, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong 518000

Patentee before: Ping An International Smart City Technology Co.,Ltd.