Data Transmission Method, Apparatus, Device and Medium

By applying preset sorting strategies in the Internet of Things to update the data structure, judge and generate differentially related data, the problem of frequent transmission of the same data in the Internet of Things is solved, and efficient data transmission is achieved in a weak network environment.

CN119766830BActive Publication Date: 2025-06-03HANGZHOU HAOLINK INTELLIGENT TECHNOLOGY CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510259132.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-06
Publication Date
2025-06-03
Estimated Expiration
2045-03-06

AI Technical Summary

Technical Problem

In the Internet of Things transmission, when the client uploads data of the same data structure at different times, it frequently transmits the same data, resulting in increased network pressure and increased network overhead, especially inefficient in weak network environments.

Method used

By obtaining the data to be synchronized, the data structure is updated using a preset sorting strategy to determine whether candidate historical synchronization data exists. If it exists, it is determined to refer to historical synchronization data and differential correlation data, generate the current transmission data and send it to the server. The server generates and stores the current synchronization data based on these data, and the client receives the data identification for storage.

Benefits of technology

It reduces the amount of data transmission between the client and the server, improves data transmission efficiency, and is effective especially in scenarios where the data structure is the same and the difference is small.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766830B_ABST
    Figure CN119766830B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention discloses a data transmission method, apparatus, device, and medium. The method includes: obtaining data to be synchronized, and updating the data to be synchronized according to a preset sorting strategy to obtain current synchronized data; determining a current data structure of the current synchronized data, and determining whether there is candidate historical synchronized data under the current data structure; if so, determining reference historical synchronized data from the candidate historical synchronized data, and determining current transmission data corresponding to the current synchronized data according to the reference historical synchronized data and the current synchronized data; sending the current transmission data to a server, so that the server generates and stores the current synchronized data according to the current transmission data and the candidate historical synchronized data, and determines a current data identifier of the current synchronized data; receiving the current data identifier fed back by the server, and storing the current synchronized data and the current data identifier. The efficiency of data transmission is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the technical field of data transmission, and in particular, to a data transmission method, apparatus, device, and medium. Background Art

[0002] In Internet of Things transmission, when a client uploads data with the same data structure at different times, there will be identical parts in the uploaded data. Frequent transmission of the same data, especially in a weak network environment, greatly increases the network pressure and network overhead. Therefore, how to reduce the amount of transmitted data and improve data transmission efficiency is crucial. Summary of the Invention

[0003] The present invention provides a data transmission method, apparatus, device, and medium to reduce the amount of transmitted data and improve data transmission efficiency.

[0004] According to one aspect of the present invention, there is provided a data transmission method applied to a client, the method including:

[0005] Obtain data to be synchronized, and update the data to be synchronized according to a preset sorting strategy to obtain current synchronized data;

[0006] Determine the current data structure of the current synchronized data, and determine whether there is candidate historical synchronized data under the current data structure;

[0007] If there is, determine reference historical synchronized data from the candidate historical synchronized data, and determine current transmission data corresponding to the current synchronized data according to the reference historical synchronized data and the current synchronized data; wherein, the current transmission data includes a reference data identifier of the reference historical synchronized data, and differential associated data;

[0008] Send the current transmission data to a server, so that the server generates and stores the current synchronized data according to the current transmission data and the candidate historical synchronized data, and determines a current data identifier of the current synchronized data;

[0009] Receive the current data identifier fed back by the server, and store the current synchronized data and the current data identifier.

[0010] According to another aspect of the present invention, there is provided a data transmission method applied to a server, the method including:

[0011] Receive the current transmission data sent by the client; wherein, the current transmission data is obtained by the client comparing the current synchronization data updated from the to-be-synchronized data according to a preset sorting strategy with the reference historical synchronization data determined from the candidate historical synchronization data; the current transmission data includes the reference data identifier of the reference historical synchronization data and the difference correlation data.

[0012] Determine the reference historical synchronization data from the candidate historical synchronization data according to the reference data identifier, and generate the current synchronization data according to the difference correlation data and the reference historical synchronization data.

[0013] Determine the current data identifier of the current synchronization data, and store the current synchronization data and the current data identifier.

[0014] Send the current data identifier to the client so that the client stores the current synchronization data and the current data identifier.

[0015] According to another aspect of the present invention, there is provided a data transmission device configured in a client, and the device includes:

[0016] A current synchronization data determination module, configured to obtain the to-be-synchronized data and update the to-be-synchronized data according to a preset sorting strategy to obtain the current synchronization data.

[0017] A historical synchronization data judgment module, configured to determine the current data structure of the current synchronization data and judge whether there is candidate historical synchronization data under the current data structure.

[0018] A current transmission data determination module, configured to, if any, determine the reference historical synchronization data from the candidate historical synchronization data, and determine the current transmission data corresponding to the current synchronization data according to the reference historical synchronization data and the current synchronization data; wherein, the current transmission data includes the reference data identifier of the reference historical synchronization data and the difference correlation data.

[0019] A current transmission data sending module, configured to send the current transmission data to the server so that the server generates and stores the current synchronization data according to the current transmission data and the candidate historical synchronization data, and determines the current data identifier of the current synchronization data.

[0020] A data storage module, configured to receive the current data identifier fed back by the server and store the current synchronization data and the current data identifier.

[0021] According to another aspect of the present invention, there is provided a data transmission device configured in a server, and the device includes:

[0022] A current transmission data receiving module, configured to receive current transmission data sent by a client; wherein, the current transmission data is obtained by the client comparing current synchronization data updated from to-be-synchronized data acquired according to a preset sorting policy with reference historical synchronization data determined from candidate historical synchronization data; the current transmission data includes a reference data identifier of the reference historical synchronization data and difference-associated data.

[0023] A current synchronization data generating module, configured to determine reference historical synchronization data from the candidate historical synchronization data according to the reference data identifier, and generate current synchronization data according to the difference-associated data and the reference historical synchronization data.

[0024] A current data identifier determining module, configured to determine a current data identifier of the current synchronization data, and store the current synchronization data and the current data identifier.

[0025] A current data identifier sending module, configured to send the current data identifier to the client, so that the client stores the current synchronization data and the current data identifier.

[0026] According to another aspect of the present invention, there is provided an electronic device, including:

[0027] One or more processors;

[0028] A memory, configured to store one or more programs;

[0029] When the one or more programs are executed by the one or more processors, the one or more processors are enabled to execute any one of the data transmission methods provided by the embodiments of the present invention.

