File processing method and device, and storage medium

By directly retrieving files within the container cluster and using the cache address in the configuration file to locate the cache space, the problems of slow file retrieval speed and high bandwidth load in the container cluster are solved, achieving fast and convenient file retrieval and reducing costs.

CN116303292BActive Publication Date: 2026-03-31BEIJING SHAREIT INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-02
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In container clusters, as the number of business containers increases, the external network bandwidth load increases when pulling files, leading to network instability, decreased file download speed, and increased failure rate. Existing technologies require modifications to business programs and increased storage costs.

Method used

Files can be retrieved directly within the container cluster. The request is obtained by parsing the file, and the cache space is located using the cache address in the configuration file, thus avoiding the occupation of external network bandwidth and retrieving files directly from the container cluster.

Benefits of technology

No need to modify business programs, reduce external network bandwidth costs, improve file retrieval speed, and shorten business container startup time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116303292B_ABST
    Figure CN116303292B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a file processing method and device and a storage medium. The method comprises: in the case of detecting a starting instruction for a to-be-started service container in a container cluster, obtaining a file acquisition request for the to-be-started service container; parsing a target file domain name and a target download address from the file acquisition request; determining whether a candidate file domain name matched with the target file domain name exists in a configuration file of the container cluster; in the case of the candidate file domain name matched with the target file domain name existing in the configuration file, determining a candidate cache address corresponding to the candidate file domain name matched with the target file domain name as a target cache address; determining a target cache space from the container cluster based on the target cache address; and determining a required target file from the target cache space based on the target download address. In this way, the file can be directly acquired from the container cluster quickly and conveniently, and the file pulling speed in the container cluster environment is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of document processing, and more particularly to a document processing method, apparatus, and storage medium. Background Technology

[0002] With the continuous development of cloud-native technologies, business operations are becoming increasingly refined, and container clusters contain more and more business containers. When a business container needs to fetch files from outside the container cluster to start, the more business containers there are, the more times files need to be fetched from outside the container cluster. Consequently, the bandwidth load on the external network of the container cluster also increases, leading to instability in the external network, a decrease in the speed of fetching files from outside the container cluster, and an increase in the failure rate of file retrieval.

[0003] In related technologies, the files to be retrieved are uploaded to public cloud storage, and then downloaded from the download address provided by the public cloud storage. This method of using public cloud storage for downloading can download files relatively stably. However, it requires modifications to the business program, which may affect the business. It also consumes bandwidth on the external network of the container cluster, cannot effectively improve the file download speed, and increases storage costs. Summary of the Invention

[0004] To overcome the problems existing in related technologies, this disclosure provides a file processing method, apparatus and storage medium that can quickly and conveniently obtain files directly from container clusters without modifying business programs. Moreover, the file retrieval process does not occupy the bandwidth of the external network of the container cluster, which can reduce the bandwidth cost of the external network of the container cluster and effectively improve the file retrieval speed in the container cluster environment, thereby shortening the time required to start the business container.

[0005] According to a first aspect of the present disclosure, a file processing method is provided, comprising:

[0006] Upon detecting a startup command for a service container to be started in a container cluster, a file retrieval request for the service container to be started is obtained; wherein, the container cluster includes at least one service container;

[0007] The target file domain name and target download address are parsed from the file retrieval request;

[0008] Determine whether there is a candidate file domain name in the configuration file of the container cluster that matches the target file domain name; wherein the configuration file pre-stores the candidate file domain name and the candidate cache address corresponding to the candidate file domain name;

[0009] If a candidate file domain name that matches the target file domain name exists in the configuration file, the candidate cache address corresponding to the candidate file domain name that matches the target file domain name is determined as the target cache address;

[0010] Based on the target cache address, determine the target cache space from the container cluster;

[0011] Based on the target download address, the target file required to start the business container to be started is determined from the target cache space.

[0012] In some embodiments, the method further includes:

[0013] If a file cache request is detected, the file download address is parsed from the file cache request;

[0014] Access the file download address to retrieve the cached file;

[0015] Upload the cached file and the file download address to the cache space corresponding to the cached file in the container cluster;

[0016] The domain name of the cached file in the file download address is determined as the candidate file domain name;

[0017] The cache address corresponding to the cache space of the cache file is determined as the candidate cache address;

[0018] Save the candidate file domain name and the candidate cache address to the configuration file.

[0019] In some embodiments, determining the target file required to start the service container to be started from the target cache space based on the target download address includes:

[0020] The cached file corresponding to the file download address that matches the target download address in the target cache space is determined as the target file.

[0021] In some embodiments, one cache file corresponds to at least two cache spaces; uploading the cache file and the file download address to the cache space in the container cluster corresponding to the cache file includes:

[0022] Upload the cache file and the file download address to at least two cache spaces corresponding to the cache file;

[0023] The step of determining the cache address corresponding to the cache space of the cached file as the candidate cache address includes:

[0024] The candidate cache address is generated based on the cache addresses of at least two of the cache spaces.

[0025] In some embodiments, the method further includes:

[0026] The file download address parsed from the file cache request is saved to a preset database;

[0027] The preset database is updated based on the received data update request;

[0028] According to a preset update cycle, extract the cached file domain names from each file download address in the preset database;

[0029] The configuration file is updated based on the cached file domain names extracted from each of the file download addresses in the preset database.

[0030] In some embodiments, determining the target file required to start the service container to be started from the target cache space based on the target download address includes:

[0031] The target download address is format-converted to obtain the target file fingerprint;

[0032] Based on the target file fingerprint, query the cache directory of the target cache space, and determine the cache directory that matches the target file fingerprint as the target cache directory;

[0033] The cache file stored in the target cache directory is identified as the target file.

[0034] In some embodiments, the method further includes:

