CN112163176A - Data storage method and device, electronic equipment and computer readable medium - Google Patents

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

Info

Publication number
CN112163176A
CN112163176A CN202011201490.3A CN202011201490A CN112163176A CN 112163176 A CN112163176 A CN 112163176A CN 202011201490 A CN202011201490 A CN 202011201490A CN 112163176 A CN112163176 A CN 112163176A
Authority
CN
China
Prior art keywords
data
cache region
target data
data cache
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
CN202011201490.3A
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 Urban Network Neighbor Information Technology Co Ltd
Original Assignee
Beijing Urban Network Neighbor Information 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 Urban Network Neighbor Information Technology Co Ltd filed Critical Beijing Urban Network Neighbor Information Technology Co Ltd
Priority to CN202011201490.3A priority Critical patent/CN112163176A/en
Publication of CN112163176A publication Critical patent/CN112163176A/en
Pending legal-status Critical Current

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 embodiment of the disclosure discloses a data storage method, a data storage device, an electronic device and a computer readable medium. One embodiment of the data storage method includes: determining whether the target data is stored in a data cache region according to the intercepted first request related to the target data; in response to the target data not being stored in the data cache, sending a second request related to the target data to obtain the target data; determining whether a storage space for storing the target data exists in the data cache region; and responding to the existence of the storage space in the data cache region, and storing the acquired target data and the aging information of the target data in the data cache region. According to the embodiment, the data cache capacity can be simply and effectively provided for the data request by storing the information of the data related to the data request, which is not stored in the data cache region, so that the data loading speed is improved laterally, and the request times are further reduced.

Description