[0030] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for enabling a processor to implement any one of the data transmission methods provided by the embodiments of the present invention when executed.

[0031] An embodiment of the present invention provides a data transmission solution. By obtaining the data to be synchronized and updating the data to be synchronized according to a preset sorting strategy, the current synchronized data is obtained; determining the current data structure of the current synchronized data, and determining whether there is candidate historical synchronized data under the current data structure; if so, determining the reference historical synchronized data from the candidate historical synchronized data, and determining the current transmission data corresponding to the current synchronized data according to the reference historical synchronized data and the current synchronized data; wherein, the current transmission data includes the reference data identifier of the reference historical synchronized data and the differential association data; sending the current transmission data to the server, so that the server generates and stores the current synchronized data according to the current transmission data and the candidate historical synchronized data, and determines the current data identifier of the current synchronized data; receiving the current data identifier fed back by the server, and storing the current synchronized data and the current data identifier. In the above solution, the client sends the current transmission data including the reference data identifier and the differential association data to the server, so that the server generates the current synchronized data according to the current transmission data and the stored candidate historical synchronized data, realizing that when there is candidate historical synchronized data in the client and the server under the current data structure, the client does not need to send the repeated part of the data again, reducing the amount of data transmitted between the client and the server and improving the efficiency of data transmission.

[0032] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained according to these drawings.

[0034] Figure 1 is a flowchart of a data transmission method provided in Embodiment 1 of the present invention;

[0035] Figure 2 is a flowchart of a data transmission method provided in Embodiment 2 of the present invention;

[0036] Figure 3 is a flowchart of a data transmission method provided in Embodiment 3 of the present invention;

[0037] Figure 4 is a schematic structural diagram of a data transmission device provided in Embodiment 5 of the present invention;

[0038] Figure 5 It is a schematic structural diagram of a data transmission device provided in Embodiment 6 of the present invention;

[0039] Figure 6 It is a schematic structural diagram of an electronic device for implementing a data transmission method provided in Embodiment 7 of the present invention. Detailed implementation manners

[0040] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. In addition, it should be noted that, for the sake of description, only parts related to the present invention are shown in the drawings, rather than all the structures.

[0041] Embodiment 1

[0042] Figure 1 It is a flowchart of a data transmission method provided in Embodiment 1 of the present invention. This embodiment is applicable to data transmission in the Internet of Things. This method can be executed by a data transmission device, and the device can be implemented in software and / or hardware and can be configured in an electronic device with a data transmission function.

[0043] See Figure 1 The data transmission method shown is applied to a client and includes:

[0044] S110. Obtain the data to be synchronized, and update the data to be synchronized according to a preset sorting strategy to obtain the current synchronized data.

[0045] Among them, the data to be synchronized refers to the data that needs to be synchronously stored between the client and the server. The present invention does not make any limitation on the form of the data to be synchronized. Exemplarily, the data to be synchronized can be displayed in the form of characters, that is, the data to be synchronized can be a string.

[0046] Among them, the preset sorting strategy refers to a strategy that is preset and can be used to sort each sub-data in the data to be synchronized. Exemplarily, the preset sorting strategy can be a dictionary sorting strategy. Specifically, according to the dictionary sorting strategy, the keys in the data to be synchronized can be sorted to update the data to be synchronized to obtain the current synchronized data. It should be noted that the key-value pairs included in the current synchronized data are the same as those in the data to be synchronized. By using the preset sorting strategy, the keys in the data to be synchronized are re-sorted to adjust the positions of the key-value pairs in the data to be synchronized to obtain the current synchronized data.

[0047] Among them, the current synchronized data refers to the data obtained after updating the data to be synchronized according to the preset sorting strategy.

[0048] Specifically, the client obtains the data to be synchronized, sorts the keys in the data to be synchronized according to a preset sorting strategy, and obtains the current synchronized data.

[0049] S120. Determine the current data structure of the current synchronized data, and determine whether there is candidate historical synchronized data under the current data structure.

[0050] Among them, the current data structure refers to the data structure of the current synchronized data, that is, the data structure of the data to be synchronized. Exemplarily, there are multiple candidate data structures in the client, and the current data structure of the data to be synchronized is determined from the candidate data structures. The candidate data structure refers to the data structures pre-stored in the client.

[0051] Among them, the candidate historical synchronized data refers to the synchronized data that has been stored in both the client and the server and belongs to the current data structure.

[0052] Specifically, the client determines the current data structure of the current synchronized data, and determines whether there is already candidate historical synchronized data under the current data structure, that is, determines whether the current synchronized data is the first synchronized data belonging to the current data structure.

[0053] S130. If there is, determine the reference historical synchronized data from the candidate historical synchronized data, and determine the current transmission data corresponding to the current synchronized data according to the reference historical synchronized data and the current synchronized data.

[0054] Among them, the current transmission data includes the reference data identifier of the reference historical synchronized data and the difference associated data.

[0055] Among them, the reference historical synchronized data refers to the candidate historical synchronized data with a smaller difference from the current synchronized data. Preferably, the reference historical synchronized data can be the candidate historical synchronized data with the smallest difference from the current synchronized data.

[0056] Exemplarily, determine the data similarity between each candidate historical synchronized data and the current synchronized data respectively; determine the reference historical synchronized data from the candidate historical synchronized data according to the data similarity. Among them, the data similarity can be used to quantify the similarity degree between the candidate historical synchronized data and the current synchronized data.

[0057] Among them, the current transmission data refers to the data sent by the client to the server. The reference data identifier can uniquely represent the identity of the reference historical synchronized data. The difference associated data refers to the associated data with differences between the current synchronized data and the reference historical synchronized data.

[0058] Specifically, if there is candidate historical synchronization data in the current data structure, the client determines the reference historical synchronization data with the smallest difference from the current synchronization data among the candidate historical synchronization data; compares the reference historical synchronization data with the current synchronization data to determine the difference-related data; and determines the current transmission data based on the reference data identifier of the reference historical synchronization data and the difference-related data.

[0059] S140. Send the current transmission data to the server so that the server generates and stores the current synchronization data based on the current transmission data and the candidate historical synchronization data, and determines the current data identifier of the current synchronization data.

[0060] Among them, the current data identifier can uniquely represent the identity of the current synchronization data.

