Data storage method, device, electronic device and computer readable medium

By checking and storing target data in the data cache area, the problem of slow data loading at low network speeds is solved, and the effect of faster data loading and reducing the number of requests.

CN112163176BActive Publication Date: 2025-01-28BEIJING CHENGSHI WANGLIN INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011201490.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-02
Publication Date
2025-01-28
Estimated Expiration
2040-11-02

AI Technical Summary

Technical Problem

Under low network speed, when the web development technology of interactive web applications is used to obtain data, the data loads slowly, resulting in poor user experience, and lacks fast and effective data cache area processing methods.

Method used

By intercepting the first request related to the target data, determine whether the target data is stored in the data cache area.

Benefits of technology

The data loading speed has been improved, the number of requests is reduced, and the faster and effective data storage solution is provided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112163176B_ABST
    Figure CN112163176B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose a data storage method, device, electronic device and computer-readable medium. A specific implementation of the data storage method includes: determining whether the target data is stored in the data cache area according to the intercepted first request related to the target data; in response to the target data not being stored in the data cache area, sending a second request related to the target data to obtain the target data; determining whether there is storage space for storing the target data in the data cache area; in response to the existence of the storage space in the data cache area, storing the acquired target data and the timeliness information of the target data in the data cache area. This implementation can simply and effectively provide data caching capabilities for the data request by storing information related to the data request that is not stored in the data cache area, which indirectly improves the data loading speed and further reduces the number of requests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to a data storage method, device, electronic device, and computer-readable medium. Background Art

[0002] With the development of mobile Internet, various applications are running on various terminal devices. At present, most of the applications on various terminal devices request the server to obtain the required data through the web development technology of interactive web applications.

[0003] However, when using the above method to obtain data, the following technical problems often occur:

[0004] First, in the case of low network speed, the web development technology of interactive web applications is used to obtain data in low-speed devices, and the data loads slowly, resulting in a poor user experience.

[0005] Second, there is a lack of fast and business-compliant processing methods for data processing in the data cache area, so that reasonable storage space cannot be provided for requested data quickly and effectively. Summary of the invention

[0006] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.

[0007] Some embodiments of the present disclosure propose a page rendering method, apparatus, device, and computer-readable medium to solve one or more of the technical problems mentioned in the above background technology section.

[0008] In a first aspect, some embodiments of the present disclosure provide a data storage method, the method comprising: determining whether the target data is stored in a data cache area based on an intercepted first request related to the target data; in response to the target data not being stored in the data cache area, sending a second request related to the target data to obtain the target data; determining whether there is storage space for storing the target data in the data cache area; in response to the existence of the storage space in the data cache area, storing the acquired target data and the timeliness information of the target data in the data cache area.

[0009] In a second aspect, some embodiments of the present disclosure provide a data storage device, which includes: a first determination unit, configured to determine whether the target data is stored in a data cache area based on an intercepted first request related to the target data; a sending unit, 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 cache area; a second determination unit, configured to determine whether there is storage space for storing the target data in the data cache area; and a storage unit, configured to store the acquired target data and the timeliness information of the target data in the data cache area in response to the existence of the storage space in the data cache area.

[0010] 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, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any method as described in the first aspect.

[0011] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, any method in the first aspect is implemented.

[0012] The above-mentioned various 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 and further reduce the number of requests. Specifically, the inventor found that the reason for the slow data loading speed is that: for the data request, there is a speed difference in data transmission using the web page development technology of the interactive web page application on the high-speed and low-speed devices, and the access to the slow 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 above-mentioned target data exists from the data cache area according to the intercepted first request related to the target data. Optionally, in response to storing the above-mentioned target data, the target data is returned to the corresponding terminal as a response. In addition, when the above-mentioned target data does not exist in the above-mentioned data cache area, a second request will be sent again to obtain the target data. Furthermore, the data related to the data request and the timeliness information of the data are stored, and the above-mentioned target data stored in the above-mentioned data cache area can be used for the next data request related to the above-mentioned target data. Compared with the web page development technology of the interactive web page application, the data loading speed is improved and the number of data requests is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0014] Figure 1 is a schematic diagram of an application scenario diagram of the data storage method of some embodiments of the present disclosure;

