Method, device, equipment, storage medium and program product for data synchronization

By utilizing the similarity calculation of environmental information between routers in a home sensing scenario, and dynamically synchronizing the matching rule base, the problem of low efficiency in updating sensor matching rules is solved, achieving efficient rule updates and reducing maintenance costs.

CN119363770BActive Publication Date: 2026-04-17CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD
Filing Date
2024-10-23
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In home sensing scenarios, the matching rules of sensors are updated inefficiently, requiring manual OTA updates, which leads to low efficiency and high maintenance costs.

Method used

The first router receives the dynamic distribution request from the second router, calculates the environmental information similarity, and synchronizes the matching rule base to the router with the highest similarity to achieve dynamic updates.

Benefits of technology

It improves the efficiency of updating matching rules, reduces the need for manual updates, and reduces equipment maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363770B_ABST
    Figure CN119363770B_ABST
Patent Text Reader

Abstract

This application discloses a data synchronization method, apparatus, device, storage medium, and program product, applied to a first router. The specific technical solution includes: receiving a dynamic distribution request sent by a second router, the dynamic distribution request including environmental information of the second router, the environmental information being used to characterize the operating environment of the second router; calculating the similarity between the environmental information of the second router and the environmental information of the first router using a preset algorithm; sending the similarity score to the second router; receiving a data synchronization request sent by the second router, the data synchronization request being determined by the second router based on the highest similarity score among at least one similarity score received from the first router; and synchronizing the matching rule base to the second router. Thus, by dynamically synchronizing the matching rules between routers, the update efficiency of the matching rules is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of data transmission technology, and in particular relates to a method, apparatus, device, storage medium and program product for data synchronization. Background Technology

[0002] In a home sensing scenario, response rules are integrated into the sensors. After the sensors collect environmental data, they process the environmental data according to the local feature extraction algorithm to obtain environmental feature data. Then, they search for matching rules that match the environmental feature data in the matching rules and finally respond according to the matching rules.

[0003] For example, in a home sensing scenario, sound wave sensors are equipped with sound wave matching rules. When the sound wave sensor collects a "turn on the light" command from a user, it processes the collected sound wave data using a sound wave feature extraction algorithm to obtain feature data. Then, based on the feature data, it searches for the corresponding matching rule in the sound wave matching rules, thereby sending an "turn on" command to the smart switch corresponding to the light.

[0004] Then, when it is necessary to update the matching rules in the sensor, the sensor needs to be updated manually using over-the-air (OTA) technology. Thus, manually updating the matching rules is inefficient. Summary of the Invention

[0005] This application provides a method, apparatus, device, storage medium, and program product for data synchronization. These can improve the efficiency of updating matching rules.

[0006] In a first aspect, embodiments of this application provide a data synchronization method applied to a first router, the method comprising:

[0007] Receive a dynamic distribution request sent by a second router, wherein the dynamic distribution request includes environmental information of the second router, and the environmental information is used to characterize the usage environment of the second router;

[0008] A preset algorithm is used to calculate the similarity between the environmental information of the second router and the environmental information of the first router;

[0009] Send the similarity score to the second router;

[0010] The second router receives a data synchronization request, which is determined by the second router based on the highest similarity among at least one similarity received from the first router.

[0011] Synchronize the matching rule base to the second router.

[0012] In one possible implementation, the environmental information includes device type information, device usage information, and existing rule information; the step of calculating the similarity between the environmental information of the second router and the environmental information of the first router using a preset algorithm includes:

[0013] The first preset algorithm is used to calculate the ratio of the number of similar devices based on the device type information;

[0014] The second preset algorithm is used to calculate the device usage frequency ratio based on the device usage information;

[0015] The third preset algorithm is used to calculate the proportion of similar rules based on the existing rule information;

[0016] The similarity of the environmental information is obtained by summing the ratio of the number of similar devices, the ratio of device usage frequency, and the ratio of similar rule proportions.

[0017] In one possible implementation, the step of calculating the ratio of the number of similar devices based on the device type information using a first preset algorithm includes:

[0018] Determine the number of devices connected to the first router that have the same device type as those in the device type information;

[0019] Based on the device type information, determine the devices connected to the second router that are of the same type as the devices connected to the first router, and obtain the number of the second devices;

[0020] Calculate the ratio of the number of the first device to the number of the second device to obtain the ratio of the number of devices of the same type.

[0021] In one possible implementation, the step of calculating the device usage frequency ratio based on the device usage information using a second preset algorithm includes:

[0022] Based on the device usage information, the usage frequency of the first device is calculated to obtain a first frequency;

[0023] The second frequency is obtained by statistically analyzing the usage frequency of the second device based on local device usage information.

[0024] Calculate the ratio of the first frequency to the second frequency to obtain the frequency ratio used by the device.