[0061] Specifically, the client sends the current synchronization data to the server; the server generates the current synchronization data based on the current synchronization data and the stored candidate historical synchronization data; the server determines the current data identifier of the current synchronization data, and stores the current synchronization data and the current data identifier in correspondence; the server sends the current data identifier to the client.

[0062] S150. Receive the current data identifier fed back by the server, and store the current synchronization data and the current data identifier.

[0063] Specifically, the client receives the current data identifier fed back by the server; the client stores the current synchronization data and the current data identifier in correspondence.

[0064] An embodiment of the present invention provides a data transmission solution. By obtaining data to be synchronized and updating the data to be synchronized according to a preset sorting strategy, the current synchronized data is obtained; determining the current data structure of the current synchronized data, and determining whether there is candidate historical synchronized data under the current data structure; if so, determining reference historical synchronized data from the candidate historical synchronized data, and determining the current transmission data corresponding to the current synchronized data according to the reference historical synchronized data and the current synchronized data; wherein the current transmission data includes a reference data identifier of the reference historical synchronized data and differential associated data; sending the current transmission data to the server so that the server generates and stores the current synchronized data according to the current transmission data and the candidate historical synchronized data, and determines the current data identifier of the current synchronized data; receiving the current data identifier fed back by the server, and storing the current synchronized data and the current data identifier. In the above solution, the client sends the current transmission data including the reference data identifier and the differential associated data to the server, so that the server generates the current synchronized data according to the current transmission data and the stored candidate historical synchronized data, realizing that when there is candidate historical synchronized data in both the client and the server under the current data structure, the client does not need to send the repeated part of the data again, reducing the amount of data transmitted between the client and the server and improving the efficiency of data transmission.

[0065] On the basis of the above technical solution, after determining whether there is candidate historical synchronized data under the current data structure, the method further includes: if not, sending the current synchronized data to the server so that the server receives and stores the current synchronized data, and determines the current data identifier of the current synchronized data; receiving the current data identifier fed back by the server, and storing the current synchronized data and the current data identifier.

[0066] Specifically, if there is no candidate historical synchronized data under the current data structure in the client, it indicates that there is no same candidate historical synchronized data in the server either. At this time, the client needs to directly send the current synchronized data to the server; the server determines the current data identifier of the current synchronized data, and stores the current data identifier and the current synchronized data correspondingly; the server sends the current data identifier to the client; the client stores the current data identifier and the current synchronized data correspondingly.

[0067] It can be understood that if there is no candidate historical synchronized data under the current data structure of the client, the current synchronized data is directly sent to the server so that at least one synchronized data that can be used as a reference for subsequent operations is stored in the server, realizing the necessary transmission of synchronized data and improving the effectiveness of data transmission between the client and the server.

[0068] Embodiment 2

[0069] Figure 2It is a flowchart of a data transmission method provided in the second embodiment of the present invention. On the basis of the above embodiments, further, the operation of "determining the current transmission data corresponding to the current synchronization data according to the reference historical synchronization data and the current synchronization data" is refined into "determining the initial data difference position and the corresponding data difference state between the reference historical synchronization data and the current synchronization data; according to the data difference state, determining the initial data difference value of the corresponding initial data difference position, and generating difference association data including the initial data difference position and the initial data difference value; determining the reference data identifier of the reference historical synchronization data, and determining the current transmission data corresponding to the current synchronization data according to the reference data identifier, the difference association data, and the preset data separator", so as to improve the determination mechanism of the current transmission data. It should be noted that for parts not described in detail in the embodiments of the present invention, reference may be made to the descriptions of other embodiments.

[0070] See Figure 2 The data transmission method shown includes:

[0071] S210. Obtain the data to be synchronized, and update the data to be synchronized according to the preset sorting strategy to obtain the current synchronization data.

[0072] S220. Determine the current data structure of the current synchronization data, and determine whether there is candidate historical synchronization data under the current data structure.

[0073] S230. If it exists, determine the reference historical synchronization data from the candidate historical synchronization data, and determine the initial data difference position and the corresponding data difference state between the reference historical synchronization data and the current synchronization data.

[0074] Among them, the initial data difference position refers to the position of the data with differences in the reference historical synchronization data and the current synchronization data. Exemplarily, the initial data difference position can be the difference sequence number. For example, the data at the 52nd position in the current synchronization data is different from the reference historical synchronization data.

[0075] Among them, the data difference state can be understood as the situation where there are differences between the current synchronization data and the reference historical synchronization data. Exemplarily, the data difference state includes a data missing state, a data adding state, and a data replacing state.

[0076] Among them, the data missing state can characterize that at least part of the data is missing in the current synchronization data compared with the reference historical synchronization data. The data adding state can characterize that at least part of the data is added in the current synchronization data compared with the reference historical synchronization data. The data replacing state can characterize that the data at a certain initial data difference position in the current synchronization data is different from the data at the corresponding initial data difference position in the reference historical synchronization data.

[0077] It is understandable that the data difference state includes at least one of a data missing state, a data adding state, and a data replacing state, which improves the diversity and richness of the data difference state.

[0078] Specifically, if any, the client compares the candidate historical synchronization data with the current synchronization data respectively, and determines the candidate historical synchronization data with the smallest difference as the reference historical synchronization data from them; the client determines the initial data difference position between the reference historical synchronization data and the current synchronization data and the data difference state corresponding to the initial data difference position.

[0079] S240. Determine the initial data difference value corresponding to the corresponding initial data difference position according to the data difference state, and generate difference association data including the initial data difference position and the initial data difference value.

[0080] Wherein, the initial data difference value refers to the value at which the current synchronization data is different from the reference historical synchronization data at the initial difference data position.

[0081] In an optional embodiment, generating difference association data including the initial data difference position and the initial data difference value includes: determining whether there are consecutive initial data difference positions among the initial data difference positions where the data difference state is the data replacing state, and if so, merging the consecutive initial data difference positions to obtain candidate data difference positions; merging the initial data difference values corresponding to the candidate data difference positions to obtain candidate data difference values; determining the difference association data according to the candidate data difference positions, the candidate data difference values, the unmerged initial data difference positions, and the initial data difference values.

[0082] Wherein, the candidate data difference position refers to the data difference position obtained after merging at least two initial data difference positions. The candidate data difference value refers to the data difference value obtained after merging the initial data difference values corresponding to the candidate data difference positions.