[0015] Figure 2 is a flow chart of some embodiments of the data storage method according to the present disclosure;

[0016] Figure 3 is a schematic diagram of an application scenario diagram of data storage in the data storage method according to the present disclosure;

[0017] Figure 4 are flow charts of other embodiments of the data storage method according to the present disclosure;

[0018] Figure 5 is a schematic diagram of the structure of some embodiments of the data storage device according to the present disclosure;

[0019] Figure 6 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0020] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0021] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

[0022] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0023] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0024] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0025] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0026] Figure 1 It is a schematic diagram of an application scenario diagram of the data storage method in some embodiments of the present disclosure.

[0027] like Figure 1 As shown, the terminal device 100 can first determine whether the target data 1011 is stored in the data cache area 101 according to the intercepted first request 103 related to the target data 1011. In this application scenario, the data cache area 101 includes: data 1012, data 1013, data 1014, data 1015, data 1016, and data 1017. Then, in response to the target data 1011 not being stored in the data cache area 101, a second request 102 related to the target data 1011 is sent to obtain the target data 1011. Further, it is determined whether there is storage space for storing the target data 1011 in the data cache area 101. Finally, in response to the storage space existing in the data cache area 101, the acquired target data 1011 and the timeliness information 104 of the target data 1011 are stored in the data cache area 101. In this application scenario, the timeliness information 104 may be “current timestamp: 1601762506”.

[0028] It is understandable that the execution subject of the data storage method can be the terminal device 100, and the execution subject of the above data storage method can also include a device formed by integrating the above terminal device 100 with the above server through a network. Among them, the terminal device 100 can be various electronic devices with information processing capabilities, including but not limited to smart phones, tablet computers, e-book readers, laptop computers and desktop computers, etc. When the execution subject of the data storage method is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.

[0029] It should be understood that Figure 1 The number of terminal devices in the figure is only for illustration. Any number of terminal devices may be provided according to implementation requirements.

[0030] Continue to refer Figure 2, shows a process 200 of some embodiments of the data storage method according to the present disclosure. The data storage method comprises the following steps:

[0031] Step 201: Determine whether the target data is stored in the data cache area according to the intercepted first request related to the target data.

