CN113760536A - Data caching method and device, electronic equipment and computer readable medium - Google Patents

Data caching method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN113760536A
CN113760536A CN202110320140.7A CN202110320140A CN113760536A CN 113760536 A CN113760536 A CN 113760536A CN 202110320140 A CN202110320140 A CN 202110320140A CN 113760536 A CN113760536 A CN 113760536A
Authority
CN
China
Prior art keywords
data
cache
resource
configuration information
target
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.)
Pending
Application number
CN202110320140.7A
Other languages
Chinese (zh)
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.)
Beijing Jingdong Tuoxian Technology Co Ltd
Original Assignee
Beijing Jingdong Tuoxian 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 Beijing Jingdong Tuoxian Technology Co Ltd filed Critical Beijing Jingdong Tuoxian Technology Co Ltd
Priority to CN202110320140.7A priority Critical patent/CN113760536A/en
Publication of CN113760536A publication Critical patent/CN113760536A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Abstract

The embodiment of the disclosure discloses a data caching method, a data caching device, electronic equipment and a computer readable medium. One embodiment of the method comprises: responding to first request information for a target resource identifier and sending second request information for the target resource identifier to a target server when resource data corresponding to the target resource identifier does not exist in a local cache; in response to receiving feedback data sent by the target server according to the second request message and the existence of cache configuration information in the feedback data, adding the resource data included in the feedback data to a local cache according to the cache configuration information, wherein the cache configuration information of the target resource identifier is stored in the target server. The implementation method can avoid releasing the new version of the client and installing the new version of the client when the cache strategy is modified. Therefore, the time for modifying the cache strategy can be shortened, and the development amount for the client side is reduced.

Description

