Data synchronization method and system based on internet of things

By acquiring user types and initializing shared tags in the IoT system, binding user tags to generate service request data packets, and optimizing the response mode, the problem of data asynchrony when IoT devices are shared by multiple users in a weak network environment is solved, realizing real-time online and low-latency data synchronization for high-frequency, large-scale data communication.

CN114143299BActive Publication Date: 2025-10-17BEIJING CHINASOFT LINKAGE TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111348247.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-15
Publication Date
2025-10-17
Estimated Expiration
2041-11-15

AI Technical Summary

Technical Problem

In weak network environments, when IoT devices are shared by multiple users, inconsistent round-trip latency between nodes can lead to asynchronous data display on different smart terminals.

Method used

By obtaining user types and initializing shared tags at the service request node, binding user tags to generate service request data packets, and processing them at the service response node, updated response data packets are fed back. The response mode is optimized using a shared user counter to achieve data synchronization.

Benefits of technology

Without increasing the processing latency of backend nodes, multiple frontend nodes can achieve high-frequency, large-scale data communication in real time, avoiding asynchronous data display on different smart terminals and reducing the round-trip latency of distributed IoT systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114143299B_ABST
    Figure CN114143299B_ABST
Patent Text Reader

Abstract

The application relates to a data synchronization method and system based on an Internet of Things, which comprises the following steps: acquiring a user type corresponding to a current service request and initializing a shared label; when the user type is a shared user, resetting the shared label as a tracking identifier of a data calling chain; binding a user label and the shared label based on the current service request, obtaining a service request data packet, and transmitting the service request data packet to a service response node, so that the service response node feeds back an updated response data packet according to the service request data packet, thereby realizing data synchronization display when one device is shared for use by multiple users; avoiding the problem that different intelligent terminals appear out of synchronization in data display due to inconsistent round-trip delays between nodes, thereby reducing the round-trip delay of a distributed Internet of Things system with a calculation dependency relationship.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of Internet of Things data processing, in particular to a data synchronization method and system based on Internet of Things. BACKGROUND

[0002] With the development of Internet of Things (IoT) technology, "Internet of Everything" is gradually changing from scientific research to mature application technology. Taking smart home as an example, whether it is a TV, a washing machine, a refrigerator, or a small household appliance such as a lamp, a camera, a sweeper, and a fitness equipment, it can become an independent controllable Internet of Things communication node. Users can use smart terminals to remotely locate and control devices, and even share Internet of Things devices with other users to realize multiple users sharing the same device and improve the utilization value of hardware products.

[0003] Distributed computing is a common feature of all Internet of Things systems, that is, an Internet of Things system is built by multiple software modules with computing dependencies and implemented in different locations. When a user initiates a function call through a front-end service (such as APP / Web), a series of service request and response communication processes will be triggered between software modules with computing dependencies. The entire data link starts from the front-end service node and runs through multiple back-end service nodes. In the distributed Internet of Things system described above, the round-trip time (RTT) refers to the total time required for a user to initiate a function request through a front-end service node and successfully obtain the data content of the response from a back-end node. In actual Internet of Things product development, attention should be paid to whether the round-trip time parameter meets the user's expectations during the system design stage. The consistency between the two is one of the important technical indicators for measuring the performance of Internet of Things products. Reducing the round-trip time (RTT) is a key technology and main difficulty for improving the performance of Internet of Things systems.

[0004] In the implementation process, the inventors found that at least the following problems exist in the prior art: In a weak network environment, that is, when the network communication of one or more service nodes in the data call chain is unstable, and when a device is shared by multiple users, the round-trip time between nodes is inconsistent, resulting in different smart terminals displaying different data. SUMMARY

[0005] Therefore, it is necessary to provide a data synchronization method and system based on Internet of Things to solve the problem that in a weak network environment, that is, when the network communication of one or more service nodes in the data call chain is unstable, and when a device is shared by multiple users, the round-trip time between nodes is inconsistent, resulting in different smart terminals displaying different data.

[0006] To achieve the above object, the embodiment of the present application provides a data synchronization method based on Internet of Things based on a service request node, comprising the following steps:

[0007] Obtaining the user type corresponding to the current service request, and initializing the shared label;

[0008] When the user type is a shared user, resetting the shared label as a tracking identifier of the data call chain;

[0009] Based on the current service request, binding the user label with the shared label to obtain a service request data packet, and transmitting the service request data packet to a service response node, so that the service response node feeds back an updated response data packet according to the service request data packet.

[0010] In one embodiment, the step of obtaining the user type corresponding to the current node service request and initializing the shared label comprises:

[0011] Applying for a sending delay phase in a round trip delay, obtaining the user type corresponding to the current service request by accessing the service response node in the data call chain;

[0012] Initializing the shared label as an empty data pointer.

[0013] In one embodiment, the step of initializing the shared label comprises:

[0014] When the user type is a non-shared user, the shared label remains as an empty data pointer.

[0015] In one embodiment, the step of binding the user label with the shared label to obtain a service request data packet based on the current service request comprises:

[0016] Applying for an end of the sending delay phase in the round trip delay.

[0017] The embodiment of the present application provides a data synchronization method based on Internet of Things based on a service response node, comprising the following steps:

[0018] Obtaining a service request data packet transmitted by a service request node;

[0019] Processing the service request data packet to obtain a shared label and a user label, and initializing a shared user counter;

[0020] When the shared label is valid, reading the user label and updating the shared user counter;

[0021] When the shared tag of the service request node is invalid or the shared user counter is updated, the update response mode is full data or incremental data, the updated response data packet is obtained, and the updated response data packet is transmitted to the service request node.

[0022] In one of the embodiments, the step of updating the shared user counter comprises:

[0023] Based on the relationship table, the shared user counter is updated within a set time period; wherein the relationship table comprises a service name, a shared tag, a user tag, and a field service request recent time.

[0024] In one of the embodiments, the step of updating the shared user counter based on the relationship table within a set time period comprises:

[0025] If the shared tag is a non-empty data pointer and the user tag does not exist in the relationship table, a shared request record is created;

[0026] If the shared tag is a non-empty data pointer and the user tag exists in the relationship table, the shared request record is updated; wherein the shared request record is updated by updating the field service request recent time corresponding to the user tag to the time of the sending time delay stage in the application occupation round trip time;

[0027] If the field service request recent time in the relationship table exceeds the set time period, the shared request record is deleted.

[0028] In one of the embodiments, the method further comprises the steps of:

[0029] When the operation of creating the shared request record is performed, the value of the shared user counter is increased by a first set value, and the update response mode is full data;

[0030] When the operation of deleting the shared request record is performed, the value of the shared user counter is decreased by the first set value, and the update response mode is incremental data;

[0031] When the operation of updating the shared request record is performed, the value of the shared user counter remains unchanged, and the update response mode is incremental data.

[0032] In one of the embodiments, when the shared tag of the service request node is invalid or the shared user counter is updated, the step of obtaining the updated response data packet by updating the response mode as full data or incremental data comprises:

[0033] The scheduling time delay stage in the application occupation round trip time is read to obtain the response mode;

[0034] If the response mode is full data, a backend sub-service node is called to obtain full data; if the response mode is incremental data, a backend sub-service node is called to obtain incremental data.

[0035] The full data or the incremental data is updated to a response data packet to obtain an updated response data packet.

[0036] The application ends the scheduling delay stage in the round trip delay.

[0037] The embodiment of the application further provides a data synchronization system based on the Internet of Things, comprising a service request node and a service response node.

[0038] The service request node is used for executing the data synchronization method based on the Internet of Things based on the service request node.

[0039] The service response node is used for executing the data synchronization method based on the Internet of Things based on the service response node.

[0040] One of the above technical solutions has the following advantages and beneficial effects:

[0041] In each embodiment of the above data synchronization method based on the Internet of Things, when a plurality of service request nodes share the same service response node, at least one service request node can obtain the user type corresponding to the current service request and initialize the shared tag; when the user type is a shared user, the shared tag is reset as a tracking identifier of a data calling chain; based on the current service request, the user tag and the shared tag are bound to obtain a service request data packet, and the service request data packet is transmitted to the service response node, so that the service response node feeds back an updated response data packet according to the service request data packet, and thus when one device is shared for use by multiple users, data synchronization display can be realized. When the distributed Internet of Things system is in a weak network environment, that is, the network signal stability of a certain computing service node has a large fluctuation, and one device is shared for use by multiple users, under the premise that the processing delay of the backend node is not increased, multiple front-end nodes can maintain real-time online for high-frequency and large-scale data communication, and the problem of different intelligent terminals being out of synchronization in data display caused by the inconsistent round trip delay between nodes can be avoided, so that the round trip delay of the distributed Internet of Things system with a computing dependency relationship is reduced. BRIEF DESCRIPTION OF DRAWINGS

[0042] Figure 1 It is a schematic diagram of the distributed computing feature of the Internet of Things system;

[0043] Figure 2 It is a schematic diagram of the application environment of the data synchronization method based on the Internet of Things in one embodiment;

[0044] Figure 3 A first flowchart of a method for synchronizing data based on Internet of Things on the side of a service request node in an embodiment;

[0045] Figure 4 A second flowchart of a method for synchronizing data based on Internet of Things on the side of a service request node in an embodiment;

[0046] Figure 5 A third flowchart of a method for synchronizing data based on Internet of Things on the side of a service request node in an embodiment;

[0047] Figure 6 A first flowchart of a method for synchronizing data based on Internet of Things on the side of a service response node in an embodiment;

[0048] Figure 7 A flowchart of a step for updating a shared user counter on the side of a service response node in an embodiment;