[0083] Specifically, determine whether there are at least two adjacent initial data difference positions among the initial data difference positions where the data difference state is the data replacing state; if so, merge the adjacent initial data difference positions to obtain candidate data difference positions, that is, use the initial data difference position in front in the consecutive initial data difference positions as the candidate data difference position, and replace the consecutive initial data difference positions with the candidate data difference position; merge the initial data difference values corresponding to the candidate data difference positions to obtain the candidate data difference value corresponding to the candidate data difference position; generate difference association data including at least two of the candidate data difference positions, the candidate data difference values, the unmerged initial data difference positions, and the unmerged initial data difference values.

[0084] For example, if the initial data difference positions where the data difference status is the data replacement status include 52, 66, 67, and 98, the initial data difference value corresponding to the initial data difference position 52 is A, the initial data difference value corresponding to the initial data difference position 66 is B, the initial data difference value corresponding to the initial data difference position 67 is C, and the initial data difference value corresponding to the initial data difference position 98 is D, then it is determined that there are consecutive initial data difference positions, namely 66 and 67. The initial data difference positions 66 and 67 are merged to obtain the candidate data difference position 66; the initial data difference values B and C corresponding to the candidate data difference position are merged to obtain the candidate data difference value BC; generate the difference association data including the candidate data difference position 66, the candidate data difference value BC, the unmerged initial data difference positions 52 and 98, and the unmerged initial data difference values A and D.

[0085] It can be understood that by merging the consecutive initial data difference positions where the data difference status is the data replacement status, the candidate data difference positions are obtained, and then the initial data difference values corresponding to the candidate data difference positions are merged to obtain the candidate data difference values, which further reduces the amount of data in the difference association data, and further reduces the amount of the current transmission data generated subsequently.

[0086] It should be noted that if the data difference status is the data missing status, a preset data missing symbol is added before the initial data difference position; if the data difference status is the data addition status, a preset data addition symbol is added before the initial data difference position. The preset data missing symbol refers to a symbol that is preset and can be used to represent that there is data missing at a certain initial data difference position. The preset data addition symbol refers to a symbol that is preset and can be used to represent that there is data addition at a certain initial data difference position.

[0087] The embodiments of the present invention do not make any limitations on the setting of the preset data missing symbol and the preset data addition symbol, and they can be set by those skilled in the art according to experience or needs. Exemplarily, the preset data missing symbol can be represented by "-". If the initial data difference positions in the data missing status are consecutive, they are merged and presented in the format of "-start position number - end position number". The start position number refers to the initial data difference position that is the earliest among the consecutive initial data difference positions where the data difference status is the data missing status. The end position number refers to the initial data difference position that is the last among the consecutive initial data difference positions where the data difference status is the data missing status. Exemplarily, the preset data addition symbol can be represented by "+".

[0088] S250. Determine the reference data identifier of the reference historical synchronization data, and determine the current transmission data corresponding to the current synchronization data according to the reference data identifier, the difference correlation data, and the preset data separator.

[0089] Among them, the preset data separator refers to a symbol that is preset and can be used to isolate data. In the embodiments of the present invention, no limitation is imposed on the preset data separator, and it can be set by those skilled in the art according to experience or needs. Exemplarily, the preset data separator can be "|".

[0090] Exemplarily, the data format in the current transmission data can be the reference data identifier, the preset data separator, the difference correlation data, and the preset data separator. For example, the current transmission data can be 1|52,4|127,9|147,3|176,38; where 1 represents the reference data identifier of the reference historical synchronization data; 52, 127, and 147 represent the initial data difference positions; 176 represents the candidate data difference position; 4, 9, and 3 represent the initial data difference values corresponding to the corresponding initial data difference positions; 38 represents the candidate data difference value corresponding to the candidate data difference position.

[0091] S260. Send the current transmission data to the server, so that the server generates and stores the current synchronization data according to the current transmission data and the candidate historical synchronization data, and determines the current data identifier of the current synchronization data.

[0092] S270. Receive the current data identifier fed back by the server, and store the current synchronization data and the current data identifier.

[0093] The embodiments of the present invention provide a data transmission solution. By refining the operation of determining the current transmission data corresponding to the current synchronization data according to the reference historical synchronization data and the current synchronization data into determining the initial data difference positions and the corresponding data difference states between the reference historical synchronization data and the current synchronization data; according to the data difference states, determining the initial data difference values of the corresponding initial data difference positions, and generating difference correlation data including the initial data difference positions and the initial data difference values; determining the reference data identifier of the reference historical synchronization data, and determining the current transmission data corresponding to the current synchronization data according to the reference data identifier, the difference correlation data, and the preset data separator, the determination mechanism of the current transmission data is improved. In the above solution, by determining the initial data difference positions and the data difference states, then determining the initial data difference values according to the data difference states, generating difference correlation data including the initial data difference positions and the initial data difference values, and determining the current transmission data corresponding to the current synchronization data according to the reference data identifier, the difference correlation data, and the preset data separator, the accuracy of the determined current transmission data is improved.

[0094] Embodiment III

[0095] Figure 3 The flowchart of a data transmission method provided in Embodiment 3 of the present invention is applicable to the data transmission scenario in the Internet of Things. This method can be executed by a data transmission device, which can be implemented in software and / or hardware and can be configured in an electronic device with data transmission function.

[0096] See Figure 3 The data transmission method shown is applied to the server side and includes:

[0097] S310. Receive the current transmission data sent by the client.

[0098] Among them, the current transmission data is the current synchronization data obtained by the client by updating the to-be-synchronized data acquired according to a preset sorting strategy, and is obtained by comparing with the reference historical synchronization data determined from the candidate historical synchronization data.

[0099] The current transmission data includes the reference data identifier of the reference historical synchronization data and the difference correlation data.

[0100] Among them, the current transmission data refers to the data sent by the client to the server. The to-be-synchronized data refers to the data that needs to be synchronously stored by the client and the server. The present invention embodiment does not make any limitation on the form of the to-be-synchronized data. Exemplarily, the to-be-synchronized data can be displayed in the form of characters, that is, the to-be-synchronized data can be a string. The current synchronization data refers to the data obtained after updating the to-be-synchronized data according to a preset sorting strategy.

[0101] Among them, the preset sorting strategy refers to a strategy that is preset and can be used to sort each sub-data in the to-be-synchronized data. Exemplarily, the preset sorting strategy can be a dictionary sorting strategy. Specifically, according to the dictionary sorting strategy, the keys in the to-be-synchronized data can be sorted to realize the update of the to-be-synchronized data and obtain the current synchronization data. It should be noted that the key-value pairs included in the current synchronization data and the to-be-synchronized data are the same. By the preset sorting strategy, the keys in the to-be-synchronized data are re-sorted to adjust the position of the key-value pairs in the to-be-synchronized data and obtain the current synchronization data.