Data caching method and device, electronic equipment and computer readable medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a data caching method, a data caching device, electronic equipment and a computer readable medium.
Background
With the development of computer technology, a client can cache resources in a local cache so as to improve the response speed of a service request. At present, when caching resources, the method generally adopted is as follows: and the client determines whether to cache the acquired resources or not according to the local cache configuration information.
However, when the above-mentioned manner is adopted to cache the resource, the following technical problems often exist: when the cache configuration information is modified, the new version of the client needs to be released and installed, so that the time for modifying the cache strategy is long, and the development amount of the client is increased by developing the new version of the client.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose data caching methods, apparatuses, electronic devices and computer readable media to solve one of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a data caching method, including: responding to first request information for a target resource identifier and sending second request information for the target resource identifier to a target server when resource data corresponding to the target resource identifier does not exist in a local cache; in response to receiving feedback data sent by the target server according to the second request message and the existence of cache configuration information in the feedback data, adding the resource data included in the feedback data to a local cache according to the cache configuration information, wherein the cache configuration information of the target resource identifier is stored in the target server.
Optionally, the method further comprises: and analyzing the resource data included in the feedback data in response to receiving the feedback data sent by the target server and the fact that no cache configuration information exists in the feedback data.
Optionally, the method further comprises: and responding to the first request information and the resource data corresponding to the target resource identifier in the local cache, and analyzing the resource data corresponding to the target resource identifier cached locally.
Optionally, the cache configuration information is generated by: receiving a cache configuration identifier and a cache time limit corresponding to the target resource identifier, wherein the cache configuration identifier represents that the resource data is cacheable data or non-cacheable data; and combining the cache configuration identifier, the cache time limit and the target resource identifier into cache configuration information.
Optionally, the feedback data is generated by: acquiring resource data corresponding to a target resource identifier corresponding to the received second request information; and combining the acquired resource data and the cache configuration information corresponding to the target resource identifier into feedback data.
Optionally, the adding the resource data included in the feedback data to a local cache includes: and adding the resource data included in the feedback data to a local cache in response to the cache configuration identifier included in the cache configuration information representing that the resource data is cacheable data.
Optionally, the method further comprises: and deleting the locally cached resource data from the local cache in response to that the caching time of the locally cached resource data is greater than or equal to the caching time limit included in the caching configuration information corresponding to the locally cached resource data.
In a second aspect, some embodiments of the present disclosure provide a data caching apparatus, including: the sending unit is configured to respond to first request information of a target resource identifier and the absence of resource data corresponding to the target resource identifier in a local cache, and send second request information of the target resource identifier to a target server; and an adding unit, configured to, in response to receiving feedback data sent by the target server according to the second request information and existence of cache configuration information in the feedback data, add the resource data included in the feedback data to a local cache according to the cache configuration information, where the cache configuration information of the target resource identifier is stored in the target server.
Optionally, the apparatus further comprises: the first analysis unit is configured to, in response to receiving feedback data sent by the target server and in response to that no cache configuration information exists in the feedback data, perform analysis processing on the resource data included in the feedback data.
Optionally, the apparatus further comprises: and the second analysis unit is configured to respond to the first request information and the existence of the resource data corresponding to the target resource identifier in the local cache, and analyze the locally cached resource data corresponding to the target resource identifier.
Optionally, the cache configuration information is generated by: receiving a cache configuration identifier and a cache time limit corresponding to the target resource identifier, wherein the cache configuration identifier represents that the resource data is cacheable data or non-cacheable data; and combining the cache configuration identifier, the cache time limit and the target resource identifier into cache configuration information.
Optionally, the feedback data is generated by: acquiring resource data corresponding to a target resource identifier corresponding to the received second request information; and combining the acquired resource data and the cache configuration information corresponding to the target resource identifier into feedback data.
Optionally, the adding unit is further configured to: and adding the resource data included in the feedback data to a local cache in response to the cache configuration identifier included in the cache configuration information representing that the resource data is cacheable data.
Optionally, the apparatus further comprises: and the deleting unit is configured to delete the locally cached resource data from the local cache in response to that the caching time of the locally cached resource data is greater than or equal to the caching time limit included in the caching configuration information corresponding to the locally cached resource data.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method described in any of the implementations of the first aspect.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium on which a computer program is stored, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect.
The above embodiments of the present disclosure have the following advantages: by the data caching method of some embodiments of the disclosure, the time for modifying the caching strategy is shortened, and the development amount of the client is reduced. Specifically, the time for modifying the cache policy is long, and the development amount of the client is increased because: when the cache configuration information is modified, the new version of the client needs to be released and installed. Based on this, the data caching method of some embodiments of the present disclosure first sends, to the target server, second request information for the target resource identifier in response to the first request information for the target resource identifier and resource data corresponding to the target resource identifier does not exist in the local cache. Thus, the feedback data transmitted by the target server can be received. Then, in response to receiving feedback data sent by the target server according to the second request message and the existence of cache configuration information in the feedback data, adding the resource data included in the feedback data to a local cache according to the cache configuration information, wherein the cache configuration information of the target resource identifier is stored in the target server. Therefore, the received resource data can be cached according to the received feedback data. And the cache configuration information is acquired from the target server, and can be updated and modified in the target server through the cache configuration information, so that the new version of the client can be prevented from being released and installed when the cache configuration information is modified. Therefore, the time for modifying the cache strategy can be shortened, and the development amount for the client side is reduced.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
1-2 are schematic diagrams of one application scenario of a data caching method according to some embodiments of the present disclosure;
FIG. 3 is a flow diagram of some embodiments of a data caching method according to the present disclosure;
FIG. 4 is a flow diagram of further embodiments of a data caching method according to the present disclosure;
FIG. 5 is a schematic structural diagram of some embodiments of a data caching apparatus according to the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1-2 are schematic diagrams of an application scenario of a data caching method according to some embodiments of the present disclosure.
In the application scenario of fig. 1, first, the computing device 101 may send, to the target server 104, the second request information 105 for the target resource identifier in response to the first request information 102 for the target resource identifier and the resource data 103 corresponding to the target resource identifier does not exist in the local cache. Then, in response to receiving the feedback data 106 sent by the target server 104 according to the second request information 105 and the presence of the cache configuration information 107 in the feedback data 106, the computing device 101 may add the resource data 103 included in the feedback data 106 to a local cache according to the cache configuration information 107. The cache configuration information 107 of the target resource identifier is stored in the target server 104.
Optionally, as shown in fig. 2, in response to receiving the feedback data 106 sent by the target server 104 and that no cache configuration information 107 exists in the feedback data 106, the computing device 101 may add the resource data 103 included in the feedback data 106 to a local cache.
The computing device 101 may be hardware or software. When the computing device is hardware, it may be implemented as a distributed cluster composed of multiple servers or terminal devices, or may be implemented as a single server or a single terminal device. When the computing device is embodied as software, it may be installed in the hardware devices enumerated above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of computing devices in fig. 1-2 is merely illustrative. There may be any number of computing devices, as implementation needs dictate.
With continued reference to fig. 3, a flow 300 of some embodiments of a data caching method according to the present disclosure is shown. The data caching method comprises the following steps:
step 301, in response to the first request information for the target resource identifier and the resource data corresponding to the target resource identifier does not exist in the local cache, sending a second request information for the target resource identifier to the target server.
In some embodiments, an executing body of the data caching method (e.g., the computing device 101 shown in fig. 1) may send second request information for the target resource identifier to the target server in response to the first request information for the target resource identifier and resource data corresponding to the target resource identifier does not exist in the local cache. The target resource identifier may be an identifier of resource data that needs to be read by the execution main body currently. The first request message may be a request message for the execution main to read resource data corresponding to the target resource identifier from a local cache. The resource data may be data that needs to be read when the current program runs. For example, the resource data may be data in an image format or data in a character string format. Here, the format of the resource data is not limited. The target server may be a server storing cache configuration information of the target resource identifier. The cache configuration information may be information related to a cache policy of the resource data. The second request message may be a request message for requesting the execution agent to acquire resource data, the request message being sent to the target server by the execution agent. Thus, the feedback data transmitted by the target server can be received.
Step 302, in response to receiving the feedback data sent by the target server according to the second request information and the presence of the cache configuration information in the feedback data, adding the resource data included in the feedback data to the local cache according to the cache configuration information.
In some embodiments, the executing entity may add, in response to receiving feedback data sent by the target server according to the second request message and the presence of cache configuration information in the feedback data, the resource data included in the feedback data to a local cache according to the cache configuration information. The cache configuration information of the target resource identifier may be stored in the target server. The cache configuration information may include a data size of the resource data.
The cache configuration information may be generated by the target server through the following steps:
the first step, receive the buffer configuration label corresponding to the above-mentioned goal resource label. The cache configuration identifier may represent that the resource data corresponding to the target resource identifier is cacheable data or non-cacheable data.
And secondly, determining the data size of the resource data corresponding to the target resource identifier.
And thirdly, combining the cache configuration identifier, the data size and the target resource identifier into cache configuration information. For example, the cache configuration identifier may be "cacheable". The data size may be "1 million". The target resource identification may be "001". The target server may combine the cache configuration identifier "cacheable", the data size "1 million" and the target resource identifier "001" into cache configuration information "cacheable, 1 million, 001".
The feedback data may be generated by the target server by:
and step one, acquiring resource data corresponding to a target resource identifier corresponding to the received second request information as feedback data.
And secondly, responding to the buffer configuration identifier representation resource data included in the buffer configuration information corresponding to the target resource identifier as cacheable data, and adding the buffer configuration information to the feedback data.
In practice, in response to receiving the feedback data sent by the target server according to the second request message and the presence of the cache configuration information in the feedback data, the execution main body may first determine a cache space corresponding to a data size included in the cache configuration information, and then add the resource data included in the feedback data to the determined cache space. Therefore, the received resource data can be cached according to the received feedback data.
Optionally, the executing body may further perform, in response to receiving feedback data sent by the target server and that no cache configuration information exists in the feedback data, analysis processing on the resource data included in the feedback data. The parsing may be a process of rendering a page according to the resource data. For example, the image included in the resource data may be displayed in a page. Therefore, the acquired resource data can be directly analyzed under the condition that the received feedback data does not contain the cache configuration information.
Optionally, the executing body may further perform, in response to the first request information and resource data corresponding to the target resource identifier in a local cache, analysis processing on the resource data corresponding to the target resource identifier cached locally. The parsing may be a process of rendering a page according to the resource data. Therefore, the resource data can be directly analyzed and processed under the condition that the resource data corresponding to the target resource identification is locally stored.
The above embodiments of the present disclosure have the following advantages: by the data caching method of some embodiments of the disclosure, the time for modifying the caching strategy is shortened, and the development amount of the client is reduced. Specifically, the time for modifying the cache policy is long, and the development amount of the client is increased because: when the cache configuration information is modified, the new version of the client needs to be released and installed. Based on this, the data caching method of some embodiments of the present disclosure first sends, to the target server, second request information for the target resource identifier in response to the first request information for the target resource identifier and resource data corresponding to the target resource identifier does not exist in the local cache. Thus, the feedback data transmitted by the target server can be received. Then, in response to receiving feedback data sent by the target server according to the second request message and the existence of cache configuration information in the feedback data, adding the resource data included in the feedback data to a local cache according to the cache configuration information, wherein the cache configuration information of the target resource identifier is stored in the target server. Therefore, the received resource data can be cached according to the received feedback data. And the cache configuration information is acquired from the target server, and can be updated and modified in the target server through the cache configuration information, so that the new version of the client can be prevented from being released and installed when the cache configuration information is modified. Therefore, the time for modifying the cache strategy can be shortened, and the development amount for the client side is reduced.
With further reference to fig. 4, a flow 400 of further embodiments of a data caching method is illustrated. The process 400 of the data caching method includes the following steps:
step 401, in response to the first request information for the target resource identifier and the absence of resource data corresponding to the target resource identifier in the local cache, sending a second request information for the target resource identifier to the target server.
In some embodiments, the specific implementation of step 401 and the technical effect brought by the implementation may refer to step 301 in those embodiments corresponding to fig. 3, which are not described herein again.
Step 402, in response to the cache configuration identifier included in the cache configuration information representing that the resource data is cacheable data, adding the resource data included in the feedback data to the local cache.
In some embodiments, an executing entity (e.g., the computing device 101 shown in fig. 1) of the data caching method may add the resource data included in the feedback data to a local cache in response to receiving the feedback data sent by the target server and the cache configuration identifier included in the cache configuration information indicating that the resource data is cacheable data. The cache configuration information may be generated by the following steps:
the first step, receive the buffer configuration label and buffer time limit corresponding to the above target resource label. The cache configuration identifier may represent that the resource data is cacheable data or non-cacheable data.
And secondly, combining the cache configuration identifier, the cache time limit and the target resource identifier into cache configuration information.
The cache configuration information may be generated by the target server. The buffering time limit may be a limited duration after the resource data is buffered. First, the target server may receive a cache configuration identifier and a cache time limit corresponding to the target resource identifier from a terminal through a wired connection or a wireless connection. Then, the target server may combine the cache configuration identifier, the cache time limit, and the target resource identifier into cache configuration information. For example, the cache configuration identifier may be "cacheable". The buffering time limit may be "7 days". The target resource identification may be "001". The target server may combine the cache configuration identifier "cacheable", the cache time limit "7 days" and the target resource identifier "001" into cache configuration information "cacheable, 7 days, 001".
The feedback data may be generated by:
and step one, acquiring resource data corresponding to a target resource identifier corresponding to the received second request information.
And secondly, combining the acquired resource data and the cache configuration information corresponding to the target resource identifier into feedback data. For example, the resource data may identify an image corresponding to "001" for the target resource. The cache configuration information may be "cacheable, 7-day, 001". The execution main body may combine the image and the cache configuration information into feedback data, so that the combined feedback data includes the image and the cache configuration information.
Wherein the feedback data may be generated by the target server. First, the target server may obtain, from the terminal, resource data corresponding to the target resource identifier corresponding to the received second request information through a wired connection or a wireless connection. Then, the target server may combine the acquired resource data and the cache configuration information corresponding to the target resource identifier into feedback data.
In practice, the executing entity may add, in response to that the cache configuration identifier included in the cache configuration information indicates that the resource data is cacheable data, the resource data included in the feedback data and the cache time limit included in the cache configuration information to a local cache. Therefore, the received resource data can be cached according to the received caching configuration information.
Optionally, the executing entity may delete the locally cached resource data from the local cache in response to that the caching time of the locally cached resource data is greater than or equal to the caching time limit included in the caching configuration information corresponding to the locally cached resource data. The cache time may be a time length of the resource data cached locally. In practice, the executing entity may delete the resource data from the local cache in response to the current time indicating that the caching time of the resource data is greater than or equal to the caching time limit. Therefore, the resource data cached locally can be managed according to the received cache configuration information.
As can be seen from fig. 4, compared with the description of some embodiments corresponding to fig. 3, the flow 400 of the data caching method in some embodiments corresponding to fig. 4 embodies the step of caching the resource data according to the received cache configuration information. Thus, the embodiments described herein may cache resource data according to remotely received cache configuration information. And the cache configuration information is acquired from the target server, so that the cache strategy can be modified through updating of the cache configuration information in the target server, and the release of a new version of the client and the installation of the new version of the client can be avoided when the cache strategy is modified. Therefore, the time for modifying the cache strategy can be shortened, and the development amount for the client side is reduced.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a data caching apparatus, which correspond to those shown in fig. 3, and which may be applied in various electronic devices.
As shown in fig. 5, the data caching apparatus 500 of some embodiments includes: a sending unit 501 and an adding unit 502. The sending unit 501 is configured to send, to a target server, second request information for a target resource identifier in response to first request information for the target resource identifier and resource data corresponding to the target resource identifier not existing in a local cache; the adding unit 502 is configured to, in response to receiving feedback data sent by the target server according to the second request information and the presence of cache configuration information in the feedback data, add the resource data included in the feedback data to a local cache according to the cache configuration information, where the cache configuration information of the target resource identifier is stored in the target server.
In an optional implementation manner of some embodiments, the data caching apparatus 500 may further include: and a first parsing unit (not shown in the figure) configured to, in response to receiving feedback data sent by the target server and that no cache configuration information exists in the feedback data, parse the resource data included in the feedback data.
In an optional implementation manner of some embodiments, the data caching apparatus 500 may further include: and a second parsing unit (not shown in the figure), configured to, in response to the first request information and the existence of the resource data corresponding to the target resource identifier in the local cache, parse the locally cached resource data corresponding to the target resource identifier.
In an optional implementation manner of some embodiments, the cache configuration information is generated by: receiving a cache configuration identifier and a cache time limit corresponding to the target resource identifier, wherein the cache configuration identifier represents that the resource data is cacheable data or non-cacheable data; and combining the cache configuration identifier, the cache time limit and the target resource identifier into cache configuration information.
In an optional implementation manner of some embodiments, the feedback data is generated by: acquiring resource data corresponding to a target resource identifier corresponding to the received second request information; and combining the acquired resource data and the cache configuration information corresponding to the target resource identifier into feedback data.
In an optional implementation of some embodiments, the adding unit 502 may be further configured to: and adding the resource data included in the feedback data to a local cache in response to the cache configuration identifier included in the cache configuration information representing that the resource data is cacheable data.
In an optional implementation manner of some embodiments, the data caching apparatus 500 may further include: and a deleting unit (not shown in the figure) configured to delete the locally cached resource data from the local cache in response to that the caching time of the locally cached resource data is greater than or equal to the caching time limit included in the caching configuration information corresponding to the locally cached resource data.
It will be understood that the elements described in the apparatus 500 correspond to various steps in the method described with reference to fig. 3. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 500 and the units included therein, and are not described herein again.
Referring now to FIG. 6, a block diagram of an electronic device (e.g., computing device 101 of FIG. 1)600 suitable for use in implementing some embodiments of the present disclosure is shown. 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 disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described in some embodiments of the present disclosure 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 or 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 some embodiments of the disclosure, 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 some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code 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. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: responding to first request information for a target resource identifier and sending second request information for the target resource identifier to a target server when resource data corresponding to the target resource identifier does not exist in a local cache; in response to receiving feedback data sent by the target server according to the second request message and the existence of cache configuration information in the feedback data, adding the resource data included in the feedback data to a local cache according to the cache configuration information, wherein the cache configuration information of the target resource identifier is stored in the target server.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes a sending unit and an adding unit. The names of these units do not form a limitation on the unit itself in some cases, for example, the sending unit may also be described as a "unit that sends second request information for a target resource identifier to a target server in response to first request information for the target resource identifier and resource data corresponding to the target resource identifier not existing in the local cache".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. A data caching method, comprising:
responding to first request information for a target resource identifier and sending second request information for the target resource identifier to a target server when resource data corresponding to the target resource identifier does not exist in a local cache;
and in response to receiving feedback data sent by the target server according to the second request information and the existence of cache configuration information in the feedback data, adding the resource data included in the feedback data to a local cache according to the cache configuration information, wherein the cache configuration information of the target resource identifier is stored in the target server.
2. The method of claim 1, wherein the method further comprises:
and in response to receiving feedback data sent by the target server and the fact that cache configuration information does not exist in the feedback data, analyzing the resource data included in the feedback data.
3. The method of claim 1, wherein the method further comprises:
responding to the first request information and the resource data corresponding to the target resource identification in the local cache, and analyzing the resource data corresponding to the target resource identification cached locally.
4. The method of claim 1, wherein the cache configuration information is generated by:
receiving a cache configuration identifier and a cache time limit corresponding to the target resource identifier, wherein the cache configuration identifier represents that the resource data is cacheable data or non-cacheable data;
and combining the cache configuration identifier, the cache time limit and the target resource identifier into cache configuration information.
5. The method of claim 4, wherein the feedback data is generated by:
acquiring resource data corresponding to a target resource identifier corresponding to the received second request information;
and combining the acquired resource data and the cache configuration information corresponding to the target resource identifier into feedback data.
6. The method of claim 5, wherein the adding the resource data included with the feedback data to a local cache comprises:
and in response to the fact that the cache configuration identification included in the cache configuration information represents that the resource data is cacheable data, adding the resource data included in the feedback data to a local cache.
7. The method of claim 4, wherein the method further comprises:
and deleting the locally cached resource data from the local cache in response to that the caching time of the locally cached resource data is greater than or equal to the caching time limit included in the caching configuration information corresponding to the locally cached resource data.
8. A data caching apparatus, comprising:
the sending unit is configured to respond to first request information of a target resource identifier and the absence of resource data corresponding to the target resource identifier in a local cache, and send second request information of the target resource identifier to a target server;
and the adding unit is configured to respond to the received feedback data sent by the target server according to the second request information and the existence of cache configuration information in the feedback data, and add the resource data included in the feedback data to a local cache according to the cache configuration information, wherein the cache configuration information of the target resource identifier is stored in the target server.
9. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-7.
CN202110320140.7A 2021-03-25 2021-03-25 Data caching method and device, electronic equipment and computer readable medium Pending CN113760536A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110320140.7A CN113760536A (en) 2021-03-25 2021-03-25 Data caching method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110320140.7A CN113760536A (en) 2021-03-25 2021-03-25 Data caching method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN113760536A true CN113760536A (en) 2021-12-07

