Data loading method and device, computer equipment and storage medium

By setting cache annotations for the data interface and selecting cache locations based on preset priorities, the problems of insufficient concurrency processing capabilities and low scalability of high concurrency systems are solved, and the data loading success rate and response speed are improved.

CN119172442APending Publication Date: 2024-12-20CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310736574.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-20
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The existing high-concurrency systems have limited concurrency processing capabilities and are not very scalable, and cannot effectively respond to requests from a large number of users, resulting in a reduced response speed.

Method used

By setting cache annotations for the data interface, determining the target cache annotations based on the preset cache priority, selecting a cache location with higher priority for data loading, improving the success rate and efficiency of data loading.

Benefits of technology

It realizes flexible selection of cache locations, improves data loading success rate and efficiency, and enhances the scalability and response speed of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172442A_ABST
    Figure CN119172442A_ABST
Patent Text Reader

Abstract

The invention provides a data loading method and device, computer equipment and a storage medium. The method comprises the steps that after a data query request initiated by an initiating end is detected, at least one cache annotation of a data interface corresponding to the data query request is acquired; wherein the data query request represents a data query request; the cache annotation is used for indicating a cache position of data corresponding to the data interface; based on a preset cache priority of each cache annotation, determining a target cache annotation from each cache annotation, and determining cache configuration information contained in the target cache annotation; the cache configuration information is used for indicating a cache mode of data at a cache position indicated by the cache annotation; acquiring data based on a cache mode indicated by cache configuration information contained in the cache annotation of the target; and the acquired data are sent to the initiating end. According to the method, data loading is carried out based on the priorities of the multiple cache annotations, and the flexibility and efficiency of data loading are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the development of computer technology, the number of users and data is increasing, which leads to the problem that more users may access the same resource at the same time. At this time, the application needs to have strong high-concurrency processing capabilities to cope with the requests of a large number of users.

[0003] At present, an effective and feasible way to improve the high concurrency capability of an application is to set up a corresponding cache for the application, use cache technology to share the pressure of the database, improve the response speed of the application, and thus improve the user experience.

[0004] In the related art, a single cache is usually used to improve the high-concurrency processing capability of an application. This setting method is relatively simple, resulting in limited processing capabilities of the high-concurrency system (that is, applications with high-concurrency processing capabilities) and low scalability. Summary of the invention

[0005] The present application provides a data loading method, apparatus, computer equipment and storage medium to solve the problem of limited concurrent processing capability and low scalability of high-concurrency systems.

[0006] In a first aspect, the present application provides a data loading method, comprising:

[0007] After detecting a data query request initiated by the initiator, obtaining at least one cache annotation of a data interface corresponding to the data query request; wherein the data query request represents a request for querying data; and the cache annotation is used to indicate a cache location of data corresponding to the data interface;

[0008] Based on the preset cache priority of each of the cache annotations, determine the cache annotation of the target from each of the cache annotations, and determine the cache configuration information contained in the cache annotation of the target; the cache configuration information is used to indicate the cache mode of the data at the cache location indicated by the cache annotation;

[0009] Based on the cache mode indicated by the cache configuration information contained in the cache annotation of the target, data is obtained; and the obtained data is sent to the initiator.

[0010] In one example, the cache configuration information includes cache key name information and first processing information, the cache key name information is determined based on input parameters of the data interface, and the first processing information indicates a reading method for reading data at a cache location;

[0011] Based on the cache mode indicated by the cache configuration information contained in the cache annotation of the target, obtaining data includes:

[0012] Based on the first processing information in the cache configuration information included in the cache annotation of the target, data matching the cache key name information in the cache configuration information included in the cache annotation of the target is read from the cache location indicated by the cache annotation of the target.

[0013] In one example, the method further includes:

[0014] If no data matching the cache key name information in the cache configuration information contained in the cache annotation of the target is read from the cache location indicated by the cache annotation of the target, the cache annotation of the target is redetermined from the remaining cache annotations, and data is obtained based on the cache mode indicated by the cache configuration information contained in the redetermined cache annotation of the target; the remaining cache annotations of the target are the cache annotations other than the cache annotation of the target in the at least one cache annotation.

[0015] In one example, the cache configuration information also includes deserialization operation information and data determination information; the deserialization operation information is used to perform a deserialization operation on the data at the cache location; the data determination information is used to determine whether the read data matching the cache key name information meets the return requirements; the method also includes:

[0016] Based on the data determination information, the read data matching the cache key name information is determined;

[0017] When it is determined that the read data matching the cache key name information meets the return requirement, a deserialization operation is performed on the matching data based on the deserialization operation information, and the deserialized data is sent to the initiator.

[0018] In one example, the method further includes:

[0019] In the case that data is not obtained based on the cache mode indicated by the cache configuration information contained in the cache annotation of the target, executing the data acquisition method corresponding to the data interface to acquire data, and sending the acquired data to the initiator;

[0020] Alternatively, when no data is obtained based on the cache mode indicated by the cache configuration information contained in the cache annotation of the target, data matching the data query request is obtained from the database, and the obtained data is sent to the initiator.

[0021] In one example, the cache configuration information further includes serialization operation information and second processing information; the serialization operation information is used to perform a serialization operation on data that is not in a cache location; the second processing information indicates a writing method for writing data to the cache location; and the method further includes:

[0022] After executing the data acquisition method corresponding to the data interface to acquire data, or after acquiring data matching the data query request from the database, performing a serialization operation on the data based on the serialization operation information to obtain data that meets the writing requirements;

[0023] Based on the second processing information in the cache configuration information included in each of the cache annotations, the data that meets the write requirement is written into the cache locations indicated by each of the cache annotations.

[0024] In one example, the cache configuration information further includes preset data update information and third processing information; the preset data update information indicates an update frequency of data at the cache location; the third processing information indicates an update method for updating data at the cache location; and the method further includes:

[0025] Based on the preset data update information and the third processing information contained in each cache annotation, the data at the cache location indicated by each cache annotation is updated to obtain updated data.

[0026] In a second aspect, the present application provides a data loading device, comprising:

[0027] A detection unit, configured to, after detecting a data query request initiated by an initiator, obtain at least one cache annotation of a data interface corresponding to the data query request; wherein the data query request represents a request for querying data; and the cache annotation is used to indicate a cache location of data corresponding to the data interface;

[0028] A determination unit, configured to determine a cache annotation of a target from each of the cache annotations based on a preset cache priority of each of the cache annotations, and to determine cache configuration information included in the cache annotation of the target; the cache configuration information is used to indicate a cache mode for data at a cache location indicated by the cache annotation;

[0029] An acquisition unit, configured to acquire data based on a cache mode indicated by cache configuration information included in a cache annotation of the target;

[0030] The sending unit is used to send the acquired data to the initiating end.

[0031] In one example, the cache configuration information includes cache key name information and first processing information, the cache key name information is determined based on an input parameter of a data interface, and the first processing information indicates a reading method for reading data at a cache location; the acquisition unit includes:

[0032] The first data acquisition module is used to read data matching the cache key name information in the cache configuration information contained in the cache annotation of the target from the cache location indicated by the cache annotation of the target based on the first processing information in the cache configuration information contained in the cache annotation of the target.

[0033] In one example, the acquisition unit further includes:

[0034] A second data acquisition module is used to redefine the cache annotation of the target from the remaining cache annotations when no data matching the cache key name information in the cache configuration information contained in the cache annotation of the target is read from the cache position indicated by the cache annotation of the target, and acquire data based on the cache method indicated by the cache configuration information contained in the redetermined cache annotation of the target; the remaining cache annotations of the target are the cache annotations other than the cache annotation of the target in the at least one cache annotation.

[0035] In one example, the cache configuration information also includes deserialization operation information and data determination information; the deserialization operation information is used to perform a deserialization operation on the data at the cache location; the data determination information is used to determine whether the read data matching the cache key name information meets the return requirements; the sending unit is also used to:

[0036] Based on the data determination information, the read data matching the cache key name information is determined;

[0037] When it is determined that the read data matching the cache key name information meets the return requirement, a deserialization operation is performed on the matching data based on the deserialization operation information, and the deserialized data is sent to the initiator.

[0038] In one example, the device further includes:

[0039] A third data acquisition module is used to execute a data acquisition method corresponding to the data interface to acquire data when no data is acquired based on the cache mode indicated by the cache configuration information contained in the cache annotation of the target, and send the acquired data to the initiator;

[0040] Alternatively, when no data is obtained based on the cache mode indicated by the cache configuration information contained in the cache annotation of the target, data matching the data query request is obtained from the database, and the obtained data is sent to the initiator.

[0041] In one example, the cache configuration information further includes serialization operation information and second processing information; the serialization operation information is used to perform a serialization operation on data that is not in a cache location; the second processing information indicates a writing method for writing data to the cache location; the device further includes:

[0042] A data storage module, configured to, after acquiring data by executing a data acquisition method corresponding to the data interface, or after acquiring data matching the data query request from a database, perform a serialization operation on the data based on the serialization operation information to obtain data that meets the writing requirements;

[0043] Based on the second processing information in the cache configuration information included in each of the cache annotations, the data that meets the write requirement is written into the cache locations indicated by each of the cache annotations.

[0044] In one example, the cache configuration information further includes preset data update information and third processing information; the preset data update information indicates an update frequency of data at the cache location; the third processing information indicates an update method of updating data at the cache location; the device further includes:

[0045] A data updating module is used to update the data at the cache location indicated by each cache annotation based on the preset data updating information and the third processing information contained in each cache annotation to obtain updated data.

[0046] In a third aspect, the present application provides a computer device, comprising: a processor, and a memory communicatively connected to the processor;

[0047] The memory stores computer-executable instructions;

[0048] The processor executes the computer-executable instructions stored in the memory to implement the method described in the first aspect.

[0049] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.

[0050] In a fifth aspect, the present application provides a computer program product, comprising: computer execution instructions, the computer execution instructions are stored in a readable storage medium, at least one processor of a computer device can read the computer execution instructions from the readable storage medium, and the at least one processor executes the computer execution instructions, so that the computer device executes the method described in the first aspect.

[0051] The data loading method, device, computer equipment and storage medium provided by the embodiment of the present application can select the cache position of the loaded data simply and flexibly by setting at least one corresponding cache annotation for the data interface in advance. At the same time, the cache position corresponding to the data under different data interfaces can be adaptively adjusted by adding cache annotations to the data interface, which has stronger scalability and higher degree of freedom. After setting the cache annotation, the data query request initiated by the initiator can be detected, and after detecting the data query request, at least one cache annotation of the data interface corresponding to the data query request is obtained, and then, based on the preset cache priority of each cache annotation, the cache annotation of the target is determined from each cache annotation. At this time, the cache annotation of the target is the cache annotation with the highest priority among the cache annotations, so that the cache position with a higher priority can be selected from multiple cache positions for data loading, which improves the probability of successful data loading and saves the time of data loading. After that, the cache configuration information contained in the cache annotation of the target can be determined to obtain data from the cache position based on the cache mode indicated by the cache configuration information, and the obtained data is sent to the initiator, which improves the efficiency of data loading. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0053] Figure 1 A schematic diagram of a flow chart of an application scenario provided in an embodiment of the present application;

[0054] Figure 2 A flowchart of a data loading method provided in an embodiment of the present application;

[0055] Figure 3 A flowchart of another data loading method provided in an embodiment of the present application;

[0056] Figure 4 A flowchart of another application scenario provided by an embodiment of the present application;

[0057] Figure 5A flow chart of obtaining data from a cache location based on cache key information in cache configuration information contained in a target cache annotation provided by an embodiment of the present application;

[0058] Figure 6 A schematic diagram of the structure of a data loading device provided in an embodiment of the present application;

[0059] Figure 7 A schematic diagram of the structure of another data loading device provided in an embodiment of the present application;

[0060] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present application;

[0061] Fig. 9 The present invention is a block diagram of a computer device according to an exemplary embodiment.