[0102] Among them, the candidate historical synchronization data refers to the synchronization data that has been stored in the client and the server and belongs to the current data structure. The reference historical synchronization data refers to the candidate historical synchronization data with a smaller difference from the current synchronization data. Preferably, the reference historical synchronization data can be the candidate historical synchronization data with the smallest difference from the current synchronization data.

[0103] Among them, the reference data identifier can uniquely represent the identity of the reference historical synchronization data. The differential associated data refers to the associated data with differences between the current synchronization data and the reference historical synchronization data.

[0104] Specifically, the client obtains the data to be synchronized, sorts the keys in the data to be synchronized according to a preset sorting strategy to obtain the current synchronization data; the client determines the current data structure of the current synchronization data and determines whether there is candidate historical synchronization data under the current data structure, that is, determines whether the current synchronization data is the first synchronization data belonging to the current data structure; if there is candidate historical synchronization data under the current data structure, the client determines the reference historical synchronization data with the smallest difference from the current synchronization data among the candidate historical synchronization data; compares the reference historical synchronization data with the current synchronization data to determine the differential associated data; determines the current transmission data according to the reference data identifier of the reference historical synchronization data and the differential associated data; the client sends the current transmission data to the server; the server receives the current transmission data.

[0105] S320. Determine the reference historical synchronization data from the candidate historical synchronization data according to the reference data identifier, and generate the current synchronization data according to the differential associated data and the reference historical synchronization data.

[0106] Specifically, the server determines the reference historical synchronization data from the stored candidate historical synchronization data according to the current parameter data identifier; the server generates the current synchronization data according to the differential associated data and the reference historical synchronization data.

[0107] It should be noted that in the process of the server generating the current synchronization data according to the reference historical synchronization data and the differential associated data, the situation where the current synchronization data replaces the reference historical synchronization data will not occur, that is, the reference historical synchronization data is still retained, and a new current synchronization data is generated.

[0108] S330. Determine the current data identifier of the current synchronization data, and store the current synchronization data and the current data identifier.

[0109] Among them, the current data identifier can uniquely represent the identity of the current synchronization data.

[0110] Specifically, the server determines the current data identifier of the current synchronization data and stores the current synchronization data and the current data identifier correspondingly.

[0111] S340. Send the current data identifier to the client so that the client stores the current synchronization data and the current data identifier.

[0112] Specifically, the server sends the current data identifier to the client; the client receives the current data identifier fed back by the server; the client stores the current synchronized data and the current data identifier in a corresponding manner.

[0113] An embodiment of the present invention provides a data transmission solution. By receiving the current transmission data sent by the client, where the current transmission data is obtained by the client comparing the current synchronized data updated from the to-be-synchronized data obtained according to a preset sorting strategy with the reference historical synchronized data determined from the candidate historical synchronized data. The current transmission data includes the reference data identifier of the reference historical synchronized data and the difference correlation data. According to the reference data identifier, the reference historical synchronized data is determined from the candidate historical synchronized data, and according to the difference correlation data and the reference historical synchronized data, the current synchronized data is generated. The current data identifier of the current synchronized data is determined, and the current synchronized data and the current data identifier are stored. The current data identifier is sent to the client so that the client stores the current synchronized data and the current data identifier. In the above solution, the client sends the current transmission data including the reference data identifier and the difference correlation data to the server, and the server generates the current synchronized data according to the current transmission data and the stored candidate historical synchronized data, realizing that when there is already candidate historical synchronized data in the client and the server under the current data structure, there is no need for the client to send the repeated part of the data again, reducing the amount of data transmitted between the client and the server and improving the data transmission efficiency.

[0114] Embodiment 4

[0115] On the basis of the above embodiments, an embodiment of the present invention provides an optional example of data transmission. It should be noted that for the parts not detailed in the embodiments of the present invention, reference can be made to the descriptions of other embodiments.

[0116] For example, if the real-time data (i.e., the data to be synchronized) transmitted by the environmental monitoring device (i.e., the client) to the server (i.e., the service provider) for the first time is {"deviceCode":"YS20230224020","externalNo":"JUCHENG","deviceTime":"1732258632000","noise":"25.8","pmTwoFive":"23.2","pmTen":"32.8","tsp":"47.4","temperature":"9.8","humidity":"55.0","windSpeed":"1.0","windAngle":"45.0"}; and the real-time data transmitted to the server for the second time 10 seconds later is {"deviceCode":"YS20230224020","externalNo":"JUCHENG","deviceTime":"1732258642000","noise":"25.8","pmTwoFive":"23.3","pmTen":"32.9","tsp":"38.4","temperature":"9.8","humidity":"55.0","windSpeed":"1.0","windAngle":"45.0"}; comparing the data to be synchronized for the two times, only the values of the following keys have changed, namely "deviceTime":"1732258632000","pmTwoFive":"23.2","pmTen":"32.8","tsp":"47.4"

[0117] "deviceTime":"1732258642000","pmTwoFive":"23.3","pmTen":"32.9","tsp":"38.4".

[0118] In the data transmission solution provided by the embodiments of the present invention, when the client first transmits real-time data to the server, all keys are sorted in alphabetical order first to obtain the following JSON (JavaScript Object Notation) string (i.e., the current synchronization data): {"deviceCode":"YS20230224020","deviceTime":"1732258632000","externalNo":"JUCHENG","humidity":"55.0","noise":"25.8","pmTen":"32.8","pmTwoFive":"23.2","temperature":"9.8","tsp":"47.4","windAngle":"45.0","windSpeed":"1.0"}; The client sends the above JSON string to the server, and after receiving it, the server saves the current transmitted data and the current data identifier 1 at the same time; The server returns a normal reception information signal and the current data identifier to the client. After receiving the signal, the client also saves the current data identifier 1 and the current synchronization data.

[0119] Further, when the client performs the second data transmission, all keys in the data to be synchronized this time are sorted in alphabetical order first to obtain the following JSON string: {"deviceCode":"YS20230224020","deviceTime":"1732258642000","externalNo":"JUCHENG","humidity":"55.0","noise":"25.8","pmTen":"32.9","pmTwoFive":"23.3","temperature":"9.8","tsp":"38.4","windAngle":"45.0","windSpeed":"1.0"}; By comparing the two JSON strings, the difference position number (i.e., the initial data difference position) and the difference value (the initial data difference value) are found, and the following Table 1 is obtained.