Family

ID=78786758

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110320140.7A Pending CN113760536A (en) 2021-03-25 2021-03-25 Data caching method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN113760536A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114339442A (en) * 2021-12-31 2022-04-12 北京达佳互联信息技术有限公司 Multimedia channel configuration method and device, electronic equipment and storage medium
CN114629919A (en) * 2022-03-31 2022-06-14 北京百度网讯科技有限公司 Resource acquisition method, device, equipment and storage medium
CN117724852A (en) * 2024-02-07 2024-03-19 微网优联科技(成都)有限公司 Cloud computer computing resource allocation method and device
CN117724852B (en) * 2024-02-07 2024-05-07 微网优联科技(成都)有限公司 Cloud computer computing resource allocation method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114339442A (en) * 2021-12-31 2022-04-12 北京达佳互联信息技术有限公司 Multimedia channel configuration method and device, electronic equipment and storage medium
CN114339442B (en) * 2021-12-31 2023-11-07 北京达佳互联信息技术有限公司 Method and device for configuring multimedia channels, electronic equipment and storage medium
CN114629919A (en) * 2022-03-31 2022-06-14 北京百度网讯科技有限公司 Resource acquisition method, device, equipment and storage medium
CN117724852A (en) * 2024-02-07 2024-03-19 微网优联科技(成都)有限公司 Cloud computer computing resource allocation method and device
CN117724852B (en) * 2024-02-07 2024-05-07 微网优联科技(成都)有限公司 Cloud computer computing resource allocation method and device