[0025] In one possible implementation, the step of using a third preset algorithm to calculate the proportion of similar rules based on the existing rule information includes:

[0026] Based on the existing rule information, a first response rule matching the first device is determined;

[0027] Calculate the ratio of the number of the first response rules to the total number of response rules in the existing rule information to obtain the proportion of similar rules in the first device;

[0028] Determine the second response rule that matches the second device based on local rule information;

[0029] Calculate the ratio of the number of the second response rules to the total number of response rules in the local rule information to obtain the proportion of similar rules in the second device;

[0030] The ratio of similar rule proportion of the first device to that of the second device is calculated to obtain the similar rule proportion ratio.

[0031] Secondly, embodiments of this application provide a data synchronization method applied to a second router, the method comprising:

[0032] A dynamic distribution request is sent to the first router in the local area network. The dynamic distribution request includes the environmental information of the second router, which is used to characterize the usage environment of the second router.

[0033] The similarity of the environmental information received from at least one first router;

[0034] From the similarity of the environmental information sent by each first router, determine the target similarity with the highest similarity and the target first router corresponding to the target similarity;

[0035] Send a data synchronization request to the target first router;

[0036] Receive the matching rule base sent by the target first router;

[0037] Update the local matching rule base according to the aforementioned matching rule base.

[0038] Thirdly, embodiments of this application provide a data synchronization apparatus applied to a first router, the apparatus comprising:

[0039] The receiving module is used to receive a dynamic distribution request sent by the second router, wherein the dynamic distribution request includes environmental information of the second router, and the environmental information is used to characterize the usage environment of the second router.

[0040] The calculation module is used to calculate the similarity between the environmental information of the second router and the environmental information of the first router using a preset algorithm;

[0041] The sending module is used to send the similarity score to the second router;

[0042] The receiving module is further configured to receive a data synchronization request sent by the second router, wherein the data synchronization request is determined by the second router based on the highest similarity among at least one similarity received from the first router;

[0043] The synchronization module is used to synchronize the matching rule base to the second router.

[0044] Fourthly, embodiments of this application provide a data synchronization apparatus applied to a second router, the apparatus comprising:

[0045] The sending module is used to send a dynamic distribution request to a first router in the local area network. The dynamic distribution request includes the environmental information of the second router, which is used to characterize the usage environment of the second router.

[0046] A receiving module is configured to receive the similarity of the environmental information sent by at least one first router;

[0047] The determining module is used to determine the target similarity with the highest similarity and the target first router corresponding to the target similarity from the similarity of the environmental information sent by each first router;

[0048] The sending module is also used to send a data synchronization request to the target first router;

[0049] The receiving module is also used to receive the matching rule base sent by the target first router;

[0050] The update module is used to update the local matching rule library according to the matching rule library.

[0051] Fifthly, embodiments of this application provide an electronic device, the device comprising: a processor and a memory storing computer program instructions;

[0052] When the processor executes the computer program instructions, it implements a data synchronization method as described in either the first or second aspect.

[0053] Sixthly, embodiments of this application provide a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the data synchronization method as described in either the first or second aspect.

[0054] In a seventh aspect, embodiments of this application provide a computer program product in which instructions, when executed by a processor of an electronic device, cause the electronic device to perform a data synchronization method as described in either the first or second aspect.

[0055] This application discloses a data synchronization method, apparatus, device, storage medium, and program product. A first router receives a dynamic distribution request from a second router, then calculates the similarity between the environmental information of the first router and the second router based on the environmental information carried in the dynamic distribution request. The first router then returns the similarity score to the second router. This similarity score can be used to determine whether the first router and the second router can provide similar functions to the user. The second router then identifies the first router with the highest similarity score from among multiple first routers and sends a data synchronization request to that first router. This data synchronization request instructs the first router to synchronize its local matching rule base. Finally, the second router receives the synchronized matching rule base from the first router. Thus, after the first router returns the environmental information similarity score to the second router, the second router determines that the first router has the highest similarity score, meaning that the first router and the second router are most likely to provide the same functions. Therefore, the first router and the second router can dynamically update each other's matching rule bases. This avoids manual updates to the matching rules and improves the efficiency of matching rule updates. Attached Figure Description

[0056] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0057] Figure 1 This application provides a schematic diagram of a system architecture using the data synchronization method provided in this application embodiment;

[0058] Figure 2 This is a flowchart illustrating a data synchronization method provided in an embodiment of this application;

[0059] Figure 3 This is a flowchart illustrating a method for calculating similarity provided in an embodiment of this application;

[0060] Figure 4 This is a flowchart illustrating a method for calculating the ratio of similar equipment quantities provided in an embodiment of this application;

[0061] Figure 5 This is an exemplary schematic diagram of a similar rule-based ratio calculation method provided in an embodiment of this application;

[0062] Figure 6 This is an exemplary schematic diagram of a virtual switch provided in an embodiment of this application;

