Data caching method, device, computer equipment and storage medium

By generating and storing cache keywords and tags based on tag functions, the problem of inconsistency between business data and cached data in traditional caching technology is solved, and the timely generation and cleaning of data is realized, and the system performance is improved.

CN114676164BActive Publication Date: 2024-12-24金蝶云科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210319930.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-29
Publication Date
2024-12-24
Estimated Expiration
2042-03-29

AI Technical Summary

Technical Problem

In traditional caching technology, the immediacy of data cache is low, resulting in inconsistent business data and cached data.

Method used

Cache keywords are generated based on the function type, function identifier and function parameters of the tag function, and the tag parameters and business object identifiers are obtained, assembled into cache tags, determine and store business data, and realize the timely generation and cleaning of cached data.

Benefits of technology

Ensure the consistency between business data and cached data, improve data reading speed and system performance, and reduce the number of data interactions between clients and servers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114676164B_ABST
    Figure CN114676164B_ABST
Patent Text Reader

Abstract

The present application relates to a data caching method, apparatus, computer equipment and storage medium. The method comprises: generating a cache keyword based on the function type, function identifier and function parameter of the marking function; when the cache keyword does not have corresponding business data, obtaining the marking parameter in the function parameter and the business object identifier corresponding to the marking parameter; assembling the business object identifier and the marking parameter into a cache tag; determining the business data based on the cache keyword and the cache tag; storing the cache keyword, the cache tag and the business data in the corresponding cache area. The use of this method can keep the business data consistent with the cache data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data caching method, apparatus, computer equipment and storage medium. Background Art

[0002] With the development of computers, cache technology has emerged. Because there is a traffic bottleneck between the server and the application client, when reading large-capacity data, the cache is used to directly serve the client. The cache can increase the data reading speed and reduce the number of data interactions between the client and the server, thereby greatly improving the performance of the program. In traditional cache technology, data is mainly cached by setting a corresponding cache mechanism. For example, an expiration time is set for the cache. After the expiration time, the cache is automatically released and the data is cached again. Because the traditional cache mechanism has low immediacy in processing data cache, there is a problem of inconsistency between business data and cached data. Summary of the invention

[0003] Based on this, it is necessary to provide a data caching method, apparatus, computer device, computer-readable storage medium and computer program product that can keep business data consistent with cached data in response to the above technical problems.

[0004] In a first aspect, the present application provides a data caching method. The method comprises:

[0005] Generate cache keywords based on the function type, function identifier and function parameters of the marked function;

[0006] When the cache keyword does not have corresponding business data, obtaining the tag parameter in the function parameter and the business object identifier corresponding to the tag parameter;

[0007] Assembling the business object identifier and the tag parameter into a cache tag;

[0008] Determine the service data based on the cache keyword and the cache tag;

[0009] The cache keyword, the cache tag and the business data are stored in a corresponding cache area.

[0010] In one embodiment, before generating the cache keyword based on the function type, function identifier and function parameters of the marking function, the method further includes:

[0011] Marking a preset function to obtain the marked function;

[0012] Acquire a business object based on the business object identifier;

[0013] The function parameters corresponding to the business object are marked to obtain marked parameters.

[0014] In one embodiment, the method further comprises:

[0015] When the business object is modified or deleted, the business data corresponding to the cache tag is cleared.

[0016] In one embodiment, after generating the cache keyword based on the function type, function identifier and function parameters of the marking function, the method further includes:

[0017] When the character length of the cache keyword exceeds a preset length, the cache keyword is encrypted to obtain a target cache keyword;

[0018] The determining the service data based on the cache keyword and the cache tag includes:

[0019] Determining the service data based on the target cache keyword and the cache tag;

[0020] The storing the cache keyword, the cache tag, and the service data in the corresponding cache area includes:

[0021] The target cache keyword, the cache tag and the business data are stored in a corresponding cache area.

[0022] In one embodiment, the method further comprises:

[0023] When the cache keyword has corresponding business data, the business data is sent to the front end.

[0024] In one embodiment, the determining the service data based on the cache keyword and the cache tag includes:

[0025] Running the marking function according to the cache keyword;

[0026] The business data corresponding to the cache tag is generated through the marking function.

[0027] In a second aspect, the present application also provides a data cache device. The device comprises:

[0028] A generation module, used for generating cache keywords based on a function type, a function identifier and function parameters of a marked function;

[0029] An acquisition module, used for acquiring a tag parameter in the function parameter and a business object identifier corresponding to the tag parameter when the cache keyword does not have corresponding business data;

[0030] An assembling module, used for assembling the business object identifier and the marking parameter into a cache tag;

[0031] A determination module, configured to determine the service data based on the cache keyword and the cache tag;

[0032] The storage module is used to store the cache keyword, the cache tag and the business data in a corresponding cache area.

[0033] In one embodiment, the device further comprises:

[0034] The marking module is used to mark a preset function to obtain the marked function; obtain a business object based on the business object identifier; and mark a function parameter corresponding to the business object to obtain a marked parameter.

[0035] In one embodiment, the device further comprises:

[0036] The cleaning module is used to clean up the business data corresponding to the cache tag when the business object is modified or deleted.

[0037] In one of the embodiments, the generating module is further configured to encrypt the cache keyword to obtain a target cache keyword when the character length of the cache keyword exceeds a preset length;

[0038] The determination module is further used to determine the business data based on the target cache keyword and the cache tag; the storage module is further used to store the target cache keyword, the cache tag and the business data in a corresponding cache area.

[0039] In one embodiment, the device further comprises:

[0040] The display module is used to send the business data to the front end when the cached keyword has corresponding business data.

[0041] In one of the embodiments, the determination module is further configured to run the marking function according to the cache keyword; and generate the business data corresponding to the cache tag through the marking function.

[0042] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0043] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0044] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0045] The above-mentioned data caching method, device, computer equipment and storage medium generate cache keywords based on the function type, function identifier and function parameters of the marking function; when the cache keyword does not have corresponding business data, obtain the marking parameter in the function parameter and the business object identifier corresponding to the marking parameter; assemble the business object identifier and the marking parameter into a cache tag; determine the business data based on the cache keyword and the cache tag; store the cache keyword, cache tag and business data in the corresponding cache area. It realizes the timely generation of corresponding cache data according to the marking function and the marking parameter, and stores the cache data in the corresponding cache area, solving the problem of inconsistency between business data and cache data. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 An application environment diagram of a data caching method in an embodiment;

[0047] Figure 2 A schematic diagram of a flow chart of a data caching method in an embodiment;

[0048] Figure 3 A flowchart of a data cleaning step in one embodiment;

[0049] Figure 4 is a flow chart of a data caching method in yet another embodiment;

[0050] Figure 5 A schematic diagram of a flow chart of a step of marking functions and parameters in one embodiment;

[0051] Figure 6 is a structural block diagram of a data cache device in one embodiment;

[0052] Figure 7 is a structural block diagram of a data cache device in one embodiment;

[0053] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0055] The data caching method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. This application can be executed by the terminal 102 or the server 104, or the terminal 102 and the server 104 can be executed in collaboration. This embodiment is described by taking the server 104 as an example.

[0056] The server 104 generates a cache keyword based on the function type, function identifier and function parameters of the marking function; when there is no corresponding business data for the cache keyword, the server 104 obtains the server 104 marking parameter in the function parameter and the business object identifier corresponding to the marking parameter; the server 104 assembles the business object identifier and the marking parameter into a cache tag; the server 104 determines the business data based on the cache keyword and the cache tag; the server 104 stores the cache keyword, the cache tag and the business data in a corresponding cache area.

[0057] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0058] In one embodiment, Figure 2 As shown, a data caching method is provided, which can be executed by the terminal 102 or the server 104, or the terminal 102 and the server 104 can be executed in collaboration. The method is described by taking the server 104 as an example, and includes the following steps:

[0059] S202: Generate a cache keyword based on the function type, function identifier and function parameters of the marked function.

[0060] Among them, the marked function can refer to a marked function, for example, the marked function can be a "GetCurrencyInfoById" function marked with the "UseCache" attribute. The function type can refer to the class name of the function, for example, the function type can be an inner class, etc. The function identifier can refer to the name of the function, for example, the function identifier can be "GetCurrencyCount". The function parameter can refer to the parameter contained in the function, for example, the function parameter can be "(ctx string, currencyld)". The cache keyword can refer to the function used to query the corresponding business data, and the cache keyword includes the marked function, function identifier and function parameter.

