File updating method and terminal

By generating and cacheing file address identifiers in an edge server and updating local memory when files change, the system performance problems caused by frequent updates of external files are solved, and the effect of reducing file update workload and improving system access efficiency is achieved.

CN120162335APending Publication Date: 2025-06-17FUJIAN TQ ONLINE INTERACTIVE INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510215313.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

In high concurrency and high throughput systems, frequent updates of external files cause edge servers to frequently pull files to the source station, affecting system operation performance.

Method used

When pulling and storing files in the source station through the edge server, an address identifier is generated and the file address is cached. If the file changes, the content in the local memory will be updated. The address referenced in the front-end page file is scanned and the replacement file address is found based on the address identifier is found to reduce the workload of file updates.

Benefits of technology

It reduces the workload of file updates, improves system access efficiency, and ensures real-time and accuracy of file data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120162335A_ABST
    Figure CN120162335A_ABST
Patent Text Reader

Abstract

The invention discloses a file updating method and a terminal, and the method comprises the steps: generating an address identifier according to a first address of a first type file in a source station when an edge server pulls and stores the first type file from the source station, obtaining a second address of the first type file in the edge server, caching the address identifier and the second address to a local memory, and if the first type file is changed in the source station, correspondingly modifying the content in the local memory according to the change condition; when the edge server pulls the second type of file from the source station, scanning a third address referenced in the second type of file, searching a corresponding second address in the local memory according to an address identifier of the third address, and replacing the third address with the second address to obtain the replaced second type of file, the second type file is a front-end page file. According to the invention, file updating is realized through comparison query of the address identifiers, the whole front-end page does not need to be updated, and the file updating efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and particularly relates to a file update method and a terminal. Background Art

[0002] Currently, with the growth of a huge amount of user demands, the system is also facing an increasing request pressure. To meet the requirements of high concurrency and high throughput, most systems adopt services such as CDN, that is, downloading the latest file data from the source station to the edge server, and customers or clients directly access the edge server nearby. In this way, the overall access volume of the system is improved. However, some problems have also emerged in the actual operation of this method. In many applications of front-end pages, a large number of external files are referenced. When these external files change, it is necessary to download the files from the source station back to the edge server. For example, if a certain external file is updated and modified, there may be multiple front-end pages that reference this external file. Suppose there are 10 such pages, then the files corresponding to these 10 pages all need to be pulled from the source station to the edge server again. If the number of pages referencing this external file increases to 100, then the relevant files of 100 pages need to be pulled synchronously. At this time, if the dependent files change frequently, this will cause the edge server to frequently pull files from the source station, affecting the system operation performance. Summary of the Invention

[0003] The technical problem to be solved by the present invention is: to provide a file update method and a terminal, which can reduce the workload of file update and improve the system access efficiency.

[0004] To solve the above technical problem, the technical solution adopted by the present invention is: A file update method, comprising the steps of: S1. When the edge server pulls and stores the first type of file from the source station, generate an address identifier according to the first address of the first type of file in the source station, obtain the second address of the first type of file in the edge server, cache the address identifier and the second address in the local memory, and if the first type of file is changed in the source station, make corresponding modifications to the content in the local memory according to the change situation; S2. When the edge server pulls the second type of file from the source station, scan the third address referenced in the second type of file, find the corresponding second address in the local memory according to the address identifier of the third address, and use the second address to replace the third address to obtain the replaced second type of file, where the second type of file is a front-end page file.

[0005] To solve the above technical problem, another technical solution adopted by the present invention is: A file update terminal includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the above-mentioned file update method.

[0006] The beneficial effects of the present invention are as follows: The file update method and terminal provided by the present invention pull and store the first type of files in the source station through the edge server, generate an address identifier according to the first address of the first type of files in the source station, ensure that the files have unique identifiers for subsequent query and comparison, obtain the second address of the first type of files in the edge server, cache the address identifier and the second address in the local memory. If the first type of files in the source station is changed, the content in the local memory is correspondingly modified according to the change situation, ensuring the real-time and accuracy of the file data; pull the second type of files in the source station through the edge server, scan the third address referenced in the second type of files, find the corresponding second address in the local memory according to the address identifier of the third address, and use the second address to replace the third address to obtain the replaced second type of files. There is no need to update the entire second type of files, only the files corresponding to the address identifier are needed, reducing the workload of file update and improving the system access efficiency. Description of the Drawings

[0007] Figure 1 It is a flowchart of a file update method according to an embodiment of the present invention; Figure 2 It is a schematic diagram of a file update terminal according to an embodiment of the present invention; Label Description: 1. A file update terminal; 2. Memory; 3. Processor. Detailed Embodiments