[0062] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0063] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0064] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 As shown, the scenario includes an initiator 101, a server 102, and a responder 103. A user can initiate a data query request to the server 102 through the initiator 101. After receiving the data query request, the server 102 can obtain data from the cache, and after obtaining the data, send the obtained data to the initiator 101 through the responder 103.

[0065] In one example, the server 102 can obtain data corresponding to the data query request by accessing the database, and send the obtained data to the initiator 101 through the responder 103. When the number of users is large, a single-point database cannot meet the high-concurrency access requirements. At the same time, it will also cause great pressure on the database, affecting the data processing efficiency of the database.

[0066] In another example, the server 102 can obtain data corresponding to the data query request by accessing the local cache, and send the obtained data to the initiator 101 through the responder 103. However, as the number of users and the amount of data gradually increase, a single local cache cannot meet the high concurrent access requirements.

[0067] In another example, the server 102 may first access the local cache, and if the local cache does not find data corresponding to the data query request, then access the distributed Redis cache to obtain the data corresponding to the data query request. This method can jointly use the local cache and the distributed Redis cache to meet high-concurrency access requirements.

[0068] However, this combination method mainly sets the local cache and the distributed Redis cache to a fixed combination mode, that is, only the local cache can be accessed first, and if the local cache cannot meet the response requirements, the distributed Redis cache will be accessed. It lacks flexibility and scalability.

[0069] The data loading method provided in this application is intended to solve the above technical problems in the prior art.

[0070] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0071] Figure 2 A flow chart of a data loading method provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the method includes:

[0072] S201. After detecting a data query request initiated by an initiator, obtain at least one cache annotation of a data interface corresponding to the data query request.

[0073] The data query request represents a request for querying data; the cache annotation is used to indicate the cache location of the data corresponding to the data interface.

[0074] Here, the initiator may indicate a user end of any device, for example, the device may be a mobile device, such as a mobile phone device, a tablet device, a notebook device, or other wearable smart devices (such as a smart watch), etc. Alternatively, the device may also be a terminal device, such as a computer terminal device.

[0075] In an embodiment of the present application, a data query request can be initiated by triggering a data query function on the user side, wherein the methods of triggering the data query function on the user side include but are not limited to the following methods: clicking a component button corresponding to the triggering data query function, giving a data query instruction by voice to trigger the data query function, shaking the device to trigger the data query function (or other operations set to trigger the data query function), etc.

[0076] After the initiator initiates a data query request, it can first determine the data interface corresponding to the data query request, and then obtain at least one cache annotation corresponding to the data interface. The number of cache annotations corresponding to the data interface can be N, where the value of N is a natural number greater than or equal to 1, for example, the value of N can be 1, 2, 3, etc.

[0077] Among them, the cache annotation can be used to indicate the cache location of the data corresponding to the data interface. For example, the cache location can be a local Caffeine cache, a local EhCache cache, a distributed cache Redis cache, or a distributed Memcached cache, etc.).

[0078] S202: Based on the preset cache priorities of the cache annotations, determine the cache annotation of the target from the cache annotations, and determine the cache configuration information included in the cache annotation of the target.

[0079] The cache configuration information is used to indicate the cache method of the data at the cache location indicated by the cache annotation.

[0080] Here, the preset cache priority indicates the order of the cache position indicated by the cache annotation when caching data. For example, when the cache position is the first cached data, the priority of the cache position is 1, and the preset cache priority corresponding to the cache annotation indicating the cache position is also 1. It can be seen that the smaller the value corresponding to the preset cache priority, the higher the priority corresponding to the cache annotation.

[0081] In one example, different cache locations may correspond to different priorities. Then, when at least one cache annotation corresponds to multiple cache locations, the preset cache priorities of the cache annotations are different.

[0082] At this time, when the cache annotation of the target is determined from at least one cache annotation, the cache annotation with the smallest value of the preset cache priority may be determined as the cache annotation of the target.

[0083] In another example, different cache locations may also correspond to the same priority. For example, assuming that the distributed Redis cache and the distributed Memcached cache both represent the cache location of the second cached data, then the priority of the cache location of the second cached data is 2. At this time, the preset cache priority of the cache annotation indicating the distributed Redis cache and the cache annotation indicating the distributed Memcached cache are both 2.

[0084] At this time, when determining the target cache annotation from at least one cache annotation, the cache annotation with the smallest value of the preset cache priority can be determined first. When there are multiple cache annotations with the smallest value of the preset cache priority, the first annotated cache annotation can be determined as the target cache annotation according to the annotation order of the cache annotations.

[0085] In an embodiment of the present application, the cache annotation may include cache configuration information, wherein the cache mode indicated by the cache configuration information may include a storage mode, a reading mode, a refresh mode, a verification mode (here, the verification mode is used to verify whether the data at the storage location is valid data), etc. of the data at the cache location.

[0086] S203: Acquire data based on the cache mode indicated by the cache configuration information included in the target cache annotation; and send the acquired data to the initiator.

[0087] In one example, data may be acquired based on a data reading method in a cache method indicated by cache configuration information included in a cache annotation of a target, and the acquired data may be sent to an initiator.

[0088] The embodiment of the present application provides a data loading method, which can pre-set at least one corresponding cache annotation for the data interface, so that the cache location of the loaded data can be selected simply and flexibly. At the same time, the cache location corresponding to the data under different data interfaces can be adaptively adjusted by adding cache annotations to the data interface, which has stronger scalability and higher degree of freedom. After setting the cache annotation, the data query request initiated by the initiator can be detected, and after detecting the data query request, at least one cache annotation of the data interface corresponding to the data query request is obtained, and then, based on the preset cache priority of each cache annotation, the cache annotation of the target is determined from each cache annotation. At this time, the cache annotation of the target is the cache annotation with the highest priority among the cache annotations, so that the cache location with a higher priority can be selected from multiple cache locations for data loading, which improves the probability of successful data loading and saves the time of data loading. After that, the cache configuration information contained in the cache annotation of the target can be determined to obtain data from the cache location based on the cache mode indicated by the cache configuration information, and the obtained data is sent to the initiator, which improves the efficiency of data loading.