[0063] Figure 7 This is a schematic diagram of the structure of a data processing module provided in an embodiment of this application;

[0064] Figure 8 This is an exemplary schematic diagram of a data synchronization method provided in an embodiment of this application;

[0065] Figure 9 This is an exemplary schematic diagram of another data synchronization method provided in the embodiments of this application;

[0066] Figure 10 This is a flowchart illustrating another data synchronization method provided in an embodiment of this application;

[0067] Figure 11 This is an exemplary schematic diagram of another data synchronization method provided in the embodiments of this application;

[0068] Figure 12 This is a schematic diagram of the structure of a data synchronization device provided in an embodiment of this application;

[0069] Figure 13 This is a schematic diagram of another data synchronization device provided in an embodiment of this application.

[0070] Figure 14 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation

[0071] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0072] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0073] Currently, in a home setting, the following two methods can be used to achieve scene awareness:

[0074] Option 1: Deploy sensors in the home environment to collect environmental data, such as sound wave data, radio wave data, and light intensity data. The sensors then upload this data to a cloud server, which matches response rules based on the environmental data and distributes these rules to devices within the home environment. The devices then respond according to these rules.

[0075] For Solution 1 above, the processing time is relatively long and the equipment response is slow.

[0076] Option 2: Integrate feature extraction algorithms and rule matching functions into the sensor. The sensor extracts features from the collected environmental data and matches response rules based on the extracted feature data.

[0077] Regarding Scheme 2 above, when it is necessary to update the feature extraction algorithm and response rules, users need to manually update the sensor or replace the entire sensor, resulting in high equipment maintenance costs.

[0078] To address the problems existing in the prior art, embodiments of this application provide a data synchronization method, apparatus, device, storage medium, and program product, firstly based on... Figure 1 This application introduces a system framework for applying the above-described data synchronization method, as provided in an embodiment. For example... Figure 1 As shown, the system includes a cloud server, an edge router, and sensors.

[0079] Specifically, users can also configure matching rules on the cloud server, and the cloud server will send the configured matching rules to the edge router.

[0080] Sensors are used to collect environmental data and upload the collected environmental data to the edge router.

[0081] The edge router uses a built-in feature extraction algorithm to process environmental data and searches for matching rules that match the environmental data in the built-in response rule database.

[0082] In addition, edge routers can synchronize matching rules across all edge routers.

[0083] Specifically, the methods for data synchronization between edge routers are as follows: Figure 2 As shown, this method is applied to the first router, and the data synchronization method specifically includes:

[0084] S201. Receive the dynamic distribution request sent by the second router.

[0085] The dynamic distribution request includes the environmental information of the second router, which is used to characterize the operating environment of the second router.

[0086] The first router and the second router belong to the same local area network (LAN). Routers within the LAN use the same communication protocol. The LAN includes multiple routers; the second router initiates the dynamic distribution request, and the first router receives the request.

[0087] Specifically, the second router can periodically send dynamic distribution requests to the first router to synchronize the matching rules within each router. The second router can also trigger a dynamic distribution request to the first router when it detects a new device accessing the network.

[0088] S202. Calculate the similarity between the environmental information of the second router and the environmental information of the first router using a preset algorithm.

[0089] S203, Send the similarity score to the second router.

[0090] S204. Receive the data synchronization request sent by the second router.

[0091] The data synchronization request is determined by the second router based on the highest similarity among at least one similarity values ​​sent by the first router.

[0092] Understandably, the second router sends dynamic distribution requests to the first router within the local area network, thus the second router can receive the similarity scores returned by each first router.

[0093] S205. Synchronize the matching rule base to the second router.

[0094] Using the above method, the first router receives a dynamic distribution request from the second router, then calculates the similarity between the environmental information of the first and second routers based on the environmental information carried in the dynamic distribution request, and then returns this similarity to the second router. This similarity can be used to determine whether the first and second routers can provide similar functions to the user. The second router then identifies the first router with the highest similarity from among multiple first routers and sends a data synchronization request to that first router. This data synchronization request instructs the first router to synchronize its local matching rule base, and finally, the second router receives the synchronized matching rule base from the first router. Thus, after the first router returns the environmental information similarity to the second router, the second router determines that the first router has the highest similarity, meaning that the first and second routers are most likely to provide the same functions. Therefore, the first and second routers can dynamically update each other's matching rule bases, avoiding manual updates to the matching rules and improving the efficiency of matching rule updates.

[0095] The following section provides a detailed introduction to methods for calculating environmental information similarity, such as... Figure 3 As shown, the above-mentioned S202, which calculates the similarity between the environmental information of the second router and the environmental information of the first router using a preset algorithm, can be implemented as follows:

[0096] S2021. The first preset algorithm is used to calculate the ratio of the number of similar devices based on the device type information.

