Search

CN-116069486-B - Resource synchronization method and device

CN116069486BCN 116069486 BCN116069486 BCN 116069486BCN-116069486-B

Abstract

The invention discloses a resource synchronization method and device, the method comprises the steps that resource loading service in regional cloud obtains the last loading time of resources corresponding to resource types in a resource control table, different resource loading services are used for loading the resources of different resource types, the resource loading service loads original data of updated resources and resource attribute information of the updated resources, which are generated after the last loading time of the resources, from a resource storage space corresponding to the resource types, the resource synchronization service in regional cloud sends the original data of the updated resources and the resource attribute information of the updated resources to an edge cloud corresponding to an edge cloud identifier according to an edge cloud identifier of the edge cloud to be synchronized, so that the edge cloud calls a resource receiving processor corresponding to the resource attribute information of the updated resources, and the resource receiving processor synchronizes the original data of the updated resources to the edge cloud, and is a processor for storing the resources according to a resource storage mode corresponding to the resource attribute information.

Inventors

  • CUI HONGQING
  • XUAN ZHIYUAN
  • LI HAIFENG
  • HU TENGFEI
  • CHEN CHEN

Assignees

  • 云控智行科技有限公司

Dates

Publication Date
20260512
Application Date
20211029

Claims (10)

  1. 1. A method of resource synchronization, the method being applied to a regional cloud, the method comprising: the resource loading service in the regional cloud obtains the resource last loading time of the corresponding resource type in a resource control table, wherein different resource loading services are used for loading the resources of different resource types, and the resource control table comprises the resource type and the resource last loading time corresponding to the resource type; The resource loading service loads original data of updated resources and resource attribute information of the updated resources, which are generated after the last loading time of the resources, from a resource storage space corresponding to the resource type, wherein the resource attribute information comprises the resource type, the resource version number and the resource identifier; The resource synchronization service in the regional cloud sends the original data of the updated resource and the resource attribute information of the updated resource loaded by the resource loading service to the marginal cloud corresponding to the marginal cloud identifier according to the marginal cloud identifier of the marginal cloud to be synchronized, so that the marginal cloud calls a resource receiving processor corresponding to the resource attribute information of the updated resource to synchronize the original data of the updated resource to the marginal cloud, wherein the resource receiving processor is a processor for storing resources according to a resource storage mode corresponding to the resource attribute information, and independent resource synchronization services are set for different marginal clouds in the regional cloud, so that the resource synchronization of different marginal clouds is mutually independent.
  2. 2. The method of claim 1, wherein the resource loading service loads, from the resource storage space corresponding to the resource type, 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, comprising: the resource loading service acquires a preset resource updating table, wherein the resource updating table comprises original data of updated resources and resource attribute information of the updated resources; If the resource update table does not have the updated resources which are the same as the target resource type and the target resource identifier, the resource loading service adds the original data of the updated resources and the resource attribute information of the updated resources, which are generated after the last loading time and are acquired from the resource storage space corresponding to the resource type, into the resource update table, wherein the target resource type and the target resource identifier are the resource type and the resource identifier in the resource attribute information of the updated resources, which are generated after the last loading time; If the resource update table contains updated resources which are the same as the target resource type and the target resource identifier, the resource loading service respectively replaces the corresponding original data and resource version numbers in the resource update table with the original data of the updated resources and the resource version numbers in the resource attribute information of the updated resources 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 and the resource attribute information of the updated resource loaded by the resource loading service to the edge cloud corresponding to the edge cloud identifier according to the edge cloud identifier of the edge cloud to be synchronized, and the method comprises the following steps: And the resource synchronization service sends the original data of the updated resources and the resource attribute information of the updated resources in the resource update table to the edge cloud corresponding to the edge cloud identifier according to the edge cloud identifier of the edge cloud to be synchronized.
  3. 3. The method of claim 2, wherein the method further comprises: after updating the resource updating table, the resource loading service determines the resource attribute information of the updated resource as resource attribute information to be synchronized, and adds the edge cloud identification of the edge cloud to be synchronized, the resource attribute information to be synchronized and the synchronization state association into a resource synchronization table, wherein the resource synchronization table comprises a mapping relationship among the edge cloud identification, the resource attribute information of the resource to be synchronized and the synchronization state of the resource to be synchronized.
  4. 4. The method of claim 3, wherein the resource synchronization service sends the original data of the updated resource and the resource attribute information of the updated resource in the resource update table to the edge cloud corresponding to the edge cloud identifier according to the edge cloud identifier of the edge cloud to be synchronized, including: the resource synchronization service acquires the resource update table and the resource synchronization table; if the synchronization state corresponding to the edge cloud identification in the resource synchronization table comprises to-be-synchronized, the resource synchronization service matches the resource attribute information of the to-be-synchronized resource corresponding to the synchronization state to the to-be-synchronized resource with the resource attribute information of the updated resource in the resource update table; And if the matching is successful, the resource synchronization service sends the resource attribute information of the updated resource which is successfully matched and the original data of the updated resource corresponding to the resource attribute information of the updated resource which is successfully matched to the edge cloud corresponding to the edge cloud identifier according to the edge cloud identifier of the edge cloud to be synchronized.
  5. 5. The method of claim 2, wherein the method further comprises: After updating the resource update table, the resource loading service updates the last loading time of the resource in the resource control table.
  6. 6. The method of any one of claims 3-5, wherein the method further comprises: the resource synchronization service receives response information sent by the edge cloud and used for indicating that the resource synchronization is completed; and the resource synchronization service updates the synchronization state of the resource synchronization in the resource synchronization table to be synchronized.
  7. 7. A method of resource synchronization, the method being applied to an edge cloud, the method comprising: Acquiring original data of updated resources and resource attribute information of the updated resources, which are sent by an area cloud, wherein the original data of the updated resources and the resource attribute information of the updated resources are related information of the updated resources, which is generated after resource loading service in the area cloud is loaded from a resource storage space of the area cloud and sent by resource synchronization service and corresponds to resource last loading time of a resource type in a resource control table, different resource loading services are used for loading resources of different resource types, the resource control table comprises the resource type and the resource last loading time corresponding to the resource type, the resource attribute information comprises the resource type, the resource version number and the resource identifier, and independent resource synchronization services are set for different edge clouds in the area cloud, so that the resource synchronization of the different edge clouds is mutually independent; And calling a 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 a resource storage mode corresponding to the resource attribute information of the updated resource.
  8. 8. The method of claim 7, wherein obtaining the original data of the updated resource and the resource attribute information of the updated resource sent by the regional cloud comprises: The load balancing service in the edge cloud receives the original data of the updated resources sent by the regional cloud and the resource attribute information of the updated resources; the load balancing service selects a target resource receiving service according to a 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 a resource receiving processor corresponding to the resource attribute information of the updated resource, comprising: The target resource receiving service invokes a resource receiving processor corresponding to the resource attribute information of the updated resource.
  9. 9. An apparatus for resource synchronization, wherein the apparatus is applied to an area cloud, the apparatus comprising: a resource loading unit, configured to obtain, by a resource loading service in the regional cloud, a resource last loading time of a corresponding resource type in a resource control table, where different resource loading services are used to load resources of different resource types, the resource control table includes a resource type and a resource last loading time corresponding to the resource type, and load, from a resource storage space corresponding to the resource type, original data of an updated resource and resource attribute information of the updated resource, where the resource attribute information includes a resource type, a resource version number, and a resource identifier, the original data of the updated resource being generated after the resource last loading time; The resource synchronization unit is used for sending the original data of the updated resource and the resource attribute information of the updated resource loaded by the resource loading service to the edge cloud corresponding to the edge cloud identifier by the resource synchronization service in the area cloud according to the edge cloud identifier of the edge cloud to be synchronized, so that the edge cloud calls a 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, wherein the resource receiving processor is a processor for storing resources according to a resource storage mode corresponding to the resource attribute information, and independent resource synchronization services are set for different edge clouds in the area cloud to enable the resource synchronization of different edge clouds to be mutually independent.
  10. 10. An apparatus for resource synchronization, wherein the apparatus is applied to an edge cloud, the apparatus comprising: The resource control system comprises an acquisition unit, a resource control table and a resource control unit, wherein the acquisition unit is used for acquiring original data of updated resources sent by an area cloud and 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 which are generated after resource last loading time of corresponding resource types in the resource control table is carried out, the related information is sent by resource synchronization service and is loaded from a resource storage space of the area cloud, the resource last loading time of the corresponding resource types in the resource control table is carried out, different resource loading services are used for loading resources of different resource types, the resource control table comprises the resource types and the resource last loading time corresponding to the resource types, the resource attribute information comprises the resource types, the resource version numbers and the resource identifiers, and independent resource synchronization services are set for different edge clouds in the area cloud, so that the resource synchronization of the different edge clouds are mutually independent; A calling unit, configured to call a resource receiving processor corresponding to the resource attribute information of the updated resource; and the storage unit is used for storing the original data of the updated resource according to a resource storage mode corresponding to the resource attribute information of the updated resource by the resource receiving processor.

