Data transmission method and electronic device
By splitting data into segments before data transmission and transmitting only the identifiers of erroneous segments, the problem of increased transmission volume caused by data retransmission is solved, achieving more efficient data transmission.
Patent Information
- Application Number
- CN202211018896.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2042-08-24
AI Technical Summary
When transmitting data between different systems, there is a problem of data retransmission due to transmission failure, which leads to a surge in the amount of data transmitted between systems.
Before data transmission, the data is split into multiple data segments according to the pin identifier, and only the target identifier of the erroneous data segment is transmitted after transmission, reducing the amount of retransmitted data.
By transmitting only erroneous data fragments, the amount of data transmitted is reduced, thereby improving data transmission efficiency and resource utilization.
Smart Images

Figure CN115391342B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular to a data transmission method and an electronic device. BACKGROUND
[0002] Various systems of large enterprises will generate massive business data in the daily operation process. These data can be transmitted to the back-end system with corresponding requirements to complete the mining of data value.
[0003] However, data transmission between different systems often fails, at which time the overall data needs to be retransmitted, resulting in a sharp increase in data transmission between systems. SUMMARY
[0004] Therefore, the present application provides a data transmission method and an electronic device to solve the technical problem of large transmission volume when data is retransmitted between systems. As follows:
[0005] A data transmission method applied to a first device, the method comprising:
[0006] receiving a data acquisition request of a second device, the data acquisition request containing at least a data identifier;
[0007] obtaining target data corresponding to the data identifier, the target data containing at least one data segment, and the data segment being configured with a corresponding pin identifier;
[0008] transmitting the target data to the second device, so that the second device can obtain the target identifier of the data segment with transmission errors according to the pin identifier;
[0009] In the case of receiving the target identifier transmitted by the second device, transmitting the target segment corresponding to the target identifier to the second device.
[0010] The above method is preferably, after receiving the data acquisition request of the second device, the method further comprises:
[0011] determining whether the target data corresponding to the data identifier is stored in the storage area of the first device;
[0012] If yes, reading the target data from the storage area of the first device, and executing the step of transmitting the target data to the second device;
[0013] If not, executing the step of obtaining the target data corresponding to the data identifier.
[0014] The above method is preferably, the step of obtaining the target data corresponding to the data identifier comprises:
[0015] obtaining native data corresponding to the data identifier;
[0016] obtaining at least one pin identifier according to the native data;
[0017] dividing the native data into a plurality of data segments according to the pin identifier;
[0018] obtaining a segment hash value corresponding to the data segment and an overall hash value corresponding to the native data;
[0019] integrating the native data, the pin identifier, the overall hash value and the segment hash value to obtain target data corresponding to the data identifier.
[0020] The method, preferably, the obtaining of the at least one pin identifier according to the native data comprises:
[0021] extracting a data field in a data item contained in the native data;
[0022] obtaining an association degree value between the data field in the data item and a service description field of the first device;
[0023] obtaining a similarity value between a first data item satisfying a sorting condition of the association degree value and a service description field of the second device;
[0024] determining the at least one pin identifier according to at least a second data item satisfying a similarity condition of the similarity value.
[0025] The method, preferably, the determining of the at least one pin identifier according to at least the second data item satisfying the similarity condition of the similarity value comprises:
[0026] obtaining a first candidate data item with a data item distance less than or equal to a preset minimum distance and a second candidate data item with a data item distance greater than the minimum distance according to a size relationship between the data item distance between adjacent second data items and the minimum distance;
[0027] determining a pin identifier according to a position of any one data item in the first candidate data item;
[0028] performing data item segmentation on the data items between adjacent second candidate data items according to the minimum distance to obtain at least one segmentation position, and determining a pin identifier according to the segmentation position.
[0029] A data transmission method applied to a second device, the method comprising:
[0030] receiving target data transmitted by a first device, the target data containing at least one data segment, and the data segment being configured with a corresponding pin identifier;
[0031] in a case where the target data meets a transmission error condition, obtaining a target identifier of the data segment with a transmission error according to the pin identifier;
[0032] transmitting the target identifier to the first device, so that the first device transmits a target segment corresponding to the target identifier to the second device.
[0033] Preferably, the target data contains original data, a pin identifier, an overall hash value corresponding to the original data, and a segment hash value corresponding to a data segment in the original data.
[0034] The target data meets a transmission error condition, including:
[0035] A current hash value corresponding to the original data does not match the overall hash value in the target data.
[0036] Preferably, obtaining a target identifier of the data segment with a transmission error according to the pin identifier includes:
[0037] dividing the original data into a plurality of data segments according to the pin identifier;
[0038] obtaining a current hash value corresponding to the data segment;
[0039] comparing the current hash value with the segment hash value in the target data to obtain a target identifier of the data segment with a hash value mismatch.
[0040] An electronic device, which serves as a first device, includes:
[0041] a memory for storing a computer program and data generated by running the computer program;
[0042] a processor for executing the computer program to achieve the following: receiving a data acquisition request of a second device, the data acquisition request containing at least a data identifier; obtaining target data corresponding to the data identifier, the target data containing at least one data segment, and the data segment being configured with a corresponding pin identifier; transmitting the target data to the second device, so that the second device can obtain a target identifier of the data segment with a transmission error according to the pin identifier; and in a case where the second device transmits the target identifier, transmitting a target segment corresponding to the target identifier to the second device.
[0043] An electronic device, comprising a second device:
[0044] a memory for storing a computer program and data generated by running of the computer program;
[0045] a processor for executing the computer program to achieve: receiving target data transmitted by a first device, the target data containing at least one data segment, and the data segment being configured with a corresponding pin identifier; in the case that the target data meets a transmission error condition, obtaining a target identifier of the data segment with transmission error according to the pin identifier; and transmitting the target identifier to the first device, so that the first device transmits a target segment corresponding to the target identifier to the second device.
[0046] From the above technical solution, it can be seen that in the data transmission method and the electronic device disclosed by the present application, before the first device transmits data to the second device, the data is first split into at least one data segment according to a pin identifier, and then after the data is transmitted to the second device, the second device can only inform the first device of a target identifier of the data segment with transmission error, and then the first device can only transmit the data segment corresponding to the target identifier, without retransmitting the entire data, thereby achieving the purpose of reducing data transmission amount. BRIEF DESCRIPTION OF DRAWINGS
[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0048] Figure 1 A flowchart of a data transmission method provided for the first embodiment of the present application;
[0049] Figure 2 Another flowchart of a data transmission method provided for the first embodiment of the present application;
[0050] Figure 3 A partial flowchart of a data transmission method provided for the first embodiment of the present application;
[0051] Figure 4 Another partial flowchart of a data transmission method provided for the first embodiment of the present application;
[0052] Figure 5 An implementation flowchart of a data transmission method provided for the second embodiment of the present application;
[0053] Figure 6A structural schematic diagram of a data transmission device provided in Embodiment Three of the present application;
[0054] Figure 7 Another structural schematic diagram of a data transmission device provided in Embodiment Three of the present application;
[0055] Figure 8 A structural schematic diagram of a data transmission device provided in Embodiment Four of the present application;
[0056] Figure 9 A structural schematic diagram of an electronic device provided in Embodiment Five of the present application;
[0057] Figure 10 A structural schematic diagram of an electronic device provided in Embodiment Six of the present application. DETAILED DESCRIPTION
[0058] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by those of ordinary skill in the art without any creative work fall within the scope of protection of the present application.
[0059] Reference Figure 1 As shown in the figure, an implementation flowchart of a data transmission method provided in Embodiment One of the present application, which can be applied to an electronic device providing data, hereinafter referred to as a first device. The technical solution in the present embodiment is mainly used to reduce the data amount of retransmission data between devices.
[0060] Specifically, the method in the present embodiment can include the following steps:
[0061] Step 101: receiving a data acquisition request of a second device.
[0062] Among them, the data acquisition request at least contains a data identifier. The data identifier is used to uniquely represent the data required (subscribed) by the second device. Specifically, the data identifier can be the data address of the target data, or the data identifier can be the data name of the target data, etc.
[0063] Step 102: obtaining the target data corresponding to the data identifier.
[0064] Among them, the target data at least contains at least one data segment, and the data segment is configured with a corresponding pin identifier.
[0065] Specifically, in the embodiment, the data in the first device can be segmented according to the pin identifier of the data item in the native data corresponding to the data identifier, and at least one data segment is obtained, and each data segment is configured with a corresponding pin identifier. The native data here refers to the initial data in the first device that has not been processed, and the target data is obtained after pin processing.
[0066] In addition, the target data can also contain other data, such as the native data corresponding to the target data.
[0067] For example, the target data is composed of a plurality of data segments, and the head or tail of each data segment corresponds to a pin identifier, indicating the position of the data item in the native data corresponding to the target data that is segmented.
[0068] Step 103: transmitting the target data to the second device, so that the second device can obtain the target identifier of the data segment with transmission error according to the pin identifier.
[0069] Specifically, after the second device receives the target data transmitted by the first device, it can be determined whether the target data satisfies the transmission error condition. If the transmission error condition is not satisfied, it means that the target data is completely transmitted correctly. If the transmission condition is satisfied, it means that at least part of the data segments of the target data are transmitted incorrectly. At this time, the target identifier of the data segment with transmission error is obtained according to the pin identifier, and then the target identifier is sent to the first device.
[0070] Step 104: In the case of receiving the target identifier transmitted by the second device, the target segment corresponding to the target identifier is transmitted to the second device.
[0071] Specifically, when the first device receives the target identifier, it finds the corresponding data segment, i.e. the target segment, according to the target identifier, and then retransmits the target segment to the second device.
[0072] From the above technical solution, it can be seen that the data transmission method provided by the first embodiment of the application can split the data into at least one data segment according to the pin identifier before the first device transmits the data to the second device, and then the second device can only notify the first device of the target identifier of the data segment with transmission error after transmitting the data to the second device, and then the first device can only transmit the data segment corresponding to the target identifier, without retransmitting the entire data, thereby achieving the purpose of reducing data transmission amount.
[0073] In an implementation manner, the first device can send the target identifier to other third device (other device which has successfully received the target data) having the data segment corresponding to the target identifier, and the third device sends the corresponding target segment to the second device according to the target identifier, so as to reduce the data transmission amount on the first device through other devices.
[0074] In an implementation manner, after step 101, the method in the embodiment can further include the following steps, as shown in Figure 2
[0075] Step 105: judging whether the target data corresponding to the data identifier is stored in the storage area of the first device, if yes, executing step 106, and if no, executing step 102.
[0076] The storage area of the first device can be understood as a backup area of the target data, and can be a hard disk or a memory area.
[0077] It should be noted that the target data obtained by processing the original data on the first device can be stored in the storage area of the first device, so as to be directly used next time. Based on this, after obtaining the data acquisition request of the second device, the embodiment first searches whether the target data corresponding to the data identifier exists in the storage area of the first device.
[0078] Step 106: reading the target data from the storage area of the first device, and executing step 103.
[0079] If the target data already exists in the storage area of the first device, step 102 does not need to be executed, and the target data does not need to be generated again. Only the target data is read from the storage area of the first device, and then the target data is directly transmitted to the second device in step 103. If the target data does not exist in the storage area of the first device, step 102 can be executed, and then the target data is transmitted to the second device after the target data is obtained.
[0080] In an implementation manner, the target data corresponding to the data identifier can be obtained in step 102 by the following manner, as shown in Figure 3
[0081] Step 301: obtaining the original data corresponding to the data identifier.
[0082] After receiving the data acquisition request, the first device can search the original data corresponding to the data identifier in the storage area of the first device.
[0083] Step 302: obtaining at least one pin identifier according to the original data.
[0084] Specifically, in the embodiment, the at least one pin identifier can be obtained according to the position of the data item in the native data whose data value meets the corresponding condition. Here, the data item whose data value meets the corresponding condition can be understood as the data item with a relatively high degree of association with the service description field of the first device and a relatively high degree of similarity between the service description fields of the second device.
[0085] Step 303: dividing the native data into a plurality of data segments according to the pin identifier.
[0086] Specifically, in the embodiment, the data items in the native data can be divided according to the position of the data item represented by the pin identifier, and then a plurality of data segments are obtained, each of which contains one or more data items 3.
[0087] Step 304: obtaining a segment hash value corresponding to the data segment and an overall hash value corresponding to the native data.
[0088] Specifically, in the embodiment, the hash value of each data segment can be calculated to obtain the segment hash value corresponding to each data segment, and the native data as a whole can be calculated to obtain the overall hash value corresponding to the native data.
[0089] Step 305: integrating the native data, the pin identifier, the overall hash value and the segment hash value to obtain the target data corresponding to the data identifier.
[0090] That is, the data segment in the target data is represented by the segment hash value calculated on the corresponding data item. As can be seen, the target data contains the native data and the overall hash value in addition to the segment hash value and the pin identifier corresponding to the segment hash value.
[0091] Further, in the embodiment, when the target data is transmitted to the second device in step 103, the target data can be divided into one or more data blocks first, and then the data blocks are sent to the second device. After receiving the data blocks on the second device, the data blocks are spliced to obtain the target data. Based on this, the second device further divides the native data in the target data into a plurality of data segments according to the pin identifier in the target data, and then obtains the current hash value of each data segment. The current hash value of each data segment is compared with the corresponding segment hash value (corresponding to the pin identifier) in the target data to obtain the target identifier of the data segment with a mismatched hash value. After sending the target identifier to the first device, the first device can retransmit the target segment corresponding to the target identifier to the second device.
[0092] Based on the above implementation, in step 302, when at least one pin identifier is obtained according to at least native data, it can be implemented in the following way, such as Figure 4 As shown in the following formula:
[0093] Step 401: Extract the data field in the data item contained in the native data.
[0094] Wherein, the data field can be understood as the field value in the data item. Such as name, department, note and other field contents in the data item.
[0095] Step 402: Obtain the correlation degree value between the data field in the data item and the business description field of the first device.
[0096] Wherein, the business description field of the first device can be understood as the function description content of the function item corresponding to the first device (data-intensive system, i.e. the system providing data).
[0097] Specifically, in this embodiment, the correlation degree calculation algorithm can be used to calculate the correlation degree between the data field in each data item contained in the native data and the business description field of the first device, so as to obtain the correlation degree value between each data item and the business description field of the first device.
[0098] Step 403: Obtain the similarity value between the first data item whose correlation degree value meets the sorting condition and the business description field of the second device.
[0099] Wherein, the sorting condition can be: the data item whose correlation degree value is sorted from large to small in the first M or the data item whose correlation degree value is greater than or equal to the correlation threshold value. M is a positive integer greater than or equal to 1.
[0100] Specifically, in this embodiment, one or more first data items with high correlation degree value (i.e. meeting the sorting condition) between the first device and the business description field are filtered out from the data items contained in the native data, and then the similarity value between the first data item and the business description field of the second device is obtained.
[0101] Wherein, the business description field of the second device can be understood as the description content of the hot item of the second device (subscription system, i.e. the system requiring to obtain data).
[0102] Specifically, in this embodiment, the similarity calculation algorithm can be used to calculate the similarity between the first data item and the business description field of the second device, so as to obtain the similarity value between each first data item and the business description field of the second device.
[0103] Step 404: At least according to the second data item whose similarity value meets the similarity condition, determine at least one pin identifier.
[0104] The similar conditions can be that the data items with the similarity values from large to small in the first N data items or the data items with the similarity values greater than or equal to a similarity threshold value.
[0105] Specifically, in the embodiment, one or more second data items with high similarity (i.e., meeting the similar condition) to the service description field of the second device are filtered out from the first data items, and the second data items can be understood as data items with high data value in the original data, i.e., value points.
[0106] For example, in the embodiment, first candidate data items with a data item distance less than or equal to a minimum distance and second candidate data items with a data item distance greater than the minimum distance can be obtained according to a size relationship between the data item distance between adjacent second data items and the minimum distance.
[0107] According to the position of any one of the first candidate data items, the pin identifier is determined.
[0108] The data items between adjacent second candidate data items can be segmented according to the minimum distance to obtain at least one segmentation position, and the pin identifier is determined according to the segmentation position.
[0109] The data item distance between adjacent second data items can be represented by the number of data items between adjacent second data items.
[0110] For example, in the embodiment, the minimum distance is pre-configured as L, which can be 20. The adjacent distance of the second data items with high data value filtered out is calculated, for example, as shown in Table 1, the second data items include data item 1, data item 3, data item 10, data item 100, and data item 200, and the data item distances are 2, 7, 90, and 100, respectively. Figure 6 According to the embodiment, the position of a randomly selected data item in the second data items with a distance less than or equal to L is determined as the pin identifier, the data items between the second data items with a distance greater than L are evenly segmented, and the position of the data item at the segmentation position is determined as the pin identifier. For example, data item 3 is randomly selected from data item 1, data item 3, and data item 10, and the position of data item 3 is determined as the pin identifier. Data item 10 and data item 100 are evenly segmented according to L, and the positions of data item 32, data item 55, and data item 77 are determined as the pin identifiers. Data item 100 and data item 200 are evenly segmented according to L, and the positions of data item 120, data item 140, data item 160, and data item 180 are determined as the pin identifiers. Thus, a list of pin identifiers, i.e., a pin point list, is obtained.
[0111] Reference Figure 5 An implementation flowchart of a data transmission method is provided for Embodiment Two of the present application. The method can be applied to an electronic device receiving data, referred to as a second device herein. The technical solution in the embodiment is mainly used to reduce the amount of data retransmitted between devices.
[0112] Specifically, the method in the embodiment can include the following steps:
[0113] Step 501: receiving target data transmitted by a first device.
[0114] Among them, the target data contains at least one data segment, and the data segment is configured with a corresponding pin identifier.
[0115] Step 502: determining whether the target data meets the transmission error condition, and executing step 503 if the target data meets the transmission error condition.
[0116] Step 503: obtaining the target identifier of the data segment with transmission error according to the pin identifier.
[0117] Among them, the target data contains original data, pin identifier, overall hash value corresponding to the original data, and segment hash value corresponding to the data segment in the original data. Based on this, the target data meeting the transmission error condition can be that the current hash value corresponding to the original data does not match the overall hash value in the target data. Therefore, if the current hash value corresponding to the original data matches the overall hash value in the target data, it means that all data segments in the target data are transmitted accurately, at which point the current process can be ended and the next received data can be judged for errors. If the current hash value corresponding to the original data does not match the overall hash value in the target data, it means that at least one data segment is not transmitted accurately, at which point step 503 is executed.
[0118] Specifically, the target identifier can be obtained in the embodiment as follows:
[0119] First, the original data is divided into multiple data segments according to the pin identifier, and then the current hash value corresponding to each data segment is obtained, for example, a hash value calculation is performed on each data segment using a hash algorithm to obtain the current hash value corresponding to each data segment; finally, the current hash value corresponding to each data segment is compared with the corresponding segment hash value in the target data, thereby finding the data segment whose current hash value does not match the segment hash value in the target data, and the segment identifier corresponding to the data segment is the target identifier of the data segment with hash value mismatch.
[0120] Step 504: transmitting the target identifier to the first device, so that the first device transmits the target segment corresponding to the target identifier to the second device.
[0121] From the above technical solution, it can be seen that the data transmission method provided by the second embodiment of the present application splits the data into at least one data segment according to the pin identifier before the first device transmits the data to the second device, and then after transmitting the data to the second device, the second device can only inform the first device of the target identifier of the data segment with transmission error, and then the first device can only transmit the data segment corresponding to the target identifier, without retransmitting the entire data, thereby achieving the purpose of reducing data transmission amount.
[0122] Reference Figure 6 The structure diagram of the data transmission device provided by the third embodiment of the present application is shown in the figure, which can be configured in an electronic device providing data, here referred to as the first device. The technical solution in the present embodiment is mainly used to reduce the data amount of retransmitting data between devices.
[0123] Specifically, the device in the present embodiment can include the following units:
[0124] The request receiving unit 601 is configured to receive a data acquisition request of the second device, wherein the data acquisition request at least contains a data identifier;
[0125] The target obtaining unit 602 is configured to obtain target data corresponding to the data identifier, wherein the target data at least contains at least one data segment, and the data segment is configured with a corresponding pin identifier;
[0126] The target transmitting unit 603 is configured to transmit the target data to the second device, so that the second device can obtain the target identifier of the data segment with transmission error according to the pin identifier;
[0127] The identifier receiving unit 604;
[0128] The segment transmitting unit 605 is configured to transmit the target segment corresponding to the target identifier to the second device in the case that the identifier receiving unit 604 receives the target identifier transmitted by the second device.
[0129] From the above technical solution, it can be seen that the data transmission device provided by the third embodiment of the present application splits the data into at least one data segment according to the pin identifier before the first device transmits the data to the second device, and then after transmitting the data to the second device, the second device can only inform the first device of the target identifier of the data segment with transmission error, and then the first device can only transmit the data segment corresponding to the target identifier, without retransmitting the entire data, thereby achieving the purpose of reducing data transmission amount.
[0130] In an implementation manner, the apparatus in the embodiment further comprises the following units, such as Figure 7 as shown in the following table:
[0131] The storage judging unit 606 is configured to, after the data acquisition request of the second device is received by the request receiving unit 601, judge whether the target data corresponding to the data identifier is stored in the storage area of the first device; if yes, trigger the storage reading unit 607; if not, trigger the target obtaining unit 602 to obtain the target data corresponding to the data identifier.
[0132] The storage reading unit 607 is configured to read the target data from the storage area of the first device, and trigger the target transmitting unit 603 to transmit the target data to the second device.
[0133] In an implementation manner, the target obtaining unit 602 is specifically configured to: obtain native data corresponding to the data identifier; obtain at least one pin identifier according to at least the native data; divide the native data into a plurality of data segments according to the pin identifier; obtain a segment hash value corresponding to the data segment and an overall hash value corresponding to the native data; and integrate the native data, the pin identifier, the overall hash value and the segment hash value to obtain the target data corresponding to the data identifier.
[0134] In an implementation manner, when the target obtaining unit 602 obtains at least one pin identifier according to at least the native data, it is specifically configured to: extract a data field in a data item included in the native data; obtain an association degree value between the data field in the data item and a service description field of the first device; obtain a similarity value between a first data item satisfying an ordering condition of the association degree value and a service description field of the second device; and determine at least one pin identifier according to at least a second data item satisfying a similarity condition of the similarity value.
[0135] In an implementation manner, when the target obtaining unit 602 determines at least one pin identifier according to at least a second data item satisfying a similarity condition of the similarity value, it is specifically configured to: obtain a first candidate data item with a data item distance less than or equal to a preset minimum distance and a second candidate data item with a data item distance greater than the minimum distance in the second data item according to a size relationship between the data item distance and the minimum distance between adjacent second data items; determine a pin identifier according to a position of any one data item in the first candidate data item; perform data item segmentation according to the minimum distance between data items between adjacent second candidate data items to obtain at least one segmentation position; and determine a pin identifier according to the segmentation position.
[0136] Reference Figure 8 , a data transmission device structure diagram is provided in the fourth embodiment of the application. The device can be configured in an electronic device receiving data, referred to as a second device here. The technical solution in the embodiment is mainly used to reduce the data amount of retransmitting data between devices.
[0137] Specifically, the device in the embodiment can include the following units:
[0138] The target receiving unit 801 is configured to receive target data transmitted by the first device. The target data contains at least one data segment, and the data segment is configured with a corresponding pin identifier.
[0139] The identifier obtaining unit 802 is configured to obtain the target identifier of the data segment with transmission error according to the pin identifier when the target data meets the transmission error condition.
[0140] The identifier transmission unit 803 is configured to transmit the target identifier to the first device, so that the first device transmits the target segment corresponding to the target identifier to the second device.
[0141] As can be seen from the above technical solution, in the data transmission device provided in the fourth embodiment of the application, the data is first split into at least one data segment according to the pin identifier before the first device transmits data to the second device. Then, after transmitting the data to the second device, the second device can only notify the first device of the target identifier of the data segment with transmission error, and then the first device can only transmit the data segment corresponding to the target identifier, without retransmitting the entire data, so as to achieve the purpose of reducing the data transmission amount.
[0142] In an implementation manner, the target data contains original data, a pin identifier, an overall hash value corresponding to the original data, and a segment hash value corresponding to the data segment in the original data; wherein the target data meets the transmission error condition, including that the current hash value corresponding to the original data does not match the overall hash value in the target data.
[0143] In an implementation manner, the identifier obtaining unit 802 is specifically configured to: divide the original data into a plurality of data segments according to the pin identifier; obtain the current hash value corresponding to the data segment; and compare the current hash value with the segment hash value in the target data to obtain the target identifier of the data segment with hash value mismatch.
[0144] Reference Figure 9 , a structure diagram of an electronic device is provided in the fifth embodiment of the application. The electronic device as a first device includes the following structure:
[0145] a memory 901, configured to store a computer program and data generated by running of the computer program;
[0146] a processor 902, configured to execute the computer program to implement: receiving a data acquisition request of a second device, the data acquisition request containing at least a data identifier; obtaining target data corresponding to the data identifier, the target data containing at least one data segment, and the data segment being configured with a corresponding pin identifier; transmitting the target data to the second device, so that the second device can obtain a target identifier of a data segment with transmission error according to the pin identifier; and in a case where the target identifier is received from the second device, transmitting a target segment corresponding to the target identifier to the second device.
[0147] It can be seen from the above technical solution that, in the electronic device provided by the embodiment five, the data is first split into at least one data segment according to the pin identifier before the first device transmits the data to the second device, and then after the data is transmitted to the second device, the second device can only inform the first device of the target identifier of the data segment with transmission error, and then the first device can only transmit the data segment corresponding to the target identifier, without retransmitting the entire data, so as to achieve the purpose of reducing data transmission amount.
[0148] Reference Figure 10 The electronic device provided by the embodiment six of the present application includes the following structure as the second device:
[0149] a memory 1001, configured to store a computer program and data generated by running of the computer program;
[0150] a processor 1002, configured to execute the computer program to implement: receiving target data transmitted by a first device, the target data containing at least one data segment, and the data segment being configured with a corresponding pin identifier; in a case where the target data satisfies a transmission error condition, obtaining a target identifier of a data segment with transmission error according to the pin identifier; and transmitting the target identifier to the first device, so that the first device transmits a target segment corresponding to the target identifier to the second device.
[0151] From the above technical solution can be seen, the embodiment six of the application provides an electronic device, before the first device transmits data to the second device, the data is first split into at least one data segment according to the pin identification, and then after transmitting the data to the second device, the second device can only inform the first device of the target identification of the transmission error data segment, and then the first device can only transmit the data segment corresponding to the target identification, without retransmitting the entire data, thereby achieving the purpose of reducing data transmission.
[0152] Taking the data transmission scenario between various application systems of large enterprises as an example, various application systems generate massive and rich business data. These data are distributed to the back-end system with corresponding requirements after simple processing and combination, so as to complete the mining of data value. However, the data distribution may have certain problems, such as incomplete distribution, interrupted distribution and the like, which all lead to the data-intensive enterprise consuming additional resources to check and retransmit data.
[0153] Therefore, the application establishes a data-intensive system association distribution control scheme, which can improve the existing sending end and receiving end, optimize the data sending method of the sending end, dynamically calculate the value point and pin point of the data, receive and calculate the pin point at the receiving end, prevent data missing and mis-transmission, improve the distribution control granularity of the data, and is beneficial to the system to realize the automatic control and efficient missing retransmission of data distribution.
[0154] Among them, on the sending end side, the sending end calculates the value point and sets the pin point of the data subscribed by the associated system, and sends the relevant data to the receiving end after packaging. On the receiving end side, the receiving end assembles the data segment information subscribed, locates the pin segment of the missing or error data detected and routes it to the relevant node for retransmission. In the application, the data of the sending end can be processed and packaged, and the receiving end can independently verify each data segment and route the best node for data retransmission. The specific scheme is as follows:
[0155] After the correlation system (i.e. the second device in the foregoing, the receiving end, which can also be a subscription system) subscribes to the data-intensive system (i.e. the first device in the foregoing, the sending end), the sending end detects the subscription data and queries whether the transmission data is generated for the subscription system. If the transmission data is generated, the transmission data is directly issued to the correlation system of the newly subscribed data. Otherwise, the data is converted from the original data to the transmission data. The conversion method is as follows: first, the value point of the data is calculated, and second, the value point is calculated according to the value point. In the value point calculation, the multiple fields of the data item are split, the correlation degree of each field and the function item corresponding to the data-intensive system is calculated, the statistical results are sorted in descending order, and the value in the sorted result field is calculated with the hot item of the subscription system. The data with a comprehensive result value greater than the system threshold is set as a value point. In the system, the minimum distance L between data intervals is set. The distance of the value point list calculated in the above step is calculated. A value point is randomly selected as a needle point for the value point with a distance less than L. The value point with a distance greater than the minimum distance is divided equally. Finally, the needle point list of the current data stream is generated.
[0156] The segmented needle point list data is calculated, and the hash value of each data segment and the overall hash value of the native data are generated. The native data, needle points, and needle segment hash values are organized in a certain way. After the data is split into multiple segments, the data is sent to the receiving end.
[0157] In the receiving end, the received data is summarized. If the overall hash value of the received data is always correct, the system ID is sent to the sending end, and the data distribution is completed. Otherwise, the needle segment is obtained according to the needle point list, the difference needle point (i.e. the needle point corresponding to the data segment with transmission error) is calculated, the error needle end is sent to the sending end, the sending end sends the needle point, position information, and successfully received data system ID to the receiving end, the receiving end analyzes the response data, obtains the abnormal needle point data, and broadcasts the abnormal needle point to the successfully received system and the sending end, requesting the correlation end to retransmit the needle point data. After receiving the signal, the sending end or other subscription systems respond to the corresponding value point data according to the idle state of the system. After the receiving end receives the data and completes the assembly, the overall hash value of the data is verified again. After the data is checked, the current system ID is sent to the sending end, and the data distribution is completed.
[0158] It can be seen that the data value point is calculated in the sending end, the needle point is determined according to the value point, the needle point is checked after the data is issued, the transmission error data is located in the needle point, and the retransmission is performed through the sending end or other receiving end, thereby reducing the data transmission amount.
[0159] The control method and device and the electronic device provided by the application can be used in the financial field or other fields, for example, can be used in the self-service business handling scene of the financial business intelligent counter in the financial field. The other fields are any fields except the financial field, for example, the distributed field, the cloud computing field, the big data field and the Internet of Things field. The above are only examples, and do not limit the application field of the application name provided by the application.
[0160] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed by the embodiments, since it corresponds to the method disclosed by the embodiments, the description is relatively simple, and the related parts can be referred to the method part.
[0161] The skilled person can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the present text can be realized by electronic hardware, computer software or combination of both. In order to clearly show the interchangeability of hardware and software, the composition and steps of each example have been described in the above description. Whether the functions are realized by hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0162] The steps of the method or algorithm described in combination with the embodiments disclosed in the present text can be directly implemented by hardware, software module executed by a processor, or combination of both. The software module can be placed in random access memory (RAM), memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0163] The above description of the disclosed embodiments enables a person skilled in the art to implement or use the present application. Various modifications to the embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data transmission method, characterized by, Applied to a first device, the method comprises: Receiving a data acquisition request of a second device, the data acquisition request containing at least a data identifier; Obtaining target data corresponding to the data identifier, the target data containing at least one data segment, and the data segment being configured with a corresponding pin identifier; Transmitting the target data to the second device, so that the second device can obtain a target identifier of the data segment with transmission error according to the pin identifier; In the case of receiving the target identifier transmitted by the second device, transmitting the target segment corresponding to the target identifier to the second device; The obtaining of the target data corresponding to the data identifier comprises: Obtaining original data corresponding to the data identifier; Obtaining at least one pin identifier according to the original data; Dividing the original data into a plurality of data segments according to the pin identifier; Obtaining a segment hash value corresponding to the data segment and an overall hash value corresponding to the original data; Integrating the original data, the pin identifier, the overall hash value and the segment hash value to obtain the target data corresponding to the data identifier; The obtaining of at least one pin identifier according to the original data comprises: Extracting a data field in a data item contained in the original data; Obtaining an association value between the data field in the data item and a business description field of the first device; Obtaining a similarity value between the first data item satisfying the sorting condition and the business description field of the second device; Determining at least one pin identifier according to at least a second data item satisfying a similarity condition of the similarity value; The determining of at least one pin identifier according to at least a second data item satisfying a similarity condition of the similarity value comprises: According to the size relationship between the data item distance between adjacent second data items and the preset minimum distance, obtaining a first candidate data item with a data item distance less than or equal to the minimum distance and a second candidate data item with a data item distance greater than the minimum distance in the second data item; Determining a pin identifier according to the position of any one data item in the first candidate data item; According to the minimum distance, the data item between adjacent second candidate data items is segmented to obtain at least one segmentation position; and a pin identifier is determined according to the segmentation position.
2. The method of claim 1, wherein, After receiving the data acquisition request of the second device, the method further comprises: Judging whether the target data corresponding to the data identifier is stored in the storage area of the first device; If yes, reading the target data from the storage area of the first device, and executing the transmitting of the target data to the second device; If not, executing the obtaining of the target data corresponding to the data identifier.
3. A data transmission method, characterized by, Applied to a second device, the method comprises: Receiving target data transmitted by a first device, the target data containing at least one data segment, and the data segment being configured with a corresponding pin identifier; In a case where the target data meets a transmission error condition, a target identifier of a data segment with a transmission error is obtained according to the pin identifier; The target identifier is transmitted to the first device, so that the first device transmits a target segment corresponding to the target identifier to the second device; The process in which the first device obtains target data corresponding to a data identifier includes: The first device obtains original data corresponding to the data identifier, obtains at least one pin identifier according to at least the original data, divides the original data into a plurality of data segments according to the pin identifier, obtains a segment hash value corresponding to the data segment and an overall hash value corresponding to the original data, and integrates the original data, the pin identifier, the overall hash value and the segment hash value to obtain the target data corresponding to the data identifier; The first device obtains at least one pin identifier according to at least the original data, and includes: The first device extracts a data field in a data item included in the original data, obtains an association value between the data field in the data item and a business description field of the first device, obtains a similarity value between a first data item with an association value meeting a sorting condition and a business description field of the second device, and determines at least one pin identifier according to at least a second data item with a similarity value meeting a similarity condition. The first device determines at least one pin identifier according to at least a second data item with a similarity value meeting a similarity condition, and includes: The first device obtains a first candidate data item with a data item distance less than or equal to a preset minimum distance and a second candidate data item with a data item distance greater than the minimum distance between adjacent second data items according to a size relationship between the data item distance and the minimum distance, determines a pin identifier according to a position of any one data item in the first candidate data item, performs data item segmentation on data items between adjacent second candidate data items according to the minimum distance to obtain at least one segmentation position, and determines a pin identifier according to the segmentation position.
4. The method of claim 3, wherein, The target data includes original data, a pin identifier, an overall hash value corresponding to the original data and a segment hash value corresponding to a data segment in the original data. The target data meets a transmission error condition, and includes: A current hash value corresponding to the original data does not match the overall hash value in the target data.
5. The method of claim 4, wherein, The target identifier of the data segment with the transmission error is obtained according to the pin identifier, and includes: The original data is divided into a plurality of data segments according to the pin identifier; A current hash value corresponding to the data segment is obtained; The current hash value is compared with the segment hash value in the target data to obtain a target identifier of a data segment with a hash value mismatch.
6. An electronic device, comprising: The electronic device as the first device includes: A memory for storing a computer program and data generated by running of the computer program; The processor is configured to execute the computer program to implement: receiving a data acquisition request of a second device, the data acquisition request comprising at least a data identifier; obtaining target data corresponding to the data identifier, the target data comprising at least one data segment, and the data segment being configured with a corresponding pin identifier; transmitting the target data to the second device, so that the second device can obtain a target identifier of a data segment with a transmission error according to the pin identifier; and in a case where the target identifier transmitted by the second device is received, transmitting a target segment corresponding to the target identifier to the second device. The obtaining of the target data corresponding to the data identifier comprises: obtaining original data corresponding to the data identifier; obtaining at least one pin identifier according to the original data; dividing the original data into a plurality of data segments according to the pin identifier; obtaining a segment hash value corresponding to the data segment and an overall hash value corresponding to the original data; integrating the original data, the pin identifier, the overall hash value and the segment hash value to obtain the target data corresponding to the data identifier; The obtaining of the at least one pin identifier according to the original data comprises: extracting a data field in a data item included in the original data; obtaining an association degree value between the data field in the data item and a business description field of the first device; obtaining a similarity value between a first data item satisfying a sorting condition of the association degree value and a business description field of the second device; determining at least one pin identifier according to at least a second data item satisfying a similarity condition of the similarity value; The determining of the at least one pin identifier according to at least the second data item satisfying the similarity condition of the similarity value comprises: obtaining a first candidate data item with a data item distance less than or equal to a preset minimum distance and a second candidate data item with a data item distance greater than the minimum distance in the second data item according to a size relationship between the data item distance of adjacent second data items and the minimum distance; determining a pin identifier according to a position of any one data item in the first candidate data item; performing data item segmentation on data items between adjacent second candidate data items according to the minimum distance to obtain at least one segmentation position; and determining a pin identifier according to the segmentation position.
7. An electronic device, comprising: The electronic device as the second device comprises: a memory configured to store a computer program and data generated by running of the computer program; a processor configured to execute the computer program to implement: receiving target data transmitted by a first device, the target data comprising at least one data segment, and the data segment being configured with a corresponding pin identifier; in a case where the target data satisfies a transmission error condition, obtaining a target identifier of a data segment with a transmission error according to the pin identifier; and transmitting the target identifier to the first device, so that the first device transmits a target segment corresponding to the target identifier to the second device. The process in which the first device obtains target data corresponding to a data identifier includes: The first device obtains native data corresponding to the data identifier, obtains at least one pin identifier according to at least the native data, divides the native data into a plurality of data segments according to the pin identifier, obtains a segment hash value corresponding to the data segment and an overall hash value corresponding to the native data, integrates the native data, the pin identifier, the overall hash value, and the segment hash value to obtain target data corresponding to the data identifier; The first device obtains at least one pin identifier according to at least the native data, including: The first device extracts a data field in a data item included in the native data, obtains an association degree value between the data field in the data item and a business description field of the first device, obtains a similarity value between a first data item whose association degree value satisfies a sorting condition and a business description field of the second device, and determines at least one pin identifier according to at least a second data item whose similarity value satisfies a similarity condition; The first device determines at least one pin identifier according to at least a second data item whose similarity value satisfies a similarity condition, including: The first device obtains a first candidate data item whose data item distance is less than or equal to a preset minimum distance and a second candidate data item whose data item distance is greater than the minimum distance according to a size relationship between a data item distance between adjacent second data items and the minimum distance, determines a pin identifier according to a position of any one data item in the first candidate data item, performs data item segmentation on data items between adjacent second candidate data items according to the minimum distance to obtain at least one segmentation position, and determines a pin identifier according to the segmentation position.
Citation Information
Patent Citations
Data verification method and device, computer equipment and storage medium
CN110377454A
Multi-channel data sending and receiving method and device and data transmission system
CN110831010A
Data transmission method and device and electronic equipment
CN113489575A