[0032] In some embodiments, the execution subject of the data storage method (eg Figure 1 The terminal device 100 shown in the figure can determine whether the target data is stored in the data cache area according to the intercepted first request related to the target data. The first request related to the target data can be intercepted by a related decorator.

[0033] Step 202: In response to the target data not being stored in the data buffer, a second request related to the target data is sent to obtain the target data.

[0034] In some embodiments, in response to the target data not being stored in the data cache, the execution subject may send a second request related to 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 the target data not being stored in the data cache, a second request related to the target data may be sent to the server. Furthermore, the server may send the target data to the terminal device.

[0035] In some optional implementations of some embodiments, data in the data cache area whose storage time exceeds a time limit is processed periodically. The storage time may be the difference between the timestamp when the target data is stored and the current timestamp. As an example, a timer may be set so that the execution subject can periodically process data in the data cache area whose storage time exceeds a time limit.

[0036] Step 203: Determine whether there is storage space in the data buffer area for storing the target data.

[0037] In some embodiments, the execution subject may first determine the size of the target data in bytes, and then read the remaining storage information of the data buffer to determine whether there is storage space in the data buffer for storing the target data.

[0038] Step 204 , in response to the existence of the storage space in the data cache area, storing the acquired target data and the timeliness information of the target data in the data cache area.

[0039] In some embodiments, in response to the existence of the storage space in the data cache, the execution subject may store the acquired target data and the expiration information of the target data in the data cache. The expiration information of the target data may include but is not limited to at least one of the following: the timestamp when the target data is stored in the data cache, and the time limit of the target data.

[0040] In some optional implementations of some embodiments, the target data stored in the data cache area is sent to the corresponding terminal as a response to the first request.

[0041] In some optional implementations of some embodiments, in response to the existence of the storage space in the data cache, storing the acquired target data and the timeliness information of the target data in the data cache may include the following steps:

[0042] The first step is to determine the timeliness information of the target data in response to the existence of the storage space in the data cache.

[0043] The second step is to use a corresponding application programming interface (API) to store the target data and the timeliness information in the data cache area. The target data stored in the data cache area may be stored in the form of key-value pairs.

[0044] Optionally, in response to the data validity information in the aging information of the target data having no time limit, a first application program interface is used to store the target data and the current storage timestamp in the aging information in the data cache.

[0045] Optionally, in response to the data validity information in the expiration information of the target data having a time limit, a second application program interface is used to store the target data, the current storage timestamp in the expiration information and the time limit of the target data in the data cache area.

[0046] As an example, Figure 3As shown, in response to the data validity information in the aging information of the target data 3011 being that there is no time limit, the first application program interface is used to store the target data 3011 and the current storage timestamp 304 in the aging information in the data cache 301, and obtain the data cache 302 after the data is stored. The data cache 301 includes: data 3012, data 3013, data 3014, data 3015, data 3016, and data 3017. The current storage timestamp can be: "1601762506". In response to the data validity information in the aging information of the target data 3011 being that there is a time limit, the second application program interface is used to store the target data 3011, the current storage timestamp 305 in the aging information, and the time limit 306 of the target data in the data cache 301, and obtain the data cache 303 after the data is stored. The current storage timestamp can be: "1017662506". The above-mentioned time limit 306 may be "36h".

[0047] The above-mentioned various 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 and further reduce the number of requests. Specifically, the inventor found that the reason for the slow data loading speed is that: for the data request, there is a speed difference in data transmission using the web page development technology of the interactive web page application on the high-speed and low-speed devices, and the access to the slow 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 above-mentioned target data exists from the data cache area according to the intercepted first request related to the target data. Optionally, in response to storing the above-mentioned target data, the target data is returned to the corresponding terminal as a response. In addition, when the above-mentioned target data does not exist in the above-mentioned data cache area, a second request will be sent again to obtain the target data. Furthermore, the data related to the data request and the timeliness information of the data are stored, and the above-mentioned target data stored in the above-mentioned data cache area can be used for the next data request related to the above-mentioned target data. Compared with the web page development technology of the interactive web page application, the data loading speed is improved and the number of data requests is reduced.

[0048] Continue to refer Figure 4 , shows a process 400 of another embodiment of the data storage method according to the present disclosure. The data storage method comprises the following steps:

[0049] Step 401: Determine whether the target data is stored in the data cache area according to the intercepted first request related to the target data.

[0050] Step 402: In response to the target data not being stored in the data buffer, a second request related to the target data is sent to obtain the target data.

[0051] Step 403: Determine whether there is storage space in the data buffer area for storing the target data.

[0052] Step 404 , in response to the existence of the storage space in the data cache area, the acquired target data and the timeliness information of the target data are stored in the data cache area.

[0053] In some embodiments, the specific implementation of steps 401-404 and the technical effects brought about can be referred to Figure 2 The corresponding steps 201-204 in the embodiments are not described in detail here.

[0054] Step 405 , in response to the absence of the storage space in the data cache area, read the data elimination strategy information written in the configuration information.

[0055] In some embodiments, in response to the absence of the storage space in the data cache, the execution subject may read the data elimination policy information written in the configuration information. The data elimination policy information may be method information that characterizes how to eliminate data from the data cache. 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 may be determined by the target user from the data elimination policy information based on business requirements.

[0056] Step 406: Determine whether to adjust the data cache area according to the data elimination strategy information and the data category of the data in the data cache area.

[0057] In some embodiments, the execution subject may determine whether to adjust the data cache area according to the data elimination strategy information and the data category of the data in the data cache area. The data category of the data in the data cache area includes at least one of the following: data with a time limit, data without a time limit, data with a number of bytes greater than or equal to a predetermined threshold, and data with a number of bytes less than a predetermined threshold.

[0058] As an example, in response to the data elimination strategy information indicating that data in the data cache area with a number of bytes greater than a predetermined threshold is to be eliminated and data in the data cache area with a number of bytes greater than or equal to the predetermined threshold exists, it is determined to adjust the data cache area.

[0059] In some optional implementations of some embodiments, the determining whether to adjust the data cache area according to the data elimination strategy information and the data category of the data in the data cache area may include the following steps:

[0060] In the first step, in response to the data elimination strategy information indicating that a first number of data with time limits are randomly eliminated and the data in the data cache area is the data without time limits, determining not to adjust the data cache area.

[0061] In the second step, in response to the data elimination strategy information indicating elimination of a second number of data with a time limit less than a predetermined value and the absence of data with a time limit less than the predetermined value in the data cache, it is determined not to adjust the data cache.

[0062] In some optional implementations of some embodiments, the determining whether to adjust the data cache area according to the data elimination strategy information and the data category of the data in the data cache area may include the following steps:

[0063] In the first step, in response to the data elimination strategy information indicating that a third number of data is randomly eliminated, it is determined to adjust the data cache area.

[0064] In a second step, in response to the data elimination strategy information indicating elimination of the first number of data with time limits and the first number of data with time limits existing in the data cache area, determining to adjust the data cache area.

[0065] In the third step, in response to the data elimination strategy information indicating elimination of the data whose second number of time periods is less than a predetermined value and the data cache having the second number of time periods less than a predetermined value, determining to adjust the data cache.

[0066] Step 407 : In response to determining to adjust the data buffer area, an adjusted data buffer area is generated.

[0067] In some embodiments, in response to determining to adjust the data cache area, the execution subject may generate an adjusted data cache area. As an example, in response to determining to adjust the data cache area, a predetermined number of data satisfying a predetermined condition is eliminated from the data cache area to obtain an adjusted data cache area.

[0068] Step 408: Store the acquired target data and the timeliness information of the target data in the adjusted data buffer area.

[0069] In some embodiments, the execution entity may store the acquired target data and the timeliness information of the target data in the adjusted data cache area.

[0070] In some optional implementations of some embodiments, in response to determining that the data cache area is not to be adjusted, an exception is thrown or silent storage fails.

[0071] The embodiment of the present disclosure solves the second technical problem mentioned in the background technology, "it is not possible to quickly and effectively provide reasonable storage space for the requested data". The factors that lead to the inability to quickly and effectively provide reasonable storage space for the requested data are often as follows: in the case where the above-mentioned storage space does not exist in the data cache area, the storage of the requested data is often predetermined, and the user cannot read the corresponding data elimination strategy information to select a storage method that suits him according to the business situation. The present disclosure provides a detailed description of the case where the above-mentioned storage space does not exist in the data cache area. When the above-mentioned storage space does not exist in the above-mentioned data cache area, first, the data elimination strategy information for determining the method of eliminating data in the data cache area is read. Then, according to the above-mentioned data elimination strategy information and the data category of the data in the above-mentioned data cache area, it is determined whether to adjust the above-mentioned data cache area. Then, the above-mentioned data cache area is adjusted to obtain the adjusted data cache area. Finally, the above-mentioned target data and the timeliness information of the above-mentioned target data obtained are stored in the above-mentioned adjusted data cache area. A fast processing method that meets business requirements can be provided for data processing in the data cache area, so as to quickly and effectively provide reasonable storage space for the requested data.

[0072] Continue to refer Figure 5 As an implementation of the above methods in the above figures, the present disclosure provides some embodiments of a data storage device, and these device embodiments are Figure 2 Corresponding to the above method embodiments, the device can be specifically applied to various electronic devices.

[0073] like Figure 5As shown, the data storage device 500 of some embodiments includes: a first determination unit 501, a sending unit 502, a second determination unit 503 and a storage unit 504. Among them, the first determination unit 501 is configured to determine whether the above-mentioned target data is stored in the data cache area 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 above-mentioned target data to obtain the above-mentioned target data in response to the above-mentioned target data not being stored in the above-mentioned data cache area. The second determination unit 503 is configured to determine whether there is storage space for storing the above-mentioned target data in the above-mentioned data cache area. The storage unit 504 is configured to store the above-mentioned target data and the timeliness information of the above-mentioned target data in the above-mentioned data cache area in response to the above-mentioned storage space existing in the above-mentioned data cache area.

[0074] In some optional implementations of some embodiments, the apparatus 500 may further include: a sending unit (not shown in the figure). The sending unit may also be configured to send the target data stored in the data buffer area to the corresponding terminal as a response to the first request.

[0075] In some optional implementations of some embodiments, the device 500 may further include: a reading unit, a third determination unit, a generation unit and a storage unit (not shown in the figure). The reading unit may be configured to read the data elimination strategy information written by the configuration information in response to the absence of the above-mentioned storage space in the above-mentioned data cache area. The third determination unit may be configured to determine whether to adjust the above-mentioned data cache area based on the above-mentioned data elimination strategy information and the data category of the data in the above-mentioned data cache area, wherein the data category of the data in the above-mentioned data cache area includes at least one of the following: data with a time limit, data without a time limit. The generation unit is configured to generate an adjusted data cache area in response to determining to adjust the above-mentioned data cache area. The storage unit may also be configured to store the acquired above-mentioned target data and the timeliness information of the above-mentioned target data in the above-mentioned adjusted data cache area.

[0076] In some optional implementations of some embodiments, the apparatus 500 may further include a throwing or executing unit (not shown in the figure). The throwing or executing unit may be configured to throw an exception or execute silent storage failure in response to determining not to adjust the data cache area.

[0077] In some optional implementations of some embodiments, the third determination unit may be further configured to: in response to the data elimination strategy information representing the random elimination of a first number of data with time limits and the data in the data cache being the data without time limits, determine that the data cache does not need to be adjusted; in response to the data elimination strategy information representing the elimination of a second number of data with time limits less than a predetermined value and the absence of data with a time limit less than the predetermined value in the data cache, determine that the data cache does not need to be adjusted.

[0078] In some optional implementations of some embodiments, the third determination unit may be further configured to: determine to adjust the data cache area in response to the data elimination strategy information representing random elimination of a third number of data; determine to adjust the data cache area in response to the data elimination strategy information representing elimination of the first number of data with time limits and the existence of the first number of data with time limits in the data cache area; determine to adjust the data cache area in response to the data elimination strategy information representing elimination of the second number of data with time limits less than a predetermined value and the existence of the second number of data with time limits less than a predetermined value in the data cache area.

[0079] In some optional implementations of some embodiments, the storage unit 504 may be further configured to: determine the expiration information of the target data in response to the existence of the storage space in the data cache; and use a corresponding application program interface to store the target data and the expiration information in the data cache.

[0080] In some optional implementations of some embodiments, the storage unit 504 can be further configured to: in response to the data validity information in the timeliness information of the above-mentioned target data being without time limit, use a first application interface to store the above-mentioned target data and the current storage timestamp in the above-mentioned timeliness information in the above-mentioned data cache area.

[0081] In some optional implementations of some embodiments, the storage unit 504 can be further configured to: in response to the data validity information in the timeliness information of the above-mentioned target data being a time limit, use a second application interface to store the above-mentioned target data, the current storage timestamp in the above-mentioned timeliness information and the time limit of the above-mentioned target data in the above-mentioned data cache area.

[0082] 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: set a timer to periodically process the data in the data buffer area that has been stored for a period exceeding a time limit.

[0083] It is understood that the units described in the device 500 are similar to those described in the reference Figure 2 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 500 and the units included therein, and will not be described in detail here.

[0084] Reference below Figure 6 , which shows an electronic device (eg, Figure 1 A schematic diagram of the structure of the terminal device 600. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0085] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0086] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0087] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.