[0035] If no candidate file domain name matching the target file domain name exists in the configuration file, the target download page is accessed based on the target download address, and the target file is obtained through the target download page;

[0036] The target file and the target download address are uploaded to the cache space corresponding to the target file in the container cluster, and the configuration file is updated based on the target file domain name.

[0037] According to a second aspect of the present disclosure, a document processing apparatus is provided, comprising:

[0038] The first acquisition module is configured to acquire a file acquisition request for the service container to be started when a start instruction for the service container to be started in the container cluster is detected; wherein the container cluster includes at least one service container.

[0039] The first parsing module is configured to parse the target file domain name and target download address from the file acquisition request.

[0040] The first determining module is configured to determine whether there is a candidate file domain name in the configuration file of the container cluster that matches the target file domain name; wherein the configuration file pre-stores the candidate file domain name and the candidate cache address corresponding to the candidate file domain name;

[0041] The second determining module is configured to, when there is a candidate file domain name in the configuration file that matches the target file domain name, determine the candidate cache address corresponding to the candidate file domain name that matches the target file domain name as the target cache address;

[0042] The third determining module is configured to determine the target cache space from the container cluster based on the target cache address;

[0043] The fourth determining module is configured to determine the target file required to start the business container to be started from the target cache space based on the target download address.

[0044] In some embodiments, the apparatus further includes:

[0045] The second parsing module is configured to parse the file download address from the file cache request when a file cache request is detected.

[0046] The second acquisition module is configured to access the file download address and acquire the cached file;

[0047] The first upload module is configured to upload the cached file and the file download address to the cache space in the container cluster corresponding to the cached file;

[0048] The fifth determining module is configured to determine the cache file domain name in the file download address as the candidate file domain name;

[0049] The sixth determining module is configured to determine the cache address of the cache space corresponding to the cache file as the candidate cache address;

[0050] The first saving module is configured to save the candidate file domain name and the candidate cache address to the configuration file.

[0051] In some embodiments, the fourth determining module is configured to:

[0052] The cached file corresponding to the file download address that matches the target download address in the target cache space is determined as the target file.

[0053] In some embodiments, one cache file corresponds to at least two cache spaces; the first upload module is configured to:

[0054] Upload the cache file and the file download address to at least two cache spaces corresponding to the cache file;

[0055] The sixth determining module is configured as follows:

[0056] The candidate cache address is generated based on the cache addresses of at least two of the cache spaces.

[0057] In some embodiments, the apparatus further includes:

[0058] The second saving module is configured to save the file download address parsed from the file cache request to a preset database;

[0059] The first update module is configured to update the preset database based on the received data update request;

[0060] The extraction module is configured to extract cached file domain names from each file download address from the preset database according to a preset update cycle;

[0061] The second update module is configured to update the configuration file based on the cached file domain names extracted from each of the file download addresses in the preset database.

[0062] In some embodiments, the fourth determining module is configured to:

[0063] The target download address is format-converted to obtain the target file fingerprint;

[0064] Based on the target file fingerprint, query the cache directory of the target cache space, and determine the cache directory that matches the target file fingerprint as the target cache directory;

[0065] The cache file stored in the target cache directory is identified as the target file.

[0066] In some embodiments, the apparatus further includes:

[0067] The third acquisition module is configured to, if there is no candidate file domain name matching the target file domain name in the configuration file, access the target download page based on the target download address and acquire the target file through the target download page;

[0068] The second upload module is configured to upload the target file and the target download address to the cache space corresponding to the target file in the container cluster, and update the configuration file based on the target file domain name.

[0069] According to a third aspect of the present disclosure, a document processing apparatus is provided, comprising:

[0070] processor;

[0071] Memory configured to store processor-executable instructions;

[0072] The processor is configured to implement the steps of any of the file processing methods in the first aspect described above during execution.

[0073] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of a file processing apparatus, the apparatus is enabled to perform the steps of any of the file processing methods of the first aspect described above.

[0074] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:

[0075] In this embodiment, when a file needs to be retrieved, the target file domain name can be searched in the container cluster's configuration file to determine the corresponding target cache address. This allows the target cache space within the container cluster to be located based on the target cache address. The target file is then retrieved from the target cache space based on the target download address. This method enables quick and convenient direct retrieval of files from within the container cluster without modifying the business application. Furthermore, the file retrieval process does not consume bandwidth from the external network of the container cluster, reducing bandwidth costs and effectively improving file retrieval speed within the container cluster environment, thereby shortening the time required to start the business container.

[0076] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

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

[0078] Figure 1 This is a flowchart illustrating a file processing method according to an exemplary embodiment;

[0079] Figure 2 This is a schematic diagram illustrating the principle of a file processing method according to an exemplary embodiment;

[0080] Figure 3 This is a block diagram of a file processing apparatus according to an exemplary embodiment;

[0081] Figure 4 This is a block diagram illustrating a file processing apparatus 800 according to an exemplary embodiment;

[0082] Figure 5 This is a hardware structure block diagram of a file processing apparatus according to an exemplary embodiment. Detailed Implementation

[0083] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0084] This disclosure provides a file processing method. Figure 1 This is a flowchart illustrating a file processing method according to an exemplary embodiment, such as... Figure 1 As shown. This method is applied to container cluster management systems and mainly includes the following steps:

[0085] In step 101, if a start command is detected for a service container to be started in the container cluster, a file retrieval request for the service container to be started is obtained; wherein, the container cluster includes at least one service container.

[0086] In step 102, the target file domain name and target download address are parsed from the file acquisition request;

[0087] In step 103, it is determined whether there is a candidate file domain name matching the target file domain name in the configuration file of the container cluster; wherein, the configuration file pre-stores the candidate file domain name and the candidate cache address corresponding to the candidate file domain name;