[0089] Figure 3 A flowchart of another data loading method provided in an embodiment of the present application is shown as follows: Figure 3 As shown, the method includes:

[0090] S301: After detecting a data query request initiated by an initiator, obtain at least one cache annotation of a data interface corresponding to the data query request.

[0091] The data query request represents a request for querying data; the cache annotation is used to indicate the cache location of the data corresponding to the data interface.

[0092] For example, this step can be referred to Figure 2 Step S201 is not described again here.

[0093] S302: Based on the preset cache priorities of the cache annotations, determine the cache annotation of the target from the cache annotations, and determine the cache configuration information included in the cache annotation of the target.

[0094] The cache configuration information is used to indicate the cache method of the data at the cache location indicated by the cache annotation.

[0095] For example, this step can be referred to Figure 2 Step S202 is not described again here.

[0096] S303. Based on the first processing information in the cache configuration information included in the target cache annotation, read data matching the cache key name information in the cache configuration information included in the target cache annotation from the cache location indicated by the target cache annotation.

[0097] The first processing information indicates a reading method for data at a cache location, and the cache key name information is determined based on input parameters of a data interface.

[0098] Exemplarily, the cache key name information can be understood as the unique identification information of the data at the cache location. For example, when the data at the cache location is key-value pair data (ie, key-value data), then the key name information can be understood as the key value information of the data at the cache location.

[0099] In an embodiment of the present application, the parameter at the default position in the input parameters of the data interface (for example, the first parameter in the data parameters of the data interface) can be determined as the cache key name information, and any parameter in the input parameters of the data interface can be manually set as the cache key name information. No specific limitation is made here, and the data at the cache position can be uniquely identified.

[0100] In this embodiment, data can be read by caching key name information to ensure that the read data corresponds to the data query request one-to-one, thereby ensuring the accuracy of the read data.

[0101] Exemplarily, the first processing information may include at least the following information: a starting position of reading, a traversal method of reading, a data comparison method, and the like.

[0102] In one example, based on the first processing information, starting from the starting position of the read, the data at the cache location can be traversed according to the read traversal method, and the data at the cache location and the cache key name information can be compared according to the data comparison method. After the comparison, it is determined whether data matching the cache key name information is read at the cache location.

[0103] At this time, based on the first processing information in the cache configuration information contained in the target cache annotation, if data matching the cache key name information in the cache configuration information contained in the target cache annotation is read from the cache location indicated by the target cache annotation, the step described in S308 below can be directly executed. Otherwise, continue to execute the step described in S304 below.

[0104] S304. When no data matching the cache key name information in the cache configuration information contained in the target's cache annotation is read from the cache location indicated by the target's cache annotation, redetermine the target's cache annotation from the remaining cache annotations, and obtain data based on the cache mode indicated by the cache configuration information contained in the redetermined target's cache annotation.

[0105] The remaining cache annotations indicate cache annotations other than the cache annotations of each target in the at least one cache annotation.

[0106] Here, the process of acquiring data based on the cache mode indicated by the cache configuration information included in the cache annotation of the re-determined target is the same as the step described in the above S303, and will not be described in detail here.

[0107] Here, the process of redetermining the target cache annotation from the remaining cache annotations can be described as: based on the preset cache priority of each remaining cache annotation, determining the target cache annotation from each remaining cache annotation. Therefore, the process of redetermining the target cache annotation is the same as the step described in S202 above, and will not be repeated here.

[0108] Exemplarily, the process of re-determining the target cache annotation from the remaining cache annotations can also be understood as a process of traversing at least one cache annotation included in the data interface to obtain data.

[0109] For example, assuming that the data interface contains at least one cache annotation, which is 3, namely cache annotation 1, cache annotation 2 and cache annotation 3. assuming that the target cache annotation is cache annotation 1, at this time, if no data matching the cache key name information in the cache configuration information contained in cache annotation 1 is read based on cache annotation 1, the target cache annotation can be re-determined from the remaining cache annotations. At this time, the remaining cache annotations include: cache annotation 2 and cache annotation 3.

[0110] For example, if the cache annotation of the re-determined target is cache annotation 2, data can be obtained based on the cache configuration information of cache annotation 2. At this time, if data matching the cache key name information in the cache configuration information contained in cache annotation 2 is not read based on cache annotation 2, the cache annotation of the target can be re-determined from the remaining cache annotations. At this time, the remaining cache annotations include: cache annotation 3. At this time, data can be obtained based on the cache configuration information of cache annotation 3.

[0111] It should be noted here that, for the same data query request, the cache key name information in the cache configuration information of each cache annotation corresponds to the same data query request. Therefore, when the cache key name information in the cache configuration information of each cache annotation indicates key value information, the cache key name information in the cache configuration information of each cache annotation is the same.

[0112] In one example, the cache configuration information also includes deserialization operation information and data determination information. The deserialization operation information is used to perform a deserialization operation on the data at the cache location; the data determination information is used to determine whether the read data matching the cache key name information meets the return requirements.

[0113] Based on this, in one example, when acquiring data according to the steps described in S303 and S304 above, the following process may also be performed:

[0114] Based on the data judgment information, the read data that matches the cache key name information is judged. When it is judged that the read data that matches the cache key name information meets the return requirements, a deserialization operation is performed on the matching data based on the deserialization operation information, and the deserialized data is sent to the initiator.

[0115] In an embodiment of the present application, the return requirement may indicate whether the data read that matches the cache key name information is valid data. For example, the return requirement may indicate at least one of the following: whether the data is empty data, whether the data is garbled data, whether the data is invalid data (for example, invalid character error), etc.

[0116] In addition, adaptive return requirements may be manually set for different data interfaces. For example, the return requirements may further indicate whether the length of the data is the same as the length of the data that should be returned by the data interface.

[0117] In this embodiment, the read data can be preliminarily checked by using the data determination information, thereby avoiding errors in the data sent to the initiator, thereby ensuring the accuracy of the data returned to the initiator and improving the performance of the data loading method.