[0097] The device type information includes the type of device accessed through the router. For example, the device can be a sensor, and the device type of the sensor can be an optical sensor or an acoustic sensor.

[0098] The ratio of similar devices refers to the ratio of the number of devices of the same type connected to the first router to the number of devices connected to the second router.

[0099] Understandably, the larger the ratio of the number of similar devices, the more devices of the same type are connected to the first router and the second router, and the greater the likelihood that the first router and the second router provide the same function.

[0100] Specifically, the first router calculates the ratio of the number of similar devices using the following method: Figure 4 As shown, the method includes:

[0101] S401. Determine the number of devices with the same device type as those in the device type information among the devices connected to the first router.

[0102] Specifically, the first router obtains the device types included in the device type information sent by the second router, thus obtaining the device types of the devices connected to the second router. Then, it obtains the device types of the devices connected to the first router. By comparing the device types of the devices connected to the first router and the device types of the devices connected to the second router, it obtains the number of devices with the same device type. Here, the "first device" refers to the device connected to the first router that has the same device type as the device connected to the second router.

[0103] For example, the device type information sent by the second router includes device type A and device type B. The first router finds the devices corresponding to device type A and device type B in the downstream devices, which are the first devices.

[0104] S402. Based on the local device type information, determine the number of devices of the same type connected to the first router, and obtain the number of second devices.

[0105] Specifically, after the first router identifies the target device with the same device type as the device type in the device type information among the locally connected devices, it determines the device type of the target device in the device type information based on the device type of the target device, and then determines the number of devices corresponding to the device type of the target device in the device type information.

[0106] Continuing with the example above, the first router finds the device corresponding to device type A in the downstream devices, and then finds the number of devices corresponding to device type A in the device type information sent by the second router to obtain the number of the second devices.

[0107] S403. Calculate the ratio of the number of the first device to the number of the second device to obtain the ratio of the number of devices of the same type.

[0108] Understandably, a higher ratio of the number of similar devices indicates a greater number of devices of the same type connected to both the first and second routers, and a greater likelihood that the first and second routers provide the same functionality. Thus, by using device type information, the first router can determine the number of devices of the same type connected to both the first and second routers, thereby determining the similarity between the first and second routers in terms of the number of devices.

[0109] S2022. The second preset algorithm is used to calculate the ratio of device usage frequency based on device usage information.

[0110] Specifically, the first router calculates the usage frequency of the first device based on its usage information to obtain a first frequency. It then calculates the usage frequency of the second device based on its local device usage information to obtain a second frequency. Finally, it calculates the ratio of the first frequency to the second frequency to obtain the device usage frequency ratio.

[0111] The first device is the target device whose device type is the same as that in the device type information sent by the first router and the second router, and the second device is the device in the second router whose device type is the same as that of the target device.

[0112] Understandably, the higher the frequency of device usage, the more likely that the router corresponding to that device has the latest matching rules. Therefore, the calculated ratio of device usage frequency can determine the probability that the router contains the latest matching rules.

[0113] S2023. The third preset algorithm is used to calculate the proportion of similar rules based on existing rule information.

[0114] Specifically, the first router calculates the proportion of similar rules using the following method: Figure 5 As shown, this specifically includes:

[0115] S501. Determine the first response rule that matches the first device based on the existing rule information.

[0116] S502. Calculate the ratio of the number of first matching rules to the total number of matching rules in the existing rule information to obtain the proportion of similar rules of the first device.

[0117] S503. Determine the second matching rule that matches the second device based on the local rule information.

[0118] S504. Calculate the ratio of the number of second matching rules to the total number of matching rules in the local rule information to obtain the proportion of similar rules of the second device;

[0119] S505. Calculate the ratio of the proportion of similar rules of the first device to the proportion of similar rules of the second device to obtain the ratio of similar rules.

[0120] In one example, the first device includes devices of device type A and devices of device type B. The existing rule information includes 10 rules, and the response rules that match the first device in the existing rule information include rule 1, rule 2, rule 3, and rule 4. Therefore, the similarity rule ratio for the first device is 4 / 10 = 0.4. The local rule information includes 12 rules, and the response rules that match the second device in the local rule information include rule A, rule B, and rule C. Therefore, the similarity rule ratio for the second device is 3 / 12 = 0.25. The calculated similarity rule ratio is 0.4 / 0.25 = 1.6.

[0121] S2024. Calculate the sum of the ratio of the number of similar devices, the ratio of device usage frequency, and the ratio of similar rule proportions to obtain the similarity of environmental information.