[0088] In step 104, if there is a candidate file domain name in the configuration file that matches the target file domain name, the candidate cache address corresponding to the candidate file domain name that matches the target file domain name is determined as the target cache address;

[0089] In step 105, a target cache space is determined from the container cluster based on the target cache address;

[0090] In step 106, based on the target download address, the target file required to start the business container to be started is determined from the target cache space.

[0091] It should be noted that the document processing method proposed in this disclosure can be applied to electronic devices as well as servers. Here, electronic devices can include terminal devices, such as mobile terminals or fixed terminals. Mobile terminals can include devices such as mobile phones, tablets, and laptops. Fixed terminals can include desktop computers, smart TVs, etc. As a type of computer, a server can provide computing or application services to other client machines (such as computers, smartphones, ATMs, and even large equipment like train systems) on a network.

[0092] The file processing method in this embodiment can be configured in a file processing device, which can be located in a server or an electronic device. This embodiment does not limit this.

[0093] It should be noted that the execution entity of the embodiments disclosed herein may be, in hardware, a central processing unit (CPU) in a server or electronic device, and in software, a related background service in a server or electronic device, without limitation.

[0094] The file processing method proposed in this disclosure can be applied to a container cluster management system. The container cluster management system can be Kubernetes, abbreviated as K8S, which is a new distributed architecture solution based on container technology and is an open-source container cluster management system.

[0095] In some embodiments, the container cluster may include at least one business container, which may be a Docker container or an RKT container; the business container to be started may be the business container that is started when there is a corresponding business requirement. The startup command may be a command initiated by the business program, which may be generated by the user by clicking the start button, by the user by accessing the startup interface, or by the administrator by running the configuration program.

[0096] Upon detecting a startup command for a service container to be started in a container cluster, a file retrieval request for the service container can be obtained. From the file retrieval request, the target file domain name and target download address can be parsed out. The target download address may include the protocol type, target file domain name, port, and file name, etc. In some embodiments, the target download address can be parsed from the file retrieval request, and the target file domain name can be determined from the target download address.

[0097] Once the target file domain name is resolved, a search can be performed in the container cluster's configuration file based on the target file domain name to determine if a candidate file domain name matching the target file domain name exists in the configuration file. Here, the configuration file may pre-store candidate file domain names and their corresponding candidate cache addresses. The configuration file can be a configuration file for a component in the container cluster. For example, if the component is a Domain Name Server (DNS), then the configuration file is the DNS server's configuration file. The configuration file can also be a pre-created cache file within the container cluster component, used to store candidate file domain names and their corresponding candidate cache addresses. In some embodiments, the configuration file can occupy local memory space; in other embodiments, it can occupy cloud-based memory space.

[0098] In some embodiments, if a candidate file domain name matching the target file domain name exists in the configuration file, the cache space pre-existing in the container cluster for the target file can be determined, and the candidate cache address corresponding to the candidate file domain name matching the target file domain name can be determined as the target cache address. If the target cache address is determined based on the target file domain name, the target cache space can be determined from the container cluster based on the target cache address.

[0099] In some embodiments, there can be one cache space in the container cluster, and the cache address of the cache space can also be one. All files can be saved to this one cache space. If a candidate file domain name is pre-stored in the configuration file, the file corresponding to the candidate file domain name can be saved to this one cache space, and one candidate file domain name can correspond to one candidate cache address. If at least two candidate file domain names are pre-stored in the configuration file, at least two files corresponding to the at least two candidate file domain names can be saved to this one cache space, and at least two candidate file domain names can correspond to this one candidate cache address.

[0100] In other embodiments, there can be at least two cache spaces in the container cluster, and at least two cache addresses for each cache space. It should be noted that the number of cache addresses can be the same as the number of cache spaces, or the number of cache addresses can be less than the number of cache spaces. Files can be saved to corresponding cache spaces, and the cache spaces can correspond to the file type or the file's purpose. Here, the number of cache spaces in the container cluster can be set according to actual needs, and the correspondence between files and cache spaces can also be adaptively adjusted according to requirements.

[0101] If a candidate file domain name is pre-stored in the configuration file, the file corresponding to the candidate file domain name can be saved to the cache space corresponding to that file, and a candidate file domain name can correspond to the candidate cache address of the cache space corresponding to that file; if at least two candidate file domain names are pre-stored in the configuration file, at least two files corresponding to the at least two candidate file domain names can be saved to the cache space corresponding to each file respectively, and at least two candidate file domain names can correspond to the candidate cache address of the cache space corresponding to each file respectively.

[0102] In some embodiments, when the target cache space is determined, a search can be performed directly in the target cache space based on the target download address. The file corresponding to the file address that matches the target download address is identified as the target file required to start the business container to be started. Here, the file can be saved to the cache space along with its corresponding file address.

[0103] In other embodiments, when the target cache space is determined, a search can be performed in the target cache space based on the target file name contained in the target download address. The file corresponding to the file name that matches the target file name is identified as the target file required to start the service container to be started. Here, the file can be saved to the cache space along with its file name. In practical applications, files can be saved to the cache space according to different correspondence methods as needed. When determining the target file from the cache space, a search can be performed based on the correspondence.

[0104] In this embodiment, when a file needs to be retrieved, the target file domain name can be searched in the container cluster's configuration file to determine the corresponding target cache address. This allows the target cache space within the container cluster to be located based on the target cache address. The target file is then retrieved from the target cache space based on the target download address. This method enables quick and convenient direct retrieval of files from within the container cluster without modifying the business application. Furthermore, the file retrieval process does not consume bandwidth from the external network of the container cluster, reducing bandwidth costs and effectively improving file retrieval speed within the container cluster environment, thereby shortening the time required to start the business container.

[0105] In some embodiments, the method further includes:

[0106] If no candidate file domain name matching the target file domain name exists in the configuration file, the target download page is accessed based on the target download address, and the target file is obtained through the target download page;