[0088] It should be noted that the computer-readable medium 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. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0089] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0090] The computer-readable medium may be included in the device; or it may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: determines whether the target data is stored in the data cache according to the intercepted first request related to the target data; in response to the target data not being stored in the data cache, sends a second request related to the target data to obtain the target data; determines whether there is storage space for storing the target data in the data cache; in response to the storage space in the data cache, stores the acquired target data and the expiration information of the target data in the data cache.

[0091] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0092] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0093] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be provided in a processor, for example, may be described as: a processor comprising a first determination unit, a sending unit, a second determination unit and a storage unit. Among them, the names of these units do not constitute a limitation on the units themselves in certain circumstances, for example, the first determination unit may also be described as "a unit for determining whether the above target data is stored in the data cache area according to the intercepted first request related to the target data".

[0094] The functions described above herein 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 chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0095] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.

Claims

1. A data storage method, comprising: Determining, according to the intercepted first request related to the target data, whether the target data is stored in the data cache area; In response to the target data not being stored in the data cache area, sending a second request related to the target data to obtain the target data; Determining whether there is storage space in the data cache area for storing the target data; In response to the storage space existing in the data cache area, storing the acquired target data and the timeliness information of the target data in the data cache area; In response to the absence of the storage space in the data cache area, reading the data elimination strategy information written in the configuration information; Determine whether to adjust the data cache area according to the data elimination strategy information and the data category of the data in the data cache area, wherein the data category of the data in the data cache area includes at least one of the following: data with a time limit and data without a time limit; In response to determining to adjust the data cache area, generating an adjusted data cache area; The acquired target data and the timeliness information of the target data are stored in the adjusted data cache area, wherein the step of determining whether to adjust the data cache area according to the data elimination strategy information and the data category of the data in the data cache area comprises: In response to the data elimination strategy information indicating that a first number of data with time limits are randomly eliminated and the data in the data cache area is the data without time limits, determining not to adjust the data cache area; In response to the data elimination policy information indicating elimination of a second number of data with a time limit less than a predetermined value and the data cache having a time limit less than the predetermined value not existing in the data cache, it is determined not to adjust the data cache.