[0122] The method provided in this application calculates the ratio of the number of similar devices between the first router and the second router using device type information, the ratio of device usage frequency between the first router and the second router using device usage information, and the ratio of the proportion of similar rules between the first router and the second router using existing rule information. The ratio of the number of similar devices, the ratio of device usage frequency, and the ratio of the proportion of similar rules can each measure the similarity between the first router and the second router from three dimensions. Therefore, based on the calculated ratios of the number of similar devices, the ratio of device usage frequency, and the ratio of the proportion of similar rules, summing these ratios yields the similarity of environmental information between the first router and the second router. Thus, by comprehensively considering the three dimensions of device type, usage, and matching rules, the similarity can be accurately calculated.

[0123] The following combination Figure 6 This application provides an embodiment of the internal structure of a router, such as... Figure 6 As shown, the edge router is a general-purpose x-architecture server, which uses Network Function Virtualization (NFV) technology to build a virtual switch. The virtual switch includes a rule matching module, a data processing module, an east-west communication module, and a routing and forwarding module.

[0124] Edge routers can connect both sensors and regular devices. For example, sensors can be acoustic or optical sensors, and regular devices can be mobile phones or tablets.

[0125] Specifically, sensors collect environmental data and upload it to an edge router. The data processing module in the edge router receives the environmental data uploaded by the sensors, selects the corresponding feature extraction algorithm based on the data type, and extracts features from the environmental data to obtain scene feature data.

[0126] The data processing module includes multiple feature extraction sub-modules, each corresponding to a feature extraction algorithm. These algorithms can be standard or custom-designed.

[0127] Sensors using standard data types correspond to standard feature extraction algorithms, while sensors using custom data types correspond to custom feature extraction algorithms.

[0128] Specifically, when a new sensor is connected to the edge router, the new sensor uploads its corresponding feature extraction algorithm to the data processing module.

[0129] like Figure 7As shown, the data processing module in router 1 includes feature extraction algorithm 1, feature extraction algorithm 2, and feature extraction algorithm 3. Sensor 3 corresponds to feature extraction algorithm 1, sensor 2 corresponds to feature extraction algorithm 2, and sensor 4 corresponds to feature extraction algorithm 3. Sensors 3 and 1 are standard access sensors, and correspondingly, feature extraction algorithm 1 is a standard feature extraction algorithm. Sensor 2 is a customized sensor; therefore, when sensor 2 is connected to router 1, sensor 2 uploads its algorithm, synchronizing the local feature extraction algorithm to router 1.

[0130] The data processing module in router 2 includes feature extraction algorithm 2, and the sensor corresponding to feature extraction algorithm 2 is sensor 2 connected to router 2.

[0131] After processing the environmental data, the data processing module obtains environmental feature data and sends it to the rule matching module. The rule matching module then searches for the matching rule corresponding to the environmental feature data in its local matching rule library.

[0132] Furthermore, the data processing module collects device data and sends the device data and the rules in the matching rule library of the rule matching module to the east-west communication module. The east-west communication module then sends the aforementioned device data and the rules in the matching rule library of the rule matching module as environmental information to other edge routers within the local area network.

[0133] The east-west communication module is used to enable the exchange of environmental information and the distribution of matching rules between edge routers. Specifically, edge routers exchange data through a customized communication protocol. By using this customized protocol, environmental information and matching rules can be distinguished from other communication traffic, ensuring the security and real-time nature of data exchange.

[0134] Specifically, the process of data exchange between edge routers via east-west communication modules is as follows: Figure 8 As shown in the diagram, edge router 1 obtains local device type information, usage information, and existing rule information, and synchronizes environmental information through the east-west communication module. Specifically, the east-west communication module encrypts the environmental information using a customized communication protocol and sends the encrypted environmental information to edge router 2. The east-west communication module in edge router 2 decrypts the encrypted environmental information according to the customized communication protocol, thereby obtaining the environmental information of edge router 1.

[0135] In addition, for ordinary traffic sent by ordinary devices received by edge router 1, edge router 1 sends ordinary traffic to edge router 2 through the routing forwarding module, and the routing forwarding module in edge router 2 processes the received ordinary traffic accordingly.

[0136] The routing and forwarding module is used to implement the router's data communication function and complete network data forwarding. Specifically, after receiving data traffic from ordinary devices, it forwards the received data traffic to other edge routers.

[0137] In addition, the routing and forwarding module can forward environmental feature data in a targeted manner based on the matching rules found by the rule matching module.

[0138] In the above Figure 6 Based on the illustrated embodiments, combined with Figure 9 This application introduces a data synchronization method provided in its embodiments, such as... Figure 9 As shown:

[0139] Figure 9 An example is shown of three edge routers included in a local area network.

[0140] When edge router 2 initiates a dynamic allocation request, edge router 1 and edge router 3 receive the dynamic allocation request, calculate the similarity of the environmental information, and return the similarity of the environmental information to edge router 2.

[0141] In this process, edge router 2 determines the environmental information corresponding to the edge router based on the data processing module and rule matching module in the virtual switch. The environmental information includes device type information, usage information, and existing rule information.

