Access path automatic completion method, device, equipment and storage medium

By querying the matching cache objects in the local cache and completing the candidates for access requests based on the cache duration, the inefficiency problem in the existing technology is solved, and efficient and reliable automatic completion of object storage service commands is achieved.

CN114281716BActive Publication Date: 2025-08-29JIHAO TECHNOLOGY (TIANJIN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110280559.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-16
Publication Date
2025-08-29
Estimated Expiration
2041-03-16

AI Technical Summary

Technical Problem

The existing automatic completion scheme requires accurate input of the full path every time when accessing remote storage objects, resulting in inefficiency.

Method used

Query the matching cache object in the local cache, complete the candidates for access requests based on the cache duration, and if there is no matching object, the storage object will be obtained from the remote server and the local cache will be updated.

Benefits of technology

Improve the efficiency of automatic completion, reduce the delay caused by simply accessing the remote server, and realize efficient and reliable automatic completion of object storage service commands.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114281716B_ABST
    Figure CN114281716B_ABST
Patent Text Reader

Abstract

The present application provides a method, apparatus, device, and storage medium for automatic completion of an access path. The method comprises: upon receiving an access path completion command, obtaining an access request; determining whether a cache object matching the access request exists in the local cache; if the cache object matching the access request exists in the local cache, completing the candidate items for the access request based on the cache duration of the cache object; if the cache object matching the access request does not exist in the local cache, obtaining a storage object matching the access request from a remote server based on the access request, and outputting the storage object as a candidate item for the access request. The present application improves the phenomenon of slow automatic completion time caused by a simple delay in accessing a remote server, thereby improving the efficiency of automatic completion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data service technology, and in particular to a method, apparatus, device and storage medium for automatic access path completion. Background Art

[0002] Autocomplete, also known as smart prompts, allows users to type a character in an input box and display a drop-down list of candidate words, making it easier for them to enter. Typically, self-hosted object storage service access commands don't have autocomplete scripts. When accessing objects stored remotely, users must enter the full path to the object.

[0003] In existing automatic completion solutions, the common remote command completion mechanism requires accessing remote storage objects every time, which has speed and efficiency limitations. Summary of the Invention

[0004] The purpose of the embodiments of the present application is to provide a method, apparatus, device and storage medium for automatic completion of access paths, which realize efficient and reliable automatic completion of object storage service commands.

[0005] A first aspect of an embodiment of the present application provides a method for automatically completing an access path, comprising: upon receiving an access path completion command, obtaining an access request; determining whether a cache object matching the access request exists in a local cache; if a cache object matching the access request exists in the local cache, completing candidate items for the access request based on the cache duration of the cache object; if a cache object matching the access request does not exist in the local cache, obtaining a storage object matching the access request from a remote server based on the access request, and outputting the storage object as a candidate item for the access request.

[0006] In some embodiments of the present invention, before determining whether there is a cache object matching the access request in the local cache, it also includes: obtaining node relationship information of the storage object in the remote server; and establishing a mapping relationship of the cache object in the local cache based on the node relationship information.

[0007] In some embodiments of the present invention, determining whether a cache object matching the access request exists in the local cache includes: determining whether the cache object matching the access request exists in the local cache based on the mapping relationship.

[0008] In some embodiments of the present invention, if the cache object that matches the access request exists in the local cache, the candidate items of the access request are completed according to the cache duration of the cache object, including: if the cache object that matches the access request exists in the local cache, reading the cache duration of the cache object; determining whether the cache duration exceeds the valid duration of the cache object; if the cache duration does not exceed the valid duration, outputting the cache object as a candidate item of the access request.

[0009] In some embodiments of the present invention, if the cache object matching the access request exists in the local cache, the candidate items of the access request are completed according to the cache duration of the cache object, and the method also includes: if the cache duration exceeds the valid duration, according to the access request, obtaining the storage object matching the access request from the remote server, and outputting the storage object as a candidate item of the access request.

[0010] In some embodiments of the present invention, if the cache object matching the access request exists in the local cache, completing the candidate items for the access request based on the cache duration of the cache object further includes: if the cache duration does not exceed the valid duration, updating the valid duration of the cache object according to the following formula:

[0011] Initial conditions:

[0012] T n0 =S / (h n-1 )

[0013] Update iterator:

[0014] T n(k+1) =f(T n(k+1),m , T n(k+1),p )

[0015] T n(k+1),p =T nk

[0016] f(T n(k+1),m , T n(k+1),p )=T n(k+1),m ×r+T n(k+1),p ×(1-r)

[0017] Where n represents the storage level of the cache object in the local cache, T n0 Indicates the initial default validity period of the cache object in the n-th layer directory, S indicates the preset validity period of the cache object in the first layer directory, h indicates the preset multiple value of the relative modification frequency of each layer directory and its upper layer directory, T n(k+1)Indicates the effective duration of the cache object in the k+1th iteration state, T n(k+1),m represents the cache duration of the cache object in the k+1th iteration, T nk Indicates the effective duration of the cache object in the kth iteration, T n(k+1),p Indicates the predicted validity period of the cache object in the k+1th iteration, k≥0.

[0018] In some embodiments of the present invention, after obtaining a storage object that matches the access request from the remote server according to the access request and outputting the storage object as a candidate for the access request, it also includes: updating the cache object that matches the access request in the local cache according to the storage object, and adding an initial valid duration for the new cache object in the local cache.

[0019] The second aspect of an embodiment of the present application provides an access path automatic completion device, including: a first acquisition module, used to obtain an access request when receiving an access path completion command; a judgment module, used to determine whether a cache object matching the access request exists in the local cache; a completion module, used to complete the candidate items of the access request according to the cache duration of the cache object if the cache object matching the access request exists in the local cache; an output module, used to obtain a storage object matching the access request from a remote server according to the access request if the cache object matching the access request does not exist in the local cache, and output the storage object as a candidate item of the access request.

[0020] In some embodiments of the present invention, it also includes: a second acquisition module, which is used to obtain the node relationship information of the storage object in the remote server before determining whether there is a cache object matching the access request in the local cache; and an establishment module, which is used to establish the mapping relationship of the cache object in the local cache based on the node relationship information.

[0021] In some embodiments of the present invention, the judgment module is configured to: judge, based on the mapping relationship, whether the cache object matching the access request exists in the local cache.

[0022] In some embodiments of the present invention, the completion module is used to: if the cache object matching the access request exists in the local cache, read the cache duration of the cache object; determine whether the cache duration exceeds the valid duration of the cache object; if the cache duration does not exceed the valid duration, output the cache object as a candidate for the access request.

[0023] In some embodiments of the present invention, the completion module is also used to: if the cache duration exceeds the effective duration, obtain a storage object matching the access request from the remote server according to the access request, and output the storage object as a candidate for the access request.

[0024] In some embodiments of the present invention, the completion module is further configured to: if the cache duration does not exceed the valid duration, update the valid duration of the cache object according to the following formula:

[0025] Initial conditions:

[0026] T n0 =S / (h n-1 )

[0027] Update iterator:

[0028] T n(k+1) =f(T n(k+1),m , T n(k+1),p )

[0029] T n(k+1),p =T nk

[0030] f(T n(k+1),m , T n(k+1),p )=T n(k+1),m ×r+T n(k+1),p ×(1-r)

[0031] Where n represents the storage level of the cache object in the local cache, T n0 Indicates the initial default validity period of the cache object in the n-th layer directory, S indicates the preset validity period of the cache object in the first layer directory, h indicates the preset multiple value of the relative modification frequency of each layer directory and its upper layer directory, T n(k+1) Indicates the effective duration of the cache object in the k+1th iteration state, T n(k+1),m represents the cache duration of the cache object in the k+1th iteration, T nk Indicates the effective duration of the cache object in the kth iteration, T n(k+1),p Indicates the predicted validity period of the cache object in the k+1th iteration, k≥0.

[0032] In some embodiments of the present invention, it also includes: an update module, which is used to obtain a storage object matching the access request from the remote server according to the access request, output the storage object as a candidate for the access request, and then update the cache object matching the access request in the local cache according to the storage object, and add an initial valid time for the new cache object in the local cache.

[0033] A third aspect of an embodiment of the present application provides an electronic device, comprising: a memory for storing a computer program; a processor for executing the method of the first aspect of the embodiment of the present application and any embodiment thereof to automatically complete candidate items of an access request.

[0034] The fourth aspect of the embodiment of the present application provides a non-transitory electronic device readable storage medium, including: a program, which, when run by an electronic device, enables the electronic device to execute the method of the first aspect of the embodiment of the present application and any one of its embodiments.

[0035] The access path automatic completion method, apparatus, device and storage medium provided by the present application, when receiving an access path completion command, first queries whether there is a cache object matching the user's access request in the local cache. If so, it further automatically completes the candidate items of the access request based on the cache duration of the cache object. Otherwise, it obtains a storage object matching the access request from the remote server, and completes the candidate items of the access request based on the storage object. In this way, the phenomenon of slow automatic completion time caused by the delay of simply accessing the remote server is improved, and the efficiency of automatic completion is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.

[0037] Figure 1 This is a schematic structural diagram of an electronic device according to an embodiment of the present application;

[0038] Figure 2 A flowchart of an access path automatic completion method according to an embodiment of the present application is shown;

[0039] Figure 3 A flowchart of an access path automatic completion method according to an embodiment of the present application is shown;

[0040] Figure 4 Schematic diagram of the structure of an access path automatic completion device according to an embodiment of the present application. DETAILED DESCRIPTION

[0041] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings. In the description of the present application, the terms "first", "second", etc. are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.

[0042] like Figure 1 As shown, this embodiment provides an electronic device 1, including: at least one processor 11 and a memory 12, Figure 1 In the example, a processor 11 and a memory 12 are connected via a bus 10. The memory 12 stores instructions executable by the processor 11. The instructions are executed by the processor 11 so that the electronic device 1 can execute all or part of the process of the method in the following embodiment to automatically complete the candidate items of the access request.

[0043] In some embodiments of the present invention, the electronic device 1 may be a mobile phone, a tablet computer, a laptop computer, a desktop computer, or the like.

[0044] Please see Figure 2 , which is an access path automatic completion method of an embodiment of the present application, the method can be Figure 1 The electronic device 1 shown is used to perform the method, and can be applied to the intelligent prompt scenario of the input box to automatically complete the candidate items of the access request in the candidate box of the input box. The method includes the following steps:

[0045] Step 201: upon receiving an access path completion command, obtaining an access request.

[0046] In this step, in real-world scenarios, when a user enters an access command in the input box, suitable options are recommended based on the specific content of the user's access request. For example, when a user enters an access request for a target object in the terminal input box, they can press the tab key as a completion command for the access path, triggering the auto-completion function to retrieve the specific content of the access request currently entered in the input box.

[0047] Step 202: Determine whether there is a cache object matching the access request in the local cache. If so, proceed to step 203; otherwise, proceed to step 204.

[0048] In this step, based on the access request content currently entered by the user in the input box, the local cache is first actively searched to see if there is a matching cache object. If so, the process proceeds to step 203 , otherwise, the process proceeds to step 204 .

[0049] Step 203: According to the cache duration of the cache object, complete the candidate items of the access request.

[0050] In this step, if a cached object matching the access request exists in the local cache, the cached object can be used as a candidate to complete the access request based on the cache validity of the cached object, thus saving the time of obtaining the candidate from the remote server.

[0051] Step 204: According to the access request, a storage object matching the access request is obtained from the remote server, and the storage object is output as a candidate for the access request.

[0052] In this step, if there is no cache object matching the access request in the local cache, it means that the candidate item for the access request cannot be obtained in the local cache. Therefore, the storage object corresponding to the access request is actively obtained from the remote server, and the found storage object is used as a candidate item for completing the access request path.

[0053] In some embodiments of the present invention, the candidate items for completion can be displayed in the form of a drop-down list below the input box. If there are multiple candidate items, the candidate items can be sorted from high to low according to priority and displayed in the drop-down list for user selection.

[0054] The above-mentioned access path automatic completion method, when receiving the access path completion command, first queries whether there is a cache object matching the user's access request in the local cache. If so, it further automatically completes the candidate items of the access request based on the cache duration of the cache object. Otherwise, it obtains the storage object matching the access request from the remote server, and completes the candidate items of the access request based on the storage object. In this way, the phenomenon of slow automatic completion time caused by the delay of simply accessing the remote server is improved, and the efficiency of automatic completion is improved.

[0055] Please see Figure 3 , which is an access path automatic completion method of an embodiment of the present application, the method can be Figure 1 The electronic device 1 shown is used to perform the method, and can be applied to the intelligent prompt scenario of the input box to automatically complete the candidate items of the access request in the candidate box of the input box. The method includes the following steps:

[0056] Step 301: Obtain node relationship information of objects stored in a remote server.

[0057] In this step, before receiving the user's access request, the storage path relationship of the storage object on the remote server is first mapped to the local cache: the storage object can be stored in the remote server in a tree-like structure, and the storage path relationship of each node and sub-node of the storage object is first obtained.

[0058] Step 302: Based on the node relationship information, a mapping relationship between cache objects in the local cache is established.

[0059] In this step, the node-to-child node storage relationship of the storage object can be simulated in the local cache by using the relationship between the parent directory and the child directory, and the name of the storage object can be recorded by the directory name of the cache object, thereby realizing the mapping of the storage object to the local cache.

[0060] Step 303: Upon receiving the access path completion command, obtain the access request. For details, refer to the description of step 201 in the above embodiment.

[0061] Step 304: Based on the preset mapping relationship, determine whether there is a cache object matching the access request in the local cache. If so, proceed to step 305; otherwise, proceed to step 306.

[0062] In this step, the preset mapping relationship may be a mapping relationship between the storage relationship of the storage object in the remote server and the local cache. First, based on the preset mapping relationship, the local cache is actively searched for a cache object that matches the completion command.

[0063] Step 305: If there is a cache object matching the access request in the local cache, the candidate items of the access request are completed according to the cache duration of the cache object.

[0064] In some embodiments of the present invention, step 305 may include:

[0065] S1: If a cache object matching the access request exists in the local cache, read the cache duration of the cache object.

[0066] In this step, if a cache object matching the access request exists in the local cache, the current cache duration of the cache object in the local cache is first read. The cache duration can be calculated using the following formula:

[0067] T k+1,m =T now -T old (1)

[0068] Among them, T k+1,m T is the cache duration of the cache object in the local cache when it is accessed for the k+1th time, now is the current access time for the cache object, T old The time when the cache object is created in the local cache.

[0069] S2: Determine whether the cache duration exceeds the valid duration of the cache object. If so, proceed to step S5 below; if not, proceed to step S3.

[0070] In this step, in actual applications, the accessed service object will be updated based on actual conditions. When the stored object on the remote server is updated, the local cache should promptly update the cached object to ensure the validity of the candidate recommended to the user. Therefore, it is necessary to set a reasonable local cache validity period for the cached object. Based on this, the first step is to determine whether the cache duration of the accessed cached object exceeds the validity period of the cached object. If so, the process proceeds to step S5; if not, the process proceeds to step S3.

[0071] S3: Output cache objects are candidates for access requests.

[0072] In this step, if the cache duration does not exceed the valid duration, it means that the cache object is currently valid and can be directly output as a candidate for the access request.

[0073] In some embodiments of the present invention, step 305 may further include:

[0074] S4: If the cache duration does not exceed the effective duration, update the effective duration of the cache object according to the following formulas (2), (3), (4), and (5).

[0075] In this step, in actual scenarios, some directories are changed very frequently, while some directories are changed very rarely. It is unscientific to set the same effective time for different directories, so it is necessary to find a scientific method to set the effective time for different directories. The idea of ​​the Kalman filter algorithm can be used to dynamically adjust the local cache effective time of a certain cache object. By recording an expected current effective time in the local cache, each time the cache object is accessed, if the cache time does not exceed the effective time, the effective time is updated according to the actual access time, thereby achieving the purpose of dynamically updating the predicted effective time according to the frequency of access to the cache object. First, set the initial conditions: According to the actual scenario, the shallower the cache level, the more stable its directory and the lower the frequency of change. As the directory level deepens, the frequency of file modification at this level will increase. Therefore, the following formula can be set to express the initial effective time of a sub-object of a cache object:

[0076] T n0 =S / (h n-1 )

[0077] Where n represents the storage level of the cache object in the local cache, T n0 It indicates the initial default validity period of the cached objects in the n-th level directory, S indicates the preset validity period of the cached objects in the first level directory, and h indicates the preset multiple value of the relative modification frequency of each level directory and the directory on the previous level.

[0078] Assuming that the default cache of the first-level object is valid for one day, and 86400 is the number of seconds in a day, the initial valid duration can be obtained:

[0079] T n0 =86400 / (5 n-1 ) (2)

[0080] The denominator uses an exponential because the frequency of changes to each directory level is considered a multiple of the frequency of changes to the previous level. Multiple-level directories can be approximated using an exponential form. In a real-world scenario, the estimated frequency of changes to the fourth-level directory is approximately 10 minutes, so the base of the exponential, or the predefined multiple value h, can be 5.

[0081] Then, set the valid time to update the iterator:

[0082] T n(k+1) =f(T n(k+1),m , T n(k+1),p ) (3)

[0083] T n(k+1),p =T nk (4)

[0084] In formula (3), T n(k+1) Indicates the effective duration of the cache object in the k+1th iteration state, T n(k+1),m Indicates the cache duration of the cache object in the k+1th iteration, T n(k+1),p represents the predicted effective duration of the cached object in the k+1th iteration, k ≥ 0. f() represents the conversion function from cache duration and predicted effective duration to effective duration.

[0085] In formula (4), T nk represents the effective duration of the cache object in the kth iteration, and formula (4) represents the predicted effective duration T in the k+1th iteration. n(k+1),p Equal to the cache duration T in the kth iteration nk , this equation relationship can be derived based on historical data statistics.

[0086] Finally, based on historical data statistics, in real-world scenarios, the actual effective duration of a cached object is linearly related to the actual cache duration and the expected effective duration. Therefore, the conversion function can be implemented using the following formula:

[0087] f(T n(k+1),m , T n(k+1),p )=T n(k+1),m ×r+T n(k+1),p ×(1-r) (5)

[0088] Here, r is the preset scenario error parameter. In actual scenarios, access time is quite random, for example, a certain object may be accessed frequently suddenly. However, such sudden changes in access time should not drastically affect the effective time setting. Therefore, the error parameter r in equation (5) is set to a small value, such as r = 0.05, to reduce the error caused by such random conditions.

[0089] That is, assuming k = 0, the initial effective duration T of the local object A is n0 , then each time you access object A, it will be based on T n0 The valid duration is updated according to the update iterator. The above formula can be used to complete the iteration from the kth to the k+1th. Since the initial condition is set, the corresponding valid duration can be dynamically updated each time the cache object is accessed.

[0090] In some embodiments of the present invention, step 305 may further include:

[0091] S5: If the cache duration exceeds the effective duration, a storage object matching the access request is obtained from the remote server according to the access request, and the storage object is output as a candidate for the access request. For details, see the description of step 204 in the above embodiment.

[0092] Step 306: If no cached object matching the access request exists in the local cache, a storage object matching the access request is retrieved from the remote server based on the access request, and the storage object is output as a candidate for the access request. The process proceeds to step 307. For details, see the description of step 204 in the above embodiment.

[0093] In some embodiments of the present application, step 307 is further included: updating the cache object that matches the access request in the local cache according to the storage object, and adding an initial valid time length for the new cache object in the local cache.

[0094] In this step, if the cached object matching the access request does not exist in the local cache, or if the cached object exists but its cache duration exceeds the valid duration, the cached object in the local cache is updated based on the stored object matching the access request obtained from the remote server, and an initial valid duration is added to the new cached object in the local cache to ensure the validity of the cached object in the local cache.

[0095] The above-mentioned access path automatic completion method writes an object access command automatic completion script. When the user presses the tab key, the automatic completion function is triggered. In the automatic completion function, the object under the current access path in the local cache or the remote server is actively searched, and the found storage object is used as an option for path completion. By mapping the storage object storage to the local storage, each time the path completion is searched, it is first searched in the local storage. If it is found and within the valid time, the local cache content is used as the next option for path completion. If it is not found, or the existence time of the local cache exceeds the valid time, the remote storage object content is accessed and the local cache is updated according to the remote storage content. This improves the phenomenon of slow automatic completion time caused by delays in accessing the remote server.

[0096] Using a Kalman filter algorithm, we record an estimated validity period in the local cache. Each time the cache is accessed, this estimated validity period is updated based on the actual access time, ensuring that the validity period is continuously updated based on the frequency of cache access. This approach ultimately enables efficient and reliable automatic completion of object storage service commands.

[0097] Please see Figure 4 , which is an access path automatic completion device 400 according to an embodiment of the present application, and is applied to Figure 1 The electronic device 1 shown can be applied to the intelligent prompt scenario of the input box to automatically complete the candidate items of the access request in the candidate box of the input box. The device includes: a first acquisition module 401, a judgment module 402, a completion module 403 and an output module 404. The principle relationship between each module is as follows:

[0098] The first acquisition module 401 is configured to acquire an access request upon receiving a command to complete an access path. For details, refer to the description of step 201 in the above embodiment.

[0099] The judgment module 402 is used to judge whether there is a cache object matching the access request in the local cache. Please refer to the description of step 202 in the above embodiment for details.

[0100] The completion module 403 is used to complete the candidate items of the access request according to the cache duration of the cache object if there is a cache object matching the access request in the local cache. For details, please refer to the description of step 203 in the above embodiment.

[0101] Output module 404 is configured to, if no cache object matching the access request exists in the local cache, retrieve a storage object matching the access request from the remote server according to the access request, and output the storage object as a candidate for the access request. For details, see the description of step 204 in the above embodiment.

[0102] Some embodiments of the present invention further include: a second acquisition module 405 configured to acquire node relationship information of the object stored in the remote server before determining whether the local cache contains a cache object matching the access request. An establishment module 406 configured to establish a mapping relationship between the cache object and the local cache based on the node relationship information. For details, see the description of steps 301 to 302 in the above embodiment.

[0103] In some embodiments of the present invention, the determination module 402 is configured to determine, based on the mapping relationship, whether a cache object matching the access request exists in the local cache.

[0104] In some embodiments of the present invention, completion module 403 is configured to: if a cache object matching the access request exists in the local cache, read the cache duration of the cache object. Determine whether the cache duration exceeds the valid duration of the cache object. If the cache duration does not exceed the valid duration, output the cache object as a candidate for the access request. For details, see the description of steps 305 to 307 in the above embodiment.

[0105] In some embodiments of the present invention, the completion module 403 is further configured to: if the cache duration exceeds the valid duration, retrieve a storage object matching the access request from the remote server according to the access request, and output the storage object as a candidate for the access request. For details, see the description of step 309 in the above embodiment.

[0106] In some embodiments of the present invention, the completion module 403 is further configured to: if the cache duration does not exceed the valid duration, update the valid duration of the cache object according to the following formula:

[0107] Initial conditions:

[0108] T n0 =S / (h n-1 )

[0109] Update iterator:

[0110] T n(k+1) =f(T n(k+1),m , T n(k+1),p )

[0111] T n(k+1),p =T nk

[0112] f(T n(k+1),m , T n(k+1),p )=T n(k+1),m ×r+T n(k+1),p ×(1-r)

[0113] Where n represents the storage level of the cache object in the local cache, T n0Indicates the initial default validity period of the cache object in the n-th layer directory, S indicates the preset validity period of the cache object in the first layer directory, h indicates the preset multiple value of the relative modification frequency of each layer directory and its upper layer directory, T n(k+1) Indicates the effective duration of the cache object in the k+1th iteration state, T n(k+1),m Indicates the cache duration of the cache object in the k+1th iteration, T nk Indicates the effective duration of the cache object in the kth iteration, T n(k+1),p Indicates the predicted effective duration of the cached object in the k+1th iteration, k ≥ 0.

[0114] For details, please refer to the description of step 308 in the above embodiment.

[0115] Some embodiments of the present invention further include an update module 407 configured to, based on the access request, obtain a storage object matching the access request from a remote server, output the storage object as a candidate for the access request, and then, based on the storage object, update the cache object matching the access request in the local cache and add an initial validity period to the new cache object in the local cache. For details, see the description of step 310 in the above embodiment.

[0116] For a detailed description of the above-mentioned access path automatic completion device 400, please refer to the description of the relevant method steps in the above-mentioned embodiment.

[0117] An embodiment of the present invention further provides a non-transitory electronic device readable storage medium, comprising: a program, which, when run on an electronic device, enables the electronic device to execute all or part of the process of the method in the above embodiment. The storage medium may be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (HDD) or a solid-state drive (SSD). The storage medium may also include a combination of the above types of memories.

[0118] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for automatically completing an access path, characterized in that: include: Upon receiving a completion command for the access path, obtaining an access request; Determine whether there is a cache object matching the access request in the local cache; If the cache object matching the access request exists in the local cache, completing the candidate items for the access request according to the cache duration of the cache object; If the cache object matching the access request does not exist in the local cache, obtaining a storage object matching the access request from a remote server according to the access request, and outputting the storage object as a candidate for the access request; Wherein, if the cache object matching the access request exists in the local cache, completing the candidate items of the access request according to the cache duration of the cache object includes: If the cache object matching the access request exists in the local cache, read the cache duration of the cache object; Determine whether the cache duration exceeds the valid duration of the cache object; If the cache duration does not exceed the valid duration, the valid duration of the cache object is updated according to the following formula: Initial conditions: Update iterator: Wherein, n represents the storage level where the cache object is located in the local cache, Indicates the initial default validity period of the cache object in the n-th layer directory, S indicates the preset validity period of the cache object in the first layer directory, and h indicates the preset multiple value of the relative modification frequency of each layer directory and its upper layer directory. Indicates the effective duration of the cache object in the k+1th iteration state, represents the cache duration of the cache object at the k+1th iteration, Indicates the effective duration of the cache object in the kth iteration, Indicates the predicted effective duration of the cache object in the k+1th iteration, k , is the preset scene error parameter.

2. The method according to claim 1, characterized in that Before determining whether a cache object matching the access request exists in the local cache, the method further includes: Obtaining node relationship information of objects stored in the remote server; Based on the node relationship information, a mapping relationship of the cache object in the local cache is established.

3. The method according to claim 2, characterized in that The determining whether a cache object matching the access request exists in the local cache includes: According to the mapping relationship, it is determined whether the cache object matching the access request exists in the local cache.

4. The method according to any one of claims 1 to 3, characterized in that If the cache object matching the access request exists in the local cache, completing the candidate items for the access request according to the cache duration of the cache object further includes: Alternatively, if the cache duration does not exceed the valid duration, the cache object is output as a candidate for the access request.

5. The method according to claim 4, characterized in that If the cache object matching the access request exists in the local cache, completing the candidate items for the access request according to the cache duration of the cache object further includes: If the cache duration exceeds the valid duration, a storage object matching the access request is obtained from the remote server according to the access request, and the storage object is output as a candidate for the access request.

6. The method according to any one of claims 1, 2, 3 or 5, characterized in that After obtaining, according to the access request, a storage object matching the access request from the remote server and outputting the storage object as a candidate for the access request, the method further includes: According to the storage object, the cache object matched by the access request in the local cache is updated, and an initial validity period is added to the new cache object in the local cache.

7. An access path automatic completion device, characterized in that: include: A first acquisition module is used to acquire an access request when receiving a completion command for an access path; A determination module, configured to determine whether a cache object matching the access request exists in the local cache; a completion module, configured to complete candidate items of the access request according to a cache duration of the cache object if the cache object matching the access request exists in the local cache; an output module configured to, if the cache object matching the access request does not exist in the local cache, obtain a storage object matching the access request from a remote server according to the access request, and output the storage object as a candidate for the access request; Wherein, if the cache object matching the access request exists in the local cache, completing the candidate items of the access request according to the cache duration of the cache object includes: If the cache object matching the access request exists in the local cache, read the cache duration of the cache object; Determine whether the cache duration exceeds the valid duration of the cache object; If the cache duration does not exceed the valid duration, the valid duration of the cache object is updated according to the following formula: Initial conditions: Update iterator: Wherein, n represents the storage level where the cache object is located in the local cache, Indicates the initial default validity period of the cache object in the n-th layer directory, S indicates the preset validity period of the cache object in the first layer directory, and h indicates the preset multiple value of the relative modification frequency of each layer directory and its upper layer directory. Indicates the effective duration of the cache object in the k+1th iteration state, Indicates the cache duration of the cache object at the k+1th iteration, Indicates the effective duration of the cache object in the kth iteration, Indicates the predicted effective duration of the cache object in the k+1th iteration, k , is the preset scene error parameter.

8. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the method according to any one of claims 1 to 6.

9. A non-transitory electronic device readable storage medium, characterized in that: The invention comprises: a program, which, when executed by an electronic device, causes the electronic device to execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data access method, device, computer equipment and storage medium

    CN110471939A