[0118] Since the data at the cache location and the data displayed by the initiator may correspond to different display styles, for example, the data at the cache location may be binary data, while the data at the initiator is decimal data, or the data at the cache location may be string data, while the data at the initiator is integer data, after reading the data that matches the cache key name information, the matching data can be deserialized through the deserialization operation information, and the deserialized data can be sent to the initiator. This implementation method can ensure the readability of the data returned to the initiator.

[0119] In one example, when data matching the cache key information in the cache configuration information included in the target cache annotation is read according to the step described in S304 above, the step described in S308 below can be directly executed. Otherwise, the step described in S305 below is continued to be executed.

[0120] 305. In the case where data is not obtained by the cache mode indicated by the cache configuration information contained in the target-based cache annotation, a data acquisition method corresponding to the data interface is executed to acquire data.

[0121] In one example, when the cache method indicated by the cache configuration information contained in the target-based cache annotation fails to obtain data, that is, none of the cache annotations of the data interface corresponding to the data query request stores data that matches the data query request. At this time, after determining the data interface corresponding to the data query request, the data acquisition method recorded in the data interface can be directly called to obtain the data.

[0122] Alternatively, execute the steps described in S306 below.

[0123] S306: When no data is obtained based on the cache mode indicated by the cache configuration information contained in the target-based cache annotation, data matching the data query request is obtained from the database.

[0124] In an example, when the cache method indicated by the cache configuration information contained in the target-based cache annotation fails to obtain data, that is, none of the cache annotations of the data interface corresponding to the data query request stores data that matches the data query request. At this time, the data corresponding to the data query request can be queried through a database statement, and the data can be obtained from the database.

[0125] In one example, the cache configuration information also includes serialization operation information and second processing information, wherein the serialization operation information is used to perform a serialization operation on data that is not in the cache location, and the second processing information indicates a writing method for writing data into the cache location.

[0126] In an embodiment of the present application, serialization operation information is used to perform a serialization operation on data that is not at a cache location so that the data that is not at a cache location meets the requirements for being stored at the cache location. For example, the serialization operation information can perform a serialization operation on the data that is not at the cache location and convert it into string data, so that the string data can be stored at the cache location.

[0127] When storing the string data in the cache location, the string data can be written to the cache location according to the writing method of writing data to the cache location indicated by the second processing information. At this time, the second processing information can indicate the writing position when the string data is written to the cache location.

[0128] Based on this, in the case where the acquired data is acquired according to the steps described in the above S305 and S306, the step described in the following S307 may be continued to be executed.

[0129] 307. Perform a serialization operation on the data based on the serialization operation information to obtain data that meets the write requirements; based on the second processing information in the cache configuration information included in each cache annotation, write the data that meets the write requirements into the cache locations indicated by each cache annotation.

[0130] Here, the write requirement may indicate the data type of the written data. For example, the write requirement may be: string data, dictionary data, integer data, etc. This embodiment does not specifically limit the write requirement, which is subject to achievable implementation.

[0131] In one example, the cache configuration information also includes preset data update information and third processing information; the preset data update information indicates the update frequency of the data at the cache location; the third processing information indicates the update method of the data at the cache location. Based on this, after executing the steps described in S301-S307 above, the step described in S308 below can be executed.

[0132] 308. Based on the preset data update information and the third processing information contained in each cache annotation, update the data at the cache location indicated by each cache annotation to obtain updated data.

[0133] In one example, the preset data update information may indicate the update frequency of the data at the cache location. At this time, the preset data update information may be understood as the data update period at the cache location. At this time, the preset data update information includes at least an update time value and an update time unit. For example, when the update time value is 5 and the update time unit is seconds, the preset data update time information indicates that the update frequency of the data at the cache location is: updated every 5 seconds.

[0134] In one example, the third processing information may indicate an update method for the data at the cache location, for example, the update method may be: fixed timeout update or smooth timeout update. The fixed timeout update may be understood as updating the data at the cache location after the existence time of the data at the cache location reaches the data update period indicated by the preset data update information, thereby obtaining updated data.

[0135] Exemplarily, when the preset data update information indicates that the update frequency of the data at the cache location is once every 5 seconds, and the third processing information indicates that the update method of the data at the cache location is a fixed timeout update, the data at the cache location can be updated every 5 seconds, and the data at the cache location that has been stored in the cache location for a duration greater than 5 seconds is deleted to obtain updated data.

[0136] Among them, smooth timeout update can be understood as the time when a certain data at a cache location is stored in the cache location, and when it is within the data update cycle indicated by the preset data update information, after a data query request for the certain data is detected, the time when the certain data is stored in the cache location is refreshed until there is no data query request location for the certain data within the new data update range, and the certain data will be updated to obtain the updated data.

[0137] Exemplarily, when the preset data update information indicates that the update frequency of the data at the cache location is once every 5 seconds, and the third processing information indicates that the update mode of the data at the cache location is smooth timeout update, if there is a certain data at the cache location, for example, data A, then the duration of the data A being stored at the cache location can be counted. Assuming that the duration of the data A being stored at the cache location is counted to be 3 seconds, and a data query request for the data A is detected, the duration of the data A being stored at the cache location is counted again from 0. When it is determined that the duration of the data A being stored at the cache location is greater than 5 seconds, and there is no data query request for the data A in the meantime, the data A at the cache location is deleted (that is, updated), and the updated data is obtained after deletion.

[0138] It should be noted here that after executing the steps described in the above S305-S307 and writing the acquired data to the cache location indicated by each cache annotation, the data written to the cache location corresponds to the preset data update information and the third processing information contained in each cache annotation. At this time, the data written to the cache location can be updated according to the preset data update information and the third processing information contained in each cache annotation.

[0139] Afterwards, the step described in S309 below is executed.

[0140] 309. Send the acquired data to the initiator.