Data storage method and device, electronic equipment and computer readable medium
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a data storage method and apparatus, an electronic device, and a computer-readable medium.
Background
With the development of the mobile internet, various applications are running on a variety of terminal devices. At present, most of applications on various terminal devices request a server to acquire required data through a web development technology of an interactive web application.
However, when the above method is used to obtain data, the following technical problems often exist:
firstly, under the condition of low network speed, data is acquired in low-speed equipment by utilizing a webpage development technology of interactive webpage application, and the data loading is slow, so that the user experience is poor.
Secondly, a processing method which is fast and meets the service requirement is lacked for the data processing of the data cache region, so that a reasonable storage space cannot be fast and effectively provided for the requested data.
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 page rendering methods, apparatuses, devices and computer readable media to solve one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a data storage method, including: determining whether the target data is stored in a data cache region according to the intercepted first request related to the target data; sending a second request related to the target data to acquire the target data in response to the target data not being stored in the data cache region; determining whether a storage space for storing the target data exists in the data cache region; and responding to the existence of the storage space in the data cache region, and storing the acquired target data and the aging information of the target data in the data cache region.
In a second aspect, some embodiments of the present disclosure provide a data storage device, the device comprising: a first determining unit configured to determine whether the target data is stored in the data buffer according to the intercepted first request related to the target data; a sending unit configured to send a second request related to the target data to acquire the target data in response to the target data not being stored in the data buffer; a second determination unit configured to determine whether a storage space for storing the target data exists in the data buffer; and a storage unit configured to store the acquired target data and the age information of the target data in the data buffer area in response to the data buffer area having the storage space.
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 a method as in any one of the first aspects.
In a fourth aspect, some embodiments of the disclosure provide a computer readable medium having a computer program stored thereon, wherein the program when executed by a processor implements a method as in any one of the first aspect.
The above embodiments of the present disclosure have the following beneficial effects: the data storage method of some embodiments of the present disclosure can improve the speed of loading data laterally, and further reduce the number of requests. Specifically, the inventors found that the reason why the data loading speed is not fast enough is: for the data request, there is a speed difference between the high-speed device and the low-speed device for data transmission by using the web page development technology of the interactive web page application, and the access to the low-speed device reduces the efficiency of the system, resulting in slow data loading. Based on this, the data storage method of some embodiments of the present disclosure preferentially determines whether the target data exists from the data cache region according to the intercepted first request related to the target data. Optionally, in response to storing the target data, the target data is returned to the corresponding terminal as a response. In addition, when the target data does not exist in the data buffer, a second request is sent again to obtain the target data. Furthermore, the data related to the data request and the aging information of the data are stored, and the target data stored in the data buffer area can be used for the next data request related to the target data. Compared with the webpage development technology of interactive webpage application, the method has the advantages that the data loading speed is increased, and the number of data requests 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 features are not necessarily drawn to scale.
FIG. 1 is a schematic diagram of an application scenario of a data storage method of some embodiments of the present disclosure;
FIG. 2 is a flow diagram of some embodiments of a data storage method according to the present disclosure;
FIG. 3 is a schematic diagram of an application scenario of data storage in the data storage method according to the present disclosure;
FIG. 4 is a flow diagram of further embodiments of a data storage method according to the present disclosure;
FIG. 5 is a schematic structural diagram of some embodiments of a data storage device 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 is a schematic diagram of an application scenario of a data storage method according to some embodiments of the present disclosure.
As shown in fig. 1, the terminal device 100 may first determine whether the target data 1011 is stored in the data buffer 101 according to the intercepted first request 103 related to the target data 1011. In this application scenario, the data buffer 101 includes: data 1012, data 1013, data 1014, data 1015, data 1016, data 1017. Then, in response to the data buffer 101 not storing the target data 1011, a second request 102 related to the target data 1011 is sent to obtain the target data 1011. Further, it is determined whether or not a storage space for storing the target data 1011 exists in the data buffer 101. Finally, in response to the existence of the storage space in the data buffer 101, the acquired target data 1011 and the age information 104 of the target data 1011 are stored in the data buffer 101. In the present application scenario, the aging information 104 may be "current timestamp: 1601762506".
It is to be understood that the main body of the data storage method may be the terminal device 100, and the main body of the data storage method may further include a device formed by integrating the terminal device 100 and the server through a network. The terminal device 100 may be various electronic devices with information processing capability, including but not limited to a smart phone, a tablet computer, an e-book reader, a laptop portable computer, a desktop computer, and the like. When the execution subject of the data storage method is software, the data storage method can be installed in the electronic devices listed 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 terminal devices in fig. 1 is merely illustrative. There may be any number of terminal devices, as desired for implementation.
With continued reference to fig. 2, a flow 200 of some embodiments of a data storage method according to the present disclosure is shown. The data storage method comprises the following steps:
step 201, determining whether the target data is stored in the data buffer according to the intercepted first request related to the target data.
In some embodiments, an executing entity of the data storage method (for example, the terminal device 100 shown in fig. 1) may determine whether the target data is stored in the data buffer according to the intercepted first request related to the target data. Wherein the first request related to the target data can be intercepted by the related decorator.
Step 202, in response to that the target data is not stored in the data buffer, sending a second request related to the target data to obtain the target data.
In some embodiments, in response to the target data not being stored in the data buffer, the execution principal may send a second request associated with the target data to obtain the target data. The second request and the first request may be the same data request or different data requests. As an example, in response to that the target data is not stored in the data buffer, a second request related to the target data may be sent to the server. Further, the server may send the target data to a terminal device.
In some optional implementations of some embodiments, the data stored in the data buffer for a time exceeding a time limit is periodically processed. The storage time may be a difference between a time stamp of the time when the target data is stored and the current time stamp. As an example, a timer may be set to enable the execution main body to process the data stored in the data buffer for a time exceeding a time limit.
Step 203, determining whether a storage space for storing the target data exists in the data buffer.
In some embodiments, the execution body may first determine the byte size occupied by the target data. Then, the remaining storage information of the data buffer is read to determine whether a storage space for storing the target data exists in the data buffer.
And 204, responding to the existence of the storage space in the data cache region, and storing the acquired target data and the aging information of the target data in the data cache region.
In some embodiments, in response to the data buffer storing the storage space, the execution main body may store the acquired target data and the aging information of the target data in the data buffer. The aging information of the target data may include, but is not limited to, at least one of the following: a timestamp of when the target data is stored in the data cache area, and a time limit of the target data.
In some optional implementation manners of some embodiments, the target data stored in the data buffer area is sent to a corresponding terminal as a response to the first request.
In some optional implementation manners of some embodiments, the storing, in the data buffer, the acquired target data and the age information of the target data in response to the data buffer having the storage space may include:
in the first step, the time efficiency information of the target data is determined in response to the storage space existing in the data buffer area.
And secondly, storing the target data and the aging information in the data cache region by adopting a corresponding Application Programming Interface (API). The target data stored in the data buffer area may be stored in the form of key value pairs.
Optionally, in response to that the data validity information in the aging information of the target data is not time-limited, a first application program interface is adopted to store the target data and the current storage time stamp in the aging information in the data cache region.
Optionally, in response to that the data validity information in the aging information of the target data is a time limit, a second application program interface is used to store the target data, the current storage time stamp in the aging information, and the time limit of the target data in the data buffer.
As an example, as shown in fig. 3, in response to that the data validity information in the aging information of the target data 3011 is not time limit, a first application program interface is adopted to store the target data 3011 and the current storage time stamp 304 in the aging information in the data buffer 301, and obtain a data buffer 302 after storing the data. The data buffer 301 includes: data 3012, data 3013, data 3014, data 3015, data 3016, and data 3017. The current storage timestamp may be: "1601762506". In response to that the data validity information in the aging information of the object data 3011 is a time limit, a second application program interface is used to store the object data 3011, the current storage time stamp 305 in the aging information, and the time limit 306 of the object data in the data buffer 301, and obtain the data buffer 303 after storing the data. Wherein, the current storage timestamp may be: "1017662506". The time period 306 may be "36 h".
The above embodiments of the present disclosure have the following beneficial effects: the data storage method of some embodiments of the present disclosure can improve the speed of loading data laterally, and further reduce the number of requests. Specifically, the inventors found that the reason why the data loading speed is not fast enough is: for the data request, there is a speed difference between the high-speed device and the low-speed device for data transmission by using the web page development technology of the interactive web page application, and the access to the low-speed device reduces the efficiency of the system, resulting in slow data loading. Based on this, the data storage method of some embodiments of the present disclosure preferentially determines whether the target data exists from the data cache region according to the intercepted first request related to the target data. Optionally, in response to storing the target data, the target data is returned to the corresponding terminal as a response. In addition, when the target data does not exist in the data buffer, a second request is sent again to obtain the target data. Furthermore, the data related to the data request and the aging information of the data are stored, and the target data stored in the data buffer area can be used for the next data request related to the target data. Compared with the webpage development technology of interactive webpage application, the method has the advantages that the data loading speed is increased, and the number of data requests is reduced.
With continued reference to FIG. 4, a flow 400 of further embodiments of a data storage method according to the present disclosure is shown. The data storage method comprises the following steps:
step 401, determining whether the target data is stored in the data buffer according to the intercepted first request related to the target data.
Step 402, in response to the target data not being stored in the data buffer, sending a second request related to the target data to obtain the target data.
Step 403, determining whether a storage space for storing the target data exists in the data buffer.
Step 404, in response to the data buffer area having the storage space, storing the acquired target data and the aging information of the target data in the data buffer area.
In some embodiments, the specific implementation and technical effects of steps 401 and 404 may refer to steps 201 and 204 in the embodiments corresponding to fig. 2, which are not described herein again.
Step 405, in response to that the data cache region does not have the storage space, reading data elimination policy information written by the configuration information.
In some embodiments, in response to the data cache not having the storage space, the execution body may read data elimination policy information written by configuration information. The data elimination strategy information may be method information representing how to eliminate data from the data cache region. The data-elimination policy information may include at least one data-elimination method. It should be noted that the data elimination method corresponding to the data cache region may be determined by the target user according to the service requirement from the data elimination policy information.
And step 406, determining whether to adjust the data cache region according to the data elimination strategy information and the data type of the data in the data cache region.
In some embodiments, the execution body may determine whether to adjust the data cache region according to the data elimination policy information and the data type of the data in the data cache region. Wherein, the data type of the data in the data buffer area comprises at least one of the following items: data with a time limit, data without a time limit, data with a number of occupied bytes greater than or equal to a predetermined threshold, and data with a number of occupied bytes less than a predetermined threshold.
As an example, in response to the data elimination policy information indicating that the number of bytes occupied in the eliminated data cache region is greater than the predetermined threshold and that the data in the data cache region has data whose number of bytes occupied is greater than or equal to the predetermined threshold, determining to adjust the data cache region.
In some optional implementation manners of some embodiments, the determining whether to adjust the data cache region according to the data elimination policy information and the data category of the data in the data cache region may include:
in the first step, in response to that the data elimination strategy information represents that a first number of data with time limit are eliminated randomly and the data in the data cache region are the data without time limit, the data cache region is determined not to be adjusted.
And secondly, responding to the data elimination strategy information representing that a second number of data with time limit smaller than a preset value are eliminated and data with time limit smaller than the preset value do not exist in the data cache region, and determining not to adjust the data cache region.
In some optional implementation manners of some embodiments, the determining whether to adjust the data cache region according to the data elimination policy information and the data category of the data in the data cache region may include:
and step one, responding to the data elimination strategy information representation to randomly eliminate a third number of data, and determining to adjust the data cache region.
And secondly, determining to adjust the data cache region in response to the data elimination strategy information representing that the first number of data with time limit are eliminated and the first number of data with time limit exist in the data cache region.
And thirdly, determining to adjust the data cache region in response to the data elimination strategy information representing that the data with the second number of time deadlines smaller than a preset value is eliminated and the data with the second number of time deadlines smaller than the preset value exists in the data cache region.
Step 407, in response to determining to adjust the data buffer, generating an adjusted data buffer.
In some embodiments, the execution entity may generate an adjusted data buffer in response to determining to adjust the data buffer. As an example, in response to determining to adjust the data cache region, a predetermined number of data satisfying a predetermined condition are eliminated from the data cache region, resulting in an adjusted data cache region.
Step 408, storing the obtained target data and the aging information of the target data in the adjusted data buffer area.
In some embodiments, the executing entity may store the acquired target data and the aging information of the target data in the adjusted data buffer.
In some optional implementations of some embodiments, in response to determining not to adjust the data cache, an exception is thrown or a silent store failure is performed.
The embodiment of the disclosure solves the technical problem mentioned in the background art that "the request data cannot be quickly and effectively provided with reasonable storage space". The factors that result in the inability to quickly and efficiently provide reasonable storage space for requested data are often as follows: for the condition that the data cache region does not have the storage space, the storage of the request data is often predetermined, and the user can not read the corresponding data elimination strategy information to select the storage method which accords with the user according to the service condition. The present disclosure describes in detail a case where the data cache region does not have the storage space, and when the data cache region does not have the storage space, first, data elimination policy information for determining a method for eliminating data in the data cache region is read. And then, determining whether to adjust the data cache region according to the data elimination strategy information and the data type of the data in the data cache region. And further, adjusting the data cache region to obtain an adjusted data cache region. And finally, storing the acquired target data and the aging information of the target data in the adjusted data buffer area. The data processing of the data cache region can provide a processing method which is fast and meets the service requirements, so that reasonable storage space is fast and effectively provided for the requested data.
With continued reference to fig. 5, as an implementation of the above-described method for the above-described figures, the present disclosure provides some embodiments of a data storage device, which correspond to those of the method embodiments described above for fig. 2, and which may be particularly applicable in various electronic devices.
As shown in fig. 5, the data storage device 500 of some embodiments includes: a first determination unit 501, a transmission unit 502, a second determination unit 503, and a storage unit 504. Wherein, the first determining unit 501 is configured to determine whether the target data is stored in the data buffer according to the intercepted first request related to the target data. The sending unit 502 is configured to send a second request related to the target data to obtain the target data in response to the target data not being stored in the data buffer. The second determination unit 503 is configured to determine whether a storage space for storing the target data exists in the data buffer. The storage unit 504 is configured to store the acquired target data and the age information of the target data in the data buffer in response to the data buffer having the storage space.
In some optional implementations of some embodiments, the apparatus 500 may further include: a sending unit (not shown in the figure). Wherein the sending unit may be further configured to send the target data stored in the data buffer to a corresponding terminal as a response to the first request.
In some optional implementations of some embodiments, the apparatus 500 may further include: a reading unit, a third determining unit, a generating unit and a storing unit (not shown in the figure). The reading unit may be configured to read the data elimination policy information written by the configuration information in response to the data cache region not having the storage space. The third determining unit may be configured to determine whether to adjust the data cache region according to the data elimination policy information and a data category of data in the data cache region, where the data category of the data in the data cache region includes at least one of: there is time-limited data, no time-limited data. The generation unit is configured to generate an adjusted data buffer in response to determining to adjust the data buffer. The storage unit may be further configured to store the acquired target data and the aging information of the target data in the adjusted data buffer.
In some optional implementations of some embodiments, the apparatus 500 may further include: a throw-out or execution unit (not shown in the figures). The cast or execute unit may be configured to cast an exception or perform a silent store failure in response to determining not to adjust the data cache.
In some optional implementations of some embodiments, the third determining unit may be further configured to: determining not to adjust the data cache region in response to the data elimination strategy information representing that a first number of data with time limit are eliminated randomly and the data in the data cache region is the data without time limit; and determining not to adjust the data cache region in response to the data elimination strategy information representing that a second number of data with time limit smaller than a preset value are eliminated and the data with time limit smaller than the preset value do not exist in the data cache region.
In some optional implementations of some embodiments, the third determining unit may be further configured to: responding to the data elimination strategy information representation to randomly eliminate a third number of data, and determining to adjust the data cache region; determining to adjust the data cache region in response to the data eviction policy information characterizing eviction of the first number of time periods of data and presence of the first number of time periods of data in the data cache region; and determining to adjust the data cache region in response to the data elimination strategy information representing that the data with the second number of time deadlines smaller than a preset value is eliminated and the data with the second number of time deadlines smaller than the preset value exists in the data cache region.
In some optional implementations of some embodiments, the storage unit 504 may be further configured to: responding to the storage space existing in the data cache region, and determining the aging information of the target data; and storing the target data and the aging information in the data buffer area by adopting a corresponding application program interface.
In some optional implementations of some embodiments, the storage unit 504 may be further configured to: and in response to that the data valid information in the aging information of the target data is not time limit, adopting a first application program interface to store the target data and the current storage time stamp in the aging information in the data cache region.
In some optional implementations of some embodiments, the storage unit 504 may be further configured to: and in response to that the data valid information in the aging information of the target data is a time limit, adopting a second application program interface to store the target data, the current storage time stamp in the aging information and the time limit of the target data in the data cache region.
In some optional implementations of some embodiments, the apparatus 500 may further include: a processing unit (not shown in the figure). The processing unit is configured to: and setting a timer to periodically process the data with the storage time exceeding the time limit in the data cache region.
It will be understood that the elements described in the apparatus 500 correspond to various steps in the method described with reference to fig. 2. 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., the terminal device 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 above 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 apparatus; 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: determining whether the target data is stored in a data cache region according to the intercepted first request related to the target data; sending a second request related to the target data to acquire the target data in response to the target data not being stored in the data cache region; determining whether a storage space for storing the target data exists in the data cache region; and responding to the existence of the storage space in the data cache region, and storing the acquired target data and the aging information of the target data in the data cache region.
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 first determination unit, a transmission unit, a second determination unit, and a storage unit. The names of the units do not form a limitation on the units themselves in some cases, for example, the first determination unit may also be described as "a unit that determines whether to store the target data in the data buffer according to the intercepted first request related to the target data".
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 (13)