[0107] The target file and the target download address are uploaded to the cache space corresponding to the target file in the container cluster, and the configuration file is updated based on the target file domain name.

[0108] Here, if a search is performed in the configuration file of the container cluster based on the target file domain name, and it is determined that there is no candidate file domain name matching the target file domain name in the configuration file, it can be determined that the target file does not exist in the cache space of the container cluster. Therefore, the target download page can be accessed directly based on the target download address, and the target file can be obtained through the target download page.

[0109] In some embodiments, when the target file is obtained through the target download page, a cache space corresponding to the target file can be determined based on the target file. The target file and the target download address are then uploaded to the corresponding cache space, and the cache address of the corresponding cache space is obtained. The target file domain name and the cache address of the corresponding cache space are then synchronously updated in the configuration file. Here, the cache space corresponding to the target file can be determined based on the type of the target file, the purpose of the target file, etc.

[0110] In this embodiment of the disclosure, by saving files that do not exist in the pre-existing cache space to the corresponding cache space in real time, and updating the configuration file based on the file domain name and the cache address of the corresponding cache space, real-time updates of the cache space and configuration file can be achieved. When the same file is needed again, the file can still be obtained directly from the cache space in the container cluster.

[0111] In some embodiments, the method further includes:

[0112] If a file cache request is detected, the file download address is parsed from the file cache request;

[0113] Access the file download address to retrieve the cached file;

[0114] Upload the cached file and the file download address to the cache space corresponding to the cached file in the container cluster;

[0115] The domain name of the cached file in the file download address is determined as the candidate file domain name;

[0116] The cache address corresponding to the cache space of the cache file is determined as the candidate cache address;

[0117] Save the candidate file domain name and the candidate cache address to the configuration file.

[0118] Here, file cache requests can be initiated by users adding data through a webpage provided by the container cluster, or by administrators adding content from configuration programs. Upon detecting a file cache request, the file download address can be parsed from the request, and the file download page can be accessed based on the download address to retrieve the cached file. The cached file and its download address are then uploaded to the corresponding cache space within the container cluster. The cached file can be a file outside the container cluster; when a file cache request for a cached file is received, the cached file can be retrieved from outside the container cluster and saved to the container cluster.

[0119] In some embodiments, the original file content of the cached file can be uploaded to the cache space corresponding to the cached file, or the original file content of the cached file can be adaptively adjusted according to requirements before being uploaded to the cache space corresponding to the cached file. For example, the size of the cached file can be compressed, the size of the cached file can be changed, or the cached file can be transcoded.

[0120] In some embodiments, there may be one cache space in the container cluster, where cached files and their download addresses can be uploaded. In other embodiments, there may be at least two cache spaces in the container cluster. The cache space corresponding to a cached file can be determined based on the type and purpose of the cached file, and the cached file and its download address can be uploaded to the corresponding cache space.

[0121] When the cached file and file download address are saved to the cache space corresponding to the cached file, the cached file domain name can be determined from the file download address and identified as a candidate file domain name; the cache address of the cache space corresponding to the cached file can be identified as a candidate cache address and the candidate file domain name and candidate cache address can be saved to the configuration file.

[0122] In this embodiment of the disclosure, by pre-downloading and uploading the cached files to the corresponding cache space in the container cluster, and storing the candidate file domain name and candidate cache address in the configuration file, the file domain name and cache address can be updated to the configuration file in a timely manner for files stored in the cache space. This makes it easy to find the cache address in the configuration file based on the file domain name, and then determine the file from the cache space. In the case of uploading the cached files to the cache space, customized development can also be carried out according to business needs.

[0123] In some embodiments, determining the target file required to start the service container to be started from the target cache space based on the target download address includes:

[0124] The cached file corresponding to the file download address that matches the target download address in the target cache space is determined as the target file.

[0125] In some embodiments, the cached file and the file download address can be uploaded to the corresponding cache space in the container cluster. If the target cache space is determined, a search can be performed within the target cache space based on the target download address. The cached file corresponding to the file download address that matches the target download address in the target cache space can be identified as the target file required to start the business container to be started.

[0126] In this embodiment of the disclosure, when the cached file and the file download address are saved in the cache space, the target file can be determined by matching the target download address with the file download address, thus accurately and quickly identifying the target file from the target cache space.

[0127] In some embodiments, one cache file corresponds to at least two cache spaces; uploading the cache file and the file download address to the cache space in the container cluster corresponding to the cache file includes:

[0128] Upload the cache file and the file download address to at least two cache spaces corresponding to the cache file;

[0129] The step of determining the cache address corresponding to the cache space of the cached file as the candidate cache address includes:

[0130] The candidate cache address is generated based on the cache addresses of at least two of the cache spaces.

[0131] In some embodiments, a cache file can correspond to at least two cache spaces. When a cache file corresponds to at least two cache spaces, the cache file and its download address can be uploaded to both cache spaces. Here, the cache file's content, configuration information, and other cache file-related information can all be uploaded to the cache spaces.

[0132] When the cached file and file download address are saved to at least two cache spaces corresponding to the cached file, the cached file domain name can be determined from the file download address and the cached file domain name can be determined as a candidate file domain name; a candidate cache address can be generated based on the cache address of at least two cache spaces, and the candidate file domain name and candidate cache address can be saved to the configuration file.

[0133] In some embodiments, a suitable method can be selected based on the cache addresses of at least two cache spaces to generate candidate cache addresses, depending on actual needs. For example, the cache addresses of at least two cache spaces can be concatenated to generate candidate cache addresses, where the concatenation order of the cache addresses can be adjusted according to actual needs, as long as the corresponding cache space can be accessed based on the candidate cache address. Another example is that specific fields can be extracted from the cache addresses of at least two cache spaces and concatenated to generate candidate cache addresses, where the extraction and concatenation methods can be adjusted according to actual needs. Yet another example is that at least two cache spaces can be packaged to generate a cache space set, and candidate cache addresses can be generated for the cache space set, allowing access to any cache space in the cache space set based on the candidate cache address.

