CN111092956A - Resource synchronization method, device, storage medium and equipment - Google Patents

Resource synchronization method, device, storage medium and equipment Download PDF

Info

Publication number
CN111092956A
CN111092956A CN201911356505.0A CN201911356505A CN111092956A CN 111092956 A CN111092956 A CN 111092956A CN 201911356505 A CN201911356505 A CN 201911356505A CN 111092956 A CN111092956 A CN 111092956A
Authority
CN
China
Prior art keywords
resource
internet
things
equipment
resources
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911356505.0A
Other languages
Chinese (zh)
Inventor
杨帆
许斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Zhenshi Intelligent Technology Co Ltd
Original Assignee
Nanjing Zhenshi Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Zhenshi Intelligent Technology Co Ltd filed Critical Nanjing Zhenshi Intelligent Technology Co Ltd
Priority to CN201911356505.0A priority Critical patent/CN111092956A/en
Publication of CN111092956A publication Critical patent/CN111092956A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a resource synchronization method, a resource synchronization device, a storage medium and equipment, and belongs to the technical field of Internet of things. The method is used in a first internet of things device and comprises the following steps: starting the first internet of things device; determining resources to be synchronized; and acquiring the resource from a second networking device storing the resource in the Internet of things, wherein the resource is provided by a cloud device in the Internet of things. According to the embodiment of the application, when the first Internet of things equipment is subjected to resource synchronization, the load of the cloud equipment and the time delay of the resource synchronization are reduced, the cloud equipment is prevented from being crashed, the accessibility of resources is improved, and the cooperation among nodes in the Internet of things can be enhanced, so that the high-cohesion purpose of the Internet of things is achieved.

Description