[0141] The data loading method of the embodiment of the present application can pre-set at least one corresponding cache annotation for the data interface, so that the cache location of the loaded data can be selected simply and flexibly. At the same time, the cache location corresponding to the data under different data interfaces can be adaptively adjusted by adding cache annotations to the data interface, which has stronger scalability and higher degree of freedom. After setting the cache annotation, the data query request initiated by the initiator can be detected, and after detecting the data query request, at least one cache annotation of the data interface corresponding to the data query request is obtained, and then, based on the preset cache priority of each cache annotation, the cache annotation of the target is determined from each cache annotation. At this time, the cache annotation of the target is the cache annotation with the highest priority among the cache annotations, so that the cache location with a higher priority can be selected from multiple cache locations for data loading, which improves the probability of successful data loading and saves the time of data loading. After that, the cache configuration information contained in the cache annotation of the target can be determined to obtain data from the cache location based on the cache mode indicated by the cache configuration information, and the obtained data is sent to the initiator, which improves the efficiency of data loading.

[0142] Figure 4 This is a flow chart of another application scenario provided by the embodiment of the present application. Figure 4 As shown, the data loading method provided in the embodiment of the present application can first detect the data query request initiated by the initiator, and after detecting the data query request initiated by the initiator, perform the following steps.

[0143] S401: Obtain at least one cache annotation of a data interface configuration corresponding to a data query request.

[0144] S402: traverse each cache annotation according to a preset cache priority.

[0145] For example, each cache annotation may be sorted according to its preset cache priority, and then the traversal order of each cache annotation may be determined according to the sorting result of each cache annotation, and each cache annotation may be traversed in turn according to the traversal order. At this time, the cache annotation currently traversed is also the cache annotation of the above target.

[0146] S403: Obtain cache configuration information of the currently traversed cache annotation (ie, the target cache annotation).

[0147] The cache configuration information may include cache key name information determined based on input parameters of the data interface and first processing information indicating a reading method for reading data at the cache location.

[0148] S404: Acquire data based on the cache key name information and the first processing information.

[0149] Exemplarily, based on the first processing information in the cache configuration information included in the target's cache annotation, data matching the cache key name information in the cache configuration information included in the target's cache annotation can be read from the cache location indicated by the target's cache annotation.

[0150] S405: Determine whether data is obtained from the cache location.

[0151] For example, Figure 5 A schematic diagram of a process for obtaining data from a cache location based on cache key information in cache configuration information contained in a target cache annotation provided by an embodiment of the present application. Figure 5 As shown, the specific steps include the following steps.

[0152] S501: Obtain first processing information in cache configuration information of a target cache annotation.

[0153] S502: Determine a cache management instance corresponding to the cache annotation of the target based on the first processing information.

[0154] For example, Figure 5 As shown, when the cache location indicated by the target's cache annotation is a distributed Redis cache, the cache management instance determined based on the first processing information is a Redis cache management instance; when the cache location indicated by the target's cache annotation is a local Caffeine cache, the cache management instance determined based on the first processing information is a Caffeine cache management instance. Here, if the cache annotation also indicates other cache locations, the cache management instance determined based on the first processing information is other cache management instances, which are not specifically limited here.

[0155] S503: Determine cache key name information.

[0156] Exemplarily, the cache key name information may be determined based on input parameters of the data interface.

[0157] S504: Read data matching the cache key name information from the cache location indicated by the cache annotation of the target through the corresponding cache management instance.

[0158] When it is determined that data is obtained from the cache location, the steps described in S406-S407 are executed below, and then the step described in S408 is executed.

[0159] S406: Perform a deserialization operation on the acquired data.

[0160] Exemplarily, a deserialization operation may be performed on the acquired data according to the deserialization operation information in the cache configuration information to obtain data after the deserialization operation is performed.

[0161] S407: Update the data at the cache location.

[0162] Exemplarily, the data at the cache location may be updated according to the preset data update information and the third processing information in the cache configuration information.

[0163] S408, returning the data to the initiating end. At this time, the data after the deserialization operation is performed is returned to the initiating end.

[0164] When it is determined that the data is not obtained from the cache location, the step described in S408 is executed after executing the steps described in S409 to S411 below.

[0165] S409: Determine whether the last cache annotation has been traversed.

[0166] S410: Execute a data acquisition method corresponding to the data interface to acquire data, or acquire data from a database.

[0167] S411, storing the acquired data in a cache location.

[0168] S408: Return the data to the initiator. At this time, the data obtained from the data acquisition method corresponding to the execution data interface or the data obtained from the database is returned to the initiator.

[0169] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0170] Figure 6 A schematic diagram of the structure of a data loading device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the data loading device 600 includes:

[0171] The detection unit 601 is used to obtain at least one cache annotation of the data interface corresponding to the data query request after detecting the data query request initiated by the initiator; wherein the data query request represents a request for querying data; the cache annotation is used to indicate the cache location of the data corresponding to the data interface.

[0172] The determination unit 602 is used to determine the target cache annotation from each cache annotation based on the preset cache priority of each cache annotation, and determine the cache configuration information contained in the target cache annotation; the cache configuration information is used to indicate the cache method of the data at the cache location indicated by the cache annotation.

[0173] The acquisition unit 603 is used to acquire data based on the cache mode indicated by the cache configuration information included in the target cache annotation.

[0174] The sending unit 604 is used to send the acquired data to the initiating end.

[0175] The device of this embodiment can execute the technical solution in the above method. Its specific implementation process and technical principles are the same and will not be repeated here.

[0176] Figure 7 A structural diagram of another data loading device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the data loading device 700 includes:

[0177] The detection unit 701 is used to obtain at least one cache annotation of the data interface corresponding to the data query request after detecting the data query request initiated by the initiator; wherein the data query request represents a request for querying data; the cache annotation is used to indicate the cache location of the data corresponding to the data interface.

[0178] The determination unit 702 is used to determine the target cache annotation from each cache annotation based on the preset cache priority of each cache annotation, and determine the cache configuration information contained in the target cache annotation; the cache configuration information is used to indicate the cache method of the data at the cache location indicated by the cache annotation.

[0179] The acquisition unit 703 is used to acquire data based on the cache mode indicated by the cache configuration information included in the cache annotation of the target.

[0180] The sending unit 704 is used to send the acquired data to the initiating end.

[0181] In one example, the cache configuration information includes cache key name information and first processing information, the cache key name information is determined based on input parameters of the data interface, and the first processing information indicates a reading method for data at a cache location.