[0061] In one embodiment, before S202, the server marks a preset function to obtain a marked function; obtains a business object based on a business object identifier; and marks function parameters corresponding to the business object to obtain marked parameters.

[0062] Among them, the preset function may refer to a function that is preset to be marked, for example, the preset function may be the "GetCurrencyInfoById" function. The business object identifier may refer to the identifier of the business object. The business object may refer to parameters that change less frequently, such as basic data. For example, when the business object is a currency, the business object identifier may be "BD_Currency". The marked parameter may refer to a parameter marked in the marking function, for example, the marked parameter may be a parameter marked with the [BaseDataInfo("BD_Currency")] attribute in the marking function "GetCurrencyInfoById".

[0063] In one embodiment, after S202, when the character length of the cache keyword exceeds a preset length, the server encrypts the cache keyword to obtain a target cache keyword;

[0064] Among them, the character length may refer to the number of characters of the cache keyword. The preset length may refer to the character length of the cache keyword set in advance, which can be used to determine whether the cache keyword needs to be encrypted. The target cache keyword may refer to the encrypted cache keyword. The encryption algorithm may be an MD5 message digest algorithm (MD5Message-Digest Algorithm), a data encryption standard (Data Encryption Standard, DES) algorithm, a triple data encryption (Triple DES, 3DES) algorithm, an advanced encryption standard (Advanced Encryption Standard, AES) algorithm, an international data encryption algorithm (International Data Encryption Algorithm, IDEA), BLOWFISH and other encryption algorithms.

[0065] For example, the character length of the cache keyword is 30 and the preset length is 25. The server determines that the character length of the cache keyword exceeds the preset length, and encrypts the cache keyword through the MD5 Message-Digest Algorithm to obtain the encrypted cache keyword, that is, the target cache keyword.

[0066] Specifically, the server may concatenate the function type, function identifier, and function parameters of the marking function in a preset order to obtain a cache keyword.

[0067] For example, the function type of the marking function is BaseClass, the function identifier is GetCurrencyInfoById, and the function parameters are "string value of ctx, currencyId". These three are concatenated in the preset order of function type, function identifier and function parameters to obtain the corresponding cache keyword.

[0068] S204: When there is no corresponding business data for the cached keyword, obtain a tag parameter in the function parameter and a business object identifier corresponding to the tag parameter.

[0069] Among them, business data can refer to data used for caching or user requests. For example, when a user requests to query the currency types available in the enterprise management system, the corresponding business data is the currency types in the enterprise management system.

[0070] In one embodiment, the server may query the corresponding cache area to see whether there is business data corresponding to the cache.

[0071] Specifically, when the cache keyword does not have corresponding business data, the marking parameter in the function parameter and the business object identifier corresponding to the marking parameter are obtained.

[0072] In one embodiment, the step of obtaining the tag parameter in the function parameter and the business object identifier corresponding to the tag parameter includes the server determining in turn whether the function parameter is a tag parameter, and when the function parameter is a tag parameter, querying the corresponding business object identifier inside the server based on the correspondence between the tag parameter and the business object identifier, until the tag parameter in all function parameters and the business object identifier corresponding to the tag parameter are obtained.

[0073] For example, when the cache keyword does not have corresponding business data, the marking parameter in the acquisition function parameter is the "currency code" parameter marked with the [BaseDataInfo("BD_Currency")] attribute, and the business object identifier corresponding to the marking parameter is "DB_Currency".

[0074] In one embodiment, when a business object is modified or deleted, the server clears the business data corresponding to the cache tag. It should be noted that the cache tag and the business data may be in a many-to-one relationship.

[0075] In one embodiment, when a business object is modified or deleted, the server may concatenate the business object identifier corresponding to the business object and the tag parameter corresponding to the business object identifier to obtain a corresponding cache tag, and clean up the business data associated with the cache tag. It should be noted that the business object identifier may correspond to one or more tag parameters, that is, when a business object is modified or deleted, one or more cache tags may be obtained.

[0076] For example, the business object is "currency". When "currency" is deleted, the server queries the corresponding cache keyword based on "currency", and determines the corresponding business data as the corresponding business data currency code "001" and currency ID "100" based on the cache keyword for cleaning.