Resource synchronization method, device, storage medium and equipment
Technical Field
The embodiment of the application relates to the technical field of internet of things, in particular to a resource synchronization method, a resource synchronization device, a storage medium and equipment.
Background
The Internet of things comprises cloud equipment and massive Internet of things equipment, and the Internet of things equipment can perform resource synchronization with the cloud equipment.
In the related art, the internet of things equipment can send a resource acquisition request to the cloud end equipment after being started, and the cloud end equipment sends resources to the internet of things equipment according to the resource acquisition request; or the cloud device may actively send the resource to each cloud device after acquiring the resource.
Since the resources are stored in the cloud device, the cloud device needs to send the resources to each internet of things device, which causes a large load on the cloud device and a large delay in resource synchronization.
Disclosure of Invention
The embodiment of the application provides a resource synchronization method, a resource synchronization device, a storage medium and a resource synchronization device, which are used for solving the problems that when the cloud device and the internet of things device perform resource synchronization, the load of the cloud device is large and the time delay of the resource synchronization is large. The technical scheme is as follows:
in one aspect, a resource synchronization method is provided, and is used in a first internet of things device, where the method includes:
starting the first internet of things device;
determining resources to be synchronized;
and acquiring the resource from a second networking device storing the resource in the Internet of things, wherein the resource is provided by a cloud device in the Internet of things.
In one aspect, a resource synchronization apparatus is provided, where the apparatus is used in a first internet of things device, and the apparatus includes:
the starting module is used for starting the first internet of things device;
a determining module, configured to determine a resource to be synchronized;
the synchronization module is used for acquiring the resources from a second internet of things device in which the resources are stored, and the resources are provided by cloud end devices in the internet of things.
In one aspect, there is provided a computer readable storage medium having stored therein at least one instruction, at least one program, set of codes, or set of instructions that is loaded and executed by a processor to implement a resource synchronization method as described above.
In one aspect, an internet of things device is provided, which includes a processor and a memory, where at least one instruction is stored in the memory, and the instruction is loaded and executed by the processor to implement the resource synchronization method described above.
The technical scheme provided by the embodiment of the application has the beneficial effects that at least:
after the first internet of things device is started, if the first internet of things device needs to perform resource synchronization, the resource to be synchronized can be determined first, and then the resource is acquired from the second internet of things device in which the resource is stored, so that the first internet of things device can only acquire the resource from the second internet of things device which already acquires the resource provided by the cloud end device in the internet of things, and does not need to acquire the resource from the cloud end device, the dependence on the cloud end device can be reduced, the load of the cloud end device can be reduced, the problem that the cloud end device is crashed due to the fact that the cloud end device has a large memory leakage because the load of the cloud end device is large can be avoided, the problem that the resource synchronization delay is large or the resource cannot be reached because the cloud end device has a large load can be avoided, and the effect of avoiding the cloud end device crash and reducing the resource synchronization delay can be achieved, the accessibility of resources is improved. In addition, because the first internet of things device can acquire resources from the second internet of things device, the cooperation between nodes in the internet of things can be enhanced, and the purpose of high cohesion of the internet of things is achieved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart of a method for resource synchronization according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for resource synchronization according to another embodiment of the present application;
FIG. 3 is a flowchart illustrating a resource synchronization method according to another embodiment of the present application;
fig. 4 is a block diagram of a resource synchronization apparatus according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present application more clear, the embodiments of the present application will be further described in detail with reference to the accompanying drawings.
The following explains an application scenario of the present application.
The application is applied to an application scene of resource synchronization of the Internet of things equipment. The Internet of things comprises cloud equipment and Internet of things equipment, connection is established between the cloud equipment and the Internet of things equipment, connection is established between the Internet of things equipment and the Internet of things equipment, and the cloud equipment can provide resources for the Internet of things equipment. The resources referred to herein are data in nature.
Referring to fig. 1, a flowchart of a resource synchronization method provided in an embodiment of the present application is shown, where the resource synchronization method may be applied to a first internet of things device. The resource synchronization method may include:
step 101, starting a first internet of things device.
After the first Internet of Things device is activated, the first Internet of Things device may access the Internet of Things (IoT).
Step 102, determining resources to be synchronized.
After accessing the internet of things, the first internet of things device may determine a resource that the first internet of things device needs to acquire, where the resource is a resource to be synchronized. The determination method of the resource to be synchronized by the first internet of things device is various, and will be described below with reference to a specific application scenario, which is not described herein again.
Step 103, obtaining resources from a second internet device in the internet of things, where the resources are stored, where the resources are provided by a cloud device in the internet of things.
In this embodiment, the first equipment of the internet of things may further detect whether a second equipment of the internet of things capable of providing the resource to be synchronized exists, and if the second equipment of the internet of things capable of providing the resource exists, the resource is acquired from the second equipment of the internet of things; and if the second connected device capable of providing the resource does not exist, acquiring the resource from the cloud device.
It should be noted that, in this embodiment, the internet of things device that needs to acquire the resource is referred to as a first internet of things device, and the internet of things device that provides the resource is referred to as a second internet of things device.
In summary, according to the resource synchronization method provided in the embodiment of the present application, after the first internet of things device is started, if the first internet of things device needs to perform resource synchronization, the resource to be synchronized may be determined first, and then the resource may be acquired from the second internet of things device in which the resource is stored, so that the first internet of things device may acquire the resource only from the second internet of things device that has already acquired the resource provided by the cloud device in the internet of things, and does not need to acquire the resource from the cloud device, and the dependency on the cloud device may be reduced, thereby reducing the load of the cloud device, avoiding the problem of cloud device breakdown due to the memory leakage of the cloud device because the load of the cloud device is large, and also avoiding the problem of large time delay or resource failure due to the failure of resource synchronization because the resource cannot be fed back in time because the load of the cloud device is large, therefore, the effects of avoiding the collapse of cloud equipment, reducing the time delay of resource synchronization and improving the accessibility of resources are achieved. In addition, because the first internet of things device can acquire resources from the second internet of things device, the cooperation between nodes in the internet of things can be enhanced, and the purpose of high cohesion of the internet of things is achieved.
In this embodiment, the first internet of things device may actively acquire resources after being started, or the cloud device may actively issue resources to the first internet of things device after acquiring the resources, and the two application scenarios are described below.
Please refer to fig. 2, which shows a flowchart of a resource synchronization method according to another embodiment of the present application, where the resource synchronization method can be applied to a first internet of things device. The resource synchronization method may include:
step 201, starting a first internet of things device.
Step 202, a resource list stored in the first internet of things device is obtained, where the resource list includes a first resource state and a second resource state, the first resource state is used to indicate a resource synchronized with the first internet of things device, and the second resource state is used to indicate a resource not synchronized with the first internet of things device.
After the first internet of things device is started, the first internet of things device can read the resource list stored on the disk. The Resource list may at least include a Resource identifier (Resource ID), a Resource Status (Status), and Data (Data), and may also include other information, which is not limited in this embodiment.
The resource identifier is MD5 (Message-Digest Algorithm) value of data, for example, the resource identifier of a resource is 2C7470FBE938689B with a length of 16 bits.
The resource state values are two, wherein one of the resource states is defined as a first resource state, the other one of the resource states is defined as a second resource state, the first resource state is used for indicating the synchronized resource of the first equipment in the internet of things, and the second resource state is used for indicating the unsynchronized resource of the first equipment in the internet of things. For example, if the two values are 0 and 1, respectively, then 0 may be set to correspond to the first resource state, and 1 may be set to correspond to the second resource state, so that when the value of the resource state in the resource list is 1, it indicates that the first internet of things device has synchronized the resource; when the value of the resource state in the resource list is 0, it indicates that the first internet of things device does not synchronize the resource.
Data may be represented in formats such as { "faceSetToken": "asdsasd" }.
After the first internet of things device obtains the resource list, the resource list can be loaded into the cache of the first internet of things device.
Step 203, selecting a resource list containing the second resource state from the resource lists.
Still taking the example in step 202 as an example, the first internet of things device may select a resource list with a resource status value of 1.
And step 204, determining the resource indicated by each selected resource list as the resource to be synchronized.
Step 205, a node list stored in the first equipment in the internet of things is obtained, where the node list is used to indicate a second equipment in the internet of things that can establish a connection with the first equipment in the internet of things.
After the first internet of things device is started, the first internet of things device may read the node list stored on the disk, and the reading sequence of the node list and the resource list is not limited in this embodiment. The Node list may at least include a Node ID (Node ID) and an IP (Internet Protocol) address.
The node identifier is a node code value used for indicating a node (namely, an internet of things device) which has uniqueness in the internet of things. For example, one node is identified as PAD-SCC 2.
The IP address is the IP address of the node in the Internet of things. For example, one IP address is 192.168.1.10.
After the first internet of things device obtains the node list, the node list may be loaded into a cache of the first internet of things device.
And step 206, establishing connection with the second connected device indicated by each node list.
The first internet-of-things device may establish a long connection with each second internet-of-things device, which may pass the heartbeat, so establishing a long connection with the second internet-of-things device may also be referred to as initiating a node heartbeat task.
Besides establishing connection with the second internet-of-things device, the first internet-of-things device also needs to establish connection with the cloud device, and then the first internet-of-things device can be considered to be connected to the internet of things. After the first internet of things device accesses the internet of things, the first internet of things device can also obtain a resource list and a node list from the cloud device so as to update the resource list and the node list stored in the first internet of things device.
Step 207, polling resources to each connected second networking device according to a predetermined sequence, wherein the resources are provided by the cloud device in the internet of things.
After determining the resource to be synchronized, the first internet-of-things device may poll each connected second internet-of-things device for the resource. For example, the first internet-of-things device may send a polling request carrying the resource identifier of the resource to be synchronized to each second internet-of-things device.
Since the number of second internet-of-things devices connected to the first internet-of-things device is large, the polling order of the second internet-of-things devices can be set. For example, the polled second associated device may be randomly determined, or the second associated device may be sorted, and the polled second associated device may be determined according to the sorting order.
In one implementation, before polling each second connected device for resources in a predetermined order, the method further comprises: acquiring a feedback score of each connected second equipment, wherein the feedback score and the times of the second equipment providing resources to the first equipment are in positive correlation; and sequencing the corresponding second-link equipment according to the sequence of the feedback scores from large to small, wherein the sequencing sequence of the second-link equipment is the polling sequence of the second-link equipment.
A connection pool is maintained in the memory of the first internet of things device, and a long connection node which survives, namely, a second internet of things device which is in long connection with the first internet of things device, is maintained in the connection pool. The connection pool scores the condition that each second networking device returns the resource to the first networking device. For example, each time a second networking device successfully returns resources to a first networking device, the score of the second networking device is increased by 1 point, and the connection pool is sorted in a reverse order according to the score of each second networking device, that is, the higher the score is, the position in the connection pool is closer to the front.
And step 208, stopping polling after a second associated device storing the resource is determined, and acquiring the resource from the determined second associated device.
The second internet-of-things device may return a determination message to the first internet-of-things device when determining that the resource exists according to the polling request, the first internet-of-things device may determine the second internet-of-things device as the second internet-of-things device in which the resource is stored, and then send a resource acquisition request to the second internet-of-things device, and the second internet-of-things device may send the resource to the first internet-of-things device according to the resource acquisition request.
If the first equipment of the Internet of things does not receive the confirmation message sent by any second equipment of the Internet of things, it is determined that the second equipment of the Internet of things capable of providing the resource does not exist, and the resource is obtained from the cloud equipment.
After the first internet of things device successfully acquires the resources, the resource list stored in the disk and the cache can be updated, that is, the resource state in the resource list is modified from the second resource state to the first resource state.
In summary, according to the resource synchronization method provided in the embodiment of the present application, after the first internet of things device is started, if the first internet of things device needs to perform resource synchronization, the resource to be synchronized may be determined first, and then the resource may be acquired from the second internet of things device in which the resource is stored, so that the first internet of things device may acquire the resource only from the second internet of things device that has already acquired the resource provided by the cloud device in the internet of things, and does not need to acquire the resource from the cloud device, and the dependency on the cloud device may be reduced, thereby reducing the load of the cloud device, avoiding the problem of cloud device breakdown due to the memory leakage of the cloud device because the load of the cloud device is large, and also avoiding the problem of large time delay or resource failure due to the failure of resource synchronization because the resource cannot be fed back in time because the load of the cloud device is large, therefore, the effects of avoiding the collapse of cloud equipment, reducing the time delay of resource synchronization and improving the accessibility of resources are achieved. In addition, because the first internet of things device can acquire resources from the second internet of things device, the cooperation between nodes in the internet of things can be enhanced, and the purpose of high cohesion of the internet of things is achieved.
Please refer to fig. 3, which shows a flowchart of a resource synchronization method according to another embodiment of the present application, where the resource synchronization method can be applied to a first internet of things device. The resource synchronization method may include:
step 301, starting the first internet of things device.
After the first internet of things device is started, the first internet of things device can access the internet of things.
Step 302, receiving a resource identifier sent by a leader node of a first internet of things device, where the leader node is a second internet of things device connected with the first internet of things device, and the leader node is used to receive the resource identifier sent by the cloud end device, a resource indicated by the resource identifier, and a device identifier of the first internet of things device of a resource to be synchronized.
The leader node is a node selected from nodes belonging to the same group, and there are many grouping rules, for example, nodes in the same network segment are grouped into one group, and the grouping rule is not limited in this embodiment.
In this embodiment, after a new node is accessed, the cloud device may divide nodes in the same network segment into a group, and each group will elect a leader node, and the cloud device may elect a leader node when a predetermined condition is satisfied, where the predetermined condition may be at least one of ① that the number of nodes in a group within a certain time period interrupt the connection reaches a set number, ② that the leader node is disconnected, ③ that the leader election in a group is performed at regular time, ④ that the response time of the leader within a certain time period is too long, and the following describes a flow of electing the leader node.
Before receiving the resource identifier sent by the leader node of the first internet of things device, the method further includes: receiving an election notification sent by cloud equipment, wherein the election notification is used for electing a leader node; and sending the equipment information of the first internet of things equipment to the cloud equipment, wherein the equipment information is used for the cloud equipment to elect the leader node.
The cloud equipment sends election notification to nodes in the same network segment, then collects node responses, calculates by using a Raft algorithm to obtain a leader node, and records the corresponding relation between the network segment and the leader node. Then, the cloud device can detect the connection state of each leader through heartbeat, and reselect the leader node if an offline leader node exists; and if the offline nodes do not exist, continuously detecting the connection state of each leader through heartbeat.
After the leader node information is stored in the cloud device, the cloud device can actively issue the resource after acquiring the resource. At this time, the cloud device may newly create a task to be issued, set the task state to be issued, and then determine whether each first internet of things device that needs to synchronize resources corresponds to the same leader node (i.e., belongs to the same network segment); if each first internet of things device needing resource synchronization corresponds to the same leader node, the resource is issued to the leader node, the task state is set to be issued, and after a receiving confirmation message sent by the leader node is received, the task state is set to be received; and if each first internet of things device needing resource synchronization corresponds to different leader nodes, the resource is issued to each corresponding leader node, the task state is set to be issued, and after receiving the receiving confirmation message sent by each leader node, the task state is set to be received. When the cloud device issues the resource, the cloud device may send a resource identifier, data, and a node identifier set to the leader node, where the node identifier set includes identifiers of nodes that need to synchronize the resource.
It should be noted that, if the leader node fails to receive the resource, the cloud device may reselect the leader node, and the election process is described in detail in the foregoing description, which is not described herein again.
After obtaining the resource issued by the cloud device, the leader node can obtain each node (including the first internet of things device) needing the resource synchronization in the network segment from the node identifier set, and then send the resource identifier to the nodes in parallel through long connection between the leader node and each node to inform the nodes of synchronizing the resource.
Step 303, detecting whether a resource list containing a resource identifier exists in the first internet of things device, where the resource identifier corresponds to the second resource state.
Step 304, if there is a resource list containing the resource identifier and the resource identifier corresponds to the second resource state, determining the resource indicated by the resource identifier as the resource to be synchronized.
Step 305, sending a resource obtaining request carrying the resource identifier to the leader node.
And step 306, receiving the resource sent by the leader node to the first internet of things device according to the resource obtaining request.
After the first internet of things device successfully acquires the resources, a receiving confirmation message can be sent to the leader node through the long connection, and the leader node can delete the node identifier from the acquired node identifier. In addition, the first internet of things device can also update the resource list in the disk and the cache, that is, the resource state in the resource list is modified from the second resource state to the first resource state.
In summary, according to the resource synchronization method provided in the embodiment of the present application, after the first internet of things device is started, if the first internet of things device needs to perform resource synchronization, the resource to be synchronized may be determined first, and then the resource may be acquired from the second internet of things device in which the resource is stored, so that the first internet of things device may acquire the resource only from the second internet of things device that has already acquired the resource provided by the cloud device in the internet of things, and does not need to acquire the resource from the cloud device, and the dependency on the cloud device may be reduced, thereby reducing the load of the cloud device, avoiding the problem of cloud device breakdown due to the memory leakage of the cloud device because the load of the cloud device is large, and also avoiding the problem of large time delay or resource failure due to the failure of resource synchronization because the resource cannot be fed back in time because the load of the cloud device is large, therefore, the effects of avoiding the collapse of cloud equipment, reducing the time delay of resource synchronization and improving the accessibility of resources are achieved. In addition, because the first internet of things device can acquire resources from the second internet of things device, the cooperation between nodes in the internet of things can be enhanced, and the purpose of high cohesion of the internet of things is achieved.
Referring to fig. 4, a block diagram of a resource synchronization apparatus provided in an embodiment of the present application is shown, where the resource synchronization apparatus may be applied to a first internet of things device. The resource synchronization apparatus may include:
a starting module 410, configured to start a first internet of things device;
a determining module 420, configured to determine a resource to be synchronized;
the synchronization module 430 is configured to acquire resources from a second internet device in the internet of things, where the resources are stored, where the resources are provided by a cloud device in the internet of things.
In an optional embodiment, the determining module 420 is further configured to:
acquiring a resource list stored in first equipment of the internet of things, wherein the resource list comprises a first resource state and a second resource state, the first resource state is used for indicating the synchronized resources of the first equipment of the internet of things, and the second resource state is used for indicating the unsynchronized resources of the first equipment of the internet of things;
selecting a resource list containing a second resource state from the resource lists;
and determining the resource indicated by each selected resource list as the resource to be synchronized.
In an alternative embodiment, the synchronization module 430 is further configured to:
acquiring a node list stored in first equipment of the internet of things, wherein the node list is used for indicating second equipment of the internet of things which can be connected with the first equipment of the internet of things;
establishing connection with a second connected device indicated by each node list;
polling resources to each connected second connected device according to a preset sequence;
and stopping polling after determining a second connected device storing the resources, and acquiring the resources from the determined second connected device.
In an alternative embodiment, the synchronization module 430 is further configured to:
before polling resources to each connected second networking device according to a preset sequence, acquiring a feedback score of each connected second networking device, wherein the feedback score and the times of the second networking device providing the resources to the first networking device are in a positive correlation relationship;
and sequencing the corresponding second-link equipment according to the sequence of the feedback scores from large to small, wherein the sequencing sequence of the second-link equipment is the polling sequence of the second-link equipment.
In an optional embodiment, the determining module 420 is further configured to:
receiving a resource identifier sent by a leader node of a first internet of things device, wherein the leader node is a second internet of things device connected with the first internet of things device and is used for receiving the resource identifier sent by a cloud device, a resource indicated by the resource identifier and a device identifier of the first internet of things device of a resource to be synchronized;
detecting whether a resource list containing a resource identifier exists in the first internet of things equipment, wherein the resource identifier corresponds to the second resource state;
and if the resource list which contains the resource identifier and corresponds to the second resource state exists, determining the resource to be synchronized by the resource indicated by the resource identifier.
In an alternative embodiment, the synchronization module 430 is further configured to:
sending a resource acquisition request carrying a resource identifier to a leader node;
and receiving the resource sent by the leader node to the first Internet of things device according to the resource acquisition request.
In an optional embodiment, the apparatus further comprises:
the system comprises a receiving module, a selecting module and a sending module, wherein the receiving module is used for receiving an election notice sent by cloud equipment before receiving a resource identifier sent by a leader node of first internet of things equipment, and the election notice is used for electing the leader node;
the sending module is used for sending the equipment information of the first internet of things equipment to the cloud equipment, and the equipment information is used for the cloud equipment to elect the leader node.
In summary, the resource synchronization apparatus provided in the embodiment of the present application, after the first internet of things device is started, if the first internet of things device needs to perform resource synchronization, the resource to be synchronized may be determined first, and then the resource may be acquired from the second internet of things device in which the resource is stored, so that the first internet of things device may acquire the resource only from the second internet of things device that has already acquired the resource provided by the cloud device in the internet of things, and does not need to acquire the resource from the cloud device, and the dependency on the cloud device may be reduced, thereby reducing the load of the cloud device, avoiding the problem that the cloud device is crashed due to the memory leakage of the cloud device because the load of the cloud device is large, and also avoiding the problem that the resource cannot be fed back in time because the load of the cloud device is large, so that the time delay of resource synchronization is large or the resource cannot be reached, therefore, the effects of avoiding the collapse of cloud equipment, reducing the time delay of resource synchronization and improving the accessibility of resources are achieved. In addition, because the first internet of things device can acquire resources from the second internet of things device, the cooperation between nodes in the internet of things can be enhanced, and the purpose of high cohesion of the internet of things is achieved.
One embodiment of the present application provides a computer-readable storage medium having stored therein at least one instruction, at least one program, set of codes, or set of instructions that is loaded and executed by a processor to implement a resource synchronization method as described above.
One embodiment of the present application provides an internet of things device, which includes a processor and a memory, where the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the resource synchronization method described above.
It should be noted that: in the resource synchronization apparatus provided in the foregoing embodiment, when performing resource synchronization, only the division of the functional modules is illustrated, and in practical applications, the function allocation may be completed by different functional modules according to needs, that is, the internal structure of the resource synchronization apparatus is divided into different functional modules to complete all or part of the functions described above. In addition, the resource synchronization apparatus and the resource synchronization method provided in the foregoing embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description should not be taken as limiting the embodiments of the present application, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the embodiments of the present application should be included in the scope of the embodiments of the present application.