[0120] Table 1 Difference table between the current synchronization data and the reference historical synchronization data of the second data transmission

[0121]

[0122] Among them, the positions corresponding to serial numbers 4 and 5 in the initial data difference are consecutive positions and can be combined for processing. Assembled in the following format to obtain the current transmitted data. Reference data identifier|Difference position number 1, Initial data difference value|Difference position number 2, Initial data difference value|Difference position number n, Initial data difference value. Exemplarily, the current transmitted data corresponding to Table 1 can be 1|52,4|127,9|147,3|176,38. After the server receives the current transmitted data, it finds the corresponding reference historical synchronization data through the reference data identifier 1, and then obtains the complete data through the replacement method, that is, generates the current synchronization data.

[0123] It should be noted that when the initial data difference value includes "|" and / or ",", to avoid misinterpretation by the server, a preset escape character needs to be added in front of "|" and "," in the initial data difference value. Among them, the preset escape character can be pre-set and is used to represent a character with a special meaning in the current transmitted data. The embodiments of the present invention do not make any limitations on the setting of the preset escape character, and it can be set by those skilled in the art according to experience or needs. Exemplarily, the preset escape character can be "\".

[0124] Further, when the client sends data for the third time, first sort all the keys in the data to be synchronized this time in alphabetical order to obtain the current synchronization data {"deviceCode":"YS20230224020","deviceTime":"1732258652000","externalNo":"JUCHENG","humidity":"55.0","noise":"25","pmTen":"32.9","pmTwoFive":"23.3","temperature":"9.8","tsp":"38.4","windAngle":"45.0","windSpeed":"1","zsite":"101,35"}; determine the reference historical synchronization data from the candidate historical synchronization data under the current data structure; compare the current synchronization data with the reference historical synchronization data to find the difference position number and the difference value, and obtain Table 2 as follows.

[0125] Table 2 Difference table between the current synchronization data and the reference historical synchronization data for the third data transmission

[0126]

[0127] From the above table, we get 2|52,5|-112-113|215,"\,|+217,"zsite":"101\,35. Among them, 2 represents the reference data identifier for referring to historical synchronization data; 52, -112-113, 215, and +217 all represent the initial data difference positions; -112-113 represents the initial data difference position where data is missing; +217 represents the initial data difference position where data is added; 5, "\,, "zsite":"101\,35 represent the initial data difference values; \ represents the preset escape character. After the server receives the current transmitted data, it finds the corresponding reference historical synchronization data through the reference data identifier 2, and then obtains the complete data through the replacement method, that is, generates the current synchronization data.

[0128] The data transmission solution provided by the embodiments of the present invention can greatly reduce the amount of data transmitted and improve the data transmission efficiency; at the same time, the embodiments of the present invention have better effects on data with the same data structure and smaller data differences, especially in the scenario of a hardware data reporting server.

[0129] Embodiment Five

[0130] Figure 4 It is a schematic structural diagram of a data transmission device provided by Embodiment Five of the present invention. This embodiment is applicable to data transmission situations in the Internet of Things. This method can be executed by a data transmission device, and the device can be implemented in software and / or hardware and can be configured in an electronic device with data transmission functions.

[0131] As Figure 4 shown, the device is configured in the client, and the device includes: a current synchronization data determination module 410, a historical synchronization data judgment module 420, a current transmission data determination module 430, a current transmission data sending module 440, and a data storage module 450. Among them,

[0132] The current synchronization data determination module 410 is used to obtain the data to be synchronized and update the data to be synchronized according to a preset sorting strategy to obtain the current synchronization data;

[0133] The historical synchronization data judgment module 420 is used to determine the current data structure of the current synchronization data and judge whether there is candidate historical synchronization data under the current data structure;

[0134] The current transmission data determination module 430 is used to, if any, determine the reference historical synchronization data from the candidate historical synchronization data, and determine the current transmission data corresponding to the current synchronization data according to the reference historical synchronization data and the current synchronization data; among them, the current transmission data includes the reference data identifier of the reference historical synchronization data and the difference-related data;

[0135] The current transmission data sending module 440 is configured to send the current transmission data to the server, so that the server generates and stores the current synchronization data according to the current transmission data and the candidate historical synchronization data, and determines the current data identifier of the current synchronization data;

[0136] The data storage module 450 is configured to receive the current data identifier fed back by the server and store the current synchronization data and the current data identifier.

[0137] An embodiment of the present invention provides a data transmission solution. By obtaining the data to be synchronized and updating the data to be synchronized according to a preset sorting strategy, the current synchronization data is obtained; the current data structure of the current synchronization data is determined, and it is judged whether there is candidate historical synchronization data under the current data structure; if so, the reference historical synchronization data is determined from the candidate historical synchronization data, and according to the reference historical synchronization data and the current synchronization data, the current transmission data corresponding to the current synchronization data is determined; wherein, the current transmission data includes the reference data identifier of the reference historical synchronization data and the difference correlation data; the current transmission data is sent to the server, so that the server generates and stores the current synchronization data according to the current transmission data and the candidate historical synchronization data, and determines the current data identifier of the current synchronization data; the current data identifier fed back by the server is received and the current synchronization data and the current data identifier are stored. In the above solution, the client sends the current transmission data including the reference data identifier and the difference correlation data to the server, so that the server generates the current synchronization data according to the current transmission data and the stored candidate historical synchronization data, realizing that when there is candidate historical synchronization data in the client and the server under the current data structure, the client does not need to send the repeated part of the data again, reducing the amount of data transmitted between the client and the server and improving the data transmission efficiency.

[0138] Optionally, the current transmission data determining module 430 includes:

[0139] The data difference status determining unit is configured to determine the initial data difference position and the corresponding data difference status between the reference historical synchronization data and the current synchronization data;

[0140] The difference correlation data determining unit is configured to determine the initial data difference value of the corresponding initial data difference position according to the data difference status, and generate the difference correlation data including the initial data difference position and the initial data difference value;

[0141] A current transmission data determining unit, configured to determine a reference data identifier of the reference historical synchronization data, and determine current transmission data corresponding to the current synchronization data according to the reference data identifier, the difference associated data, and a preset data delimiter.

