A cloud-edge collaborative transnational resource synchronization method and system
Through the cross-border resource synchronization method of cloud-edge collaboration, KV data index and shared Kafka cluster are used to solve the problems of low reliability and efficiency in cross-border data transmission, achieve the stability and consistency of cross-border data transmission, and reduce control costs.
Patent Information
- Application Number
- CN202110738726.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-30
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-06-30
AI Technical Summary
Cross-border data transmission is affected by poor reliability, low transmission efficiency, and complex network environments, leading to data transmission interruptions and errors, and it is difficult for existing technologies to guarantee data integrity and consistency.
Adopting the cross-border resource synchronization method of cloud-edge collaboration, rapid retrieval and stable transmission of resource files are achieved through KV data index generation, resource file metadata persistence, and subscription publishing to shared Kafka clusters and public cloud storage.
In complex transnational network environments, the reliability and efficiency of data transmission are improved, the integrity and consistency of data are guaranteed, and control costs are reduced.
Smart Images

Figure CN113342766B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cross-border data synchronization transmission, and in particular to a cloud-edge collaborative cross-border resource synchronization method and system. Background Art
[0002] Under the globalization of the economy, the cross-border transmission process may be affected by many unknown factors, resulting in transmission interruptions and errors. The cross-border transmission of big data has the following technical bottlenecks: First, the reliability of data, that is, there is a certain difference between the reliability of network transmission and the reliability of writing to the storage medium; second, the current transmission efficiency of large file transmission and massive file transmission is low, and the transmission efficiency needs to be improved to achieve faster transmission in a short time; third, the impact of cross-border networks on transmission.
[0003] If data leakage occurs due to the selection of an imperfect file transfer solution, it is unacceptable for enterprises or companies. How to ensure that data is correctly and completely transmitted to the target location and that the source and target files are 100% consistent requires detailed consideration and design. Summary of the invention
[0004] The purpose of the present invention is to solve the deficiencies in the prior art and provide a cloud-edge collaborative transnational resource synchronization method and system, which utilizes current public cloud services, reasonably integrates and controls costs, and breaks through the data transmission problem in a complex transnational network environment.
[0005] To achieve the above purpose, the technical solution provided by the present invention is: a cloud-edge collaborative transnational resource synchronization method, comprising the following steps:
[0006] 1) Generate KV data index for the resource file metadata of the current area, and persist the resource file metadata of the current area to the resource database of the current area;
[0007] 2) The client in the current region uploads the resource file to the central pipeline or edge pipeline in the current region, and the file stream is synchronously written to the OSS cloud storage or minio storage, and the corresponding resource file metadata is added to the resource database in the current region;
[0008] 3) Subscribe all resource file metadata in the resource database of the current region to the shared Kafka cluster;
[0009] 4) The file synchronization service in the current region consumes the resource file metadata shared in other regions from the shared Kafka cluster, generates a new KV data index and writes the corresponding resource file metadata record to the resource database in the current region. At the same time, it pulls resource files from other regions to the OSS cloud storage in the current region. After the resource file transfer is completed, the resource file metadata record is updated.
[0010] Furthermore, the resource file metadata includes a unique ID, region, status, and organization ID.
[0011] Furthermore, the KV data index is a data cache structure that provides a fast retrieval of metadata area information with a time complexity of O(1).
[0012] Furthermore, in step 2), the end side of the current region uploads the resource file to the central pipeline of the current region through the network, the file stream is synchronously written to the OSS cloud storage, and a new resource file metadata with a status mark of 1 is added to the resource database of the current region.
[0013] Furthermore, in step 2), the end side of the current region uploads the resource file to the edge pipeline of the current region through the organization's intranet, the file stream is synchronously written to the minio storage, and the resource file metadata of the resource file is reported to the metadata center service of the current region. At the same time, the metadata center service of the current region adds a resource file metadata with a status mark of 1 to the resource database of the current region.
[0014] Further, in step 3), all resource file metadata in the resource database of the current region is subscribed to the shared Kafka cluster, specifically:
[0015] The resource file metadata is first subscribed from the resource database to the intermediate service for parsing, and then sent to the shared Kafka cluster through a high-speed network channel.
[0016] Further, in step 4), when the file synchronization service of the current area consumes resource file metadata shared by other areas from the shared Kafka cluster, the status of the resource file metadata is marked as 0. After the resource file transfer in other areas is completed, the status mark of the resource file metadata is updated to 1.
[0017] The present invention provides a cloud-edge collaborative transnational resource synchronization system, including:
[0018] KV data index storage module, responsible for supporting fast retrieval of resource file metadata;
[0019] The resource file metadata storage module is responsible for storing the regional information of the resource file metadata into the resource database;
[0020] The resource file upload module is responsible for uploading resource files, pushing them to the pipeline service in the specified area through TCP network streaming and storing them in OSS cloud storage or minio storage;
[0021] The data publishing module is responsible for publishing the resource file metadata records in the resource database to the shared Kafka cluster;
[0022] The consumption service module is responsible for synchronizing the metadata records of resource files in other regions to the current region and generating file IO synchronization message instructions.
[0023] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0024] The present invention publishes resource file subscriptions to a shared cluster and uses a public cloud storage service to store file streams, so that multiple modules are decoupled and work together to transmit resource files, reasonably integrate and control costs, break through the data transmission difficulties in a complex transnational network environment, complete transnational file synchronization, and ensure reliable and stable transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is a schematic diagram of the present invention.
[0026] Figure 2 This is a service architecture diagram for the central pipeline.
[0027] Figure 3 This is a service architecture diagram for the edge pipeline. DETAILED DESCRIPTION
[0028] The present invention will be further described below in conjunction with specific embodiments.
[0029] See also Figures 1 to 3 As shown, the cloud-edge collaborative transnational resource synchronization method provided in this embodiment includes the following steps:
[0030] 1) Generate a KV data index for the resource file metadata of the current area 1, and persist the resource file metadata of the current area 1 to the resource database of the current area; wherein the KV data index is a data cache structure that provides a time complexity of O(1) for fast retrieval of metadata area information, and the resource file metadata includes a unique ID, area, status, and organization ID.
[0031] 2) The client in region 1 uploads the resource file to the central pipeline or edge pipeline in region 1. The file stream is synchronously written to OSS cloud storage or minio storage, and the corresponding resource file metadata is added to the resource database in region 1. The details are as follows:
[0032] The end side of the current region 1 uploads resource files to the central pipeline of the current region 1 through the network. The file stream is synchronously written to the OSS cloud storage, and a new resource file metadata with a status mark of 1 is added to the resource database of the current region.
[0033] The end side of the current region 1 uploads the resource file to the edge pipeline of the current region 1 through the organization's intranet. The file stream is synchronously written to the minio storage, and the resource file metadata of the resource file is reported to the metadata center service of the current region 1. At the same time, the metadata center service of the current region 1 adds a resource file metadata with a status mark of 1 to the resource database of the current region 1.
[0034] 3) Subscribe all resource file metadata in the resource database of the current region 1 to the shared Kafka cluster, specifically:
[0035] The resource file metadata is first subscribed from the resource database to the intermediate service for parsing, and then sent to the shared Kafka cluster through a high-speed network channel.
[0036] 4) The file synchronization service in the current region 1 consumes the resource file metadata shared by other regions 2 from the shared Kafka cluster, generates a new KV data index, writes the corresponding resource file metadata record to the resource database of the current region 1, marks the resource file metadata status as 0, and pulls the resource file from other regions 2 to the OSS cloud storage in the current region 1. After the resource file is transferred, the resource file metadata record is updated, and the resource file metadata status mark is updated to 1.
[0037] The following is a cross-border resource synchronization system for cloud-edge collaboration in this embodiment, including:
[0038] The KV data index storage module is responsible for supporting the rapid retrieval of resource file metadata, as follows:
[0039] The resource file (fur / aabbcc.png) is stored in redis with key=MD-RES-FILE:fur / 8307289d48208a1e0030145b8b2b0e4d.PNG and value=CN-SZ-PRO|US-USA-PRO structure.
[0040] The resource file metadata storage module is responsible for storing the regional information of the resource file metadata into the resource database, wherein the resource database is a postgresql database, and the record format of the resource file metadata is as follows:
[0041]
[0042] The resource file upload module is responsible for uploading resource files, pushing them to the pipeline service in the specified area through TCP network streaming and storing them in OSS cloud storage or minio storage;
[0043] The data publishing module is responsible for publishing the resource file metadata records in the postgresql database to the shared kafka cluster, and based on the postgresql database logical replication stream technology, it parses the test_coding log data to implement data subscription and publishing.
[0044] The consumption service module is responsible for synchronizing the metadata records of resource files in other regions to the current region and generating file IO synchronization message instructions.
[0045] The embodiments described above are only preferred embodiments of the present invention and are not intended to limit the scope of implementation of the present invention. Therefore, all changes made according to the shape and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A cloud-edge collaborative transnational resource synchronization method, characterized in that: The following steps are involved: 1) Generate KV data index for the resource file metadata of the current area, and persist the resource file metadata of the current area to the resource database of the current area; 2) The end side of the current region uploads the resource file to the central pipeline or edge pipeline of the current region, and the file stream is synchronously written to the OSS cloud storage or minio storage, and the corresponding resource file metadata is added to the resource database of the current region; The end side of the current region uploads the resource file to the central pipeline of the current region through the network, and the file stream is synchronously written to the OSS cloud storage, and a resource file metadata with a status mark of 1 is added to the resource database of the current region; The end side of the current region uploads the resource file to the edge pipeline of the current region through the organization's intranet. The file stream is synchronously written to the minio storage, and the resource file metadata of the resource file is reported to the metadata center service of the current region. At the same time, the metadata center service of the current region adds a resource file metadata with a status mark of 1 to the resource database of the current region. 3) Subscribe all resource file metadata in the resource database of the current region to the shared Kafka cluster; 4) The file synchronization service in the current region consumes the resource file metadata shared in other regions from the shared Kafka cluster, generates a new KV data index and writes the corresponding resource file metadata record to the resource database in the current region. At the same time, it pulls resource files from other regions to the OSS cloud storage in the current region. After the resource file transfer is completed, the resource file metadata record is updated.
2. According to claim 1, a cloud-edge collaborative transnational resource synchronization method is characterized by: The resource file metadata includes a unique ID, region, status, and organization ID.
3. According to claim 1, a cloud-edge collaborative transnational resource synchronization method is characterized by: The KV data index is a data cache structure that provides a fast retrieval of metadata area information with a time complexity of O(1).
4. The cloud-edge collaborative transnational resource synchronization method according to claim 1, characterized in that: In step 3), all resource file metadata in the resource database of the current region is subscribed to the shared Kafka cluster, specifically: The resource file metadata is first subscribed from the resource database to the intermediate service for parsing, and then sent to the shared Kafka cluster through a high-speed network channel.
5. The cloud-edge collaborative transnational resource synchronization method according to claim 1, characterized in that: In step 4), when the file synchronization service in the current area consumes resource file metadata shared in other areas from the shared Kafka cluster, the status of the resource file metadata is marked as 0. After the resource file transfer in other areas is completed, the status mark of the resource file metadata is updated to 1.
6. A cloud-edge collaborative transnational resource synchronization system, characterized in that: include: KV data index storage module, responsible for supporting fast retrieval of resource file metadata; The resource file metadata storage module is responsible for storing the regional information of the resource file metadata into the resource database; The resource file upload module is responsible for uploading resource files, pushing them to the pipeline service in the specified area through TCP network streaming and storing them in OSS cloud storage or minio storage. The end side of the current area uploads resource files to the central pipeline of the current area through the network, and the file stream is synchronously written to OSS cloud storage, and a new resource file metadata with a status mark of 1 is added to the resource database of the current area. The end side of the current region uploads the resource file to the edge pipeline of the current region through the organization's intranet. The file stream is synchronously written to the minio storage, and the resource file metadata of the resource file is reported to the metadata center service of the current region. At the same time, the metadata center service of the current region adds a resource file metadata with a status mark of 1 to the resource database of the current region. The data publishing module is responsible for publishing the resource file metadata records in the resource database to the shared Kafka cluster; The consumption service module is responsible for synchronizing the metadata records of resource files in other regions to the current region and generating file IO synchronization message instructions.