[0049] Figure 8 A flowchart of a step for updating response data on the side of a service response node in an embodiment;

[0050] Figure 9 A schematic diagram of an application of a method for synchronizing data based on Internet of Things in an embodiment;

[0051] Figure 10 A schematic diagram of a structure of a system for synchronizing data based on Internet of Things in an embodiment. DETAILED DESCRIPTION

[0052] In order to make the personnel in the art better understand the scheme of the present application, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present application.

[0053] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0054] In addition, the term "a plurality" shall mean two and more.

[0055] Distributed computing is a common feature of all IoT systems, that is, an IoT system is built by multiple software modules with computing dependencies and implemented in distributed deployment. When a user initiates a function call through a front-end service (such as APP / Web), a series of service request and response communication processes will be triggered between software modules with computing dependencies. The entire data link starts from the front-end service node and runs through multiple back-end service nodes (such as Figure 1 The computing architecture of the back-end service node is not limited and can be a stationary computing unit or a moving robot.

[0056] In the above-described distributed IoT system, the round-trip time (RTT) refers to the total time required for a user to initiate a function request through a front-end service node and successfully obtain the data content of the response of a back-end node. In actual IoT product development, the system design stage should pay attention to whether the round-trip time parameter meets the user's expectations, and the consistency between the two is one of the important technical indicators for measuring the performance of an IoT product. Assuming that a service data call chain is composed of N pairs of software modules with computing dependencies, T i is the time delay generated by the i-th pair of software modules with mutual dependencies (including four serial stages of sending time delay, propagation time delay, scheduling time delay, and processing time delay, which are represented by parameters s i , t i , d i , and p i , respectively), the calculation formula of the round-trip time of the above data call chain can be represented as

[0057] Reducing the round-trip time (RTT) is a key technology and main difficulty for improving the performance of an IoT system. There are mainly two ways to reduce the round-trip time. The first way is to use a lightweight and reliable network communication protocol to reduce the propagation time delay t i . The second way is to optimize the scheduling algorithm of the back-end service node to improve the scheduling time delay parameter d i between software modules with computing dependencies. Both ways are helpful to improve the overall round-trip time of the data call chain. At present, the service scheduling algorithms provided by most IoT platforms can be further divided into two categories, namely, asynchronous method (Asynchronous) and synchronous method (Synchronous).

[0058] Asynchronous method: the software module (caller) initiating the call initiates a service request through the Internet of Things cloud, and does not wait for the response of the called software module (callee); the cloud directly returns the result after executing the call.

[0059] Synchronous method: the software module (caller) initiating the call initiates a service request through the Internet of Things cloud, and waits for the response of the called software module (callee); the cloud executes the call and returns the result within a set time (such as 6 seconds), and if no response of the called software module is received, the caller is fed back that the call times out.

[0060] However, the two service scheduling methods provided by the existing Internet of Things platform have defects, specifically: in a weak network environment, that is, when one or more network communications of the service nodes in the data call chain are unstable, the synchronous scheduling method will cause the service request to frequently receive network call timeout exceptions, thereby affecting the user experience of the Internet of Things product. In a weak network environment, the asynchronous scheduling method can effectively reduce the probability of network call exceptions in the synchronous method, but when the request / response data packet size is relatively large and a backend node shared by multiple people needs to be synchronized, the existing asynchronous service scheduling method can only respond to data without distinction, so that the processing delay parameter of the backend service node becomes large, and finally the round-trip delay performance of the entire service data call chain becomes poor.

[0061] The data synchronization method based on the Internet of Things provided in the present application can be applied to, for example Figure 2The application environment shown. Among them, a plurality of service request nodes 102 are connected to service response nodes 104, and the application object of the service request node 102 can be a smart terminal, which can be but is not limited to a smart phone, a smart tablet, a notebook computer, a smart wearable device, etc. The application object of the service response node 104 can be a household appliance with Internet of Things function, for example, the household appliance can be but is not limited to a television, a washing machine, a refrigerator, a table lamp, a sweeper, a camera, etc. At least one service request node 102 can be used to execute the following steps: obtaining the user type corresponding to the current service request, and initializing the shared label; when the user type is a shared user, resetting the shared label to the tracking identifier of the data call chain; based on the current service request, binding the user label with the shared label to obtain a service request data packet, and transmitting the service request data packet to the service response node 104, so that the service response node 104 feeds back an updated response data packet according to the service request data packet. The service response node 104 can be used to execute the following steps: obtaining the service request data packet transmitted by the service request node 102; processing the service request data packet to obtain the shared label and the user label, and initializing the shared user counter; when the shared label is valid, reading the user label and updating the shared user counter; when the shared label of the service request node is invalid or the shared user counter is updated, updating the response mode to full data or incremental data to obtain an updated response data packet, and transmitting the updated response data packet to the service request node 102.

[0062] In one embodiment, as shown in Figure 3 , a data synchronization method based on Internet of Things is provided, which is applied to the service request node 102 in Figure 2 for example, including the following steps:

[0063] Step S310, obtaining the user type corresponding to the current service request, and initializing the shared label.

[0064] Among them, the current service request refers to the service request initiated by the service request node. The user type can include a shared user and a non-shared user. The service request node can obtain the user type corresponding to the current service request, and the service request node can also initialize the shared label according to the current service request, such as clearing the original information in the shared label and resetting the default information of the shared label.

[0065] For example, a plurality of service request nodes (such as smart terminals) are respectively connected to the same service response node (such as a smart household appliance), and the service request node obtains the user type corresponding to the current service request by accessing the service response node, and initializes the shared label.

[0066] Step S320, when the user type is a shared user, resetting the shared label as a tracking identifier of the data call chain.

[0067] The data call chain refers to that in the process of completing a service call of the system, the calling information (time, interface, level, result) between services is dotted into a log, and then all the dotted data is connected as a tree chain to generate a call chain. The tracking system analyzes and processes the log information generated in the process, restores the complete calling process of the service end-to-end execution, and performs statistical analysis according to different dimensions; thereby identifying the abnormal service call, which can quickly analyze and delimit the abnormal service; at the same time, the system performance bottleneck can be analyzed according to the data statistics. The tracking identifier is also called a tracking identifier. The tracking identifier can be a full-link call tracking identifier in the data call chain.

[0068] The service request node judges and processes the obtained user type, and resets the shared label as a tracking identifier of the data call chain when the user type is a shared user.

[0069] Step S330, based on the current service request, the user label and the shared label are bound to obtain a service request data packet, and the service request data packet is transmitted to the service response node, so that the service response node feeds back an updated response data packet according to the service request data packet.

[0070] The service request node can obtain the user label according to the obtained user type. The service request node can bind the user label and the reset shared label based on the current service request to obtain a service request data packet, and transmit the processed service request data packet to the service response node. Then, the service response node can process the service request data packet according to the service request data packet, feed back an updated response data packet according to the processing result, and realize reducing the round-trip time delay of the distributed Internet of Things system with calculation dependency, so that each service request node does not exist because the data display is not synchronized due to the inconsistent round-trip time delay between service nodes.

[0071] Specifically, when multiple service request nodes share the same service response node, at least one service request node can obtain the user type corresponding to the current service request and initialize the shared label; when the user type is a shared user, the shared label is reset as a tracking identifier of the data call chain; based on the current service request, the user label and the shared label are bound to obtain a service request data packet, and the service request data packet is transmitted to the service response node, so that the service response node feeds back an updated response data packet according to the service request data packet, and then when one device is shared by multiple users, data synchronous display can be realized.

[0072] In the above embodiment, when the distributed Internet of Things system is in a weak network environment, that is, the network signal stability of a certain computing service node has large fluctuations, and one device is shared by multiple users, the problem of different intelligent terminals showing different data synchronization caused by inconsistent round-trip delay between nodes can be solved without increasing the processing delay of the backend node, so that multiple front-end nodes can maintain real-time online for high-frequency and large-scale data communication, thereby reducing the round-trip delay of the distributed Internet of Things system with computing dependency.

[0073] It should be noted that when calculating the round-trip delay of the data call chain of the Internet of Things system, the service request node and the service response node are a pair of communication nodes with computing dependency.

[0074] In one embodiment, as shown in Figure 4 , a data synchronization method based on Internet of Things is provided. Taking the service request node 102 in Figure 2 as an example, the method comprises the following steps:

[0075] Step S410: Apply for occupying the sending delay phase in the round-trip delay, and obtain the user type corresponding to the current service request by accessing the service response node in the data call chain.

[0076] The round-trip delay can include a sending delay phase and a calling delay phase. The service request node needs to apply for occupying the sending delay phase in the round-trip delay before obtaining the user type, and then the service request node can access the backend node in the data call chain that provides public services, that is, access the service response node in the data call chain, and then obtain the user type corresponding to the current service request, so as to facilitate the subsequent step of judging whether the user type belongs to a shared user, that is, judging whether the service request type represented by the current node belongs to a shared data request, and taking the obtained user type as a type flag for accessing the backend service node of the current service request node.

[0077] Step S420: Initialize the shared label as an empty data pointer.

[0078] After the service request node obtains the user type, the shared label is initialized, and the shared label is assigned as an empty data pointer.

[0079] Step S430: When the user type is a shared user, reset the shared label as the tracking identifier of the data call chain.

[0080] Step S440, based on the current service request, binding the user label with the sharing label, obtaining a service request data packet, and transmitting the service request data packet to the service response node, so that the service response node feeds back an updated response data packet according to the service request data packet.

[0081] The specific description of steps S430 and S440 is described above in the embodiments, which will not be repeated here.

[0082] In the above embodiments, when the distributed Internet of Things system is in a weak network environment, that is, the network signal stability of a certain computing service node has large fluctuations, and one device is shared by multiple users, the problem of different intelligent terminals showing different data synchronization caused by inconsistent round-trip delay between nodes can be solved without increasing the processing delay of the backend node, so that multiple front-end nodes maintain real-time online for high-frequency and large-scale data communication, thereby reducing the round-trip delay of the distributed Internet of Things system with computing dependency relationship.

[0083] In one embodiment, as shown in Figure 5 , a data synchronization method based on Internet of Things is provided. Taking the service request node 102 in Figure 2 as an example, the method comprises the following steps:

[0084] Step S510, apply for occupying the sending delay phase in the round-trip delay, access the service response node in the data call chain, and obtain the user type corresponding to the current service request.

[0085] Step S520, initialize the sharing label as an empty data pointer.

[0086] Step S530, when the user type is a non-sharing user, the sharing label remains as an empty data pointer.

[0087] Step S540, when the user type is a sharing user, reset the sharing label to the tracking identifier of the data call chain.

[0088] Step S550, based on the current service request, binding the user label with the sharing label, obtaining a service request data packet, and transmitting the service request data packet to the service response node, so that the service response node feeds back an updated response data packet according to the service request data packet.

[0089] Step S560, apply for ending the occupation of the sending delay phase in the round-trip delay.

[0090] Specifically, the service request node applies for occupying a sending time delay stage in a round trip time delay, accesses a backend node providing a common service in a data call chain, and obtains a judgment on whether a service request type represented by the current node belongs to a shared data request user type. The service request node takes the obtained user type as a type mark for judging the current service request node accessing the backend service node, and initializes a shared label as an empty data pointer. When the type mark for the current service request node accessing the backend service node is a shared user, the service request node resets the shared label as a tracking identifier (with global uniqueness) of the data call chain; otherwise, the shared label remains as the empty data pointer. The service request node binds the shared label and a user label (with global uniqueness) in a service request data packet, and applies for ending the occupation of the sending time delay stage in the round trip time delay, thereby realizing data synchronous display when one device is shared for use by multiple users. When the distributed Internet of Things system is in a weak network environment, that is, the network signal stability of a certain computing service node has large fluctuations, and one device is shared for use by multiple users, the multiple front-end nodes can keep real-time online for high-frequency and large-scale data communication without increasing the processing time delay of the backend node, thereby avoiding the problem of different intelligent terminals being out of synchronization in data display due to inconsistent round trip time delays between nodes, and reducing the round trip time delay of the distributed Internet of Things system with computing dependency relationship.

[0091] In one embodiment, as shown in Figure 6 , a data synchronization method based on Internet of Things is provided, which is applied to the service response node 104 in Figure 2 for example, and includes the following steps:

[0092] Step S610: obtaining a service request data packet transmitted by a service request node.

[0093] The service request data packet can include a shared label and a user label, and further includes a service request instruction for requesting service data. The service response node can obtain the service request data packet transmitted by the service request node. It should be noted that the service response node can actively obtain the service request data packet from the service request node; in other embodiments, the service request node can also actively send the service request data packet to the service response node, and then the service response node receives the service request data packet.

[0094] Step S620: processing the service request data packet to obtain the shared label and the user label, and initializing a shared user counter.

[0095] The service response node can analyze and process the service request data packet, and then obtain the corresponding shared label and user label. The service response node can also initialize the shared user counter according to the service request data packet, for example, initialize the shared user counter to 0.

[0096] In step S630, when the shared label is valid, the user label is read, and the shared user counter is updated.

[0097] The service response node can perform validity judgment processing on the processed shared label. According to the processing result, when the shared label is valid, the user label is read, and the shared user counter is updated according to the user label.

[0098] In step S640, when the shared label of the service request node is invalid or the shared user counter is updated, the update response mode is full data or incremental data, the updated response data packet is obtained, and the updated response data packet is transmitted to the service request node.

[0099] The service response node can update the response mode to full data or incremental data when it detects that the shared label of the service request node is invalid, obtain the updated response data packet, and transmit the updated response data packet to the service request node. The service response node can also update the response mode to full data or incremental data when the shared user counter is updated, obtain the updated response data packet, and transmit the updated response data packet to the service request node.

[0100] In the above embodiment, based on the principle of distributed data call chain, the service scheduling algorithm of the service response node (i.e. the backend node) is optimized to reduce the overall round-trip time delay of the Internet of Things system. In a weak network environment, that is, when the network signal stability of a certain computing service node fluctuates greatly, and a device is shared by multiple users, the problem of different smart terminals showing different data synchronization caused by inconsistent round-trip time delay between nodes can be solved without increasing the processing time delay of the backend node. The multiple service request nodes (i.e. front-end nodes) can maintain real-time online for high-frequency and large-scale data communication, thereby reducing the round-trip time delay of the distributed Internet of Things system with computing dependency relationship.

[0101] In one example, the step of updating the shared user counter in step S630 includes:

[0102] Based on the relationship table, the shared user counter is updated within a set time period. The relationship table includes service name, shared label, user label, and field service request recent time.

[0103] In particular, the relationship table can be used to record the login and logout information of the service function and the sharing request. The main fields maintained by the relationship table include a service name (FL), a sharing label (SL), a user label (UL), and a service request recent time (FRLT). The field service name (FL) is a function identifier defined for the object model represented by S2, the field sharing label (SL) and the field user label (UL) are the same as described in S1. The field service request recent time (FRLT) is the time when the service request node S1 arrives at the service response backend node S2, and S2 decides whether to update the time of the sending delay phase in the round-trip delay applied by S2 according to the legitimacy of the field sharing label and the field user label.

[0104] For example, the product design of the Internet of Things system updates the value of the shared user counter within a set time period (such as 3 seconds) according to the actual business requirements of the application scenario.

[0105] In one embodiment, as shown in Figure 7 based on the relationship table, the step of updating the shared user counter within a set time period includes:

[0106] Step S710: If the sharing label is a non-empty data pointer and the user label does not exist in the relationship table, create a shared request record.

[0107] Step S720: If the sharing label is a non-empty data pointer and the user label exists in the relationship table, update the shared request record; wherein updating the shared request record is to update the field service request recent time corresponding to the user label to the time of the sending delay phase in the round-trip delay applied.

[0108] Step S730: If the field service request recent time in the relationship table exceeds the set time period, delete the shared request record.

[0109] Specifically, the relationship table exists three basic operations, respectively, creating a shared request record, updating a shared request record, deleting a shared request record. The three basic operations are completed in the sending delay phase of the service response node applying for occupying the round-trip delay, and the corresponding algorithm processing logic is: when the service request node arrives at the service response node, the service response node parses the service request corresponding to the service request data packet, obtains the bound shared tag and user tag. If the shared tag is a non-empty data pointer, and the user tag does not exist in the relationship table, a record is created. If the shared tag is a non-empty data pointer, and the user tag exists in the relationship table, the field service request recent time (FRLT) corresponding to the user tag is updated, and the time of the service response node applying for occupying the sending delay phase of the round-trip delay is reset to S2. If the field service request recent time (FRLT) of a record in the relationship table has expired and exceeds the time period set by the product design of the Internet of Things system (such as 3 seconds), the record is deleted.

[0110] Further, the data synchronization method based on the Internet of Things further includes the steps of:

[0111] When the operation of creating a shared request record is performed, the value of the shared user counter is increased by a first set value, and the update response mode is full data.

[0112] When the operation of deleting a shared request record is performed, the value of the shared user counter is decreased by a first set value, and the update response mode is incremental data.

[0113] When the operation of updating a shared request record is performed, the value of the shared user counter remains unchanged, and the update response mode is incremental data.

[0114] Specifically, in the process of completing the three basic operations of the relationship table, the service response node also needs to complete important operations in the sending delay phase of applying for occupying the round-trip delay, including: when the record creation operation is performed, the value of the locally maintained shared user counter is increased by 1, and the response mode maintained locally by the service response node is updated to full data. When the record deletion operation is performed, the value of the locally maintained shared user counter is decreased by 1, and the response mode maintained locally by the service response node is updated to incremental data. When the record update operation is performed, the value of the locally maintained shared user counter remains unchanged, and the response mode maintained locally by the service response node is updated to incremental data.

[0115] In one embodiment, as shown in Figure 8 When the shared tag of the service request node is invalid or the shared user counter is updated, the response mode is updated to full data or incremental data, and the step of obtaining the updated response data packet includes:

[0116] Step S810, the application occupies the scheduling delay phase in the round-trip delay, reads the response mode.

[0117] Step S820, if the response mode is full data, the backend sub-service node is called to obtain full data; if the response mode is incremental data, the backend sub-service node is called to obtain incremental data.

[0118] Step S830, the full data or incremental data is updated to the response data packet to obtain the updated response data packet.

[0119] Step S840, the application ends the occupation of the scheduling delay phase in the round-trip delay.

[0120] Specifically, after the service response node applies to end the occupation of the sending delay phase in the round-trip delay, the service response node also detects whether the time period (such as 3 seconds) set by the product design of the Internet of Things system expires. If it expires, the application occupies the scheduling delay phase in the round-trip delay, reads the local maintained response mode set in the sending delay; if it has not expired, it exits. The service response node obtains full data by calling the backend sub-service node according to the read response mode. If the response mode is incremental data, the backend sub-service node is called to obtain incremental data. The data (full data or incremental data) obtained from the backend sub-service node is updated to the response data packet. The application ends the scheduling delay phase in the round-trip delay.

[0121] In the above embodiment, when multiple service request nodes share the same service response node to obtain data for synchronous display, the service response node only needs to call the backend sub-service node once to obtain data in the scheduling delay phase, overcoming the defect that the service request and the service response must be one-to-one in the existing Internet of Things technology. The round-trip delay of a single data call chain is reduced, and the time consumed by the backend response node in the processing delay phase is also reduced; the service request has strong fault tolerance in a weak network environment. The service node can automatically sense whether a certain service request is terminated due to network failure or reconnected due to network recovery by using the locally maintained shared user counter. When a certain service request is terminated, the backend response node continues to report incremental data; on the contrary, when a certain service request is reconnected, the backend response node reports full data again, and all request nodes are synchronized with high precision.

[0122] In one example, as shown in Figure 9 , an application scenario in which multiple intelligent terminals (such as mobile phones) interact with a sweeping robot is taken as an example for description.

[0123] In the scenario of a sweeping robot, simultaneous localization and mapping (SLAM) is a software function with high frequency of user operation and relatively large scale of calculation. In order to ensure good user experience, when the user's mobile phone is online and the SLAM human-computer interaction function is turned on, the intelligent terminal will synchronize map data at a high frequency. Taking 3 seconds as the request period of map data, the sweeping robot needs to respond 20 times in one minute. Considering that the computing resources of the sweeping robot itself are extremely limited, frequent responses to data requests from the front-end node will sacrifice the mapping quality of the map, and even affect the motion control of the robot.

[0124] In order to improve the utilization value of the product, the sharing function of the sweeping robot has become a basic function of the sweeping robot, that is, one sweeping robot can be used for shared operation by multiple family members using the intelligent mobile phone terminal. When the sweeping robot is simultaneously used by multiple family members using the intelligent mobile phone terminal to operate the SLAM function online, the service scheduling method provided by the existing distributed Internet of Things platform cannot meet the round-trip time (RTT) technical index required by the product function. The reason is that multiple front-end nodes repeatedly and asynchronously request map data, and the back-end device node is not only prone to computing overload, but also the high-frequency data transmission of the distributed Internet of Things in a weak network environment will cause communication congestion.

[0125] As Figure 9 The Internet of Things example system is composed of three pairs of software modules with computing dependency, S1:APP(User1), S2:Robot; S1:APP(User2), S2:Robot; S1:APP(User3), S2:Robot. Among them, S1 is used to indicate the service request node, and S2 is used to indicate the service response node. It is assumed that the network of S1:APP(User2) and S2:Robot is unstable, and the Internet of Things data communication is in a weak network state. Although the three front-end nodes all use asynchronous scheduling methods, the response frequency of the back-end robot node remains constant within a set time period (such as 3 seconds), and does not change with the increase in the number of front-end request nodes. In addition, the back-end node can automatically perceive the network state of the front-end node. After the network of the front-end node is interrupted, the data call chain of the Internet of Things system can work normally and does not have the communication congestion problem existing in the synchronous call method. When S1 has a network interruption, the data call chain is not affected at all. Only when S1 recovers to normal, S2 needs to adjust the data response strategy once. The S2:Robot node can use the locally maintained shared user counter to adaptively adjust the type of response data. When the value of the shared user counter increases, the response data type is full map data; otherwise, it is incremental map data.

[0126] In the above examples, when the distributed Internet of Things system is in a weak network environment, that is, the network signal stability of a certain computing service node has large fluctuations, and one device is shared by multiple users, the problem of different smart terminals showing out-of-sync data due to inconsistent round-trip delays between nodes is avoided, and the round-trip delay of the distributed Internet of Things system with computing dependency is reduced, without increasing the processing delay of the backend node, and multiple front-end nodes maintain real-time online for high-frequency and large-scale data communication, avoiding the problem of different smart terminals showing out-of-sync data due to inconsistent round-trip delays between nodes.

[0127] It should be understood that, although Figures 3-8 The steps in the flowchart of the application are displayed in sequence according to the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, Figures 3-8 At least part of the steps in the application can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily sequential, but can be alternately executed with other steps or at least part of the sub-steps or stages of other steps.

[0128] In one embodiment, as Figure 10 It is also provided a data synchronization system based on Internet of Things, comprising: a service request node 10 and a service response node 20.

[0129] Wherein, the number of service request nodes 10 can be multiple, and multiple service request nodes 10 are connected to the service response node 20 respectively, the application object of the service request node 10 can be a smart terminal, which can be but not limited to a smart phone, a smart tablet, a notebook computer, a smart wearable device, etc. The application object of the service response node 20 can be a household appliance with Internet of Things function, for example, the household appliance can be but not limited to a television, a washing machine, a refrigerator, a table lamp, a sweeper, a camera, etc.

[0130] Exemplarily, the network communication protocol adopted between the service request node 10 and the service response node 20 is not limited in the present application. Preferably, in the actual engineering development of the Internet of Things system, if the data communication scale between the service request node 10 and the service response node 20 is large, or the network communication environment between the two can be predicted in advance to be weak, the network communication between the service request node 10 and the service response node 20 adopts the MQTT (Message Queuing Telemetry Transport) protocol which is light and has a certain fault-tolerant mechanism for unstable networks. The implementation process of the MQTT protocol adopts a lightweight data communication protocol based on the publish / subscribe mode. That is to say, when multiple user accounts share the same device, the Internet of Things platform subscribes to the same topic message for all user accounts; when the device sends certain data to the platform, the platform actively publishes the corresponding data through the topic, automatically completes the data synchronization of all users once, and does not need to be compensated by additional programming.

[0131] The service request node 10 is used to execute the above-mentioned Internet of Things-based data synchronization method based on the service request node. For example, the service request node 10 can be used to execute the following steps:

[0132] The user type corresponding to the current service request is obtained, and the shared label is initialized; when the user type is a shared user, the shared label is reset to the tracking identifier of the data call chain; the user label is bound with the shared label based on the current service request, the service request data packet is obtained, and the service request data packet is transmitted to the service response node 20, so that the service response node 20 feeds back the updated response data packet according to the service request data packet.

[0133] The service response node 20 is used to execute the above-mentioned Internet of Things-based data synchronization method based on the service response node. For example, the service response node 20 can be used to execute the following steps:

[0134] The service request data packet transmitted by the service request node 10 is obtained; the service request data packet is processed to obtain the shared label and the user label, and the shared user counter is initialized; when the shared label is valid, the user label is read and the shared user counter is updated; when the shared label of the service request node is invalid or the shared user counter is updated, the response mode is updated to full data or incremental data, the updated response data packet is obtained, and the updated response data packet is transmitted to the service request node 10.

[0135] When multiple service request nodes share the same backend response node to obtain data for synchronous display, the backend response node only needs to call the backend sub-service node to obtain data once in the scheduling delay stage, overcoming the defect that service request and service response must be one-to-one in the existing Internet of Things technology. Therefore, the new scheme not only reduces the round-trip delay of a single data call chain, but also reduces the time consumed by the backend response node in the processing delay stage. It has strong fault tolerance capability when the service request is in a weak network environment. The backend response node can automatically sense whether a certain service request is terminated due to network failure or reconnected due to network recovery by using the shared user counter maintained locally. When a certain service request is terminated, the backend response node continues to report incremental data; otherwise, when a certain service request is reconnected, the backend response node reports full data again to synchronize all request nodes with high precision.

[0136] In the above embodiments, when a background device node is shared by multiple front-end nodes in an Internet of Things system, based on the principle of distributed data call chain, the data service scheduling algorithm of the backend node is optimized to reduce the overall round-trip delay of the Internet of Things system, and to realize that the front-end nodes do not display different data due to inconsistent round-trip delay between service nodes. The backend node automatically senses network interruption and recovery, and adaptively adjusts the data type of service response. The computing scale and communication pressure of the backend node remain basically constant and are independent of the number of front-end data request nodes.

[0137] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiments. Any reference to memory, storage, database or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0138] Each technical feature of the above-described embodiments can be combined with any other technical feature, and for the sake of brevity, not all possible combinations are described, but it is understood that the scope of the present disclosure encompasses all such possible combinations.