[0142] Optionally, the data difference status includes a data missing status, a data adding status, and a data replacing status.

[0143] Optionally, the difference associated data determining unit is specifically configured to:

[0144] Determine whether there are consecutive initial data difference positions in the initial data difference positions where the data difference status is the data replacing status. If so, merge the consecutive initial data difference positions to obtain candidate data difference positions;

[0145] Merge the initial data difference values corresponding to the candidate data difference positions to obtain candidate data difference values;

[0146] Determine difference associated data according to the candidate data difference positions, the candidate data difference values, the unmerged initial data difference positions, and the initial data difference values.

[0147] Optionally, after determining whether there is candidate historical synchronization data under the current data structure, the apparatus further includes:

[0148] A current data identifier determining module, configured to, if not, send the current synchronization data to the server, so that the server receives and stores the current synchronization data, and determines a current data identifier of the current synchronization data;

[0149] A current data identifier receiving module, configured to receive the current data identifier fed back by the server, and store the current synchronization data and the current data identifier.

[0150] The data transmission apparatus provided by the embodiments of the present invention can execute the data transmission method provided by any embodiment of the present invention, and has corresponding function modules and beneficial effects for executing each data transmission method.

[0151] In the technical solution of the present invention, the collection, storage, use, processing, transmission, provision, and disclosure of the data to be synchronized, candidate historical synchronization data, etc. all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.

[0152] Embodiment Six

[0153] Figure 5FIG. 0 is a schematic structural diagram of a data transmission device provided in Embodiment 6 of the present invention. This embodiment is applicable to data transmission in the Internet of Things. This method can be executed by the data transmission device. The device can be implemented in software and / or hardware and can be configured in an electronic device carrying a data transmission function.

[0154] As Figure 5 shown, the device is configured in the server. The device includes: a current transmission data receiving module 510, a current synchronization data generating module 520, a current data identifier determining module 530, and a current data identifier sending module 540. Among them,

[0155] The current transmission data receiving module 510 is used to receive the current transmission data sent by the client. Among them, the current transmission data is obtained by comparing the current synchronization data obtained by the client by updating the to-be-synchronized data according to a preset sorting strategy with the reference historical synchronization data determined from the candidate historical synchronization data; the current transmission data includes the reference data identifier of the reference historical synchronization data and the difference-related data;

[0156] The current synchronization data generating module 520 is used to determine the reference historical synchronization data from the candidate historical synchronization data according to the reference data identifier, and generate the current synchronization data according to the difference-related data and the reference historical synchronization data;

[0157] The current data identifier determining module 530 is used to determine the current data identifier of the current synchronization data and store the current synchronization data and the current data identifier;

[0158] The current data identifier sending module 540 is used to send the current data identifier to the client so that the client stores the current synchronization data and the current data identifier.

[0159] An embodiment of the present invention provides a data transmission solution, which includes receiving current transmission data sent by a client; where the current transmission data is obtained by comparing the current synchronization data obtained by the client by updating the to-be-synchronized data acquired according to a preset sorting strategy with the reference historical synchronization data determined from the candidate historical synchronization data; the current transmission data includes the reference data identifier of the reference historical synchronization data and the difference-related data; determining the reference historical synchronization data from the candidate historical synchronization data according to the reference data identifier, and generating the current synchronization data according to the difference-related data and the reference historical synchronization data; determining the current data identifier of the current synchronization data, and storing the current synchronization data and the current data identifier; and sending the current data identifier to the client so that the client stores the current synchronization data and the current data identifier. In the above solution, the client sends the current transmission data including the reference data identifier and the difference-related data to the server, and the server generates the current synchronization data according to the current transmission data and the stored candidate historical synchronization data, realizing that when there is candidate historical synchronization data in both the client and the server under the current data structure, there is no need for the client to send the repeated part of the data again, reducing the amount of data transmitted between the client and the server and improving the data transmission efficiency.

[0160] The data transmission device provided by the embodiment of the present invention can execute the data transmission method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing each data transmission method.

[0161] In the technical solution of the present invention, the collection, storage, use, processing, transmission, provision, and disclosure of the to-be-synchronized data, candidate historical synchronization data, etc. all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.

[0162] Embodiment Seven

[0163] Figure 6 It is a schematic structural diagram of an electronic device for implementing the data transmission method provided by Embodiment Seven of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0164] Such as Figure 6As shown, the electronic device 10 includes at least one processor 11 and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. Among them, the memory stores a computer program executable by the at least one processor. The processor 11 can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0165] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0166] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the data transmission method.

[0167] In some embodiments, the data transmission method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the data transmission method described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the data transmission method by any other appropriate means (e.g., by means of firmware).

[0168] The various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), system-on-a-chip systems (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0169] The computer programs for implementing the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, a special purpose computer, or other programmable data processing device, such that the computer programs, when executed by the processor, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The computer programs can be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine, or entirely on the remote machine or server.

[0170] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0171] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0172] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.

[0173] A computing system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The relationship between the client and the server is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.

[0174] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.

[0175] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A data transmission method, characterized in that: Applied to a client, the method comprises: Acquire the data to be synchronized, and update the data to be synchronized according to a preset sorting strategy to obtain the current synchronized data; Determine the current data structure of the current synchronization data, and determine whether there is candidate historical synchronization data under the current data structure; If so, determine the reference historical synchronization data from the candidate historical synchronization data, and determine the current transmission data corresponding to the current synchronization data according to the reference historical synchronization data and the current synchronization data; wherein the current transmission data includes the reference data identifier of the reference historical synchronization data, and difference-related data; Sending the current transmission data to the server, so that the server generates and stores the current synchronization data according to the current transmission data and the candidate historical synchronization data, and determines the current data identifier of the current synchronization data; Receive the current data identifier fed back by the server, and store the current synchronization data and the current data identifier; Wherein, determining the current transmission data corresponding to the current synchronization data according to the reference historical synchronization data and the current synchronization data includes: Determine the initial data difference position and the corresponding data difference state between the reference historical synchronization data and the current synchronization data; wherein the data difference state includes a data missing state, a data addition state and a data replacement state; Determine an initial data difference value of a corresponding initial data difference position according to the data difference state, and generate difference association data including the initial data difference position and the initial data difference value; Determine a reference data identifier of the reference historical synchronization data, and determine current transmission data corresponding to the current synchronization data according to the reference data identifier, the difference-related data and a preset data separator; Wherein, the method further comprises: For any initial data difference position, if the data difference state corresponding to the initial data difference position is a data missing state, a preset data missing symbol is added before the initial data difference position; If the data difference state corresponding to the initial data difference position is a data increase state, a preset data increase symbol is added before the initial data difference position.

