Data breakpoint transmission method, device, equipment and program product
By creating a record file with mapped collection and breakpoint identification, the problem of long and inefficient data transmission time caused by Bluetooth transmission interruption is solved, and reliable data transmission and efficiency improvement is achieved.
Patent Information
- Application Number
- CN202510481792.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-04-17
AI Technical Summary
Bluetooth transmission is easily interrupted when the device is too far away or the signal is unstable, resulting in a long data transmission time and low efficiency.
By creating a cache of the mapping set, including the mapping identifier and array of data to be transferred, the breakpoint identifier is set in the record file, and after the data transmission is interrupted, the mapping identifier is searched according to the breakpoint identifier for continuous transmission.
Reliable continuous transmission after data transmission is interrupted, reducing transmission time and improving data transmission efficiency.
Smart Images

Figure CN120050278B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data transmission, and in particular, to a data breakpoint transmission method, apparatus, device, and program product. Background Art
[0002] With the development of technology, Bluetooth technology has been continuously evolving and is increasingly used in the field of wireless device connection. Bluetooth technology is convenient to use and does not rely on network connection. As long as the distance between devices is within a reasonable range, Bluetooth transmission of files can be easily achieved. However, Bluetooth transmission also has limitations. In the case of too far distance between devices or unstable signal, the transmission process may encounter interruptions.
[0003] Taking the firmware upgrade of a device by a mobile phone App via Bluetooth as an example, if the transmission is interrupted due to unstable signal or exhausted mobile phone battery, the user needs to reconnect and re-transmit, resulting in a long data transmission time and low data transmission efficiency. Summary of the Invention
[0004] In view of this, embodiments of this application provide a data breakpoint transmission method, apparatus, device, and program product to solve the problem of long data transmission time and low data transmission efficiency in the prior art when the transmission is interrupted.
[0005] The first aspect of the embodiments of this application provides a data breakpoint transmission method, and the method includes:
[0006] Obtain data to be transmitted;
[0007] Create a cache of a mapping set according to the data to be transmitted, where the mapping set includes a mapping identifier of the data to be transmitted and an array corresponding to the mapping identifier, and the array is generated by dividing the data to be transmitted;
[0008] Create a record file according to the data to be transmitted, set a breakpoint identifier in the record file, and write the mapping set into the record file;
[0009] Send the array of the data to be transmitted, and update the breakpoint identifier in the record file according to the successful transmission response message;
[0010] After the transmission of the data to be transmitted is interrupted, according to the breakpoint identifier in the record file, find the corresponding mapping identifier in the mapping set in the record file, and find and send the data to be re-transmitted according to the mapping identifier.
[0011] Combined with the first aspect, in the first possible implementation manner of the first aspect, creating a cache of a mapping set according to the data to be transmitted includes:
[0012] Read data from the data to be transmitted in sequence according to a predetermined array capacity size to generate data;
[0013] Set the mapping identifiers corresponding to the generated arrays in sequence;
[0014] Create a cache of the mapping set in the form of key-value pairs according to the mapping identifier and the array.
[0015] Combined with the first aspect, in the second possible implementation manner of the first aspect, send the array of the data to be transmitted, and update the breakpoint identifier in the record file according to the response message indicating successful transmission, including:
[0016] Generate data blocks according to the array and the mapping identifier;
[0017] Send the data blocks in sequence according to the order of the mapping identifier;
[0018] When receiving the response message of the data block, update the breakpoint identifier in the record file to the mapping identifier in the response message.
[0019] Combined with the second possible implementation manner of the first aspect, in the third possible implementation manner of the first aspect, send the data blocks in sequence according to the order of the mapping identifier, including:
[0020] Send the data blocks in sequence according to the order of the mapping identifier in the sending manner of the stop-and-wait protocol;
[0021] When receiving the response message of the data block, update the breakpoint identifier in the record file to the mapping identifier in the response message, including:
[0022] When receiving the response message of the data block, update the breakpoint identifier in the record file to the mapping identifier in the received response message.
[0023] Combined with the second possible implementation manner of the first aspect, in the fourth possible implementation manner of the first aspect, send the data blocks in sequence according to the order of the mapping identifier, including:
[0024] Send at least two of the data blocks in the sliding window continuously in sequence according to the order of the mapping identifier in the sending manner of the sliding window protocol;
[0025] When receiving the response message of the data block, update the breakpoint identifier in the record file to the mapping identifier in the response message, including:
[0026] When receiving a response message for the data block, update at least two break point identifiers set in the record file to the mapping identifiers in the received response message corresponding to the data blocks in the sliding window, respectively.
[0027] Combined with the first aspect, in the fifth possible implementation manner of the first aspect, after the transmission of the data to be transmitted is interrupted, according to the break point identifier in the record file, find the corresponding mapping identifier in the mapping set in the record file, and find and transmit the data to be continued according to the mapping identifier, including:
[0028] After the transmission of the data to be transmitted is interrupted, when it is detected that the cache of the mapping set corresponding to the data to be transmitted still exists, according to the break point identifier in the record file, find the corresponding mapping identifier in the cache, and find and transmit the data to be continued according to the mapping identifier;
[0029] After the transmission of the data to be transmitted is interrupted, when it is detected that the cache of the mapping set corresponding to the data to be transmitted does not exist, generate key-value pair data of the mapping identifier and the array according to the data in the record file, and find and transmit the data to be continued according to the break point identifier in the key-value pair data.
[0030] Combined with the first aspect to the fifth possible implementation manner of the first aspect, in the sixth possible implementation manner of the first aspect, after sending the array of the data to be transmitted and updating the break point identifier in the record file according to the response message indicating successful transmission, the method further includes:
[0031] After detecting that all the data to be transmitted is successfully sent, delete the record file.
[0032] The second aspect of the embodiments of the present application provides a data break point transmission device, and the device includes:
[0033] A data acquisition unit, configured to acquire data to be transmitted;
[0034] A mapping unit, configured to create a cache of the mapping set according to the data to be transmitted, where the mapping set includes the mapping identifier of the data to be transmitted and the array corresponding to the mapping identifier, and the array is generated according to the data to be transmitted;
[0035] A recording unit, configured to create a record file according to the data to be transmitted, set a break point identifier in the record file, and write the mapping set into the record file;
[0036] A break point identifier update unit, configured to send the array of the data to be transmitted and update the break point identifier in the record file according to the response message indicating successful transmission;
[0037] A resume transmission unit, configured to, after the interruption of the transmission of the data to be transmitted, according to the breakpoint identifier in the record file, find a corresponding mapping identifier in the mapping set in the record file, and find and transmit the data to be resumed according to the mapping identifier.
[0038] A third aspect of the embodiments of the present application provides a data breakpoint transmission device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the data breakpoint transmission device implements the method according to any one of the first aspects.
[0039] A fourth aspect of the embodiments of the present application provides a computer program product, which, when running on a computer, causes the computer to execute the method according to the first aspect or its various implementation manners.
[0040] A fifth aspect of the embodiments of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the method according to any one of the first aspects are implemented.
[0041] A sixth aspect of the embodiments of the present application provides a chip for implementing the methods according to the various implementation manners in the first aspect. Specifically, the above chip includes: a processor, configured to call and run a computer program from a memory, so that a device installed with the above chip executes the method according to the first aspect or its various implementation manners.
[0042] The beneficial effects of the embodiments of the present application compared with the prior art are as follows: The embodiments of the present application create a cache of a mapping set according to the data to be transmitted, write the mapping set and the breakpoint identifier into the created record file, and update the breakpoint identifier in the record file according to the response message of the successful transmission of the array when sending the array of the data to be transmitted. After the data transmission is interrupted, the corresponding mapping identifier can be found in the record file according to the breakpoint identifier, and the data to be resumed is found and transmitted based on the mapping identifier, so that the data can still be reliably resumed after the interruption, which is beneficial to reducing the data transmission time and improving the data transmission efficiency. Description of the Drawings
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0044] Figure 1 It is an implementation scenario diagram of a data breakpoint transmission method provided by an embodiment of the present application;
[0045] Figure 2 is a schematic diagram of the implementation process of a data breakpoint transmission method provided by an embodiment of the present application;
[0046] Figure 3 is a schematic diagram of a mapping set provided by an embodiment of the present application;
[0047] Figure 4 is a schematic diagram of the data structure in a record file provided by an embodiment of the present application;
[0048] Figure 5 is a schematic diagram of transmitting data according to a sliding window provided by an embodiment of the present application;
[0049] Figure 6 is a schematic diagram of a data breakpoint transmission device provided by an embodiment of the present application;
[0050] Figure 7 is a schematic diagram of a data breakpoint transmission device provided by an embodiment of the present application. Detailed implementation manners
[0051] In the following description, for the purpose of illustration rather than limitation, specific details such as specific system architectures and technologies are proposed to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0052] To illustrate the technical solutions described in the present application, the following specific embodiments are used for illustration.
[0053] With the progress of technology, Bluetooth technology plays an increasingly important role in the field of wireless communication. It is known for its simplicity and allows devices to conveniently transfer files as long as they are within a suitable distance without network support. However, Bluetooth transmission also faces challenges in some cases. For example, when the devices are far apart or the signal quality is poor, the transmission may be interrupted.
[0054] For example, when a user attempts to update the firmware of a device using Bluetooth technology through a mobile phone application, if the transmission is aborted due to unstable signals or insufficient battery power of the mobile phone, the user will have to re - establish the connection and start the transmission from the beginning. This not only prolongs the data transmission time but also reduces the transmission efficiency.
[0055] Therefore, an embodiment of the present application proposes a data breakpoint transmission method, as Figure 1The figure shows a schematic diagram of the implementation scenario of this method. In the implementation scenario of data breakpoint transmission, it includes a data breakpoint transmission device 1 and a data receiving device 2.
[0056] Among them, the data breakpoint transmission device 1 may include intelligent devices such as mobile phones, tablets, servers, etc. The data receiving device may include embedded devices such as inverters or other devices that need to perform firmware upgrades. The data transmission link between the data breakpoint transmission device 1 and the data receiving device 2 may include, for example, a Bluetooth link, a Wifi link, etc.
[0057] The data breakpoint transmission device 1 includes data to be transmitted 10 and a record file 11. The data to be transmitted can be divided into at least two arrays according to the data group capacity, and each array corresponds to a mapping identifier. The data to be transmitted with the added mapping identifier can be written in the record file 11. When the data breakpoint transmission device 1 sends the data to be transmitted to the data receiving device 2, when the data receiving device 2 receives an array including the mapping identifier, it will send a response message to the data breakpoint transmission device 1. The data breakpoint transmission device 1 updates the breakpoint identifier in the record file 11 according to the mapping identifier included in the response message. After the transmission of the data to be transmitted is interrupted, the array with this breakpoint identifier as the mapping identifier can be found according to the breakpoint identifier in the record file 11, so as to be able to reliably and effectively send the data to be continued to be transmitted, improving the efficiency and reliability of data transmission.
[0058] Figure 2 The figure is a schematic diagram of the implementation process of a data breakpoint transmission method provided by an embodiment of this application, which is described in detail as follows:
[0059] In S201, obtain the data to be transmitted.
[0060] The data to be transmitted in the embodiment of this application may include, for example, firmware upgrade data, parameter configuration data, etc.
[0061] The data to be transmitted in the embodiment of this application may be data in the BIN file format for firmware upgrade. The BIN file is in binary format and can directly contain the original data of the firmware without the need for compression or encoding processing, thus effectively improving the accuracy and integrity of the firmware file during transmission and writing.
[0062] When obtaining the data to be transmitted, the data identification information of the data to be transmitted can be obtained. For example, when the data to be transmitted is a BIN file for firmware upgrade, since the BIN file is used for firmware upgrade, the version information of the BIN file upgrade can be used as the data identification information. By using the version information of the data to be transmitted as the data identification information, different versions of firmware upgrade data can be effectively distinguished, which is beneficial to improving the identification degree of the data to be transmitted.
[0063] In S202 , a cache of a mapping set is created according to the data to be transmitted, where the mapping set includes a mapping identifier of the data to be transmitted and an array corresponding to the mapping identifier.
[0064] The array is generated by dividing the data to be transmitted.
[0065] To facilitate the continued transmission of the data to be transmitted, the embodiment of the present application can sequentially divide the data to be transmitted according to the size of a predetermined array capacity to obtain at least two arrays formed by dividing the data to be transmitted, wherein the array capacity is smaller than the capacity of the data to be transmitted.
[0066] For the at least two arrays obtained by the division, a mapping identifier can be added to the array according to the order of the arrays in the data to be transmitted. The mapping identifier is the identifier mapped to the array. The location of the array can be quickly located based on the mapping identifier.
[0067] like Figure 3 As shown, assuming that the size of the BIN file of the data to be transmitted is 10,000 bytes, and the capacity of a single array is 1,000 bytes. For the data to be transmitted, you can start reading from the first byte. After reading the 1,000th byte, you get the first array, i.e., array 1. You can set array 1 to correspond to mapping identifier 1. Then start reading from the 1,001th byte. After reading the 2,000th byte, you get the second array, i.e., array 2. You can set array 2 to correspond to mapping identifier 2. Read backward in sequence according to this method until you read the last byte of the data to be transmitted, such as the 10,000th byte of the data to be transmitted, and correspond the last array, i.e., array 10, to mapping identifier 10. According to the established correspondence between arrays and mapping identifiers, a mapping set is obtained, i.e., a set of arrays and mapping identifiers.
[0068] The mapping set in the embodiment of the present application can be stored in the cache in the form of a key-value pair. For example, the mapping identifier 0 can be used as the key, and the data from the 1st byte to the 1000th byte corresponding to the mapping identifier 0 can be used as the value. The correspondence between the mapping identifier and the array can be cached in the form of key-value. The correspondence between other mapping identifiers and arrays can also be cached in the form of key-value. By caching the correspondence between the mapping identifier and the array in the form of a key-value pair, the array can be quickly accessed through the key, which is conducive to improving data access efficiency.
[0069] In S203 , a record file is created according to the data to be transmitted, a breakpoint identifier is set in the record file, and the mapping set is written into the record file.
[0070] To facilitate recording the current sending progress, embodiments of the present application can create a record file according to the data to be transmitted. The name of the record file can include the version information of the data to be transmitted. For example, the version information of the file to be transmitted can be directly used as the name of the record file, thereby establishing the relationship between the record file and the data to be transmitted. Without limitation, the relationship can also be established between the record file and other identification information of the file to be transmitted, including, for example, the digest information of the file to be transmitted. For example, the digest information of the file to be transmitted can be directly used as the name of the record file.
[0071] The record file in the embodiments of the present application is used to record mapping identifiers and arrays. The position of the array in the record file and the position of the mapping identifier in the record file can be determined according to the preset array capacity size. The record file can be a file in TXT text format, etc. As Figure 4 shown, when the mapping identifier occupies one byte and the length of the array is m bytes, if the position of the first mapping identifier is the a-th (a is a natural number, and the first a bytes can be set as breakpoint identifiers) byte, then the position of the n-th mapping identifier is the a + (m + 1)*(n - 1)-th byte, and the position of the first character of the array corresponding to the n-th mapping identifier is a + 1 + (m + 1)*(n - 1).
[0072] The record file in the embodiments of the present application includes breakpoint identifiers (TAGs), and the breakpoint identifier can be the latest identifier of the array that has been successfully sent currently. Due to different data sending protocols, the number of breakpoint identifiers can include one or at least two.
[0073] For example, when the array sending protocol is the stop-and-wait protocol, one breakpoint identifier can be set. When the array sending protocol is the sliding window protocol, the number of breakpoint identifiers can be determined according to the number of arrays included in the sliding window. For example, when the number of arrays in the sliding window protocol is 3, the number of breakpoint identifiers can be set to 3, which are respectively used to record the sending status of the 3 arrays in the sliding window.
[0074] In S204, send the array of the data to be transmitted, and update the breakpoint identifier in the record file according to the response message indicating successful sending.
[0075] When sending data, data blocks can be generated according to the arrays. A data block can include a single array and the mapping identifier corresponding to the array. When sending data, the data blocks can be sent in order according to the order of the mapping identifiers.
[0076] After the data block is sent to the data receiving device, the data receiving device will return a response message. The response message includes the mapping identifier of the array and the identifier indicating whether the reception is successful. When it is detected that the data block corresponding to the mapping identifier is successfully received, the mapping identifier can be updated in the breakpoint identifier in the record file, indicating that the array corresponding to the mapping identifier has been successfully sent and received successfully.
[0077] The sending method of the data to be transmitted in the embodiments of the present application may include a stop-and-wait protocol and a sliding window protocol. Among them, the stop-and-wait protocol is to send one data block each time until the data is successfully received, that is, after receiving the response message indicating successful sending, update the breakpoint identifier to the mapping identifier of the data block, and send the next data block.
[0078] For example, the initialized breakpoint identifier is 0. After sending the first data block, if the response message indicating successful sending is received, the breakpoint identifier can be updated to the mapping identifier of the first data block, indicating that the first data block has been successfully sent. If a data interruption occurs at this time, the first data block can be found backward based on the current breakpoint identifier, that is, the second data block is determined as the data block to be retransmitted.
[0079] The sliding window protocol is that the number of data blocks sent each time is the number of data blocks included in the sliding window. If the sliding window includes 3 data blocks, 3 breakpoint identifiers can be set. After the data block with the smallest mapping identifier in the currently sent 3 data blocks is successfully received, the sliding window is slid backward, and the step size of the sliding window is determined according to the smallest mapping identifier of the data blocks that have not been successfully sent in the current sliding window, so that the data blocks sent in the sliding window start from the smallest mapping identifier, and the newly sent data blocks are determined according to the sliding window length.
[0080] For example Figure 5As shown, the data blocks sent in the first parallel transmission are 1, 2, and 3. If response messages indicating successful transmission of data blocks 1, 2, and 3 are received, the breakpoint identifiers initialized to 0 are updated to 1, 2, and 3 respectively, and the step size is slid backward by 3, and data blocks 4, 5, and 6 are sent. If, after sending data blocks 1, 2, and 3, only the response message indicating successful transmission of data block 1 is received, then one of the breakpoint identifiers is updated to 1, and the other two breakpoint identifiers remain 0. At this time, the smallest mapping identifier that has not been successfully sent is 2, so starting from 2 and with a window length of 3, data blocks 2, 3, and 4 are determined as the currently being sent data blocks. When a response message indicating successful transmission of data block 2, 3, or 4 is received, the smallest identifier among the breakpoint identifiers is updated to the currently successful response identifier. For example, after data blocks 2 and 3 are successfully sent, the two breakpoint identifiers with a value of 0 among the breakpoint identifiers are updated to 2 and 3 respectively. At this time, the smallest mapping identifier of the data blocks that have not been successfully sent is 4, so data blocks 4, 5, and 6 are determined as the currently sent data blocks. If the transmission is successful, for example, if data block 5 is successfully sent, the smallest breakpoint identifier 1 is updated to 5, and it is determined that the mapping identifier of the data block that has not been successfully sent remains 4, and the currently sent data blocks are not updated temporarily at this time. At this time, if the transmission is interrupted, the smallest mapping identifier of the data blocks that have not been successfully sent can be determined according to the 2, 3, and 5 recorded in the breakpoint identifiers. The first missing identifier found in the increasing direction starting from the smallest identifier of the breakpoint identifiers is the mapping identifier to be continued for transmission. For example, if the breakpoint identifiers only record 2, 3, and 5, and the first missing consecutive identifier is 4, then the array corresponding to the mapping identifier 4 is determined as the data to be continued for transmission.
[0081] In S205, after the interruption of the data to be transmitted, according to the breakpoint identifier in the record file, the corresponding mapping identifier is searched in the mapping set in the record file, and the data to be continued for transmission is searched and sent according to the mapping identifier.
[0082] According to the response message after the data block is sent, the value of the breakpoint identifier can be updated in real time, and the mapping identifier corresponding to the latest successfully sent data block is updated to the breakpoint identifier. If the transmission is interrupted, the data to be continued for transmission can be determined according to the breakpoint identifier, and the breakpoint continuation transmission is performed according to the determined data to be continued for transmission, so as to reduce the probability of repeated data transmission and improve the data transmission efficiency.
[0083] In addition, in the embodiment of the present application, when it is determined that the data to be transmitted is interrupted, if a response message indicating successful reception is not received within a specified duration, the transmission can be repeated a specified number of times. For example, it can be repeated three times. If the response is still not successful after repeating the specified number of times, it can be determined that the data to be transmitted is interrupted, and the data to be continued for transmission can be determined according to the breakpoint identifier saved in the record file.
[0084] In addition, after the embodiments of the present application determine the data to be continued for transmission according to the mapping identifier, if the reconnection is successful, the cache can be searched first to determine whether the data in the cache can be paired by key and value, and the array corresponding to the mapping identifier of the data to be continued for transmission is searched. If so, the data block generated by the cache array is directly used for continued transmission. If the array corresponding to the mapping identifier of the data to be continued for transmission cannot be found in the cached data, the mapping identifier and the array in the record file, and the key-value pair data of the cached mapping identifier and the array can be cached, so that the data to be continued for transmission can be quickly located in the key-value pair cache according to the breakpoint identifier.
[0085] After all the data to be transmitted is successfully transmitted, the record file can be deleted, such as deleting the text file including the breakpoint identifier and the mapping set, etc., so as to release the storage space.
[0086] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0087] Figure 6 The figure is a schematic diagram of a data breakpoint transmission device provided by an embodiment of the present application. The device includes:
[0088] A data acquisition unit 601, configured to acquire data to be transmitted;
[0089] A mapping unit 602, configured to create a cache of a mapping set according to the data to be transmitted, where the mapping set includes a mapping identifier of the data to be transmitted and an array corresponding to the mapping identifier, and the array is generated by dividing the data to be transmitted;
[0090] A recording unit 603, configured to create a record file according to the data to be transmitted, set a breakpoint identifier in the record file, and write the mapping set into the record file;
[0091] A breakpoint identifier update unit 604, configured to send the array of the data to be transmitted, and update the breakpoint identifier in the record file according to the response message indicating successful transmission;
[0092] A continued transmission unit 605, configured to, after the transmission of the data to be transmitted is interrupted, search for a corresponding mapping identifier in the mapping set in the record file according to the breakpoint identifier in the record file, and search for and send the data to be continued for transmission according to the mapping identifier.
[0093] Figure 6 The shown data breakpoint transmission device corresponds to Figure 2 The shown data breakpoint transmission method.
[0094] Figure 7 This is a schematic diagram of a data breakpoint transmission device provided by an embodiment of the present application. As Figure 7 shown, the data breakpoint transmission device 7 of this embodiment includes: a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70, such as a data breakpoint transmission program. When the processor 70 executes the computer program 72, the steps in the above-mentioned various data breakpoint transmission method embodiments are implemented. Alternatively, when the processor 70 executes the computer program 72, the functions of each module / unit in the above-mentioned various device embodiments are implemented.
[0095] Exemplarily, the computer program 72 can be divided into one or more modules / units. The one or more modules / units are stored in the memory 71 and executed by the processor 70 to complete the present application. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program 72 in the data breakpoint transmission device 7.
[0096] The data breakpoint transmission device 7 can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The data breakpoint transmission device may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art can understand that Figure 7 this is only an example of a data breakpoint transmission device 7 and does not constitute a limitation on the data breakpoint transmission device 7. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the data breakpoint transmission device may further include an input / output device, a network access device, a bus, etc.
[0097] The so-called processor 70 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0098] The memory 71 may be an internal storage unit of the data breakpoint transfer device 7, such as the hard disk or memory of the data breakpoint transfer device 7. The memory 71 may also be an external storage device of the data breakpoint transfer device 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the data breakpoint transfer device 7. Further, the memory 71 may also include both the internal storage unit of the data breakpoint transfer device 7 and the external storage device. The memory 71 is used to store the computer program and other programs and data required by the data breakpoint transfer device. The memory 71 may also be used to temporarily store the data that has been output or will be output.
[0099] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiment and will not be elaborated herein.
[0100] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0101] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0102] In the embodiments provided in this application, it should be understood that the disclosed device / terminal device and method can be implemented in other ways. For example, the device / terminal device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical, mechanical or other forms.
[0103] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0104] In addition, each functional unit in various embodiments of this application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0105] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above method embodiments of this application can also be completed by hardware related to computer program instructions. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0106] In addition, an embodiment of the present application further provides a computer program product, which, when running on a computer, causes the computer to execute the methods in the above-mentioned various implementation manners.
[0107] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A data breakpoint transmission method, characterized in that, The method includes: Obtain the data to be transmitted; Create a cache of a mapping set according to the data to be transmitted, where the mapping set includes a mapping identifier of the data to be transmitted and an array corresponding to the mapping identifier, and the array is generated by partitioning the data to be transmitted; Create a record file according to the data to be transmitted, set a breakpoint identifier in the record file, and write the mapping set into the record file; Send the array of the data to be transmitted, and update the breakpoint identifier in the record file according to the response message indicating successful sending, including: generating data blocks according to the array and the mapping identifier, where the data block includes a single array and the mapping identifier corresponding to the array, and sending the data blocks in order according to the order of the mapping identifiers. When receiving the response message of the data block, update the breakpoint identifier in the record file to the mapping identifier in the response message. Among them, sending the data blocks in order according to the order of the mapping identifiers includes: sending at least two of the data blocks in the sliding window continuously in order according to the sending method of the sliding window protocol according to the order of the mapping identifiers. Specifically, after the data block with the smallest mapping identifier among at least two data blocks sent in the sliding window is successfully received, slide backward, and the step size of the sliding window is determined according to the smallest mapping identifier of the data blocks that have not been successfully sent in the sliding window. Starting from the smallest mapping identifier of the data blocks sent in the sliding window, determine the newly sent data blocks according to the length of the sliding window; when receiving the response message of the data block, updating the breakpoint identifier in the record file to the mapping identifier in the response message includes: when receiving the response message of the data block, updating at least two of the breakpoint identifiers set in the record file to the mapping identifiers in the response messages corresponding to the data blocks in the sliding window received; After the sending of the data to be transmitted is interrupted, according to the breakpoint identifier in the record file, find the corresponding mapping identifier in the mapping set in the record file, and find and send the data to be continued according to the mapping identifier.
2. The method according to claim 1, wherein Creating a cache of a mapping set according to the data to be transmitted includes: Read the data from the data to be transmitted in sequence to generate an array according to a predetermined array capacity size; Set the mapping identifiers corresponding to the generated arrays in sequence; Create a cache of the mapping set in the form of key-value pairs according to the mapping identifier and the array.
3. The method according to claim 1, wherein Sending the data blocks in order according to the order of the mapping identifiers includes: Sending the data blocks in order according to the sending method of the stop-and-wait protocol according to the order of the mapping identifiers; When receiving the response message of the data block, updating the breakpoint identifier in the record file to the mapping identifier in the response message includes: When receiving the response message of the data block, update the breakpoint identifier in the record file to the mapping identifier in the received response message.
4. The method according to claim 1, wherein After the interruption of the transmission of the data to be transmitted, according to the breakpoint identifier in the record file, find the corresponding mapping identifier in the mapping set in the record file, and find and transmit the data to be resumed, including: After the interruption of the transmission of the data to be transmitted, when it is detected that there is still a cache of the mapping set corresponding to the data to be transmitted, according to the breakpoint identifier in the record file, find the corresponding mapping identifier in the cache, and find and transmit the data to be resumed according to the mapping identifier; After the interruption of the transmission of the data to be transmitted, when it is detected that there is no cache of the mapping set corresponding to the data to be transmitted, generate key-value pair data of the mapping identifier and the array according to the data in the record file, and find and transmit the data to be resumed in the key-value pair data according to the breakpoint identifier.
5. The method according to any one of claims 1-4, characterized in that, After sending the array of the data to be transmitted and updating the breakpoint identifier in the record file according to the response message indicating successful transmission, the method further includes: After detecting that all the data to be transmitted have been successfully sent, delete the record file.
6. A data breakpoint transmission device, characterized in that, The device includes: A data acquisition unit, configured to acquire data to be transmitted; A mapping unit, configured to create a cache of a mapping set according to the data to be transmitted, where the mapping set includes a mapping identifier of the data to be transmitted and an array corresponding to the mapping identifier, and the array is generated by dividing the data to be transmitted; A recording unit, configured to create a record file according to the data to be transmitted, set a breakpoint identifier in the record file, and write the mapping set into the record file; A breakpoint identifier updating unit, configured to send the array of the data to be transmitted and update the breakpoint identifier in the record file according to the response message indicating successful transmission, including: generating data blocks according to the array and the mapping identifier, where the data blocks include a single array and the mapping identifier corresponding to the array, and sending the data blocks in order according to the order of the mapping identifiers. When receiving the response message of the data block, update the breakpoint identifier in the record file to the mapping identifier in the response message. Among them, sending the data blocks in order according to the order of the mapping identifiers includes: sending at least two of the data blocks in the sliding window continuously in order according to the sending method of the sliding window protocol according to the order of the mapping identifiers. Specifically, after the data block with the smallest mapping identifier among at least two data blocks sent in the sliding window is successfully received, slide backward, and the step size of the sliding window is determined according to the smallest mapping identifier of the data blocks that have not been successfully sent in the sliding window. Starting from the smallest mapping identifier of the data blocks sent in the sliding window, determine the newly sent data blocks according to the length of the sliding window; when receiving the response message of the data block, updating the breakpoint identifier in the record file to the mapping identifier in the response message includes: when receiving the response message of the data block, updating at least two of the breakpoint identifiers set in the record file to the mapping identifiers in the response messages corresponding to the data blocks in the sliding window received; A resume transmission unit, configured to, after the interruption of sending the data to be transmitted, find a corresponding mapping identifier in a mapping set in the record file according to a breakpoint identifier in the record file, and find and send the data to be resumed according to the mapping identifier.
7. A data breakpoint transmission device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the data breakpoint transmission device implements the method according to any one of claims 1-5.
8. A computer program product, comprising computer program instructions, characterized in that, When the computer program runs, the method according to any one of claims 1-5 is executed.
Citation Information
Patent Citations
Multi-channel firmware upgrading method and system supporting breakpoint resume
CN119556960A