2. The method according to claim 1, wherein: The method further comprises: The target data stored in the data buffer area is sent to the corresponding terminal as a response to the first request.

3. The method according to claim 1, wherein: The method further comprises: In response to determining that the data cache area is not to be adjusted, an exception is thrown or a silent storage failure is performed.

4. The method according to claim 1, wherein: The determining whether to adjust the data cache area according to the data elimination strategy information and the data category of the data in the data cache area includes: In response to the data elimination strategy information indicating that a third number of data is randomly eliminated, determining to adjust the data cache area; In response to the data elimination policy information indicating that the first number of data with a time limit is to be eliminated and the first number of data with a time limit exists in the data cache area, determining to adjust the data cache area; In response to the data elimination policy information indicating elimination of the data whose second number of time periods is less than a predetermined value and the data whose second number of time periods is less than a predetermined value existing in the data cache, it is determined to adjust the data cache.

5. The method according to claim 1, wherein: In response to the storage space existing in the data cache area, storing the acquired target data and the timeliness information of the target data in the data cache area includes: In response to the storage space existing in the data cache area, determining the timeliness information of the target data; The target data and the timeliness information are stored in the data buffer area using a corresponding application program interface.

6. The method according to claim 5, wherein: The using a corresponding application program interface to store the target data and the timeliness information in the data buffer area includes: In response to the data validity information in the aging information of the target data being without a time limit, a first application program interface is used to store the target data and a current storage timestamp in the aging information in the data cache.