[0134] In some embodiments, taking the pods in the container cluster as the cache space and the Service as the cache space set as an example, cached files and their download addresses can be uploaded to at least two pods corresponding to the cached files. The Service can define the service's access entry point. Here, a tag selector can be used to establish the correspondence between the Service and at least two pods, and the Service can define candidate cache addresses. Thus, based on the candidate cache addresses, access can be made to each pod contained within the Service.

[0135] In this embodiment of the disclosure, by uploading the cached file and the file download address to at least two cache spaces corresponding to the cached file, the cached file and the file download address can be stored simultaneously in at least two cache spaces. This can ensure the stability of the container cluster and prevent the inability to successfully and timely obtain the file from the container cluster due to a problem with a certain cache space.

[0136] In some embodiments, the method further includes:

[0137] The file download address parsed from the file cache request is saved to a preset database;

[0138] The preset database is updated based on the received data update request;

[0139] According to a preset update cycle, extract the cached file domain names from each file download address in the preset database;

[0140] The configuration file is updated based on the cached file domain names extracted from each of the file download addresses in the preset database.

[0141] In some embodiments, the file download address can be parsed from the file cache request and saved to a preset database. Alternatively, both the file download address and file name can be saved to the preset database simultaneously. The data content stored in the preset database can be adjusted as needed. The preset database can be a pre-created space in memory for data storage. In some embodiments, the preset database can be local memory; in other embodiments, it can be cloud-based memory.

[0142] Upon receiving a data update request, a preset database can be updated based on the received request. In some embodiments, the data update request may be initiated by a user modifying or deleting data through a webpage provided by the container cluster. In other embodiments, the data update request may be initiated by an administrator updating a configuration program.

[0143] In some embodiments, cached file domain names from each file download address can be extracted from a preset database according to a preset update cycle. Based on the extracted cached file domain names and their corresponding cache addresses, the configuration file is updated in real time. Here, the preset update cycle can be determined based on the startup frequency of the business containers in the container cluster, or it can be determined based on the number of cached files in the container cluster. The preset update cycle can be one hour, ten hours, one day, etc., and can be adjusted according to actual usage requirements.

[0144] In other embodiments, when the idle time of a cached file reaches a time threshold, the cached file that has reached the time threshold can be removed from the cache space, and the corresponding candidate file domain name and candidate cache address in the configuration file can be updated, thereby realizing the deletion of expired cached files.

[0145] In this embodiment of the disclosure, by saving the file download address to a preset database, when a data update request is received, the database is directly updated, and the configuration file is updated by extracting the domain names of each cached file from the preset database according to a preset update cycle. In this way, the configuration file can be updated periodically based on the data in the preset database, and expired files can also be deleted, ensuring the real-time performance and accuracy of the data in the configuration file.

[0146] In some embodiments, determining the target file required to start the service container to be started from the target cache space based on the target download address includes:

[0147] The target download address is format-converted to obtain the target file fingerprint;

[0148] Based on the target file fingerprint, query the cache directory of the target cache space, and determine the cache directory that matches the target file fingerprint as the target cache directory;

[0149] The cache file stored in the target cache directory is identified as the target file.

[0150] Here, the target download address can be formatted to obtain the target file fingerprint. In some embodiments, the target file fingerprint can be determined based on all fields of the target download address. Specifically, the MD5 hash algorithm can be used to calculate the MD5 hash of all fields of the target download address, and the calculated MD5 hash can be used as the target file fingerprint. The MD5 hash algorithm can generate a 16-byte hash value, producing a unique digital fingerprint for various files (different sizes, formats, and quantities).

[0151] In other embodiments, the target file fingerprint can be determined based on certain fields of the target download address. These fields can be a combination of the target file's domain name and filename in the target download address, a combination of the port number and filename in the target download address, or a combination of the target file's domain name, port number, and filename in the target download address. A suitable method can be selected to determine the target file fingerprint based on the actual situation, and the generated target file fingerprint can uniquely identify the target download address.

[0152] In some embodiments, the cache directory of the target cache space can be queried based on the target file fingerprint, and the cache directory matching the target file fingerprint is determined as the target cache directory. The cache files stored in the target cache directory are then determined as the target files. Here, the cache directory can be a cache file fingerprint generated based on the file download address, and the cache files can be saved to the corresponding cache directory. It should be noted that the method for generating the target file fingerprint based on the target download address is the same as the method for generating the cache file fingerprint based on the file download address, thus allowing the corresponding file to be found based on the fingerprint.

[0153] In this embodiment of the disclosure, by converting the file download address into a cache file fingerprint, that is, by generating and saving a cache directory based on the file download address, and storing the cache file in the corresponding cache directory, data storage can be performed in a more standardized and convenient manner; by converting the target download address into a target file fingerprint, determining the cache directory that matches the target file fingerprint as the target cache directory, and determining the target file from the target cache directory, the file can be found more quickly and accurately.

[0154] Figure 2 This is a schematic diagram illustrating the principle of a file processing method according to an exemplary embodiment, such as... Figure 2As shown, a file processing component can be deployed in a container cluster 201 to implement the file processing method in this embodiment of the present disclosure. Here, the file processing component may include a file caching service 202 and a file management service 203. Here, the file caching service 202 and the file management service 203 can be custom objects defined using a programming language.

[0155] File management service 203 can detect file cache requests 204, parse the file download address from the file cache request, and access the file download page based on the file download address. The cached file can then be retrieved from the file download page. File cache request 204 can be a request initiated by a user to add data via a webpage provided by the container cluster, or a request initiated by an administrator to add content from a configuration program. The cached file can be a file outside the container cluster (205). When there is a file cache request for a cached file, the cached file can be pulled from outside the container cluster (205).