[0077] In one embodiment, Figure 3 The figure is a flow chart of the data cleaning step in an embodiment; as shown in the figure, when a business object is modified or deleted, the cache dependencies are sorted out: the cache dependency subject (business object identifier) ​​and the cache dependency item (tag parameter), the cache dependency subject and the cache dependency item are concatenated to obtain a cache tag, and the corresponding cache (business data) is cleaned according to the cache tag.

[0078] For example, the business object is currency, the business object identifier is DB_Currency, and the tag parameters are the business object ID "100" and the currency code "001". When the business object is modified or deleted, the cache tags generated based on the business object identifier and tag parameters can be "DB_Currency", "BD_Currency_100", "DB_Currency_001", and the corresponding business data is cleaned up with the cache tags "DB_Currency", "BD_Currency_100", "DB_Currency_001".

[0079] In one embodiment, when there is corresponding business data for a cached keyword, the server sends the business data to the front end so that the front end displays the business data on a business data display page.

[0080] The business data display page may refer to a page used to display business data.

[0081] S206: Assemble the business object identifier and the tag parameter into a cache tag.

[0082] The cache tag may be a tag used to identify business data, and the cache tag includes a business object identifier and a tag parameter. For example, when the business object is "currency", the corresponding business object identifier may be "DB_Currency", the tag parameter may be the business object ID "100" and the currency code "001", and the cache tags may be "BD_Currency_100" and "DB_Currency_001" respectively.

[0083] Specifically, the server may concatenate the business object identifier and the tag parameter in the order of business object identifier first and tag object second or tag object first and business object identifier second to obtain the cache tag. The server may also concatenate the business object identifier and the tag parameter in a preset order to obtain the cache tag.

[0084] S208, determining business data based on the cache keyword and the cache tag.

[0085] In one embodiment, S208 includes the server determining the business data based on the target cache keyword and the cache tag.

[0086] The target cache keyword is an encrypted cache keyword.

[0087] Specifically, the server runs a marking function based on the cache keyword; and generates business data corresponding to the cache tag through the marking function.

[0088] In one embodiment, the server runs the corresponding marking function according to the function type, function identifier and function parameters in the cache keyword. When the marking function is finished, the function running result is obtained through the marking function. The function running result can be the business data corresponding to the cache tag.

[0089] For example, the server runs the corresponding tag function "GetCurrencyInfoById" according to the cache keyword. When the tag function is finished running, the function running result "3" is obtained, that is, the business data corresponding to the cache tag is "3".

[0090] S210, storing cache keywords, cache tags and business data in corresponding cache areas.

[0091] The cache area may refer to an area for storing cache keywords, cache tags, and business data. The cache area may be a storage area inside the server or a corresponding database.

[0092] In one embodiment, S210 includes the server combining the target cache keyword, the cache tag, and the business data and storing them in a corresponding cache area.

[0093] For example, Figure 4 This is a flow chart of a data caching method in another embodiment; as shown in the figure, a user or an interface can request business data, and the server obtains the corresponding business logic (code). Before the business logic is executed, the cache aspect logic splices the corresponding cache key (keyword) and queries the cache device for the existence of the cache (business data) based on the cache keyword. When the cache exists, the cache consistent with the request is returned to the user or interface; when the cache does not exist, the business logic is executed. After the business logic is executed, the execution result of the business logic is returned to the user or interface, and the key, cache dependency, cache dependency subject and the execution result of the business logic are spliced ​​and stored in the corresponding cache area.

[0094] In the above data caching method, a cache keyword is generated based on the function type, function identifier and function parameters of the marking function; when there is no corresponding business data for the cache keyword, the marking parameter in the function parameter and the business object identifier corresponding to the marking parameter are obtained; the business object identifier and the marking parameter are assembled into a cache tag; the business data is determined based on the cache keyword and the cache tag; the cache keyword, the cache tag and the business data are stored in the corresponding cache area, so that the corresponding cache data is generated in time according to the marking function and the marking parameter, and the cache data is stored in the corresponding cache area. At the same time, when the business object is modified or deleted, the business data corresponding to the cache tag is cleaned up, so that the cache data is cleaned up in time, and the problem of inconsistency between the business data and the cache data is solved.

[0095] In one embodiment, Figure 5 As shown, the steps of marking functions and parameters include:

[0096] S502: Mark the preset function to obtain a marked function.

