Method and apparatus for resource synchronization
By directly synchronizing updated resources to the edge cloud through the regional cloud and utilizing resource loading and synchronization services, the problem of increased construction costs caused by different resource storage methods in existing technologies is solved, and resource synchronization can be achieved without adding storage nodes and programs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TUS CLOUD CONTROL (BEIJING) TECH LTD
- Filing Date
- 2021-10-29
- Publication Date
- 2026-05-12
AI Technical Summary
In cloud control platforms, due to the different resource storage methods of regional clouds and edge clouds, existing technologies require the addition of peer storage nodes and resource loading programs to achieve resource synchronization, which increases construction costs.
The resource loading service in the regional cloud obtains the last loading time of the resource in the resource control table, loads and updates the original data and attribute information of the resource, and sends it directly to the edge cloud by the resource synchronization service. The edge cloud calls the corresponding resource receiving processor for storage, avoiding the need to add additional peer storage nodes and resource loading programs.
While achieving resource synchronization, it also saved on the construction costs of the cloud control platform.
Smart Images

Figure CN116069486B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Internet technology, and more specifically, to a method and apparatus for resource synchronization. Background Technology
[0002] Cloud control platforms typically employ a multi-tiered architecture, consisting of a regional cloud and multiple edge clouds. The regional and edge clouds reside in different network environments, transmitting data via wide area networks (WANs) or dedicated lines. The regional cloud manages devices and their generated data within a predefined area, while the edge clouds perform calculations on data uploaded by nearby devices. These devices and data are referred to as resources on the cloud control platform. For example, in the field of autonomous driving, this includes autonomous vehicles, Roadside Units (RSUs), and roadside cooperative units. When new data is acquired, these devices can connect to the nearest edge cloud based on their geographical location and upload the new data for computation. The regional cloud provides a management platform to manage these devices and data.
[0003] Due to different ways of using resources, resources may be stored in different ways in regional clouds and edge clouds. For example, RSU information is provided for CRUD operations in regional clouds, so the data can be stored in a MySQL database. However, in edge clouds, when an event occurs on a road, the edge cloud uses the coordinates and impact range of the event to locate the RSUs that need to receive the event and sends the event to these RSUs. To achieve this, RSU information is generally stored in a MongoDB database, and a spatial index is created for the location of the RSUs for fast lookup.
[0004] Currently, when regional cloud and edge cloud resources use different storage methods, methods for synchronizing regional cloud and edge cloud resources include: adding storage nodes in the edge cloud with storage methods equivalent to those in the regional cloud; when resources in the regional cloud are updated, a resource loader can first load the resources to be synchronized from the regional cloud, then synchronize these loaded resources from the regional cloud to the corresponding storage nodes in the edge cloud; then, another resource loader can be added to load the resources from the corresponding storage nodes in the edge cloud, and the loaded resources can be stored using the corresponding resource storage method in the edge cloud. However, when there are many edge clouds corresponding to a regional cloud, the number of additional corresponding storage nodes and resource loader programs will also increase, significantly increasing the construction cost of the cloud control platform. Summary of the Invention
[0005] This invention provides a method and apparatus for resource synchronization, which can directly synchronize resources updated in the regional cloud to the edge cloud without adding peer storage nodes and additional resource loading programs, thereby saving the construction cost of the cloud control platform.
[0006] The specific technical solution is as follows:
[0007] In a first aspect, embodiments of the present invention provide a method for resource synchronization, the method being applied to a regional cloud, the method comprising:
[0008] The resource loading service in the regional cloud obtains the last loading time of the resource type corresponding to the resource control table. Different resource loading services are used to load resources of different resource types. The resource control table includes the resource type and the last loading time of the resource corresponding to the resource type.
[0009] The resource loading service loads the original data of the updated resource and the resource attribute information of the updated resource generated after the last loading time of the resource from the resource storage space corresponding to the resource type. The resource attribute information includes resource type, resource version number and resource identifier.
[0010] The resource synchronization service in the regional cloud sends the original data of the updated resource loaded by the resource loading service and the resource attribute information of the updated resource to the edge cloud corresponding to the edge cloud identifier, based on the edge cloud identifier of the edge cloud to be synchronized. This allows the edge cloud to call the resource receiving processor corresponding to the resource attribute information of the updated resource to synchronize the original data of the updated resource to the edge cloud. The resource receiving processor is a processor that stores resources according to the resource storage method corresponding to the resource attribute information.
[0011] Optionally, the resource loading service loads the original data of the updated resource generated after the last loading time of the resource from the resource storage space corresponding to the resource type, and the resource attribute information of the updated resource, including:
[0012] The resource loading service obtains a preset resource update table, wherein the resource update table includes the original data of the updated resource and the resource attribute information of the updated resource;
[0013] If there is no updated resource in the resource update table that is identical to the target resource type and the target resource identifier, the resource loading service will add the original data of the updated resource generated after the last loading time and the resource attribute information of the updated resource obtained from the resource storage space corresponding to the resource type to the resource update table. The target resource type and the target resource identifier are respectively the resource type and resource identifier in the resource attribute information of the updated resource generated after the last loading time.
[0014] If there is an updated resource in the resource update table that is identical to the target resource type and the target resource identifier, then the resource loading service replaces the corresponding original data and resource version number in the resource update table with the original data and resource version number in the resource attribute information of the updated resource, respectively, according to the target resource type and the target resource identifier.
[0015] The resource synchronization service in the regional cloud sends the original data of the updated resource loaded by the resource loading service and the resource attribute information of the updated resource to the edge cloud corresponding to the edge cloud identifier, based on the edge cloud identifier of the edge cloud to be synchronized. This includes:
[0016] The resource synchronization service sends the original data of the updated resource in the resource update table and the resource attribute information of the updated resource to the edge cloud corresponding to the edge cloud identifier, based on the edge cloud identifier of the edge cloud to be synchronized.
[0017] Optionally, the method further includes:
[0018] After updating the resource update table, the resource loading service determines the resource attribute information of the updated resource as the resource attribute information to be synchronized, and adds the edge cloud identifier of the edge cloud to be synchronized, the resource attribute information to be synchronized, and the synchronization status association to the resource synchronization table. The resource synchronization table includes a mapping relationship between the edge cloud identifier, the resource attribute information of the resource to be synchronized, and the synchronization status of the resource to be synchronized.
[0019] Optionally, the resource synchronization service sends the original data of the updated resource in the resource update table and the resource attribute information of the updated resource to the edge cloud corresponding to the edge cloud identifier, based on the edge cloud identifier of the edge cloud to be synchronized, including:
[0020] The resource synchronization service obtains the resource update table and the resource synchronization table;
[0021] If the synchronization status corresponding to the edge cloud identifier in the resource synchronization table includes "to be synchronized", then the resource synchronization service will match the resource attribute information of the resource to be synchronized when the synchronization status is "to be synchronized" with the resource attribute information of the updated resource in the resource update table.
[0022] If a match is successful, the resource synchronization service will send the resource attribute information of the successfully matched updated resource and the original data of the updated resource corresponding to the resource attribute information to the edge cloud to be synchronized, based on the edge cloud identifier of the edge cloud to be synchronized.
[0023] Optionally, the method further includes:
[0024] After updating the resource update table, the resource loading service updates the last loaded time of the resources in the resource control table.
[0025] Optionally, the method further includes:
[0026] Receive response information sent by the edge cloud indicating the completion of resource synchronization;
[0027] Update the synchronization status of the resources that have completed synchronization in the resource synchronization table to "synchronized".
[0028] Secondly, embodiments of the present invention provide a resource synchronization method, the method being applied to edge cloud, the method comprising:
[0029] The process involves acquiring the original data of updated resources sent by the regional cloud and the resource attribute information of the updated resources. The original data and resource attribute information of the updated resources are related information of the updated resources generated after the last loading time of the corresponding resource type in the resource control table, loaded from the resource storage space of the regional cloud by the resource loading service and sent by the resource synchronization service. Different resource loading services are used to load resources of different resource types. The resource control table includes the resource type and the last loading time of the resource corresponding to the resource type. The resource attribute information includes the resource type, resource version number, and resource identifier.
[0030] The resource receiving processor corresponding to the resource attribute information of the updated resource is invoked, so that the resource receiving processor stores the original data of the updated resource according to the resource storage method corresponding to the resource attribute information of the updated resource.
[0031] Optionally, the raw data of the updated resources sent by the regional cloud and the resource attribute information of the updated resources are obtained, including:
[0032] The load balancing service in the edge cloud receives the original data of the updated resources and the resource attribute information of the updated resources sent by the regional cloud;
[0033] The load balancing service selects a target resource receiving service according to the load balancing strategy, and sends the original data of the updated resource and the resource attribute information of the updated resource to the target resource receiving service.
[0034] Invoking the resource receiving processor corresponding to the resource attribute information of the updated resource includes:
[0035] The target resource receiving service invokes the resource receiving processor corresponding to the resource attribute information of the updated resource.
[0036] Thirdly, embodiments of the present invention provide a resource synchronization apparatus, the apparatus being applied to a regional cloud, the apparatus comprising:
[0037] The resource loading unit is used to obtain the last loading time of the resource corresponding to the resource type from the resource loading service in the regional cloud. Different resource loading services are used to load resources of different resource types. The resource control table includes resource types and the last loading time of the resource corresponding to the resource type. The unit loads the original data of the updated resource generated after the last loading time of the resource from the resource storage space corresponding to the resource type and the resource attribute information of the updated resource. The resource attribute information includes resource type, resource version number and resource identifier.
[0038] The resource synchronization unit is used by the resource synchronization service in the regional cloud to send the original data of the updated resource loaded by the resource loading service and the resource attribute information of the updated resource to the edge cloud corresponding to the edge cloud identifier, according to the edge cloud identifier of the edge cloud to be synchronized. This allows the edge cloud to call the resource receiving processor corresponding to the resource attribute information of the updated resource to synchronize the original data of the updated resource to the edge cloud. The resource receiving processor is a processor that stores resources according to the resource storage method corresponding to the resource attribute information.
[0039] Optionally, the resource loading unit includes:
[0040] The first acquisition module is used to acquire a preset resource update table from the resource loading service, wherein the resource update table includes the original data of the updated resource and the resource attribute information of the updated resource;
[0041] An addition module is provided to add the original data of the updated resource generated after the last loading time and the resource attribute information of the updated resource obtained from the resource storage space corresponding to the resource type to the resource update table if there is no updated resource in the resource update table that is identical to the target resource type and the target resource identifier. The target resource type and the target resource identifier are respectively the resource type and resource identifier in the resource attribute information of the updated resource generated after the last loading time.
[0042] The replacement module is used to replace the original data and resource version number in the resource update table with the original data and resource version number in the resource attribute information of the updated resource, respectively, according to the target resource type and the target resource identifier, if there is an updated resource in the resource update table that is the same as the target resource type and the target resource identifier.
[0043] The resource synchronization unit is used by the resource synchronization service to send the original data of the updated resource in the resource update table and the resource attribute information of the updated resource to the edge cloud corresponding to the edge cloud identifier, based on the edge cloud identifier of the edge cloud to be synchronized.
[0044] Optionally, the resource loading unit further includes:
[0045] The synchronization table update module is used to, after updating the resource update table, determine the resource attribute information of the updated resource as the resource attribute information to be synchronized by the resource loading service, and add the edge cloud identifier of the edge cloud to be synchronized, the resource attribute information to be synchronized, and the synchronization status association to the resource synchronization table. The resource synchronization table includes a mapping relationship between the edge cloud identifier, the resource attribute information to be synchronized, and the synchronization status of the resource to be synchronized.
[0046] Optionally, the resource synchronization unit includes:
[0047] The second acquisition module is used to acquire the resource update table and the resource synchronization table from the resource synchronization service;
[0048] The matching module is used to match the resource attribute information of the resource to be synchronized when the synchronization status corresponding to the edge cloud identifier in the resource synchronization table includes pending synchronization with the resource attribute information of the updated resource in the resource update table if the synchronization status is pending synchronization.
[0049] The sending module is configured to, if a match is successful, send the resource attribute information of the successfully matched updated resource and the original data of the updated resource corresponding to the resource attribute information to the edge cloud corresponding to the edge cloud identifier, according to the edge cloud identifier of the edge cloud to be synchronized.
[0050] Optionally, the resource loading unit further includes:
[0051] The control table update module is used to update the last loading time of resources in the resource control table after the resource update table is updated.
[0052] Optionally, the device further includes:
[0053] A receiving unit is configured to receive response information sent by the edge cloud, indicating the completion of resource synchronization, from the resource synchronization service.
[0054] The synchronization table update unit is used by the resource synchronization service to update the synchronization status of the completed resource synchronization in the resource synchronization table to "synchronized".
[0055] Fourthly, embodiments of the present invention provide a resource synchronization apparatus, the apparatus being applied to an edge cloud, the apparatus comprising:
[0056] The acquisition unit is used to acquire the original data of the updated resources sent by the regional cloud and the resource attribute information of the updated resources. The original data of the updated resources and the resource attribute information of the updated resources are related information of the updated resources generated after the last loading time of the corresponding resource type in the resource control table, which is loaded from the resource storage space of the regional cloud by the resource loading service in the regional cloud and sent by the resource synchronization service. Different resource loading services are used to load resources of different resource types. The resource control table includes the resource type and the last loading time of the resource corresponding to the resource type. The resource attribute information includes the resource type, resource version number and resource identifier.
[0057] The calling unit is used to call the resource receiving processor corresponding to the resource attribute information of the updated resource;
[0058] The storage unit is used by the resource receiving processor to store the original data of the updated resource according to the resource storage method corresponding to the resource attribute information of the updated resource.
[0059] Optionally, the acquisition unit includes:
[0060] The receiving module is used for the load balancing service in the edge cloud to receive the original data of the updated resources and the resource attribute information of the updated resources sent by the regional cloud;
[0061] The selection module is used by the load balancing service to select a target resource receiving service according to the load balancing strategy.
[0062] The sending module is used to send the original data of the updated resource and the resource attribute information of the updated resource to the target resource receiving service by the load balancing service;
[0063] The calling unit is used by the target resource receiving service to call the resource receiving processor corresponding to the resource attribute information of the updated resource.
[0064] Fifthly, embodiments of the present invention provide a storage medium storing executable instructions thereon, which, when executed by a processor, cause the processor to implement the method described in the first or second aspect.
[0065] Sixthly, embodiments of the present invention provide an electronic device, comprising:
[0066] One or more processors;
[0067] Storage device for storing one or more programs.
[0068] Wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in the first aspect or the second aspect.
[0069] In a seventh aspect, embodiments of the present invention provide a resource synchronization system, the system comprising a regional cloud and at least one edge cloud;
[0070] The regional cloud is used to obtain the last loading time of resources of the corresponding resource type from the resource control table by the resource loading service. Different resource loading services are used to load resources of different resource types. The resource control table includes resource types and the last loading time of the resources corresponding to the resource types. The resource loading service loads the original data of the updated resource generated after the last loading time of the resource from the resource storage space corresponding to the resource type and the resource attribute information of the updated resource. The resource attribute information includes resource type, resource version number, and resource identifier. The resource synchronization service in the regional cloud sends the original data of the updated resource loaded by the resource loading service and the resource attribute information of the updated resource to the edge cloud corresponding to the edge cloud identifier, according to the edge cloud identifier of the edge cloud to be synchronized.
[0071] The edge cloud is used to acquire the original data of the updated resources sent by the regional cloud and the resource attribute information of the updated resources; and to call the resource receiving processor corresponding to the resource attribute information of the updated resources so that the resource receiving processor stores the original data of the updated resources according to the resource storage method corresponding to the resource attribute information of the updated resources.
[0072] As can be seen from the above, the resource synchronization method and apparatus provided in this embodiment of the invention can load the original data and resource attribute information of updated resources of different resource types by different resource loading services in the regional cloud, and send the loaded original data and resource attribute information of the updated resources to the edge cloud by the resource synchronization service. The edge cloud calls the resource receiving processor corresponding to the resource attribute information of the updated resources to store the original data of the updated resources according to the resource storage method corresponding to the resource attribute information of the updated resources, without adding additional peer storage nodes and resource loading programs, thereby saving the construction cost of the cloud control platform.
[0073] Of course, implementing any product or method of the present invention does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0074] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0075] Figure 1 A flowchart illustrating a resource synchronization method provided in an embodiment of the present invention;
[0076] Figure 2 A flowchart illustrating another resource synchronization method provided in an embodiment of the present invention;
[0077] Figure 3 This is a schematic diagram of a method for loading and updating resources based on a resource loading service, provided by an embodiment of the present invention.
[0078] Figure 4 A flowchart illustrating another resource synchronization method provided in an embodiment of the present invention;
[0079] Figure 5 A block diagram illustrating the composition of a resource synchronization device provided in an embodiment of the present invention;
[0080] Figure 6 This is a block diagram of another resource synchronization device provided in an embodiment of the present invention. Detailed Implementation
[0081] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0082] It should be noted that the terms "comprising" and "having," and any variations thereof, in the embodiments and drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0083] This invention provides a method and apparatus for resource synchronization, which can directly synchronize updated resources from a regional cloud to an edge cloud without adding additional peer storage nodes and resource loading programs, thereby saving the construction cost of the cloud control platform. The method provided in this invention can be applied to any electronic device with computing capabilities. In one implementation, the software implementing this method can exist as a standalone client software or as a plugin for existing client software.
[0084] The embodiments of the present invention will be described in detail below.
[0085] Figure 1 This is a flowchart illustrating a resource synchronization method provided in an embodiment of the present invention. The method is applied to a regional cloud and may include the following steps:
[0086] S100: The resource loading service in the regional cloud obtains the last loading time of the resource of the corresponding resource type from the resource control table.
[0087] Different resource loading services are used to load resources of different types. The resource control table includes the resource type and the last load time of the resource corresponding to that resource type. The resource loading service can periodically obtain the last load time of the corresponding resource type from the resource control table so as to periodically load and update resources according to the last load time.
[0088] Different resource loading services can be deployed on different servers or on the same server. The specific number of resource loading services that need to be deployed on one server depends on the actual needs.
[0089] S110: The resource loading service loads the original data of the updated resource and the resource attribute information of the updated resource generated after the last loading time of the resource from the resource storage space corresponding to the resource type.
[0090] The resource attribute information includes resource type, resource version number, and resource identifier. When loading updated resources, the resource loading service can first load the updated resources into a resource update table that stores information related to the updated resources. Then, the resource synchronization service performs resource synchronization based on the resource update table, allowing the resource loading service and the resource synchronization service to execute asynchronously and independently.
[0091] Specifically, such as Figure 2As shown, the resource loading service can obtain a preset resource update table, which includes the original data of the updated resource and the resource attribute information of the updated resource. If there is no updated resource in the resource update table that is identical to the target resource type and the target resource identifier, the resource loading service will add the original data of the updated resource generated after the last loading time from the resource storage space corresponding to the resource type and the resource attribute information of the updated resource to the resource update table. The target resource type and the target resource identifier are respectively the resource type and resource identifier in the resource attribute information of the updated resource generated after the last loading time. If there is an updated resource in the resource update table that is identical to the target resource type and the target resource identifier, the resource loading service will replace the corresponding original data and resource version number in the resource update table with the resource version number in the original data and resource attribute information of the updated resource, respectively, based on the target resource type and the target resource identifier. Therefore, in the resource update table, there will only be one updated resource with the same resource type and the same resource identifier; that is, only the final original data and resource version number of the updated resource are retained. After updating the resource update table (i.e., performing the above-mentioned add or replace operation), in order to prevent the resource loading service from repeatedly loading the same updated resource, the resource loading service may update the last loading time of the resource in the resource control table.
[0092] To facilitate the resource synchronization service in quickly identifying which edge clouds have had which updated resources synchronized, and which updated resources require synchronization, a resource synchronization table can be set up in the regional cloud. This table stores the mapping relationship between the edge cloud identifier, the resource attribute information of the resource to be synchronized, and the synchronization status of the resource to be synchronized. This allows the resource synchronization service to determine which operations need to be performed based on the synchronization status in the resource synchronization table. For example... Figure 2 As shown, when a resource update table is set up, after updating the resource update table, the resource loading service determines the resource attribute information of the updated resource as the resource attribute information to be synchronized, and adds the edge cloud identifier of the edge cloud to be synchronized, the resource attribute information to be synchronized, and the synchronization status to the resource synchronization table. The resource attribute information stored in the resource synchronization table may only include the resource identifier and resource version number, or it may also include the resource type. The synchronization status includes pending synchronization, synchronized, expired, and synchronization failed.
[0093] For example, such as Figure 3As shown, assuming the regional cloud has two types of resources that need to be synchronized, namely RSU and RCU, the regional cloud adds a resource loading service for each type of resource, namely Resource Loading Service 1 and Resource Loading Service 2. The resource loading service retrieves the original data and resource attribute information of the updated resource from the resource storage space of the corresponding type of resource (e.g., RSU type resources are stored in the rsu_base_info table of the MySQL database, and RCU type resources are stored in the rcu_base_info table of the MySQL database) based on the last loading time of the resource of the corresponding resource type in the resource control table, and writes the original data and resource attribute information of the updated resource into the resource update table. At the same time, it adds a record to be synchronized for each edge cloud to be synchronized in the resource synchronization table, and updates the last loading time of the corresponding resource type in the resource control table.
[0094] S120: The resource synchronization service in the regional cloud sends the original data of the updated resource loaded by the resource loading service and the resource attribute information of the updated resource to the edge cloud corresponding to the edge cloud identifier, according to the edge cloud identifier of the edge cloud to be synchronized, so that the edge cloud can call the resource receiving processor corresponding to the resource attribute information of the updated resource to synchronize the original data of the updated resource to the edge cloud.
[0095] The resource receiving processor is a processor that stores resources according to the resource storage method corresponding to the resource attribute information. Different resource receiving processors are used to process updated resources of different resource types. In the regional cloud, independent resource synchronization services can be set up for different edge clouds, making resource synchronization between different edge clouds independent of each other. When an edge cloud is unable to receive resource synchronization or processes it slowly due to network failure or other reasons, it will not affect the resource synchronization of other edge clouds. After the resource loading service loads the updated resources into the resource update table, the resource synchronization service can send the original data of the updated resources in the resource update table and the resource attribute information of the updated resources to the edge cloud corresponding to the edge cloud identifier, based on the edge cloud identifier of the edge cloud to be synchronized.
[0096] like Figure 2As shown, when the resource loading service stores the resource synchronization task in the resource synchronization table, the specific implementation of the resource synchronization service sending the original data of the updated resource in the resource update table and the resource attribute information of the updated resource to the edge cloud corresponding to the edge cloud identifier according to the edge cloud identifier of the edge cloud to be synchronized includes: the resource synchronization service obtaining the resource update table and the resource synchronization table; if the synchronization status corresponding to the edge cloud identifier in the resource synchronization table includes "pending synchronization", then the resource synchronization service matches the resource attribute information of the resource to be synchronized corresponding to the synchronization status of "pending synchronization" with the resource attribute information of the updated resource in the resource update table; if the match is successful, then the resource synchronization service sends the resource attribute information of the successfully matched updated resource and the original data of the updated resource corresponding to the resource attribute information of the successfully matched updated resource to the edge cloud corresponding to the edge cloud identifier according to the edge cloud identifier of the edge cloud to be synchronized.
[0097] A successful match means that the resource attribute information in the resource update table is the same as the resource attribute information in the resource synchronization table. A failed match occurs when the resource identifier and resource type are the same in the two resource attribute information entries, but the resource version number is different. This indicates that the resource update table and the resource synchronization table are not synchronized for the same resource update. Therefore, the corresponding synchronization status in the resource synchronization table can be changed to "expired".
[0098] Optionally, the resource synchronization service receives response information sent by the edge cloud indicating that resource synchronization is complete; the resource synchronization service updates the synchronization status of the completed resource synchronization in the resource synchronization table to "synchronized".
[0099] If an exception occurs during the resource synchronization service, such as a network failure, retries should be performed at regular intervals until successful. If the edge cloud returns an error, the error type needs to be identified. If it is a reentrant error (e.g., system busy), retries should also be performed at regular intervals. If it is a non-reentrant error, it may be due to resource data errors; in this case, the synchronization status in the resource synchronization table should be updated to "synchronization failed," and no further retries should be performed. All of the above exceptions can generate alarms, and manual intervention is required when necessary.
[0100] It should be added that, similar to the resource loading service, different resource synchronization services can be deployed on different servers or on the same server. The specific number of resource synchronization services that need to be deployed on one server depends on the actual needs.
[0101] The resource synchronization method provided in this invention allows different resource loading services in a regional cloud to load the original data and resource attribute information of updated resources of different resource types. The resource synchronization service then sends the loaded original data and resource attribute information of the updated resources to the edge cloud. The edge cloud then calls the resource receiving processor corresponding to the resource attribute information of the updated resources to store the original data of the updated resources according to the resource storage method corresponding to the resource attribute information of the updated resources. This eliminates the need to add additional peer storage nodes and resource loading programs, thereby saving the construction cost of the cloud control platform.
[0102] Based on the above method embodiments, another embodiment of the present invention also provides a resource synchronization method, such as... Figure 4 As shown, the method is applied to edge clouds, and the method includes:
[0103] S200: Obtain the original data of the updated resources sent by the regional cloud and the resource attribute information of the updated resources.
[0104] The original data of the updated resource and the resource attribute information of the updated resource are related information of the updated resource generated after the last loading time of the resource type in the resource control table, which is loaded from the resource storage space of the regional cloud by the resource loading service in the regional cloud and sent by the resource synchronization service. The resource control table includes the resource type and the last loading time of the resource corresponding to the resource type. The resource attribute information includes the resource type, resource version number and resource identifier.
[0105] Specifically, multiple resource receiving services can be deployed in the edge cloud, and load balancing technology can be used to achieve load balancing among these services. That is, the load balancing service in the edge cloud receives the raw data of updated resources and the resource attribute information of the updated resources sent by the regional cloud; the load balancing service selects a target resource receiving service according to a load balancing strategy, and sends the raw data and resource attribute information of the updated resources to the target resource receiving service. Different resource receiving services can be deployed on different servers or on the same server; the specific number of resource receiving services deployed on a single server depends on actual needs.
[0106] S210: Invoke the resource receiving processor corresponding to the resource attribute information of the updated resource, so that the resource receiving processor stores the original data of the updated resource according to the resource storage method corresponding to the resource attribute information of the updated resource.
[0107] Specifically, after the load balancing service sends the original data and resource attribute information of the updated resource to the target resource receiving service, the target resource receiving service can call the resource receiving processor corresponding to the resource attribute information of the updated resource to store the original data. For example, if an RSU type updated resource needs to be saved to both a MongoDB database and a Redis database, the processing method of the RSU type resource receiving processor can be customized as needed, and the basic information of the resource receiving processor can be registered with the resource receiving service.
[0108] The resource synchronization method provided in this invention allows different resource loading services in a regional cloud to load the original data and resource attribute information of updated resources of different resource types. The resource synchronization service then sends the loaded original data and resource attribute information of the updated resources to the edge cloud. The edge cloud then calls the resource receiving processor corresponding to the resource attribute information of the updated resources to store the original data of the updated resources according to the resource storage method corresponding to the resource attribute information of the updated resources. This eliminates the need to add additional peer storage nodes and resource loading programs, thereby saving the construction cost of the cloud control platform.
[0109] Based on a method embodiment applied to a regional cloud, this embodiment of the invention provides a resource synchronization apparatus, which is applied to a regional cloud, such as... Figure 5 As shown, the device includes:
[0110] The resource loading unit 30 is used to obtain the last loading time of the resource of the corresponding resource type from the resource loading service in the regional cloud. Different resource loading services are used to load resources of different resource types. The resource control table includes resource types and the last loading time of the resource corresponding to the resource type. The unit loads the original data of the updated resource generated after the last loading time of the resource from the resource storage space corresponding to the resource type and the resource attribute information of the updated resource. The resource attribute information includes resource type, resource version number and resource identifier.
[0111] The resource synchronization unit 32 is used by the resource synchronization service in the regional cloud to send the original data of the updated resource loaded by the resource loading service and the resource attribute information of the updated resource to the edge cloud corresponding to the edge cloud identifier, according to the edge cloud identifier of the edge cloud to be synchronized. This allows the edge cloud to call the resource receiving processor corresponding to the resource attribute information of the updated resource to synchronize the original data of the updated resource to the edge cloud. The resource receiving processor is a processor that stores resources according to the resource storage method corresponding to the resource attribute information.
[0112] Optionally, the resource loading unit 30 includes:
[0113] The first acquisition module is used to acquire a preset resource update table from the resource loading service, wherein the resource update table includes the original data of the updated resource and the resource attribute information of the updated resource;
[0114] An addition module is provided to add the original data of the updated resource generated after the last loading time and the resource attribute information of the updated resource obtained from the resource storage space corresponding to the resource type to the resource update table if there is no updated resource in the resource update table that is identical to the target resource type and the target resource identifier. The target resource type and the target resource identifier are respectively the resource type and resource identifier in the resource attribute information of the updated resource generated after the last loading time.
[0115] The replacement module is used to replace the original data and resource version number in the resource update table with the original data and resource version number in the resource attribute information of the updated resource, respectively, according to the target resource type and the target resource identifier, if there is an updated resource in the resource update table that is the same as the target resource type and the target resource identifier.
[0116] The resource synchronization unit 32 is used by the resource synchronization service to send the original data of the updated resource in the resource update table and the resource attribute information of the updated resource to the edge cloud corresponding to the edge cloud identifier, based on the edge cloud identifier of the edge cloud to be synchronized.
[0117] Optionally, the resource loading unit 30 further includes:
[0118] The synchronization table update module is used to, after updating the resource update table, determine the resource attribute information of the updated resource as the resource attribute information to be synchronized by the resource loading service, and add the edge cloud identifier of the edge cloud to be synchronized, the resource attribute information to be synchronized, and the synchronization status association to the resource synchronization table. The resource synchronization table includes a mapping relationship between the edge cloud identifier, the resource attribute information to be synchronized, and the synchronization status of the resource to be synchronized.
[0119] Optionally, the resource synchronization unit 32 includes:
[0120] The second acquisition module is used to acquire the resource update table and the resource synchronization table from the resource synchronization service;
[0121] The matching module is used to match the resource attribute information of the resource to be synchronized when the synchronization status corresponding to the edge cloud identifier in the resource synchronization table includes pending synchronization with the resource attribute information of the updated resource in the resource update table if the synchronization status is pending synchronization.
[0122] The sending module is configured to, if a match is successful, send the resource attribute information of the successfully matched updated resource and the original data of the updated resource corresponding to the resource attribute information to the edge cloud corresponding to the edge cloud identifier, according to the edge cloud identifier of the edge cloud to be synchronized.
[0123] Optionally, the resource loading unit 30 further includes:
[0124] The control table update module is used to update the last loading time of resources in the resource control table after the resource update table is updated.
[0125] Optionally, the device further includes:
[0126] A receiving unit is configured to receive response information sent by the edge cloud, indicating the completion of resource synchronization, from the resource synchronization service.
[0127] The synchronization table update unit is used by the resource synchronization service to update the synchronization status of the completed resource synchronization in the resource synchronization table to "synchronized".
[0128] Based on method embodiments applied to edge cloud, this embodiment of the invention provides a resource synchronization apparatus, which is applied to edge cloud, such as... Figure 6 As shown, the device includes:
[0129] The acquisition unit 40 is used to acquire the original data of the updated resources sent by the regional cloud and the resource attribute information of the updated resources. The original data of the updated resources and the resource attribute information of the updated resources are related information of the updated resources generated after the last loading time of the corresponding resource type in the resource control table, which is loaded from the resource storage space of the regional cloud by the resource loading service in the regional cloud and sent by the resource synchronization service. The resource control table includes the resource type and the last loading time of the resource corresponding to the resource type. The resource attribute information includes the resource type, resource version number and resource identifier.
[0130] Calling unit 42 is used to call the resource receiving processor corresponding to the resource attribute information of the updated resource;
[0131] Storage unit 44 is used by the resource receiving processor to store the original data of the updated resource according to the resource storage method corresponding to the resource attribute information of the updated resource.
[0132] Optionally, the acquisition unit 40 includes:
[0133] The receiving module is used for the load balancing service in the edge cloud to receive the original data of the updated resources and the resource attribute information of the updated resources sent by the regional cloud;
[0134] The selection module is used by the load balancing service to select a target resource receiving service according to the load balancing strategy.
[0135] The sending module is used to send the original data of the updated resource and the resource attribute information of the updated resource to the target resource receiving service by the load balancing service;
[0136] The calling unit 42 is used by the target resource receiving service to call the resource receiving processor corresponding to the resource attribute information of the updated resource.
[0137] Based on the above method embodiments, another embodiment of the present invention provides a storage medium storing executable instructions that, when executed by a processor, enable the processor to implement a method for resource synchronization, such as that applied to a regional cloud or a method for resource synchronization applied to an edge cloud.
[0138] Based on the above method embodiments, another embodiment of the present invention provides an electronic device, the electronic device comprising:
[0139] One or more processors;
[0140] Storage device for storing one or more programs.
[0141] When the one or more programs are executed by the one or more processors, the one or more processors implement a method for resource synchronization, such as that applied to a regional cloud or a method applied to an edge cloud.
[0142] Based on the above method embodiments, another embodiment of the present invention provides a resource synchronization system, the system including a regional cloud and at least one edge cloud;
[0143] The regional cloud is used to obtain the edge cloud identifier of the edge cloud to be synchronized, the original data of the updated resources to be synchronized to the edge cloud, and the resource attribute information of the updated resources; and to send the original data of the updated resources and the resource attribute information of the updated resources to the edge cloud corresponding to the edge cloud identifier.
[0144] The edge cloud is used to acquire the original data of the updated resources sent by the regional cloud and the resource attribute information of the updated resources; and to call the resource receiving processor corresponding to the resource attribute information of the updated resources so that the resource receiving processor stores the original data of the updated resources according to the resource storage method corresponding to the resource attribute information of the updated resources.
[0145] The above system and device embodiments correspond to the method embodiments and have the same technical effects. For detailed descriptions, please refer to the method embodiments. The device embodiments are derived based on the method embodiments; detailed descriptions can be found in the method embodiments section, and will not be repeated here. Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of one embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing the present invention.
[0146] Those skilled in the art will understand that the modules in the apparatus of the embodiments can be distributed in the apparatus of the embodiments as described in the embodiments, or they can be located in one or more devices different from this embodiment with corresponding changes. The modules of the above embodiments can be combined into one module, or they can be further divided into multiple sub-modules.
[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for resource synchronization, characterized in that, The method is applied to a regional cloud, and the method includes: The resource loading service in the regional cloud obtains the last loading time of the resource type corresponding to the resource control table. Different resource loading services are used to load resources of different resource types. The resource control table includes the resource type and the last loading time of the resource corresponding to the resource type. The resource loading service loads the original data of the updated resource and the resource attribute information of the updated resource generated after the last loading time of the resource from the resource storage space corresponding to the resource type. The resource attribute information includes resource type, resource version number and resource identifier. The resource synchronization service in the regional cloud sends the original data of the updated resource loaded by the resource loading service and the resource attribute information of the updated resource to the edge cloud corresponding to the edge cloud identifier, based on the edge cloud identifier of the edge cloud to be synchronized. This allows the edge cloud to call the resource receiving processor corresponding to the resource attribute information of the updated resource to synchronize the original data of the updated resource to the edge cloud. The resource receiving processor is a processor that stores resources according to the resource storage method corresponding to the resource attribute information. Independent resource synchronization services are set up for different edge clouds in the regional cloud, so that the resource synchronization of different edge clouds is independent of each other.
2. The method as described in claim 1, characterized in that, The resource loading service loads the original data of the updated resource and the resource attribute information of the updated resource generated after the last loading time of the resource from the resource storage space corresponding to the resource type, including: The resource loading service obtains a preset resource update table, wherein the resource update table includes the original data of the updated resource and the resource attribute information of the updated resource; If there is no updated resource in the resource update table that is identical to the target resource type and the target resource identifier, the resource loading service will add the original data of the updated resource generated after the last loading time and the resource attribute information of the updated resource obtained from the resource storage space corresponding to the resource type to the resource update table. The target resource type and the target resource identifier are respectively the resource type and resource identifier in the resource attribute information of the updated resource generated after the last loading time. If there is an updated resource in the resource update table that is identical to the target resource type and the target resource identifier, then the resource loading service replaces the corresponding original data and resource version number in the resource update table with the original data and resource version number in the resource attribute information of the updated resource, respectively, according to the target resource type and the target resource identifier. The resource synchronization service in the regional cloud sends the original data of the updated resource loaded by the resource loading service and the resource attribute information of the updated resource to the edge cloud corresponding to the edge cloud identifier, based on the edge cloud identifier of the edge cloud to be synchronized. This includes: The resource synchronization service sends the original data of the updated resource in the resource update table and the resource attribute information of the updated resource to the edge cloud corresponding to the edge cloud identifier, based on the edge cloud identifier of the edge cloud to be synchronized.
3. The method as described in claim 2, characterized in that, The method further includes: After updating the resource update table, the resource loading service determines the resource attribute information of the updated resource as the resource attribute information to be synchronized, and adds the edge cloud identifier of the edge cloud to be synchronized, the resource attribute information to be synchronized, and the synchronization status association to the resource synchronization table. The resource synchronization table includes a mapping relationship between the edge cloud identifier, the resource attribute information of the resource to be synchronized, and the synchronization status of the resource to be synchronized.
4. The method as described in claim 3, characterized in that, The resource synchronization service, based on the edge cloud identifier of the edge cloud to be synchronized, sends the original data of the updated resource in the resource update table and the resource attribute information of the updated resource to the edge cloud corresponding to the edge cloud identifier, including: The resource synchronization service obtains the resource update table and the resource synchronization table; If the synchronization status corresponding to the edge cloud identifier in the resource synchronization table includes "to be synchronized", then the resource synchronization service will match the resource attribute information of the resource to be synchronized when the synchronization status is "to be synchronized" with the resource attribute information of the updated resource in the resource update table. If a match is successful, the resource synchronization service will send the resource attribute information of the successfully matched updated resource and the original data of the updated resource corresponding to the resource attribute information to the edge cloud to be synchronized, based on the edge cloud identifier of the edge cloud to be synchronized.
5. The method as described in claim 2, characterized in that, The method further includes: After updating the resource update table, the resource loading service updates the last loaded time of the resources in the resource control table.
6. The method according to any one of claims 3-5, characterized in that, The method further includes: The resource synchronization service receives response information sent by the edge cloud, indicating that resource synchronization is complete; The resource synchronization service updates the synchronization status of resources that have completed synchronization in the resource synchronization table to "synchronized".
7. A method for resource synchronization, characterized in that, The method is applied to edge clouds, and the method includes: The system acquires the original data of the updated resources sent by the regional cloud and the resource attribute information of the updated resources. The original data and resource attribute information of the updated resources are related information of the updated resources generated after the last loading time of the corresponding resource type in the resource control table, loaded from the resource storage space of the regional cloud by the resource loading service and sent by the resource synchronization service. Different resource loading services are used to load resources of different resource types. The resource control table includes the resource type and the last loading time of the resource corresponding to the resource type. The resource attribute information includes the resource type, resource version number, and resource identifier. Independent resource synchronization services are set up for different edge clouds in the regional cloud, making the resource synchronization of different edge clouds independent of each other. The resource receiving processor corresponding to the resource attribute information of the updated resource is invoked, so that the resource receiving processor stores the original data of the updated resource according to the resource storage method corresponding to the resource attribute information of the updated resource.
8. The method as described in claim 7, characterized in that, Obtain the raw data of the updated resources sent by the regional cloud and the resource attribute information of the updated resources, including: The load balancing service in the edge cloud receives the original data of the updated resources and the resource attribute information of the updated resources sent by the regional cloud; The load balancing service selects a target resource receiving service according to the load balancing strategy, and sends the original data of the updated resource and the resource attribute information of the updated resource to the target resource receiving service. Invoking the resource receiving processor corresponding to the resource attribute information of the updated resource includes: The target resource receiving service invokes the resource receiving processor corresponding to the resource attribute information of the updated resource.
9. A resource synchronization device, characterized in that, The device is applied to a regional cloud, and the device includes: The resource loading unit is used to obtain the last loading time of the resource corresponding to the resource type from the resource loading service in the regional cloud. Different resource loading services are used to load resources of different resource types. The resource control table includes resource types and the last loading time of the resource corresponding to the resource type. The unit loads the original data of the updated resource generated after the last loading time of the resource from the resource storage space corresponding to the resource type and the resource attribute information of the updated resource. The resource attribute information includes resource type, resource version number and resource identifier. The resource synchronization unit is used by the resource synchronization service in the regional cloud to send the original data of the updated resource loaded by the resource loading service and the resource attribute information of the updated resource to the edge cloud corresponding to the edge cloud identifier, based on the edge cloud identifier of the edge cloud to be synchronized. This allows the edge cloud to call the resource receiving processor corresponding to the resource attribute information of the updated resource to synchronize the original data of the updated resource to the edge cloud. The resource receiving processor is a processor that stores resources according to the resource storage method corresponding to the resource attribute information. Independent resource synchronization services are set up for different edge clouds in the regional cloud, so that the resource synchronization of different edge clouds is independent of each other.
10. A resource synchronization device, characterized in that, The device is applied to edge clouds, and the device includes: The acquisition unit is used to acquire the original data of the updated resources sent by the regional cloud and the resource attribute information of the updated resources. The original data and resource attribute information of the updated resources are related information of the updated resources generated after the last loading time of the corresponding resource type in the resource control table, which is loaded from the resource storage space of the regional cloud by the resource loading service in the regional cloud and sent by the resource synchronization service. Different resource loading services are used to load resources of different resource types. The resource control table includes the resource type and the last loading time of the resource corresponding to the resource type. The resource attribute information includes the resource type, resource version number and resource identifier. Independent resource synchronization services are set for different edge clouds in the regional cloud so that the resource synchronization of different edge clouds is independent of each other. The calling unit is used to call the resource receiving processor corresponding to the resource attribute information of the updated resource; The storage unit is used by the resource receiving processor to store the original data of the updated resource according to the resource storage method corresponding to the resource attribute information of the updated resource.