Claims (10)

1. A resource synchronization method is used in a first Internet of things device, and comprises the following steps:
starting the first internet of things device;
determining resources to be synchronized;
and acquiring the resource from a second networking device storing the resource in the Internet of things, wherein the resource is provided by a cloud device in the Internet of things.
2. The method of claim 1, wherein the determining resources to be synchronized comprises:
acquiring a resource list stored in the first equipment for the internet of things, wherein the resource list comprises a first resource state and a second resource state, the first resource state is used for indicating the synchronized resources of the first equipment for the internet of things, and the second resource state is used for indicating the unsynchronized resources of the first equipment for the internet of things;
selecting a resource list containing the second resource state from the resource lists;
and determining the resource indicated by each selected resource list as the resource to be synchronized.
3. The method according to claim 2, wherein the obtaining the resource from a second networked device in the internet of things, which stores the resource, comprises:
acquiring a node list stored in the first equipment for the Internet of things, wherein the node list is used for indicating second equipment for the Internet of things which can be connected with the first equipment for the Internet of things;
establishing connection with a second connected device indicated by each node list;
polling the resources to each connected second connected device according to a predetermined sequence;
and stopping polling after a second associated device storing the resource is determined, and acquiring the resource from the determined second associated device.
4. The method of claim 3, wherein prior to polling each second connected device for the resources in the predetermined order, the method further comprises:
acquiring a feedback score of each connected second equipment, wherein the feedback score is in positive correlation with the times of providing resources to the first equipment by the second equipment;
and sequencing the corresponding second networked devices according to the sequence of the feedback scores from large to small, wherein the sequencing sequence of the second networked devices is the polling sequence of the second networked devices.
5. The method of claim 1, wherein the determining resources to be synchronized comprises:
receiving a resource identifier sent by a leader node of the first internet of things device, wherein the leader node is a second internet of things device connected with the first internet of things device, and the leader node is used for receiving the resource identifier sent by the cloud device, a resource indicated by the resource identifier and a device identifier of the first internet of things device to be synchronized with the resource;
detecting whether a resource list containing the resource identification exists in the first internet of things equipment, wherein the resource identification corresponds to a second resource state;
and if a resource list which contains the resource identifier and corresponds to the second resource state exists, determining the resource indicated by the resource identifier to be the resource to be synchronized.
6. The method according to claim 5, wherein the obtaining the resource from a second networked device storing the resource in the internet of things comprises:
sending a resource acquisition request carrying the resource identifier to the leader node;
and receiving the resource sent by the leader node to the first Internet of things device according to the resource acquisition request.
7. The method according to claim 5, wherein before said receiving the resource identifier sent by the leader node of the first internet of things device, the method further comprises:
receiving an election notification sent by the cloud equipment, wherein the election notification is used for electing the leader node;
and sending the equipment information of the first Internet of things equipment to the cloud equipment, wherein the equipment information is used for the cloud equipment to elect the leader node.
8. A resource synchronization apparatus, configured to be used in a first internet of things device, the apparatus comprising:
the starting module is used for starting the first internet of things device;
a determining module, configured to determine a resource to be synchronized;
the synchronization module is used for acquiring the resources from a second internet of things device in which the resources are stored, and the resources are provided by cloud end devices in the internet of things.
9. A computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement the resource synchronization method according to any one of claims 1 to 7.
10. An internet of things device, comprising a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the resource synchronization method according to any one of claims 1 to 7.
CN201911356505.0A 2019-12-25 2019-12-25 Resource synchronization method, device, storage medium and equipment Pending CN111092956A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911356505.0A CN111092956A (en) 2019-12-25 2019-12-25 Resource synchronization method, device, storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911356505.0A CN111092956A (en) 2019-12-25 2019-12-25 Resource synchronization method, device, storage medium and equipment