Description

Resource synchronization method and device Technical Field The invention relates to the technical field of Internet, in particular to a method and a device for synchronizing resources. Background The cloud control platform generally adopts a multi-stage architecture and consists of one set of regional cloud and a plurality of sets of edge clouds. The regional cloud and the edge cloud are located in different network environments, and data transmission is performed through a wide area network or a private line. The regional cloud is used for managing devices in a preset region and data generated by the devices, and the edge cloud is used for carrying out relevant calculation on the data uploaded by the nearby devices, wherein the devices and the data are called resources in the cloud control platform. For example, in the field of autopilot, including devices such as an autopilot vehicle, an RSU (Road Side Unit), a Road Side collaboration Unit, and the like, when new data is obtained, the devices may connect the edge cloud nearby according to a geographic area, and upload the new data to the edge cloud for calculation, and the area cloud provides a management platform, so that the devices and the data may be managed. Because of different usage manners of the resources, the resources may have different storage manners in the regional cloud and the edge cloud. If the information of the RSU is provided with the deletion and correction service in the regional cloud, the data can be stored in the mysql database, and if the edge cloud is more than the edge cloud, the edge cloud finds the RSU needing to issue the event through the coordinate point and the influence range of the event, and sends the event to the RSU, so that the information of the RSU is generally stored in the mongdb database, a spatial index is created for the position of the RSU, and the RSU is quickly searched through the spatial index. At present, when the storage modes of regional cloud and edge cloud resources are different, the method for realizing the synchronization of regional cloud and edge cloud resources comprises the steps of adding storage nodes which are equivalent to the storage modes of regional cloud resources at the edge cloud, when the regional cloud resources are updated, loading resources to be synchronized from the regional cloud by using a resource loading program, synchronizing the loaded resources to be synchronized from the regional cloud to the peer storage nodes of the edge cloud, adding the resource loading program, loading the resources from the peer storage nodes of the edge cloud, and storing the loaded resources by using the resource storage modes of the corresponding resources in the edge cloud. However, when the edge cloud corresponding to the regional cloud is more, the peer storage nodes and resource loading programs which need to be added are also increased, so that the construction cost of the cloud control platform is greatly increased. Disclosure of Invention The invention provides a resource synchronization method and a resource synchronization device, which can directly synchronize the resources updated by an area cloud to an edge cloud without adding a peer-to-peer storage node and an additional resource loading program, thereby saving the construction cost of a cloud control platform. The specific technical scheme is as follows: In a first aspect, an embodiment of the present invention provides a method for resource synchronization, where the method is applied to an area cloud, and the method includes: the resource loading service in the regional cloud obtains the resource last loading time of the corresponding resource type in a resource control table, wherein different resource loading services are used for loading the resources of different resource types, and the resource control table comprises the resource type and the resource last loading time corresponding to the resource type; The resource loading service loads original data of updated resources and resource attribute information of the updated resources, which are generated after the last loading time of the resources, from a resource storage space corresponding to the resource type, wherein the resource attribute information comprises the resource type, the resource version number and the resource identifier; And the resource synchronization service in the regional cloud sends the original data of the updated resource and the resource attribute information of the updated resource loaded by the resource loading service 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 calls a resource receiving processor corresponding to the resource attribute information of the updated resource and synchronizes the original data of the updated resource to the edge cloud, wherein the resource receiving processor is a processor for storing resources a