7. The method according to claim 5, wherein: The using a corresponding application program interface to store the target data and the timeliness information in the data buffer area includes: In response to the data validity information in the aging information of the target data having a time limit, a second application program interface is used to store the target data, the current storage timestamp in the aging information and the time limit of the target data in the data cache area.

8. The method according to claim 1, wherein: After sending 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 cache, the method further includes: The data in the data buffer area that has been stored for longer than the time limit is periodically processed.

9. A data storage device, comprising: A first determining unit is configured to determine whether the target data is stored in the data cache area 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 obtain the target data in response to the target data not being stored in the data cache area; A second determining unit is configured to determine whether there is storage space for storing the target data in the data cache area; a storage unit configured to store the acquired target data and the timeliness information of the target data in the data cache area in response to the storage space existing in the data cache area, The device also includes: in response to the data cache area not having the storage space, reading the data elimination strategy information written by the configuration information; determining whether to adjust the data cache area according to the data elimination strategy information and the data category of the data in the data cache area, wherein the data category of the data in the data cache area includes at least one of the following: data with a time limit, data without a time limit; in response to determining to adjust the data cache area, generating an adjusted data cache area; storing the acquired target data and the timeliness information of the target data in the adjusted data cache area, wherein the determining whether to adjust the data cache area according to the data elimination strategy information and the data category of the data in the data cache area includes: in response to the data elimination strategy information indicating that a first number of data with a time limit are randomly eliminated and the data in the data cache area is the data without a time limit, determining not to adjust the data cache area; in response to the data elimination strategy information indicating that a second number of data with a time limit less than a predetermined value are eliminated and the data cache area does not have a time limit less than the predetermined value, determining not to adjust the data cache area.

10. An electronic device, comprising: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 8.

11. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Data request method, data processing system and computing equipment

    CN111414383A