1. A method of data storage, comprising:
determining whether the target data is stored in a data cache region according to the intercepted first request related to the target data;
sending a second request related to the target data to acquire the target data in response to the target data not being stored in the data cache region;
determining whether a storage space for storing the target data exists in the data cache region;
and responding to the existence of the storage space in the data cache region, and storing the acquired target data and the aging information of the target data in the data cache region.
2. The method of claim 1, wherein the method further comprises:
and sending the target data stored in the data cache region to a corresponding terminal as a response of the first request.
3. The method of claim 1, wherein the method further comprises:
responding to the data cache region without the storage space, and reading data elimination strategy information written by the configuration information;
determining whether to adjust the data cache region according to the data elimination strategy information and the data type of the data in the data cache region, wherein the data type of the data in the data cache region comprises at least one of the following items: data with time limit, data without time limit;
generating an adjusted data cache region in response to determining to adjust the data cache region;
and storing the acquired target data and the aging information of the target data in the adjusted data cache region.
4. The method of claim 3, wherein the method further comprises:
in response to determining not to adjust the data cache, throw an exception or perform a silent store failure.
5. The method of claim 3, wherein the determining whether to adjust the data cache according to the data eviction policy information and the data category of the data in the data cache comprises:
determining not to adjust the data cache region in response to the data elimination strategy information representing that a first number of data with time limit are eliminated randomly and the data in the data cache region is the data without time limit;
and determining not to adjust the data cache region in response to the data elimination strategy information representing that a second number of data with time limit smaller than a preset value are eliminated and the data with time limit smaller than the preset value do not exist in the data cache region.
6. The method of claim 3, wherein the determining whether to adjust the data cache according to the data eviction policy information and the data category of the data in the data cache comprises:
responding to the data elimination strategy information representation to randomly eliminate a third number of data, and determining to adjust the data cache region;
determining to adjust the data cache in response to the data eviction policy information characterizing eviction of the first number of time-dated data and the presence of the first number of time-dated data in the data cache;
and determining to adjust the data cache region in response to the data elimination strategy information representing that the data with the second number of time deadlines smaller than a preset value is eliminated and the data with the second number of time deadlines smaller than the preset value exists in the data cache region.
7. The method of claim 1, wherein the storing the obtained target data and age information of the target data in the data cache in response to the data cache existing the storage space comprises:
determining aging information of the target data in response to the data cache region having the storage space;
and adopting a corresponding application program interface to store the target data and the aging information in the data cache region.
8. The method of claim 7, wherein said employing a corresponding application program interface to store the target data and the age information in the data cache comprises:
and in response to that the data valid information in the aging information of the target data is not time limit, adopting a first application program interface to store the target data and the current storage time stamp in the aging information in the data cache region.
9. The method of claim 7, wherein said employing a corresponding application program interface to store the target data and the age information in the data cache comprises:
and in response to that the data valid information in the aging information of the target data is a time limit, adopting a second application program interface to store the target data, the current storage time stamp in the aging information and the time limit of the target data in the data cache region.
10. The method of claim 1, wherein after the sending of the second request related to the target data to obtain the target data in response to the target data not being stored in the data cache, the method further comprises:
and processing the data stored in the data cache region for a time exceeding the time limit periodically.
11. A data storage device comprising:
a first determining unit configured to determine whether the target data is stored in a data buffer according to the intercepted first request related to the target data;
a sending unit configured to send a second request related to the target data to acquire the target data in response to the target data not being stored in the data cache region;
a second determination unit configured to determine whether a storage space for storing the target data exists in the data buffer;
a storage unit configured to store the acquired target data and the aging information of the target data in the data cache region in response to the data cache region having the storage space.
12. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-10.
13. 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-10.
CN202011201490.3A 2020-11-02 2020-11-02 Data storage method and device, electronic equipment and computer readable medium Pending CN112163176A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011201490.3A CN112163176A (en) 2020-11-02 2020-11-02 Data storage method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011201490.3A CN112163176A (en) 2020-11-02 2020-11-02 Data storage method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN112163176A true CN112163176A (en) 2021-01-01