2. The method according to claim 1, characterized in that The generating of difference associated data including the initial data difference position and the initial data difference value comprises: Determine whether there are continuous initial data difference positions among the initial data difference positions whose data difference state is a data replacement state, and if so, merge the continuous initial data difference positions to obtain candidate data difference positions; Merging the initial data difference values ​​corresponding to the candidate data difference positions to obtain the candidate data difference values; Determine difference-associated data according to the candidate data difference positions, the candidate data difference values, the unmerged initial data difference positions, and the initial data difference values.

3. The method according to claim 1, characterized in that After determining whether candidate historical synchronization data exists under the current data structure, the method further includes: If not, sending the current synchronization data to the server, so that the server receives and stores the current synchronization data, and determines the current data identifier of the current synchronization data; Receive the current data identifier fed back by the server, and store the current synchronization data and the current data identifier.

4. A data transmission method, characterized in that: Applied to the server, the method includes: Receive current transmission data sent by the client; wherein the current transmission data is the current synchronization data obtained by the client updating the acquired data to be synchronized according to a preset sorting strategy, and comparing the reference historical synchronization data determined from the candidate historical synchronization data; the current transmission data includes a reference data identifier of the reference historical synchronization data, and difference-related data; Determine reference historical synchronization data from the candidate historical synchronization data according to the reference data identifier, and generate current synchronization data according to the difference association data and the reference historical synchronization data; Determine a current data identifier of the current synchronization data, and store the current synchronization data and the current data identifier; Sending the current data identifier to the client, so that the client stores the current synchronization data and the current data identifier; The current transmission data is determined based on the following method: Determine the initial data difference position and the corresponding data difference state between the reference historical synchronization data and the current synchronization data; wherein the data difference state includes a data missing state, a data addition state and a data replacement state; Determine an initial data difference value of a corresponding initial data difference position according to the data difference state, and generate difference association data including the initial data difference position and the initial data difference value; Determine a reference data identifier of the reference historical synchronization data, and determine current transmission data corresponding to the current synchronization data according to the reference data identifier, the difference-related data and a preset data separator; Wherein, the method further comprises: For any initial data difference position, if the data difference state corresponding to the initial data difference position is a data missing state, a preset data missing symbol is added before the initial data difference position; If the data difference state corresponding to the initial data difference position is a data increase state, a preset data increase symbol is added before the initial data difference position.

5. A data transmission device, characterized in that: Configured on the client, the device includes: The current synchronization data determination module is used to obtain the data to be synchronized, and update the data to be synchronized according to a preset sorting strategy to obtain the current synchronization data; A historical synchronization data judgment module is used to determine the current data structure of the current synchronization data and to judge whether there is candidate historical synchronization data under the current data structure; A current transmission data determination module, used to determine the reference historical synchronization data from the candidate historical synchronization data, if any, and determine the current transmission data corresponding to the current synchronization data according to the reference historical synchronization data and the current synchronization data; wherein the current transmission data includes the reference data identifier of the reference historical synchronization data, and difference-related data; A current transmission data sending module, used to send the current transmission data to the server, so that the server generates and stores the current synchronization data according to the current transmission data and the candidate historical synchronization data, and determines the current data identifier of the current synchronization data; A data storage module, used for receiving the current data identifier fed back by the server, and storing the current synchronization data and the current data identifier; Wherein, the current transmission data determination module includes: A data difference state determination unit, used to determine the initial data difference position between the reference historical synchronization data and the current synchronization data and the corresponding data difference state; wherein the data difference state includes a data missing state, a data addition state and a data replacement state; a difference-associated data determining unit, configured to determine an initial data difference value of a corresponding initial data difference position according to the data difference state, and generate difference-associated data including the initial data difference position and the initial data difference value; a current transmission data determination unit, configured to determine a reference data identifier of the reference historical synchronization data, and determine current transmission data corresponding to the current synchronization data according to the reference data identifier, the difference association data and a preset data separator; Wherein, the device is also used for: For any initial data difference position, if the data difference state corresponding to the initial data difference position is a data missing state, a preset data missing symbol is added before the initial data difference position; If the data difference state corresponding to the initial data difference position is a data increase state, a preset data increase symbol is added before the initial data difference position.

6. A data transmission device, characterized in that: Configured at the server end, the device includes: A current transmission data receiving module, used to receive the current transmission data sent by the client; wherein the current transmission data is the current synchronization data obtained by the client updating the acquired data to be synchronized according to the preset sorting strategy, and the reference historical synchronization data determined from the candidate historical synchronization data; the current transmission data includes the reference data identifier of the reference historical synchronization data, and the difference association data; a current synchronization data generating module, configured to determine reference historical synchronization data from the candidate historical synchronization data according to the reference data identifier, and generate current synchronization data according to the difference association data and the reference historical synchronization data; A current data identification determination module, used to determine the current data identification of the current synchronization data, and store the current synchronization data and the current data identification; A current data identification sending module, used for sending the current data identification to the client, so that the client stores the current synchronization data and the current data identification; The current transmission data is determined based on the following method: Determine the initial data difference position and the corresponding data difference state between the reference historical synchronization data and the current synchronization data; wherein the data difference state includes a data missing state, a data addition state and a data replacement state; Determine an initial data difference value of a corresponding initial data difference position according to the data difference state, and generate difference association data including the initial data difference position and the initial data difference value; Determine a reference data identifier of the reference historical synchronization data, and determine current transmission data corresponding to the current synchronization data according to the reference data identifier, the difference-related data and a preset data separator; Wherein, for any initial data difference position, if the data difference state corresponding to the initial data difference position is a data missing state, a preset data missing symbol is added before the initial data difference position; If the data difference state corresponding to the initial data difference position is a data increase state, a preset data increase symbol is added before the initial data difference position.

7. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement a data transmission method as described in any one of claims 1 to 4.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a data transmission method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • File monitoring and message pushing based real-time synchronization system

    CN105740418A

  • Data transmission method and device

    CN110636009A

  • Cloud object storage synchronization method and device, computer equipment and storage medium

    CN113282540A

  • Method and device for updating maintenance and measurement data

    CN118132576A