Similar Documents

Publication Publication Date Title
CN112416632B (en) Event communication method and device, electronic equipment and computer readable medium
CN111510466B (en) Data updating method and device for client, electronic equipment and readable medium
CN112256733A (en) Data caching method and device, electronic equipment and computer readable storage medium
CN111209306A (en) Business logic judgment method and device, electronic equipment and storage medium
CN113760536A (en) Data caching method and device, electronic equipment and computer readable medium
CN112311656A (en) Message aggregation and display method and device, electronic equipment and computer readable medium
CN111930709A (en) Data storage method and device, electronic equipment and computer readable medium
CN112269959A (en) Display content control method and device, readable medium and electronic equipment
CN112748962A (en) Application loading method and device, electronic equipment and computer readable medium
CN112558933A (en) Component rendering method and device, readable medium and electronic equipment
CN111756953A (en) Video processing method, device, equipment and computer readable medium
CN114115941A (en) Resource sending method, page rendering method, device, electronic equipment and medium
CN113590986B (en) Page link configuration method and device, electronic equipment and computer readable medium
CN114785770A (en) Mirror layer file sending method and device, electronic equipment and computer readable medium
CN111444457B (en) Data release method and device, storage medium and electronic equipment
CN112203103B (en) Message processing method, device, electronic equipment and computer readable storage medium
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN111580890A (en) Method, apparatus, electronic device, and computer-readable medium for processing features
CN112163176A (en) Data storage method and device, electronic equipment and computer readable medium
CN113360348A (en) Exception request processing method and device, electronic equipment and storage medium
CN110795670A (en) Webpage image monitoring method and device, electronic equipment and readable storage medium
CN113342837B (en) Data transmission method, device, electronic equipment and computer readable medium
CN113157365B (en) Program running method, program running device, electronic equipment and computer readable medium
CN112632542B (en) Application program detection file dynamic adjustment method and device, electronic equipment and medium
CN112637048B (en) Information sending method, information sending device, electronic equipment and computer readable 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