Family

ID=73865394

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011201490.3A Pending CN112163176A (en) 2020-11-02 2020-11-02 Data storage method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN112163176A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113342837A (en) * 2021-08-06 2021-09-03 北京金山云网络技术有限公司 Data transmission method, device, electronic equipment and computer readable medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113342837A (en) * 2021-08-06 2021-09-03 北京金山云网络技术有限公司 Data transmission method, device, electronic equipment and computer readable medium

Similar Documents

Publication Publication Date Title
US11146502B2 (en) Method and apparatus for allocating resource
CN110781373B (en) List updating method and device, readable medium and electronic equipment
CN112379982B (en) Task processing method, device, electronic equipment and computer readable storage medium
CN112416632B (en) Event communication method and device, electronic equipment and computer readable medium
CN113760536A (en) Data caching method and device, electronic equipment and computer readable medium
CN110768861B (en) Method, device, medium and electronic equipment for obtaining overtime threshold
CN112163176A (en) Data storage method and device, electronic equipment and computer readable medium
CN114785770A (en) Mirror layer file sending method and device, electronic equipment and computer readable medium
CN111625745B (en) Recommendation method, recommendation device, electronic equipment and computer readable medium
CN114095907A (en) Bluetooth connection control method, device and equipment
CN112527454A (en) Container group scheduling method and device, electronic equipment and computer readable medium
CN111580890A (en) Method, apparatus, electronic device, and computer-readable medium for processing features
CN112685156A (en) Task execution method and device, electronic equipment and computer readable medium
CN111756833A (en) Node processing method and device, electronic equipment and computer readable medium
CN113342837B (en) Data transmission method, device, electronic equipment and computer readable medium
CN112637048B (en) Information sending method, information sending device, electronic equipment and computer readable medium
CN112235167B (en) Flow alarm method, device, electronic equipment and computer readable medium
CN117170986B (en) Chip consistency processing system, method, device, equipment and medium thereof
CN112685455B (en) Real-time data classification display method and device, electronic equipment and readable medium
CN115993942B (en) Data caching method, device, electronic equipment and computer readable medium
CN112148448A (en) Resource allocation method, device, equipment and computer readable medium
CN113760365A (en) Token fetching operation execution method, device, electronic equipment and computer readable medium
CN111404824A (en) Method, apparatus, electronic device and computer readable medium for forwarding a request
CN111625566A (en) Data caching method, device, medium and equipment
CN112632434A (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