[0182] The acquisition unit 703 includes:

[0183] The first data acquisition module 7031 is used to read data matching the cache key name information in the cache configuration information contained in the target's cache annotation from the cache location indicated by the target's cache annotation based on the first processing information in the cache configuration information contained in the target's cache annotation.

[0184] The second data acquisition module 7032 is used to redetermine the cache annotation of the target from the remaining cache annotations when no data matching the cache key name information in the cache configuration information contained in the cache annotation of the target is read from the cache location indicated by the cache annotation of the target, and acquire data based on the cache method indicated by the cache configuration information contained in the redetermined cache annotation of the target; the remaining cache annotations of the target are the cache annotations other than the cache annotation of the target in the at least one cache annotation.

[0185] In one example, the cache configuration information also includes deserialization operation information and data determination information; the deserialization operation information is used to perform a deserialization operation on the data at the cache location; the data determination information is used to determine whether the read data that matches the cache key name information meets the return requirements.

[0186] The sending unit 704 is further configured to:

[0187] Based on the data judgment information, the read data that matches the cache key name information is judged; when it is judged that the read data that matches the cache key name information meets the return requirements, a deserialization operation is performed on the matching data based on the deserialization operation information, and the deserialized data is sent to the initiator.

[0188] In one example, the device further includes:

[0189] The third data acquisition module 705 is used to execute the data acquisition method corresponding to the data interface to acquire data when the cache mode indicated by the cache configuration information contained in the target-based cache annotation fails to acquire data, and send the acquired data to the initiator; or, when the cache mode indicated by the cache configuration information contained in the target-based cache annotation fails to acquire data, acquire data matching the data query request from the database, and send the acquired data to the initiator.

[0190] In one example, the cache configuration information also includes serialization operation information and second processing information; the serialization operation information is used to perform serialization operations on data that is not in the cache location; and the second processing information indicates a writing method for writing data to the cache location.

[0191] The device also includes:

[0192] The data storage module 706, after acquiring data by executing the data acquisition method corresponding to the data interface, or after acquiring data matching the data query request from the database, performs a serialization operation on the data based on the serialization operation information to obtain data that meets the write requirements; based on the second processing information in the cache configuration information contained in each cache annotation, writes the data that meets the write requirements into the cache locations indicated by each cache annotation.

[0193] In one example, the cache configuration information also includes preset data update information and third processing information; the preset data update information indicates the update frequency of the data at the cache location; the third processing information indicates the update method of updating the data at the cache location.

[0194] The device also includes:

[0195] The data updating module 707 is used to update the data at the cache location indicated by each cache annotation based on the preset data updating information and the third processing information contained in each cache annotation to obtain updated data.

[0196] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the computer device 800 includes: a memory 801 and a processor 802 .

[0197] Memory 801 is a memory used to store instructions executable by processor 802 .

[0198] The processor 802 is configured to execute the method provided in the above embodiment.

[0199] The computer device further includes a receiver 803 and a transmitter 804. The receiver 803 is used to receive instructions and data sent by an external device, and the transmitter 804 is used to send instructions and data to the external device.

[0200] Fig. 9 It is a block diagram of a computer device according to an exemplary embodiment. The device may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0201] Device 900 may include one or more of the following components: a processing component 902 , a memory 904 , a power component 906 , a multimedia component 909 , an audio component 910 , an input / output (I / O) interface 912 , a sensor component 914 , and a communication component 916 .

[0202] The processing component 902 generally controls the overall operation of the device 900, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 902 may include one or more modules to facilitate the interaction between the processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate the interaction between the multimedia component 909 and the processing component 902.

[0203] The memory 904 is configured to store various types of data to support operations on the device 900. Examples of such data include instructions for any application or method operating on the device 900, contact data, phone book data, messages, pictures, videos, etc. The memory 904 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0204] The power supply component 906 provides power to the various components of the device 900. The power supply component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 900.

[0205] The multimedia component 909 includes a screen that provides an output interface between the device 900 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 909 includes a front camera and / or a rear camera. When the device 900 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0206] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC), and when the device 900 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 904 or sent via the communication component 916. In some embodiments, the audio component 910 also includes a speaker for outputting audio signals.

[0207] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0208] The sensor assembly 914 includes one or more sensors for providing various aspects of status assessment for the device 900. For example, the sensor assembly 914 can detect the open / closed state of the device 900, the relative positioning of components, such as the display and keypad of the device 900, and the sensor assembly 914 can also detect the position change of the device 900 or a component of the device 900, the presence or absence of user contact with the device 900, the orientation or acceleration / deceleration of the device 900, and the temperature change of the device 900. The sensor assembly 914 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 914 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0209] The communication component 916 is configured to facilitate wired or wireless communication between the device 900 and other devices. The device 900 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0210] In an exemplary embodiment, the apparatus 900 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above method.

[0211] The present application also provides a computer-readable storage medium on which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the steps of the data loading method in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0212] An embodiment of the present application also provides a computer program product, which carries computer execution instructions. The instructions included in the computer execution instructions can be used to execute the steps of the data loading method in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0213] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0214] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A data loading method, characterized in that: include: After detecting a data query request initiated by the initiator, obtaining at least one cache annotation of a data interface corresponding to the data query request; wherein the data query request represents a request for querying data; and the cache annotation is used to indicate a cache location of data corresponding to the data interface; Based on the preset cache priority of each of the cache annotations, determine the cache annotation of the target from each of the cache annotations, and determine the cache configuration information contained in the cache annotation of the target; the cache configuration information is used to indicate the cache mode of the data at the cache location indicated by the cache annotation; Based on the cache mode indicated by the cache configuration information contained in the cache annotation of the target, data is obtained; and the obtained data is sent to the initiator.

2. The method according to claim 1, characterized in that The cache configuration information includes cache key name information and first processing information, wherein the cache key name information is determined based on input parameters of the data interface, and the first processing information indicates a reading method for reading data at a cache location; Based on the cache mode indicated by the cache configuration information contained in the cache annotation of the target, obtaining data includes: Based on the first processing information in the cache configuration information included in the cache annotation of the target, data matching the cache key name information in the cache configuration information included in the cache annotation of the target is read from the cache location indicated by the cache annotation of the target.