[0097] The preset function may refer to a function that is preset to be marked, for example, the preset function may be a "GetCurrencyInfoById" function. It should be noted that the marking of functions may adopt the aspect-oriented programming (AOP) technology, which may isolate or intercept various parts of the existing business logic and insert cache aspect logic into the business logic according to the characteristics. Attributes include characteristics used to mark functions or mark parameters.

[0098] Specifically, the server may obtain the preset function characteristics, mark the preset function according to the preset function characteristics, and obtain the marked function.

[0099] The preset function characteristic may be a characteristic of a preset marking function.

[0100] For example, the preset function attribute is "UseCacheAttribute", and the preset function is "GetCurrencyInfoById". The server marks the "GetCurrencyInfoById" preset function according to "UseCache Attribute" to obtain the marked "GetCurrencyInfoById" function, that is, the marked function.

[0101] S504: Acquire the business object based on the business object identifier.

[0102] The business object identifier may refer to an identifier of a business object. A business object may refer to a parameter that changes less frequently, such as basic data. For example, when the business object is a currency, the business object identifier may be "BD_Currency".

[0103] Specifically, the server first obtains a business object identifier, and searches for a corresponding business object according to the business object identifier, wherein the business object identifier and the business object may be in a one-to-one correspondence.

[0104] S506, marking the function parameters corresponding to the business object to obtain marked parameters.

[0105] The marked parameter may refer to a marked parameter in a marked function, for example, the marked parameter may refer to a parameter marked with the [BaseDataInfo("BD_Currency")] property in the "GetCurrencyInfoById" function.

[0106] Specifically, the server determines the function parameters related to the business object in the marking function in turn, and marks all the function parameters related to the business object to obtain the marking parameters.

[0107] In one embodiment, the step of marking the function parameters related to the business object includes obtaining preset parameter characteristics, marking the function parameters related to the business object according to the preset parameter characteristics, and obtaining marked parameters.

[0108] The preset parameter characteristics may be characteristics of pre-set marking parameters.

[0109] For example, when the business object identifier is "BD_Currency" and the business object is "currency", the function parameters related to the business object in the marking function "GetCurrencyInfoById" are the currency code "001" and the currency ID "100", and the currency code "001" and currency ID "100" are marked with the preset parameter attributes of "BaseDataInfoAttribute", and the currency code "001" and currency ID "100" marked with the [BaseDataInfo("BD_Currency")] attribute are obtained.

[0110] In this embodiment, a marked function is obtained by marking a preset function. A business object is obtained based on a business object identifier. Function parameters corresponding to the business object are marked to obtain marked parameters. When a user or an interface requests business data, corresponding cache data can be generated in time according to the marked function and the marked parameters, and the cache data can be stored in a corresponding cache area, thereby solving the problem of inconsistency between business data and cache data.

[0111] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0112] Based on the same inventive concept, the embodiment of the present application also provides a data caching device for implementing the data caching method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more data caching device embodiments provided below can refer to the limitations on the data caching method above, and will not be repeated here.

[0113] In one embodiment, Figure 6 As shown, a data cache device is provided, including: a generation module 602, an acquisition module 604, an assembly module 606, a determination module 608 and a storage module 610, wherein:

[0114] A generating module 602, configured to generate a cache keyword based on a function type, a function identifier and function parameters of a marked function;

[0115] An acquisition module 604 is used to acquire a tag parameter in the function parameter and a business object identifier corresponding to the tag parameter when there is no corresponding business data for the cached keyword;

[0116] An assembling module 606, used to assemble the business object identifier and the tag parameter into a cache tag;

[0117] A determination module 608, configured to determine service data based on cache keywords and cache tags;

[0118] The storage module 610 is used to store cache keywords, cache tags and business data in corresponding cache areas.

[0119] In one embodiment, the generating module 602 is further configured to encrypt the cache keyword to obtain a target cache keyword when the character length of the cache keyword exceeds a preset length;

[0120] The determination module 608 is further used to determine the business data based on the target cache keyword and the cache tag; the storage module 610 is further used to store the target cache keyword, the cache tag and the business data in the corresponding cache area.

[0121] In one embodiment, the determination module 608 is further configured to run a marking function according to the cache keyword; and generate business data corresponding to the cache tag through the marking function.

[0122] In one embodiment, Figure 7 As shown, the device also includes: a marking module 612, a display module 614, and a cleaning module 616, wherein:

[0123] The marking module 612 is used to mark the preset function to obtain the marked function; obtain the business object based on the business object identifier; and mark the function parameters corresponding to the business object to obtain the marked parameters.

[0124] The cleaning module 616 is used to clean up the business data corresponding to the cache tag when the business object is modified or deleted.

[0125] The display module 614 is used to send the business data to the front end when there is corresponding business data for the cached keyword.

[0126] In the above embodiment, a cache keyword is generated based on the function type, function identifier and function parameter of the marking function; when the cache keyword does not have corresponding business data, the marking parameter in the function parameter and the business object identifier corresponding to the marking parameter are obtained; the business object identifier and the marking parameter are assembled into a cache tag; the business data is determined based on the cache keyword and the cache tag; the cache keyword, the cache tag and the business data are stored in the corresponding cache area. The corresponding cache data is generated in time according to the marking function and the marking parameter, and the cache data is stored in the corresponding cache area. At the same time, when the business object is modified or deleted, the business data corresponding to the cache tag is cleaned up, which realizes the timely cleaning of the cache data and solves the problem of inconsistency between the business data and the cache data.

[0127] Each module in the above data cache device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0128] In one embodiment, a computer device is provided. The computer device may be a server or a terminal. This embodiment is described by taking a server as an example. The internal structure diagram thereof may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data cache data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data caching method is implemented.

[0129] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0130] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and the above embodiments are implemented when the processor executes the computer program.

[0131] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above embodiments are implemented.

[0132] In one embodiment, a computer program product is provided, including a computer program, and the computer program implements the above embodiments when executed by a processor.

[0133] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0134] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0135] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0136] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A data caching method, characterized in that: The method comprises: Generate cache keywords based on the function type, function identifier and function parameters of the marked function; the marked function refers to the marked function; the function type refers to the class name of the function; the function identifier refers to the name of the function; the cache keywords include the marked function, the function identifier and the function parameters; When the cache keyword does not have corresponding business data, obtaining the tag parameter in the function parameter and the business object identifier corresponding to the tag parameter; Assembling the business object identifier and the tag parameter into a cache tag; Running the marking function according to the cache keyword; generating the business data corresponding to the cache tag through the marking function; The cache keyword, the cache tag and the business data are stored in a corresponding cache area.

2. The method according to claim 1, characterized in that: Before generating cache keywords based on the function type, function identifier and function parameters of the marking function, the method further includes: Marking a preset function to obtain the marked function; Acquire a business object based on the business object identifier; The function parameters corresponding to the business object are marked to obtain marked parameters.

3. The method according to claim 2, characterized in that The method further comprises: When the business object is modified or deleted, the business data corresponding to the cache tag is cleared.

4. The method according to claim 1, characterized in that After generating the cache keyword based on the function type, function identifier and function parameters of the marking function, the method further includes: When the character length of the cache keyword exceeds a preset length, the cache keyword is encrypted to obtain a target cache keyword; The step of running the marking function according to the cache keyword includes: Running the marking function according to the target cache keyword; The storing the cache keyword, the cache tag, and the service data in the corresponding cache area includes: The target cache keyword, the cache tag and the business data are stored in a corresponding cache area.

5. The method according to claim 1, characterized in that The method further comprises: When the cache keyword has corresponding business data, the business data is sent to the front end.

6. A data cache device, characterized in that: The device comprises: A generation module, used to generate cache keywords based on a function type, a function identifier and a function parameter of a marked function; the marked function refers to a marked function; the function type refers to a class name where the function is located; the function identifier refers to a name of the function; the cache keywords include the marked function, the function identifier and the function parameter; An acquisition module, used for acquiring a tag parameter in the function parameter and a business object identifier corresponding to the tag parameter when the cache keyword does not have corresponding business data; An assembling module, used for assembling the business object identifier and the marking parameter into a cache tag; A determination module, configured to run the marking function according to the cache keyword; and generate the business data corresponding to the cache tag through the marking function; The storage module is used to store the cache keyword, the cache tag and the business data in a corresponding cache area.

7. The device according to claim 6, characterized in that The device also includes a marking module, which is used to: Marking a preset function to obtain the marked function; Acquire a business object based on the business object identifier; The function parameters corresponding to the business object are marked to obtain marked parameters.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.