[0142] If edge router 2 determines that edge router 3 has the highest similarity value among the received similarities, then edge router 2 requests a matching rule set from edge router 3, and edge router 3 returns the matching rule set to edge router 2.

[0143] Based on the same concept, this application also provides a data synchronization method, which is applied to a second router, such as... Figure 10 As shown, the method includes:

[0144] S1001, Send a dynamic distribution request to the first router in the local area network.

[0145] The dynamic distribution request includes the environmental information of the second router, which is used to characterize the operating environment of the second router.

[0146] S1002, Receive the similarity of environmental information sent by at least one first router.

[0147] The method by which the first router calculates the similarity of environmental information is described in the above embodiments and will not be repeated here.

[0148] S1003. From the similarity of the environmental information sent by each first router, determine the target similarity with the highest similarity and the target first router corresponding to the target similarity.

[0149] S1004. Send a data synchronization request to the target first router.

[0150] S1005, Receive the matching rule base sent by the target first router.

[0151] S1006. Update the local matching rule library according to the matching rule library.

[0152] Using the method provided in this application embodiment, a first router receives a dynamic distribution request sent by a second router, then calculates the similarity between the environmental information of the first router and the second router based on the environmental information carried in the dynamic distribution request, and then returns the similarity to the second router. This similarity can be used to determine whether the first router and the second router can provide similar functions to the user. The second router then determines the first router with the highest similarity from among multiple first routers and sends a data synchronization request to that first router. This data synchronization request instructs the first router to synchronize its local matching rule base, and finally, the second router receives the synchronized matching rule base from the first router. Thus, after the first router returns the environmental information similarity to the second router, the second router determines that the first router has the highest similarity, meaning that the first router and the second router are most likely to provide the same functions. Therefore, the first router and the second router can dynamically update each other's matching rule bases. This avoids manual updates to the matching rules and improves the efficiency of matching rule updates.

[0153] Based on the above embodiments, combined with Figure 11 This application introduces a method for dynamically distributing matching rules according to embodiments, such as... Figure 11 As shown, the method includes:

[0154] S1101, Calculate your own environmental information.

[0155] Specifically, when a new device is connected to the router or when the preset update time is reached, the router calculates the environmental information through the aforementioned data processing module and rule matching module.

[0156] S1102. Distribute environmental information through the east-west communication module.

[0157] Specifically, the methods for environment synchronization and matching rule distribution among edge routers are described in the above embodiments and will not be repeated here.

[0158] S1103. Compare the similarity returned by all routers.

[0159] S1104. Select the router with the highest similarity and request its matching rule set.

[0160] S1105. Determine if there are matching rules for the new device.

[0161] If yes, then execute S1106; otherwise, end the process.

[0162] S1106. Use the corresponding matching rule as the recommended matching rule.

[0163] It should be noted that if the matching rule set includes matching rules for new devices, these matching rules can be recommended to users so that they can manually modify them according to their actual business needs.

[0164] By employing the method provided in this application, and setting feature extraction algorithms and matching rules in the edge router, the data flow path can be reduced, thereby ensuring the timeliness of scene perception. Furthermore, when a new device connects, if the new device uses a standard feature extraction algorithm, a correspondence between the new device's data format and the standard feature extraction algorithm can be established. If the new device uses a customized feature extraction algorithm, it can upload the customized algorithm to the edge router without manually updating the feature extraction algorithm in the edge router, thus reducing device maintenance costs. In addition, the edge router, through the interaction of environmental information, completes the synchronization of the matching rule set, achieves dynamic distribution of matching rules between edge routers, and realizes the updating of matching rules in the edge router, further reducing device maintenance costs and enabling timely updates of the matching rules corresponding to the device, thereby improving the accuracy of scene perception.

[0165] Based on the same concept, embodiments of this application also provide a data synchronization device, applied to a first router, such as... Figure 12 As shown, the device includes:

[0166] The receiving module 1201 is used to receive a dynamic distribution request sent by the second router, wherein the dynamic distribution request includes environmental information of the second router, and the environmental information is used to characterize the usage environment of the second router.

[0167] The calculation module 1202 is used to calculate the similarity between the environmental information of the second router and the environmental information of the first router using a preset algorithm;

[0168] Sending module 1203 is used to send the similarity to the second router;

[0169] The receiving module 1201 is further configured to receive a data synchronization request sent by the second router, wherein the data synchronization request is determined by the second router based on the highest similarity among at least one similarity received from the first router;

[0170] Synchronization module 1204 is used to synchronize the matching rule base to the second router.

[0171] In one possible implementation, the environmental information includes device type information, device usage information, and existing rule information; the calculation module 1202 is specifically used for:

[0172] The first preset algorithm is used to calculate the ratio of the number of similar devices based on the device type information;

[0173] The second preset algorithm is used to calculate the device usage frequency ratio based on the device usage information;