[0156] In some embodiments, upon obtaining a cached file, the cached file and its download address can be uploaded to the cache space corresponding to the cached file in container cluster 201. Here, file management service 203 can obtain the cache address of the cache space corresponding to the cached file through the acquisition interface 206 in container cluster 201, and access the file upload interface of the cache space through the cache address, thereby uploading the cached file and its download address to the cache space. Taking a Kubernetes container cluster as an example, acquisition interface 206 can be a Kubernetes API.

[0157] In some embodiments, a cached file may correspond to a cache space. The file management service 203 can obtain the cache address of the cache space corresponding to the cached file through the acquisition interface 206, and access the file upload interface of the cache space through the cache address, thereby uploading the cached file and file download address to the cache space. In other embodiments, a cached file may correspond to at least two cache spaces. The file management service 203 can obtain the cache address of each cache space corresponding to the cached file through the acquisition interface 206, and access the file upload interface of each cache space through the cache address in a traversal manner, thereby uploading the cached file and file download address to each cache space.

[0158] Taking the pods in the container cluster as the cache space and the Service as the cache space collection as an example, the file management service 203 can obtain the addresses of each pod in the container cluster through interface 206, and can also obtain the address of the Service cache space collection through interface 206. The Service can define the access entry point of the service. Here, a tag selector can be used to establish the correspondence between the Service and at least two pods, and the Service can define candidate cache addresses. In this way, the various pods contained in the Service can be accessed based on the candidate cache addresses.

[0159] File caching service 202 can read data uploaded by file management service 203 through the file upload interface of each cache space, generate cache file fingerprints based on the read file download addresses, and create a cache directory. The directory name can be the cache file fingerprint. Two files, header file and data file, can be created in the cache directory. The header file can be used to store configuration information for the cache files, including file download addresses and file names; the data file can be used to store the content of the cache files.

[0160] In some embodiments, when the cached file and file download address are saved to the cache space corresponding to the cached file, the file management service 203 can determine the cached file domain name from the file download address and identify the cached file domain name as a candidate file domain name; it can also identify the cache address of the cache space corresponding to the cached file as a candidate cache address and save the candidate file domain name and candidate cache address to a configuration file. Here, the configuration file can be the configuration file of component 208 in the container cluster 201, and the file management service 203 can update the configuration file. Taking a Kubernetes container cluster as an example, component 208 can be a domain name server, and the configuration file can be the configuration file of the domain name server. The type of the domain name server can be CoreDNS, and the type of the domain name server can be adjusted according to the actual usage.

[0161] In this way, by saving the cached file and file download address to the cache space corresponding to the cached file in the container cluster, and saving the candidate file domain name and candidate cache address to the configuration file, the pre-download of the cached file can be completed.

[0162] In some embodiments, upon detecting a startup command for a business container to be started (201) in the container cluster, a file retrieval request for the business container to be started can be obtained. From the file retrieval request, the target file domain name and target download address can be parsed out. The target download address may include the protocol type, target file domain name, port, and file name, etc. The startup command can be an instruction initiated by the business program (207), generated by the user by clicking the startup button, by the user by accessing the startup interface, or by the administrator by running a configuration program.

[0163] Once the target file domain name is resolved, component 208 can search the container cluster's configuration file based on the target file domain name, determine the candidate cache address corresponding to the candidate file domain name that matches the target file domain name as the target cache address, and send the target cache address to business application 207. Business application 207 can determine the target cache space from container cluster 201 based on the target cache address, and directly search in the target cache space based on the target download address, determining the file corresponding to the file address that matches the target download address as the target file required to start the business container to be started.

[0164] In this embodiment of the disclosure, by deploying the file caching service 202 and the file management service 203 in the container cluster 201, it is possible to achieve unified management of cached files, complete the pre-download of files, and quickly and conveniently obtain files directly from the container cluster without modifying the business program. Moreover, the file retrieval process does not occupy the bandwidth of the external network of the container cluster, which can reduce the bandwidth cost of the external network of the container cluster and effectively improve the file retrieval speed in the container cluster environment, thereby shortening the time required to start the business container.

[0165] Figure 3 This is a block diagram illustrating a file processing apparatus according to an exemplary embodiment. Figure 3 As shown, the file processing device 300 is used in a container cluster management system and mainly includes:

[0166] The first acquisition module 301 is configured to acquire a file acquisition request for the service container to be started when a start instruction for the service container to be started in the container cluster is detected; wherein the container cluster includes at least one service container.

[0167] The first parsing module 302 is configured to parse the target file domain name and the target download address from the file acquisition request.

[0168] The first determining module 303 is configured to determine whether there is a candidate file domain name in the configuration file of the container cluster that matches the target file domain name; wherein the configuration file pre-stores the candidate file domain name and the candidate cache address corresponding to the candidate file domain name;

[0169] The second determining module 304 is configured to, when there is a candidate file domain name in the configuration file that matches the target file domain name, determine the candidate cache address corresponding to the candidate file domain name that matches the target file domain name as the target cache address;

[0170] The third determining module 305 is configured to determine the target cache space from the container cluster based on the target cache address;

[0171] The fourth determining module 306 is configured to determine the target file required to start the business container to be started from the target cache space based on the target download address.

[0172] In some embodiments, the apparatus further includes:

[0173] The second parsing module is configured to parse the file download address from the file cache request when a file cache request is detected.

[0174] The second acquisition module is configured to access the file download address and acquire the cached file;

[0175] The first upload module is configured to upload the cached file and the file download address to the cache space in the container cluster corresponding to the cached file;

[0176] The fifth determining module is configured to determine the cache file domain name in the file download address as the candidate file domain name;