[0008] To describe in detail the technical content, achieved objectives and effects of the present invention, the following is described in conjunction with the embodiments and accompanied by the drawings.

[0009] Please refer to Figure 1 , an embodiment of the present invention provides a file update method, including the steps: S1. When the edge server pulls and stores the first type of files from the source station, generate an address identifier according to the first address of the first type of files in the source station, obtain the second address of the first type of files in the edge server, cache the address identifier and the second address in the local memory. If the first type of files in the source station is changed, the content in the local memory is correspondingly modified according to the change situation; S2. When the edge server pulls the second type of file from the origin server, scan the third address referred to in the second type of file, look up the corresponding second address in the local memory according to the address identifier of the third address, and use the second address to replace the third address to obtain the replaced second type of file, where the second type of file is a front-end page file.

[0010] As can be seen from the above description, the beneficial effects of the present invention are as follows: By pulling and storing the first type of file in the origin server through the edge server, generating an address identifier according to the first address of the first type of file in the origin server, ensuring that the file has a unique identifier for subsequent query and comparison, obtaining the second address of the first type of file in the edge server, caching the address identifier and the second address in the local memory, if the first type of file in the origin server changes, then modify the content in the local memory accordingly according to the change situation, ensuring the real-time and accuracy of the file data; By pulling the second type of file in the origin server through the edge server, scanning the third address referred to in the second type of file, looking up the corresponding second address in the local memory according to the address identifier of the third address, and using the second address to replace the third address to obtain the replaced second type of file, there is no need to update the entire second type of file, only the file corresponding to the address identifier needs to be updated, reducing the workload of file update and improving the system access efficiency.

[0011] Further, if the first type of file in the origin server changes, then modify the content in the local memory accordingly according to the change situation, including: If the first type of file in the origin server changes, the edge server obtains and stores the changed file, and generates the first address identifier of the changed file according to the first address of the changed file in the origin server; Compare and query the first address identifier with the address identifiers in the local memory. If the query result is that it does not exist, store the first address identifier and the second address of the changed file in the edge server in the local memory.

[0012] As can be seen from the above description, the edge server obtains the changed file and generates the first address identifier according to the first address of the changed file in the origin server to ensure the identification of the changed file, compares and queries the first address identifier with the address identifiers in the local memory to determine whether the changed file is the file existing in the local memory. If the query result is that it does not exist, store the first address identifier and the second address of the changed file in the edge server in the local memory, store the changed file in time, improve the comprehensiveness and reliability of the data, and avoid data loss.

[0013] Further, comparing and querying the first address identifier with the address identifiers in the local memory further includes: If the query result is existence, use the address of the change file in the edge server to replace the second address corresponding to the address identifier that has been queried in the local memory.

[0014] As can be seen from the above description, if the query result is existence, it means that the change file is a file existing in the local memory. Then directly use the address of the change file in the edge server to replace the second address corresponding to the address identifier that has been queried in the local memory, without storing it again, thereby improving the space utilization rate and file update efficiency.

[0015] Further, before the step S2, it includes: Dynamically configure the file suffix types included in the second type of file; Determine whether the second type of file needs to be updated. If so, load the second type of file to the edge server.

[0016] As can be seen from the above description, by dynamically configuring the file suffix types included in the second type of file and loading the second type of file that needs to be updated to the edge server, it can meet the file update for a certain file suffix type, improving the update efficiency and maintainability.

[0017] Further, scan the third addresses referenced in the second type of file, find the corresponding second addresses in the local memory according to the address identifiers of the third addresses, and use the second addresses to replace the third addresses to obtain the replaced second type of file, including: Scan the address class tags in the second type of file, and generate a to-be-replaced address identifier according to the third addresses of the address class tags; Compare and query the to-be-replaced address identifier with the address identifiers in the local memory. If the query result is existence, replace the second address corresponding to the queried address identifier to the address class tag of the second type of file, and save the replaced second type of file to the local memory.

[0018] As can be seen from the above description, by scanning the address class tags of the second type of file, generating a to-be-replaced address identifier according to the addresses of the address class tags, comparing and querying the to-be-replaced address identifier with the address identifiers in the local memory to determine whether there is a file required for updating the second type of file in the local memory. If the query result is existence, replace the second address corresponding to the queried address identifier to the address class tag of the second type of file, realizing the update of the second type of file, without updating the entire second type of file, and improving the file update efficiency.

[0019] Please refer to Figure 2, another embodiment of the present invention provides a file update terminal, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements each step of the above-mentioned file update method.