Publications (1)

Publication Number Publication Date
CN111092956A true CN111092956A (en) 2020-05-01

Family

ID=70397324

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911356505.0A Pending CN111092956A (en) 2019-12-25 2019-12-25 Resource synchronization method, device, storage medium and equipment

Country Status (1)

Country Link
CN (1) CN111092956A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112130931A (en) * 2020-09-27 2020-12-25 联想(北京)有限公司 Application deployment method, node, system and storage medium
CN115277687A (en) * 2021-04-30 2022-11-01 北京小米移动软件有限公司 Resource data acquisition method, resource data acquisition device, and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101959054A (en) * 2009-07-14 2011-01-26 中国电信股份有限公司 Integrated P2P (Peer-To-Peer) VOD (Video-On-Demand) system and partner node selecting method
CN102932751A (en) * 2012-10-17 2013-02-13 中国联合网络通信集团有限公司 Internet of Things data transmission method and Internet of Things
CN103607456A (en) * 2013-11-21 2014-02-26 厦门雅迅网络股份有限公司 Remote software upgrade method for clustered mobile terminals
CN105376766A (en) * 2014-08-11 2016-03-02 无锡市嘉邦电力管道厂 Internet-of-things data transmission method
CN107592367A (en) * 2017-09-30 2018-01-16 广东美的制冷设备有限公司 Resource share method, device and the computer-readable recording medium of home appliance
CN108737500A (en) * 2018-04-20 2018-11-02 青岛海尔科技有限公司 Target resource acquisition, providing method, device, storage medium and computer equipment
CN109257197A (en) * 2017-07-12 2019-01-22 西安中兴新软件有限责任公司 A kind of internet-of-things terminal upgrade method, device, system, terminal and storage medium
US20190075165A1 (en) * 2017-09-06 2019-03-07 National Taiwan University Vehicle information and environment monitoring compound vehicle system and data processing and transmission method therein
CN109660367A (en) * 2018-11-21 2019-04-19 语联网(武汉)信息技术有限公司 Reach method, apparatus and electronic equipment based on the common recognition for improving Raft algorithm
CN109714195A (en) * 2018-12-11 2019-05-03 Oppo广东移动通信有限公司 Apparatus control method, device, electronic equipment and Internet of things system
CN110572229A (en) * 2019-09-09 2019-12-13 Oppo广东移动通信有限公司 Time calibration method, device, terminal and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101959054A (en) * 2009-07-14 2011-01-26 中国电信股份有限公司 Integrated P2P (Peer-To-Peer) VOD (Video-On-Demand) system and partner node selecting method
CN102932751A (en) * 2012-10-17 2013-02-13 中国联合网络通信集团有限公司 Internet of Things data transmission method and Internet of Things
CN103607456A (en) * 2013-11-21 2014-02-26 厦门雅迅网络股份有限公司 Remote software upgrade method for clustered mobile terminals
CN105376766A (en) * 2014-08-11 2016-03-02 无锡市嘉邦电力管道厂 Internet-of-things data transmission method
CN109257197A (en) * 2017-07-12 2019-01-22 西安中兴新软件有限责任公司 A kind of internet-of-things terminal upgrade method, device, system, terminal and storage medium
US20190075165A1 (en) * 2017-09-06 2019-03-07 National Taiwan University Vehicle information and environment monitoring compound vehicle system and data processing and transmission method therein
CN107592367A (en) * 2017-09-30 2018-01-16 广东美的制冷设备有限公司 Resource share method, device and the computer-readable recording medium of home appliance
CN108737500A (en) * 2018-04-20 2018-11-02 青岛海尔科技有限公司 Target resource acquisition, providing method, device, storage medium and computer equipment
CN109660367A (en) * 2018-11-21 2019-04-19 语联网(武汉)信息技术有限公司 Reach method, apparatus and electronic equipment based on the common recognition for improving Raft algorithm
CN109714195A (en) * 2018-12-11 2019-05-03 Oppo广东移动通信有限公司 Apparatus control method, device, electronic equipment and Internet of things system
CN110572229A (en) * 2019-09-09 2019-12-13 Oppo广东移动通信有限公司 Time calibration method, device, terminal and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112130931A (en) * 2020-09-27 2020-12-25 联想(北京)有限公司 Application deployment method, node, system and storage medium
CN115277687A (en) * 2021-04-30 2022-11-01 北京小米移动软件有限公司 Resource data acquisition method, resource data acquisition device, and storage medium
CN115277687B (en) * 2021-04-30 2024-02-23 北京小米移动软件有限公司 Resource data acquisition method, resource data acquisition device and storage medium