[0177] The sixth determining module is configured to determine the cache address of the cache space corresponding to the cache file as the candidate cache address;

[0178] The first saving module is configured to save the candidate file domain name and the candidate cache address to the configuration file.

[0179] In some embodiments, the fourth determining module 306 is configured to:

[0180] The cached file corresponding to the file download address that matches the target download address in the target cache space is determined as the target file.

[0181] In some embodiments, one cache file corresponds to at least two cache spaces; the first upload module is configured to:

[0182] Upload the cache file and the file download address to at least two cache spaces corresponding to the cache file;

[0183] The sixth determining module is configured as follows:

[0184] The candidate cache address is generated based on the cache addresses of at least two of the cache spaces.

[0185] In some embodiments, the apparatus further includes:

[0186] The second saving module is configured to save the file download address parsed from the file cache request to a preset database;

[0187] The first update module is configured to update the preset database based on the received data update request;

[0188] The extraction module is configured to extract cached file domain names from each file download address from the preset database according to a preset update cycle;

[0189] The second update module is configured to update the configuration file based on the cached file domain names extracted from each of the file download addresses in the preset database.

[0190] In some embodiments, the fourth determining module 306 is configured to:

[0191] The target download address is format-converted to obtain the target file fingerprint;

[0192] Based on the target file fingerprint, query the cache directory of the target cache space, and determine the cache directory that matches the target file fingerprint as the target cache directory;

[0193] The cache file stored in the target cache directory is identified as the target file.

[0194] In some embodiments, the apparatus further includes:

[0195] The third acquisition module is configured to, if there is no candidate file domain name matching the target file domain name in the configuration file, access the target download page based on the target download address and acquire the target file through the target download page;

[0196] The second upload module is configured to upload the target file and the target download address to the cache space corresponding to the target file in the container cluster, and update the configuration file based on the target file domain name.

[0197] Figure 4 This is a block diagram illustrating a file processing apparatus 800 according to an exemplary embodiment. For example, apparatus 800 may be a mobile phone, a mobile computer, etc.

[0198] Reference Figure 4 The device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0199] Processing component 802 typically controls the overall operation of device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.

[0200] Memory 804 is configured to store various types of data to support the operation of device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 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 storage, flash memory, magnetic disk, or optical disk.

[0201] Power supply component 806 provides power to various components of device 800. Power supply component 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to device 800.

[0202] Multimedia component 808 includes a screen that provides an output interface between device 800 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 touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0203] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.

[0204] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0205] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of device 800. For example, sensor assembly 814 may detect the on / off state of device 800, the relative positioning of components such as the display and keypad of device 800, changes in the position of device 800 or a component of device 800, the presence or absence of user contact with device 800, the orientation or acceleration / deceleration of device 800, and temperature changes of device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0206] Communication component 816 is configured to facilitate wired or wireless communication between device 800 and other devices. Device 800 can access wireless networks based on communication standards, such as Wi-Fi, 4G, or 5G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0207] In an exemplary embodiment, the apparatus 800 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 methods described above.

[0208] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of the device 800 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0209] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of a file processing device, enables the file processing device to perform a file processing method, the method comprising:

[0210] Upon detecting a startup command for a service container to be started in a container cluster, a file retrieval request for the service container to be started is obtained; wherein, the container cluster includes at least one service container;

[0211] The target file domain name and target download address are parsed from the file retrieval request;

[0212] Determine whether there is a candidate file domain name in the configuration file of the container cluster that matches the target file domain name; wherein the configuration file pre-stores the candidate file domain name and the candidate cache address corresponding to the candidate file domain name;

[0213] If a candidate file domain name that matches the target file domain name exists in the configuration file, the candidate cache address corresponding to the candidate file domain name that matches the target file domain name is determined as the target cache address;

[0214] Based on the target cache address, determine the target cache space from the container cluster;

[0215] Based on the target download address, the target file required to start the business container to be started is determined from the target cache space.

[0216] Figure 5 This is a hardware structure block diagram of a file processing apparatus according to an exemplary embodiment. For example, electronic device 1900 may be provided as a server. (Refer to...) Figure 5 The electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions, such as application programs, that can be executed by the processing component 1922. The application programs stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform a file processing method, including:

[0217] Upon detecting a startup command for a service container to be started in a container cluster, a file retrieval request for the service container to be started is obtained; wherein, the container cluster includes at least one service container;

[0218] The target file domain name and target download address are parsed from the file retrieval request;

[0219] Determine whether there is a candidate file domain name in the configuration file of the container cluster that matches the target file domain name; wherein the configuration file pre-stores the candidate file domain name and the candidate cache address corresponding to the candidate file domain name;

[0220] If a candidate file domain name that matches the target file domain name exists in the configuration file, the candidate cache address corresponding to the candidate file domain name that matches the target file domain name is determined as the target cache address;

[0221] Based on the target cache address, determine the target cache space from the container cluster;

[0222] Based on the target download address, the target file required to start the business container to be started is determined from the target cache space.

[0223] Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input / output (I / O) interface 1958. Electronic device 1900 can operate on an operating system stored in memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.