[0020] The above-mentioned file update method and terminal of the present invention are applicable to the file update scenario, which can reduce the workload of file update and improve the system access efficiency. The following is illustrated by specific embodiments: Please refer to Figure 1 , Embodiment 1 of the present invention is: A file update method, including the steps of: S1. When the edge server pulls and stores the first type of file from the source station, generate an address identifier according to the first address of the first type of file in the source station, obtain the second address of the first type of file in the edge server, cache the address identifier and the second address to the local memory. If the first type of file is changed in the source station, modify the content in the local memory accordingly according to the change situation.

[0021] In this embodiment, the edge server pulls and stores the first type of file in the source station, generates an address identifier according to the first address of the first type of file in the source station, ensures that the file has a unique identifier for subsequent query and comparison, obtains the second address of the first type of file in the edge server, caches the address identifier and the second address to the local memory. If the first type of file is changed in the source station, modify the content in the local memory accordingly according to the change situation, ensuring the real-time and accuracy of the file data.

[0022] Among them, the first address can be a url, the address identifier is unique, and the corresponding and unique address identifier is generated by hash(url). The storage medium of the address identifier and the second address in the local memory can be a database table or a file, which is convenient for quick query.

[0023] Further, in this embodiment, if the first type of file is changed in the source station, the content in the local memory is modified accordingly, including: if the first type of file is changed in the source station, the edge server obtains and stores the changed file, generates a first address identifier of the changed file according to the first address of the changed file in the source station to ensure the identification of the changed file; compares and queries the first address identifier with the address identifiers in the local memory. If the query result is that it does not exist, the first address identifier and the second address of the changed file in the edge server are stored in the local memory. If the query result exists, the address of the changed file in the edge server is used to replace the second address corresponding to the queried address identifier in the local memory. In this way, by comparing and querying the first address identifier with the address identifiers in the local memory to determine whether the changed file is the file existing in the local memory, and then performing corresponding processing according to the query result, it can not only improve the comprehensiveness and reliability of data, avoid data loss, but also improve the space utilization rate and file update efficiency.

[0024] S2. When the edge server pulls the second type of file from the source station, scan the third address referenced in the second type of file, find the corresponding second address in the local memory according to the address identifier of the third address, and use the second address to replace the third address to obtain the replaced second type of file, where the second type of file is a front-end page file.

[0025] In this embodiment, the edge server pulls the second type of file from the source station, scans the third address referenced in the second type of file, finds the corresponding second address in the local memory according to the address identifier of the third address, and uses the second address to replace the third address to obtain the replaced second type of file. Specifically: scan the address class tags in the second type of file, and generate a to-be-replaced address identifier according to the third address of the address class tag; compare and query the to-be-replaced address identifier with the address identifiers in the local memory. If the query result is that it exists, replace the second address corresponding to the queried address identifier to the address class tag of the second type of file, and save the replaced second type of file to the local memory to implement the update of the second type of file; if the query result is that it does not exist, no processing is required. After finally replacing the memory, save the latest front-end file to the local and provide access services externally. In this way, there is no need to update the entire second type of file, only the file corresponding to the address identifier needs to be updated, reducing the workload of file update and improving the system access efficiency.

[0026] Further, in this embodiment, before the step S2, it includes: dynamically configuring the file suffix types included in the second type of file, and the file suffix types can be configured as html, js, etc.; determining whether the second type of file needs to be updated, and if so, loading the second type of file to the edge server, so as to meet the update of files of a certain file suffix type, improving the update efficiency and maintainability.

[0027] In this way, when the dependent file changes, only this one file needs to be updated, and there is no need to update the front-end pages that reference this file, which can reduce file updates and improve system access efficiency.

[0028] Please refer to Figure 2 , Embodiment 2 of the present invention is: A file update method terminal 1, including a memory 2, a processor 3, and a computer program stored on the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, it implements each step of a file update method in Embodiment 1.

[0029] In summary, for a file update method and terminal provided by the present invention, when the edge server pulls and stores the first type of file from the source station, an address identifier is generated according to the first address of the first type of file in the source station, the second address of the first type of file in the edge server is obtained, and the address identifier and the second address are cached in the local memory. If the first type of file is changed in the source station, the content in the local memory is correspondingly modified according to the change situation, including: if the first type of file is changed in the source station, the edge server obtains and stores the changed file, and generates the first address identifier of the changed file according to the first address of the changed file in the source station to ensure the identification of the changed file; comparing and querying the first address identifier with the address identifiers in the local memory. If the query result is non-existent, the first address identifier and the second address of the changed file in the edge server are stored in the local memory. If the query result exists, the second address corresponding to the address identifier that has been queried in the local memory is replaced with the address of the changed file in the edge server to ensure the timeliness and reliability of the update of the file data stored in the local memory.