Similar Documents

Publication Publication Date Title
CN106960060B (en) Database cluster management method and device
CN111538763A (en) Method for determining main node in cluster, electronic equipment and storage medium
CN111198662B (en) Data storage method, device and computer readable storage medium
CN111541762B (en) Data processing method, management server, device and storage medium
CN108769118B (en) Method and device for selecting master nodes in distributed system
CN111092956A (en) Resource synchronization method, device, storage medium and equipment
CN113810216B (en) Fault switching method and device for cluster and electronic equipment
CN108509296B (en) Method and system for processing equipment fault
US10853892B2 (en) Social networking relationships processing method, system, and storage medium
CN112000850B (en) Method, device, system and equipment for processing data
CN111147585B (en) Equipment upgrading method, device, storage medium and system
CN110798492B (en) Data storage method and device and data processing system
CN111708763A (en) Data migration method and device of fragment cluster and fragment cluster system
CN116756108A (en) File synchronization method, system, device and readable storage medium
CN116633766A (en) Fault processing method and device, electronic equipment and storage medium
EP4207637A1 (en) Time synchronization method and apparatus, device, and storage medium
CN115065664A (en) Internet protocol address recovery method, electronic equipment and storage medium
CN111464395B (en) Method and device for creating blockchain and readable storage medium
CN107332679B (en) Centerless information synchronization method and device
CN114979153B (en) Load balancing method, computer equipment and storage device
CN111479084B (en) Video networking conference establishment method, device, system and storage medium
CN104348906A (en) Data consultation method and device in distributed type system
CN114979180B (en) Data synchronization method, system and equipment
CN115174447B (en) Network communication method, device, system, equipment and storage medium
CN113282660B (en) Method and system for synchronizing data in cluster, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200501