[0224] It should be understood that the phrase "an embodiment" or "one embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this disclosure. Therefore, "in one embodiment" or "one embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this disclosure, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this disclosure. The sequence numbers of the above-described embodiments are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0225] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0226] In the several embodiments provided in this disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components may be combined, or integrated into another system, or some features may be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0227] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0228] In addition, each functional unit in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0229] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0230] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A file processing method characterized by, The application is applied to a container cluster management system, comprising: In the case of detecting a starting instruction for a to-be-started service container in a container cluster, a file acquisition request for the to-be-started service container is acquired; wherein the container cluster comprises at least one service container; A target file domain name and a target download address are parsed from the file acquisition request; It is determined whether a candidate file domain name matched with the target file domain name exists in a configuration file of the container cluster; wherein the candidate file domain name is pre-stored in the configuration file, and the candidate file domain name corresponds to a candidate cache address; In the case that the candidate file domain name matched with the target file domain name exists in the configuration file, the candidate cache address corresponding to the candidate file domain name matched with the target file domain name is determined as a target cache address; Based on the target cache address, a target cache space is determined from the container cluster; Based on the target download address, a target file required for starting the to-be-started service container is determined from the target cache space; The method further comprises: In the case of determining the target cache space, the target download address is searched in the target cache space, and a cache file corresponding to a file download address matched with the target download address in the target cache space is determined as the target file.

2. The method of claim 1, wherein, The method further comprises: In the case of detecting a file cache request, a file download address is parsed from the file cache request; The file download address is accessed to acquire a cache file; The cache file and the file download address are uploaded to a cache space corresponding to the cache file in the container cluster; A cache file domain name in the file download address is determined as the candidate file domain name; A cache address of the cache space corresponding to the cache file is determined as the candidate cache address; The candidate file domain name and the candidate cache address are saved to the configuration file.

3. The method of claim 2, wherein, One cache file corresponds to at least two cache spaces; the cache file and the file download address are uploaded to the cache spaces corresponding to the cache file; The cache file and the file download address are uploaded to the at least two cache spaces corresponding to the cache file; The cache address of the cache space corresponding to the cache file is determined as the candidate cache address, comprising: Based on the cache addresses of the at least two cache spaces, the candidate cache address is generated.

4. The method of claim 2, wherein, The method further comprises: The file download address parsed from the file cache request is saved to a preset database; Based on a received data update request, the preset database is updated; According to a preset update period, cache file domain names in each file download address are extracted from the preset database; Based on the cache file domain names in each file download address extracted from the preset database, the configuration file is updated.

5. The method of claim 1, wherein, The method further comprises: In the case where the candidate file domain name matching the target file domain name does not exist in the configuration file, accessing a target download page based on the target download address, and obtaining the target file through the target download page; Uploading the target file and the target download address to a cache space corresponding to the target file in the container cluster, and updating the configuration file based on the target file domain name. The application is applied to a container cluster management system, comprising:

6. The method of claim 1, wherein, A first obtaining module configured to obtain a file obtaining request for a to-be-started service container in the container cluster in the case where a start instruction for the to-be-started service container is detected; wherein the container cluster comprises at least one service container; A first analyzing module configured to analyze a target file domain name and a target download address from the file obtaining request; A first determining module configured to determine whether a candidate file domain name matching the target file domain name exists in a configuration file of the container cluster; wherein the candidate file domain name and a candidate cache address corresponding to the candidate file domain name are pre-stored in the configuration file; 7. A file processing apparatus characterized by comprising: A second determining module configured to determine the candidate cache address corresponding to the candidate file domain name matching the target file domain name as a target cache address in the case where the candidate file domain name matching the target file domain name exists in the configuration file; A third determining module configured to determine a target cache space from the container cluster based on the target cache address; A fourth determining module configured to determine a target file required for starting the to-be-started service container from the target cache space based on the target download address; specifically configured to search in the target cache space based on the target download address in the case where the target cache space is determined, and determine a cache file corresponding to a file download address matching the target download address in the target cache space as the target file. The device further comprises: A second analyzing module configured to analyze a file download address from a file cache request in the case where the file cache request is detected; A second obtaining module configured to access the file download address and obtain a cache file; A first uploading module configured to upload the cache file and the file download address to a cache space corresponding to the cache file in the container cluster; 8. The apparatus of claim 7, wherein, A fifth determining module configured to determine a cache file domain name in the file download address as the candidate file domain name; ​ ​ ​ ​ The sixth determining module is configured to determine a cache address corresponding to a cache space of the cache file as the candidate cache address; The first saving module is configured to save the candidate file domain name and the candidate cache address to the configuration file.

9. The apparatus of claim 8, wherein, One cache file corresponds to at least two cache spaces; the first uploading module is configured to: upload the cache file and the file download address to at least two cache spaces corresponding to the cache file; The sixth determining module is configured to: generate the candidate cache address based on cache addresses of the at least two cache spaces.

10. The apparatus of claim 8, wherein, The device further comprises: The second saving module is configured to save the file download address parsed from the file cache request to a preset database; The first updating module is configured to update the preset database based on the received data update request; The extraction module is configured to extract a cache file domain name in each file download address from the preset database according to a preset update period; The second updating module is configured to update the configuration file based on the cache file domain name in each file download address extracted from the preset database.

11. The apparatus of claim 7, wherein, The fourth determining module is configured to: perform format conversion on the target download address to obtain a target file fingerprint; query a cache directory of the target cache space based on the target file fingerprint, and determine a cache directory matching the target file fingerprint as a target cache directory; determine a cache file stored in the target cache directory as the target file.

12. The apparatus of claim 7, wherein, The device further comprises: The third obtaining module is configured to, in a case where no candidate file domain name matching the target file domain name exists in the configuration file, access a target download page based on the target download address, and obtain the target file through the target download page; The second uploading module is configured to upload the target file and the target download address to a cache space corresponding to the target file in the container cluster, and update the configuration file based on the target file domain name.

13. A file processing apparatus characterized by comprising: comprise: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the steps in any one of the file processing methods in claims 1-6 when executed.

14. A non-transitory computer-readable storage medium, comprising: When the instructions in the storage medium are executed by the processor of the file processing device, the device can perform the steps in any one of the file processing methods in claims 1-6.

Citation Information

Patent Citations

  • Domain name resolution method and device, electronic equipment and storage medium

    CN111245944A

  • Method for reducing connection time to website and apparatus for same

    KR1020150031083A