[0139] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as limiting the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of the patent of the present application should be subject to the appended claims.

Claims

1. A data synchronization method based on the Internet of Things, characterized in that: The following steps are involved: Get the user type corresponding to the current service request and initialize the shared tag; When the user type is a shared user, resetting the shared tag to a tracking identifier of the data call chain; Based on the current service request, the user tag is bound to the shared tag to obtain a service request data packet, and the service request data packet is transmitted to the service response node, so that the service response node feeds back an updated response data packet according to the service request data packet.

2. The data synchronization method based on the Internet of Things according to claim 1, characterized in that: The steps of obtaining the user type corresponding to the current node service request and initializing the shared tag include: Applying for the sending delay phase in the round-trip delay, obtaining the user type corresponding to the current service request by accessing the service response node in the data call chain; Initialize the shared tag to a null data pointer.

3. The data synchronization method based on the Internet of Things according to claim 2, characterized in that: The step of initializing the shared tag then includes: When the user type is a non-sharing user, the sharing tag remains as the empty data pointer.

4. The data synchronization method based on the Internet of Things according to claim 3, characterized in that: After the step of binding the user tag and the shared tag based on the current service request to obtain a service request data packet, the following steps are included: The application ends the sending delay phase in the round trip delay.

5. A data synchronization system based on the Internet of Things, characterized in that: include: Service request node and service response node; The service request node is used to execute the Internet of Things-based data synchronization method described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Data management system and method based on data directory system

    CN111475490A