[0174] The third preset algorithm is used to calculate the proportion of similar rules based on the existing rule information;

[0175] The similarity of the environmental information is obtained by summing the ratio of the number of similar devices, the ratio of device usage frequency, and the ratio of similar rule proportions.

[0176] In one possible implementation, the computing module 1202 is specifically used for:

[0177] Determine the number of devices connected to the first router that have the same device type as those in the device type information;

[0178] Based on the device type information, determine the devices connected to the second router that are of the same type as the devices connected to the first router, and obtain the number of the second devices;

[0179] Calculate the ratio of the number of the first device to the number of the second device to obtain the ratio of the number of devices of the same type.

[0180] In one possible implementation, the computing module 1202 is specifically used for:

[0181] Based on the device usage information, the usage frequency of the first device is calculated to obtain a first frequency;

[0182] The second frequency is obtained by statistically analyzing the usage frequency of the second device based on local device usage information.

[0183] Calculate the ratio of the first frequency to the second frequency to obtain the frequency ratio used by the device.

[0184] In one possible implementation, the computing module 1202 is specifically used for:

[0185] Based on the existing rule information, a first matching rule is determined that matches the first device;

[0186] Calculate the ratio of the number of the first matching rules to the total number of matching rules in the existing rule information to obtain the proportion of similar rules of the first device;

[0187] Determine a second matching rule that matches the second device based on local rule information;

[0188] Calculate the ratio of the number of the second matching rules to the total number of matching rules in the local rule information to obtain the proportion of similar rules in the second device;

[0189] The ratio of similar rule proportion of the first device to that of the second device is calculated to obtain the similar rule proportion ratio.

[0190] It should be noted that the data synchronization device is the same as the data synchronization method described above. All implementation methods in the above method embodiments are applicable to the embodiments of this device and can achieve the same technical effect.

[0191] Based on the same concept, embodiments of this application provide a data synchronization device applied to a second router, such as... Figure 13 As shown, the device includes:

[0192] The sending module 1301 is used to send a dynamic distribution request to a first router in the local area network. The dynamic distribution request includes environmental information of the second router, which is used to characterize the usage environment of the second router.

[0193] The receiving module 1302 is used to receive the similarity of the environmental information sent by at least one first router;

[0194] The determining module 1303 is used to determine the target similarity with the highest similarity and the target first router corresponding to the target similarity from the similarity of the environmental information sent by each first router;

[0195] The sending module 1301 is also used to send a data synchronization request to the target first router;

[0196] The receiving module 1302 is also used to receive the matching rule base sent by the target first router;

[0197] The update module 1304 is used to update the local matching rule library according to the matching rule library.

[0198] It should be noted that the data synchronization device is the same as the data synchronization method described above. All implementation methods in the above method embodiments are applicable to the embodiments of this device and can achieve the same technical effect.

[0199] Figure 14 A schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application is shown.

[0200] An electronic device may include a processor 1401 and a memory 1402 storing computer program instructions.

[0201] Specifically, the processor 1401 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0202] Memory 1402 may include mass storage for data or instructions. For example, and not limitingly, memory 1402 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 1402 may include removable or non-removable (or fixed) media. Where appropriate, memory 1402 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 1402 is non-volatile solid-state memory.

[0203] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to one aspect of this disclosure.

[0204] The processor 1401 implements any of the data synchronization methods described in the above embodiments by reading and executing computer program instructions stored in the memory 1402.

[0205] In one example, the electronic device may also include a communication interface 1403 and a bus 1404. For example, Figure 14As shown, the processor 1401, memory 1402, and communication interface 1403 are connected through bus 1404 and complete communication with each other.

[0206] The communication interface 1403 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0207] Bus 1404 includes hardware, software, or both, that couples components of an electronic device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 1404 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.

[0208] Furthermore, in conjunction with the data synchronization methods described in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the data synchronization methods described in the above embodiments.

[0209] In conjunction with the data synchronization methods in the above embodiments, this application embodiment can provide a computer program product in which the instructions are executed by the processor of an electronic device, causing the electronic device to perform any of the data synchronization methods in the above embodiments.

[0210] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0211] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0212] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0213] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0214] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method of data synchronization, characterized by, Applied to a first router, the method includes: The system receives a dynamic distribution request sent by a second router. The dynamic distribution request includes environmental information of the second router. The environmental information is used to characterize the usage environment of the second router. The environmental information is information obtained by the second router based on multiple sensors. The environmental information includes device type information, device usage information, and existing rule information. A preset algorithm is used to calculate the similarity between the environmental information of the second router and the environmental information of the first router; Send the similarity score to the second router; The second router receives a data synchronization request, which is determined by the second router based on the highest similarity among at least one similarity received from the first router. The matching rule base is synchronized to the second router, and the matching rules in the matching rule base are obtained by the first router from the cloud server.