[0030] When the edge server pulls the second type of file from the source station, it scans the third address referred to in the second type of file, looks up the corresponding second address in the local memory according to the address identifier of the third address, and uses the second address to replace the third address to obtain the replaced second type of file. The second type of file is a front-end page file, including: scanning the address class tags in the second type of file, and generating a to-be-replaced address identifier according to the third address of the address class tag; comparing and querying the to-be-replaced address identifier with the address identifiers in the local memory. If the query result is that it exists, the second address corresponding to the queried address identifier is replaced at the address class tag of the second type of file, and the replaced second type of file is saved in the local memory to implement the update of the second type of file. There is no need to update the entire second type of file, improving the file update efficiency.

[0031] The above are only the embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in the relevant technical fields, shall be equally included in the patent protection scope of the present invention.

Claims

1. A file updating method, characterized in that: Includes steps: S1. When the edge server pulls and stores a first type of file from a source station, an address identifier is generated according to a first address of the first type of file in the source station, a second address of the first type of file in the edge server is obtained, the address identifier and the second address are cached in a local memory, and if the first type of file is changed in the source station, the content in the local memory is modified accordingly according to the change; S2. When the edge server pulls the second type of file from the source station, it scans the third address referenced in the second type of file, searches the local memory for the corresponding second address according to the address identifier of the third address, and replaces the third address with the second address to obtain the replaced second type of file, where the second type of file is a front-end page file.

2. A file updating method according to claim 1, characterized in that: If the first type of file is changed in the source station, the content in the local memory is modified accordingly according to the change, including: If the first type of file is changed in the source station, the edge server acquires and stores the changed file, and generates a first address identifier of the changed file according to the first address of the changed file in the source station; The first address identifier is compared with the address identifier in the local memory, and if the query result is non-existent, the first address identifier and the second address of the change file in the edge server are stored in the local memory.

3. A file updating method according to claim 2, characterized in that: Comparing and querying the first address identifier with the address identifier in the local memory further includes: If the query result is yes, the address of the change file in the edge server is used to replace the second address corresponding to the queried address identifier in the local memory.

4. A file updating method according to claim 1, characterized in that: Before step S2, the method includes: Dynamically configure the file suffix type included in the second type of files; It is determined whether the second type of file needs to be updated, and if so, the second type of file is loaded to the edge server.

5. A file updating method according to claim 1, characterized in that: Scanning a third address referenced in the second type file, searching the local memory for a corresponding second address according to an address identifier of the third address, and replacing the third address with the second address to obtain a replaced second type file, including: Scanning the address class label in the second type of file, and generating the address identifier to be replaced according to the third address of the address class label; The address identifier to be replaced is compared and queried with the address identifier in the local memory. If the query result is existence, the second address corresponding to the queried address identifier is replaced with the address class label of the second type of file, and the replaced second type of file is saved to the local memory.

6. A file update terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: S1. When the edge server pulls and stores a first type of file from a source station, an address identifier is generated according to a first address of the first type of file in the source station, a second address of the first type of file in the edge server is obtained, the address identifier and the second address are cached in a local memory, and if the first type of file is changed in the source station, the content in the local memory is modified accordingly according to the change; S2. When the edge server pulls the second type of file from the source station, it scans the third address referenced in the second type of file, searches the local memory for the corresponding second address according to the address identifier of the third address, and replaces the third address with the second address to obtain the replaced second type of file, where the second type of file is a front-end page file.

7. A file update terminal according to claim 6, characterized in that: If the first type of file is changed in the source station, the content in the local memory is modified accordingly according to the change, including: If the first type of file is changed in the source station, the edge server acquires and stores the changed file, and generates a first address identifier of the changed file according to the first address of the changed file in the source station; The first address identifier is compared with the address identifier in the local memory, and if the query result is non-existent, the first address identifier and the second address of the change file in the edge server are stored in the local memory.

8. A file update terminal according to claim 7, characterized in that: Comparing and querying the first address identifier with the address identifier in the local memory also includes: If the query result is yes, the address of the change file in the edge server is used to replace the second address corresponding to the queried address identifier.

9. A file update terminal according to claim 6, characterized in that: Before step S2, the method includes: Dynamically configure the file suffix type included in the second type of file; It is determined whether the second type of file needs to be updated, and if so, the second type of file is loaded to the edge server.

10. A file update terminal according to claim 6, characterized in that: Scanning a third address referenced in the second type file, searching the local memory for a corresponding second address according to an address identifier of the third address, and replacing the third address with the second address to obtain a replaced second type file, including: Scanning the address class label in the second type of file, and generating the address identifier to be replaced according to the third address of the address class label; The address identifier to be replaced is compared and queried with the address identifier in the local memory. If the query result is existence, the second address corresponding to the queried address identifier is replaced with the address class label of the second type of file, and the replaced second type of file is saved to the local memory.