3. The method according to claim 2, characterized in that The method further comprises: If no data matching the cache key name information in the cache configuration information contained in the cache annotation of the target is read from the cache location indicated by the cache annotation of the target, the cache annotation of the target is redetermined from the remaining cache annotations, and data is obtained based on the cache mode indicated by the cache configuration information contained in the redetermined cache annotation of the target; the remaining cache annotations of the target are the cache annotations other than the cache annotation of the target in the at least one cache annotation.

4. The method according to claim 2, characterized in that: The cache configuration information also includes deserialization operation information and data determination information; the deserialization operation information is used to perform a deserialization operation on the data at the cache location; The data determination information is used to determine whether the read data matching the cache key name information meets the return requirements; The method further comprises: Based on the data determination information, the read data matching the cache key name information is determined; When it is determined that the read data matching the cache key name information meets the return requirement, a deserialization operation is performed on the matching data based on the deserialization operation information, and the deserialized data is sent to the initiator.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: In the case that data is not obtained based on the cache mode indicated by the cache configuration information contained in the cache annotation of the target, executing the data acquisition method corresponding to the data interface to acquire data, and sending the acquired data to the initiator; Alternatively, when no data is obtained based on the cache mode indicated by the cache configuration information contained in the cache annotation of the target, data matching the data query request is obtained from the database, and the obtained data is sent to the initiator.

6. The method according to claim 5, characterized in that The cache configuration information also includes serialization operation information and second processing information; the serialization operation information is used to perform a serialization operation on data that is not in the cache location; The second processing information indicates a writing mode for writing data into the cache location; The method further comprises: After executing the data acquisition method corresponding to the data interface to acquire data, or after acquiring data matching the data query request from the database, performing a serialization operation on the data based on the serialization operation information to obtain data that meets the writing requirements; Based on the second processing information in the cache configuration information included in each of the cache annotations, the data that meets the write requirement is written into the cache locations indicated by each of the cache annotations.

7. The method according to any one of claims 1 to 4, characterized in that The cache configuration information also includes preset data update information and third processing information; the preset data update information indicates the update frequency of the data at the cache location; The third processing information indicates an update mode of updating the data at the cache location; the method further includes: Based on the preset data update information and the third processing information contained in each cache annotation, the data at the cache location indicated by each cache annotation is updated to obtain updated data.

8. A data loading device, characterized in that: The device comprises: A detection unit, configured to, after detecting a data query request initiated by an initiator, obtain at least one cache annotation of a data interface corresponding to the data query request; wherein the data query request represents a request for querying data; and the cache annotation is used to indicate a cache location of data corresponding to the data interface; A determination unit, configured to determine a cache annotation of a target from each of the cache annotations based on a preset cache priority of each of the cache annotations, and to determine cache configuration information included in the cache annotation of the target; the cache configuration information is used to indicate a cache mode for data at a cache location indicated by the cache annotation; An acquisition unit, configured to acquire data based on a cache mode indicated by cache configuration information included in a cache annotation of the target; The sending unit is used to send the acquired data to the initiating end.

9. The device according to claim 8, characterized in that The cache configuration information includes cache key name information and first processing information, wherein the cache key name information is determined based on input parameters of the data interface, and the first processing information indicates a reading method for reading data at a cache location; The acquisition unit comprises: The first data acquisition module is used to read data matching the cache key name information in the cache configuration information contained in the cache annotation of the target from the cache location indicated by the cache annotation of the target based on the first processing information in the cache configuration information contained in the cache annotation of the target.

10. The device according to claim 9, characterized in that The acquisition unit further includes: A second data acquisition module is used to redefine the cache annotation of the target from the remaining cache annotations when no data matching the cache key name information in the cache configuration information contained in the cache annotation of the target is read from the cache position indicated by the cache annotation of the target, and acquire data based on the cache mode indicated by the cache configuration information contained in the redetermined cache annotation of the target; the remaining cache annotations indicate cache annotations in the at least one cache annotation except the cache annotations of each of the targets.

11. The device according to claim 9, characterized in that The cache configuration information also includes deserialization operation information and data determination information; the deserialization operation information is used to perform a deserialization operation on the data at the cache location; the data determination information is used to determine whether the read data matching the cache key name information meets the return requirement; the sending unit is also used to: Based on the data judgment information, the read data that matches the cache key name information is judged; when it is judged that the read data that matches the cache key name information meets the return requirements, a deserialization operation is performed on the matching data based on the deserialization operation information, and the deserialized data is sent to the initiator.

12. The device according to any one of claims 8 to 11, characterized in that The device also includes: A third data acquisition module is used to execute a data acquisition method corresponding to the data interface to acquire data if no data is acquired based on the cache mode indicated by the cache configuration information contained in the cache annotation of the target, and send the acquired data to the initiator; or, if no data is acquired based on the cache mode indicated by the cache configuration information contained in the cache annotation of the target, acquire data matching the data query request from a database and send the acquired data to the initiator.

13. The device according to claim 12, characterized in that The cache configuration information also includes serialization operation information and second processing information; the serialization operation information is used to perform a serialization operation on the data at the cache location; The second processing information indicates a writing mode for writing data into the cache location; The device also includes: A data storage module is used to perform a serialization operation on the data based on the serialization operation information to obtain data that meets the writing requirements after executing the data acquisition method corresponding to the data interface, or after obtaining data matching the data query request from the database; based on the second processing information in the cache configuration information contained in each of the cache annotations, write the data that meets the writing requirements into the cache locations indicated by each of the cache annotations.

14. The device according to any one of claims 8 to 11, characterized in that The cache configuration information also includes preset data update information and third processing information; the preset data update information indicates the update frequency of the data at the cache location; The third processing information indicates an update method for updating the data at the cache location; The device also includes: A data updating module is used to update the data at the cache location indicated by each cache annotation based on the preset data updating information and the third processing information contained in each cache annotation to obtain updated data.

15. A computer device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the data loading method according to any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the data loading method according to any one of claims 1 to 7.