2. The method of claim 1, wherein, The step of calculating the similarity between the environmental information of the second router and the environmental information of the first router using a preset algorithm includes: The first preset algorithm is used to calculate the ratio of the number of similar devices based on the device type information; The second preset algorithm is used to calculate the device usage frequency ratio based on the device usage information; The third preset algorithm is used to calculate the proportion of similar rules based on the existing rule information; The similarity of the environmental information is obtained by summing the ratio of the number of similar devices, the ratio of device usage frequency, and the ratio of similar rule proportions.

3. The method of claim 2, wherein, The step of calculating the ratio of the number of similar devices based on the device type information using the first preset algorithm includes: Determine the number of devices connected to the first router that have the same device type as those in the device type information; Based on the device type information, determine the devices connected to the second router that are of the same type as the devices connected to the first router, and obtain the number of the second devices; Calculate the ratio of the number of the first device to the number of the second device to obtain the ratio of the number of devices of the same type.

4. The method of claim 3, wherein, The step of calculating the device usage frequency ratio based on the device usage information using the second preset algorithm includes: Based on the device usage information, the usage frequency of the first device is calculated to obtain a first frequency; The second frequency is obtained by statistically analyzing the usage frequency of the second device based on local device usage information. Calculate the ratio of the first frequency to the second frequency to obtain the frequency ratio used by the device.

5. The method of claim 3, wherein, The step of using a third preset algorithm to calculate the proportion of similar rules based on the existing rule information includes: Based on the existing rule information, a first matching rule is determined that matches the first device; Calculate the ratio of the number of the first matching rules to the total number of matching rules in the existing rule information to obtain the proportion of similar rules of the first device; Determine a second matching rule that matches the second device based on local rule information; Calculate the ratio of the number of the second matching rules to the total number of matching rules in the local rule information to obtain the proportion of similar rules in the second device; The ratio of similar rule proportion of the first device to that of the second device is calculated to obtain the similar rule proportion ratio.

6. A method of data synchronization, characterized by, Applied to a second router, the method includes: A dynamic distribution request is sent to the first router in the local area network. The dynamic distribution request includes the environmental information of the second router. The environmental information is used to characterize the usage environment of the second router. The environmental information is information obtained by the second router based on multiple sensors. The environmental information includes device type information, device usage information and existing rule information. The similarity of the environmental information received from at least one first router; From the similarity of the environmental information sent by each first router, determine the target similarity with the highest similarity and the target first router corresponding to the target similarity; Send a data synchronization request to the target first router; Receive the matching rule base sent by the target first router; The local matching rule library is updated according to the matching rule library, wherein the matching rules in the matching rule library are obtained by the first router from the cloud server.

7. An apparatus for data synchronization, the apparatus comprising: Applied to a first router, the device includes: The receiving module is used to receive a dynamic distribution request sent by the second router. The dynamic distribution request includes environmental information of the second router. The environmental information is used to characterize the usage environment of the second router. The environmental information is information obtained by the second router based on multiple sensors. The environmental information includes device type information, device usage information, and existing rule information. The calculation module is used to calculate the similarity between the environmental information of the second router and the environmental information of the first router using a preset algorithm; The sending module is used to send the similarity score to the second router; The receiving module is further configured to receive a data synchronization request sent by the second router, wherein the data synchronization request is determined by the second router based on the highest similarity among at least one similarity received from the first router; The synchronization module is used to synchronize the matching rule base to the second router. The matching rules in the matching rule base are obtained by the first router from the cloud server.

8. An apparatus for data synchronization, the apparatus comprising: The device, applied to a second router, includes: The sending module is used to send a dynamic distribution request to the first router in the local area network. The dynamic distribution request includes the environmental information of the second router. The environmental information is used to characterize the usage environment of the second router. The environmental information is information obtained by the second router based on multiple sensors. The environmental information includes device type information, device usage information and existing rule information. A receiving module is configured to receive the similarity of the environmental information sent by at least one first router; The determining module is used to determine the target similarity with the highest similarity and the target first router corresponding to the target similarity from the similarity of the environmental information sent by each first router; The sending module is also used to send a data synchronization request to the target first router; The receiving module is also used to receive the matching rule library sent by the target first router; The update module is used to update the local matching rule library according to the matching rule library, wherein the matching rules in the matching rule library are obtained by the first router from the cloud server.

9. An electronic device, comprising: The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the data synchronization method as described in any one of claims 1-5 or 6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the data synchronization method as described in any one of claims 1-5 or 6.

11. A computer program product, characterised in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device performs the data synchronization method as described in any one of claims 1-5 or 6.

Citation Information

Patent Citations

  • Key configuration automatic synchronization method among wireless routers

    CN105392140A

  • Configuration method and device of intelligent equipment, electronic equipment and storage medium

    CN116032680A

  • Self-configuring network devices

    US10419282B1