Data processing method and device
By encoding and splicing the data to be sent at the data sending end, the problem of inefficient data transmission in the prior art is solved, and efficient and compatible data transmission is achieved.
Patent Information
- Application Number
- CN202111257384.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-27
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2041-10-27
AI Technical Summary
In the prior art, when transmitting network data packets, special processing of the data length is required to avoid crashing, crashing or overflowing on the receiving end, resulting in inefficient data transmission.
On the data sending end, the target sending data and overflow data in the data to be sent are determined, and the overflow data is encoded, the target sending data is spliced with the encoded overflow data to form splicing data, and then sent to the data receiving end. The data receiving end decodes after receiving it to restore the original data.
Through this method, it is avoided to significantly increase the data footprint, improve data transmission efficiency, and improve data compatibility.
Smart Images

Figure CN115529109B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, for example, to a data processing method and device. Background Art
[0002] With the advancement of science and technology and the improvement of people's living standards, more and more devices need to be connected to the Internet of Things to exchange information and communicate in order to realize intelligent control of devices. The more devices connected to the network, the higher the requirements for network transmission efficiency. Therefore, there is an urgent need for an efficient and compatible data transmission solution.
[0003] A method for transmitting and analyzing network data packets is currently available. The following steps are performed during information transmission: a message code is added before the transmitted message to establish a one-to-one mapping relationship with the length of the transmission information; the message code and the transmission information are packaged together into a data packet, wherein the message code serves as the packet header of the data packet and the transmission information serves as the packet body of the data packet; the entire data packet is sent out; after receiving the message, the receiving end first interprets the message code of the data packet. If the length displayed by the message code is the same as the length of the transmission information, the transmission information is further read; if the length displayed by the message code is different from the length of the transmission information, the transmission information is no longer read.
[0004] It can be seen that the above method first needs to establish a code that corresponds to the data length, determine the data length by interpreting the code, and then parse the data according to the data length. This can ensure that the data receiving end does not crash, freeze or overflow. Therefore, this method requires special processing of the data length, which will greatly increase the space occupied by the data and lead to low data transmission efficiency. Summary of the invention
[0005] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0006] The embodiments of the present disclosure provide a data processing method and device to avoid a significant increase in the space occupied by data and ensure data transmission efficiency.
[0007] In some embodiments, the data processing method includes: when there is overflow in the data to be sent, the data sending end determines the target sending data and the overflow data from the data to be sent; encodes the overflow data, and splices the target sending data with the encoded overflow data to obtain spliced data; and sends the spliced data to the data receiving end, so that the data receiving end decodes the spliced data to obtain the data to be sent.
[0008] In some embodiments, the data processing method includes: a data receiving end obtains spliced data sent by a data sending end, the spliced data is obtained by the data sending end when there is overflow in the data to be sent, by determining the target sending data and the overflow data from the data to be sent, and splicing the target sending data and the encoded overflow data; the spliced data is decoded to obtain the data to be sent.
[0009] In some embodiments, the data processing device includes a processor and a memory storing program instructions. The processor is configured to execute the above data processing method when executing the program instructions.
[0010] The data processing method and data processing device provided by the embodiments of the present disclosure can achieve the following technical effects:
[0011] When there is overflow in the data to be sent, the data sending end can determine the target sending data and the overflow data from the data to be sent, encode the overflow data, and splice the target sending data with the encoded overflow data to obtain spliced data. In this way, the data sending end can send the spliced data to the data receiving end so that the data receiving end decodes the spliced data to obtain the correct data to be sent. Compared with the prior art, this can avoid a significant increase in the space occupied by data, ensure data transmission efficiency, and improve data compatibility.
[0012] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:
[0014] Figure 1 is a schematic diagram of a data processing system provided by an embodiment of the present disclosure;
[0015] Figure 2 is a flow chart of a data processing method provided by an embodiment of the present disclosure;
[0016] Figure 3 is a flow chart of a data processing method provided by an embodiment of the present disclosure;
[0017] Figure 4 is a flow chart of a data processing method provided by an embodiment of the present disclosure;
[0018] Figure 5 is a flow chart of a data processing method provided by an embodiment of the present disclosure;
[0019] Figure 6 is a flow chart of a data processing method provided by an embodiment of the present disclosure;
[0020] Figure 7 It is a schematic diagram of a data processing device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0022] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0023] Unless otherwise stated, the term "plurality" means two or more.
[0024] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0025] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0026] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
[0027] In the embodiments of the present disclosure, smart home appliances refer to home appliances that are formed by introducing microprocessors, sensor technology, and network communication technology into home appliances. They have the characteristics of intelligent control, intelligent perception, and intelligent application. The operation process of smart home appliances often relies on the application and processing of modern technologies such as the Internet of Things, the Internet, and electronic chips. For example, smart home appliances can be connected to electronic devices to enable users to remotely control and manage the smart home appliances.
[0028] Figure 1 Schematic diagram of a data processing system provided by an embodiment of the present disclosure. Figure 1 As shown, the embodiment of the present disclosure provides a data processing system, including a data sending end and a data receiving end. As an example, the data sending end can be deployed on various sensors, and the data receiving end can be deployed on a gateway. The two cooperate with each other, and through the solution provided by the embodiment of the present application, the data transmission efficiency is guaranteed and the data compatibility is improved. In this way, the gateway can further send the correct data measured by the sensor to the data requester, such as a smart home appliance.
[0029] In actual application, when there is overflow in the data to be sent, the data sending end can determine the target sending data and the overflow data from the data to be sent, so as to encode the overflow data. After encoding the overflow data, the data sending end can splice the target sending data with the encoded overflow data to obtain spliced data, and send it to the data receiving end. Correspondingly, the data receiving end can obtain the spliced data and decode the spliced data to obtain the data to be sent. The specific implementation method can be referred to the introduction below.
[0030] Figure 2 is a flow chart of a data processing method provided by an embodiment of the present disclosure. Figure 2 As shown, the embodiment of the present disclosure provides a data processing method applicable to a data sending end, which may include:
[0031] S21, when there is overflow in the data to be sent, the data sending end determines target sending data and overflow data from the data to be sent.
[0032] Optionally, determining the target transmission data and overflow data from the data to be transmitted may include: the data transmitting end obtains data corresponding to a preset data length from the data to be transmitted, and uses the corresponding data as the target transmission data; the data transmitting end uses the remaining data in the data to be transmitted as the overflow data. In this way, by determining the target transmission data and the overflow data, it is helpful for the subsequent data transmitting end to accurately encode the overflow data, and to splice the target transmission data and the overflow data to complete the data assembly. In this way, when the data receiving end decodes the spliced data, it can obtain the correct data to be transmitted, avoid transmission errors caused by data overflow, help ensure data transmission efficiency, and improve data compatibility.
[0033] Here, the preset data length can be determined by the data sending end and the data receiving end through negotiation.
[0034] As an example, the data sending end is a temperature and humidity sensor, and the data to be sent are the detected temperature value 22, the detected humidity value 41, and the device identification 69857 of the temperature and humidity sensor. The preset data lengths corresponding to the above three data are 1 unit length, 1 unit length, and 2 unit lengths, respectively. The data sending end encodes the above-mentioned detected humidity value, detected temperature value, and the device identification of the temperature and humidity sensor in hexadecimal encoding format, and the encoding result is: detected temperature value 0x16, detected humidity value 0x29, and device identification 0x110E1 of the temperature and humidity sensor. At this time, corresponding to the preset data length, the target sending data can be 0x16 0x29 0x1 0x10, and the overflow data is 0xE1.
[0035] S22, the data transmitting end encodes the overflow data, and splices the target transmission data with the encoded overflow data to obtain spliced data.
[0036] Optionally, the data transmitting end encodes the overflow data, which may include: the data transmitting end obtains the overflow position, overflow content and overflow amount of the overflow data; the data transmitting end encodes the overflow position, overflow content and overflow amount respectively to obtain the encoding result. In this way, the data transmitting end, by encoding the overflow position, overflow content and overflow amount, helps the subsequent data receiving end to accurately decode and accurately restore the data to be sent, avoids transmission errors caused by data overflow, ensures data transmission efficiency, and improves data compatibility. At the same time, the decoding end time can be accurately determined to avoid decoding conflicts at the data receiving end when there are other data to be decoded at the end of the overflow data.
[0037] The overflow position may be reflected as the number of data overflows, or the number of lengths of data overflows. In this regard, the embodiments of the present disclosure may not be specifically limited, and only need to ensure that the count starts from the head of the data to be sent.
[0038] The overflow amount may be reflected as a number of data overflows, or may be reflected as a number of data overflows of lengths. In this regard, the embodiments of the present disclosure may not be specifically limited.
[0039] Specifically, the data transmitting end encodes the overflow position, overflow content and overflow amount respectively, which may include: the data transmitting end encodes the overflow position, overflow content and overflow amount according to a preset encoding format to obtain a first encoding result corresponding to the overflow position, a second encoding result corresponding to the overflow content, and a third encoding result corresponding to the overflow amount; wherein the first encoding result, the second encoding result and the third encoding result are separated by a separation mark pair. Using a separation mark pair to separate the encoding results in this way helps the subsequent data receiving end to accurately separate and decode, accurately restore the data to be sent, avoid transmission errors caused by data overflow, ensure data transmission efficiency, and improve data compatibility.
[0040] Here, the preset encoding format can be determined by both the data sending end and the data receiving end.
[0041] Combined with the above example, taking the hexadecimal encoding format as an example, the encoding results of the above three data to be sent are: detected temperature value 0x16, detected humidity value 0x29, and device identification of the temperature and humidity sensor 0x110E1. The preset data lengths corresponding to the above three data are 1 unit length, 1 unit length, and 2 unit lengths, respectively. The target transmission data is 0x16 0x290x1 0x10, and the overflow data is 0xE1. Therefore, the overflow position of the overflow data is the third data, the overflow content is 0xE1, and the overflow amount is 1 data. The data sending end encodes the overflow position, overflow content, and overflow amount according to the hexadecimal encoding format, and the obtained encoding results can be: the first encoding result 0x3, the second encoding result 0xE1, and the third encoding result 0x1.
[0042] On this basis, each encoding result can be separated by a separator pair. Here, the separator pair can be determined by both the data transmitter and the data receiver. For example, 0xFA is added to the head and tail of the encoding result. Correspondingly, the first encoding result after the separator pair is separated is 0xFA0x3 0xFA, the second encoding result after the separator pair is separated is 0xFA0xE10xFA, and the third encoding result after the separator pair is separated is 0xFA0x1 0xFA.
[0043] Specifically, the data sending end encodes the overflow position, overflow content and overflow amount respectively, and may also include: the data sending end uses the first encoding result after the separation of the separation identifier pair as the key and the second encoding result after the separation of the separation identifier pair as the value to construct a key-value pair. In this way, a simple key-value pair is used to store the first separated data and the second separated data, making the operations of reading and writing data faster and more flexible, further improving the transmission efficiency.
[0044] Optionally, the data transmitting end splices the target transmission data with the encoded overflow data, which may include: the data transmitting end sequentially splices the third encoding result and the key-value pair separated by the separation identifier pair to the end of the target transmission data. In this way, it is helpful for the subsequent data transmitting end to preferentially parse and obtain the overflow amount when decoding the overflow data, so as to preferentially determine the decoding end time, and avoid decoding conflicts at the data receiving end when there are other data to be decoded at the end of the overflow data.
[0045] Combined with the above example, taking the hexadecimal encoding format as an example, the target transmission data is 0x16 0x290x1 0x10, the third encoding result after the separation of the separator pair is 0xFA 0x1 0xFA, and the key-value pair is 0xFA 0x3 0xFA; 0xFA 0xE10xFA. Correspondingly, the data transmitter splices the target transmission data with the encoded overflow data, and the spliced data obtained is 0x16 0x29 0x1 0x10 0xFA0x1 0xFA 0xFA 0x3 0xFA 0xFA 0xE1 0xFA.
[0046] S23, the data transmitting end sends the spliced data to the data receiving end, so that the data receiving end decodes the spliced data to obtain the data to be sent.
[0047] In summary, by using the data processing method provided by the embodiment of the present disclosure, when there is overflow in the data to be sent, the data sending end can determine the target sending data and the overflow data from the data to be sent, encode the overflow data, and splice the target sending data with the encoded overflow data to obtain spliced data. In this way, the data sending end can send the spliced data to the data receiving end so that the data receiving end decodes the spliced data to obtain the correct data to be sent. In this way, it is possible to avoid a significant increase in the space occupied by data, ensure data transmission efficiency, and improve data compatibility.
[0048] Figure 3 is a flow chart of a data processing method provided by an embodiment of the present disclosure. Figure 3 As shown, the embodiment of the present disclosure provides a data processing method applicable to a data sending end, which may include:
[0049] S31, when there is overflow in the data to be sent, the data sending end determines target sending data and overflow data from the data to be sent.
[0050] S32, the data sending end obtains the overflow position, overflow content and overflow amount of the overflow data.
[0051] S33, the data sending end encodes the overflow position, overflow content and overflow amount respectively to obtain an encoding result.
[0052] S34, when one or more of the encoding results are the same as one of the separation identifier pairs, the data sending end adds an escape identifier to one or more of the encoding results.
[0053] Here, the escape identifier can be determined by both the data transmitter and the data receiver. For example, the separator identifier pair is to add 0xFA to the head and tail of the encoding result, respectively, and one of the encoding results is 0xFA, then the data transmitter needs to add an escape identifier to the encoding result. The encoding result after adding the escape identifier is 0xFB. Correspondingly, the encoding result after the separator identifier pair is separated is 0xFA0xFB 0xFA.
[0054] In this way, the encoding result and the separation identifier pair are distinguished by using the escape identifier to avoid the separation identifier pair and the encoding result being the same, thereby ensuring the accuracy of data transmission.
[0055] S35, the data transmitting end splices the target transmitting data with the encoded overflow data to obtain spliced data.
[0056] S36, the data transmitting end sends the spliced data to the data receiving end, so that the data receiving end decodes the spliced data to obtain the data to be sent.
[0057] In summary, by adopting the data processing method provided by the embodiment of the present disclosure, when there is overflow in the data to be sent, the data sending end can determine the target sending data and the overflow data from the data to be sent, encode the overflow data, and splice the target sending data with the encoded overflow data to obtain spliced data. In this way, the data sending end can send the spliced data to the data receiving end so that the data receiving end decodes the spliced data to obtain the correct data to be sent. In this way, it is possible to avoid a significant increase in the space occupied by data, ensure the transmission efficiency of data, and improve the compatibility of data. In addition, by using the escape identifier to distinguish the encoding result and the separation identifier pair, it is also possible to avoid the separation identifier pair being the same as the encoding result, further ensuring the accuracy of data transmission.
[0058] Figure 4 is a flow chart of a data processing method provided by an embodiment of the present disclosure. Figure 4 As shown, the embodiment of the present disclosure provides a data processing method applicable to a data sending end, which may include:
[0059] S21, when there is overflow in the data to be sent, the data sending end determines target sending data and overflow data from the data to be sent.
[0060] S22, the data transmitting end encodes the overflow data, and splices the target transmission data with the encoded overflow data to obtain spliced data.
[0061] S23, the data transmitting end sends the spliced data to the data receiving end, so that the data receiving end decodes the spliced data to obtain the data to be sent.
[0062] S41, when there is no overflow in the data to be sent, the data sending end splices a no overflow flag to the end of the data to be sent, and sends it to the data receiving end, so that the data receiving end decodes the spliced data to obtain the data to be sent.
[0063] Here, the no overflow flag can be defined by both the data sending end and the data receiving end. For example, the no overflow flag is 0x1.
[0064] As an example, the data sending end is a temperature and humidity sensor, and the data to be sent are the detected temperature value 25, the detected humidity value 39, and the device identification 3219 of the temperature and humidity sensor. The preset data lengths corresponding to the above three data to be sent are 1 unit length, 1 unit length, and 2 unit lengths, respectively. The data sending end encodes the above-mentioned detected humidity value, detected temperature value, and the device identification of the temperature and humidity sensor in hexadecimal encoding format, and the encoding result is: detected temperature value 0x19, detected humidity value 0x27, and device identification 0xC93 of the temperature and humidity sensor. At this time, corresponding to the preset data length, the data to be sent can be 0x19 0x27 0xC 0x93, and there is no overflow. Therefore, the data sending end can splice the no overflow identifier to the end of the data to be sent, that is, 0x19 0x27 0xC 0x93 0x1.
[0065] Setting the no overflow flag in this way helps to quickly and efficiently transmit data to the data receiver accurately when there is no data overflow. It can ensure data transmission efficiency and improve data compatibility while avoiding a significant increase in the space occupied by data.
[0066] In summary, by using the data processing method provided by the embodiment of the present disclosure, when there is overflow in the data to be sent, the data sending end can determine the target sending data and the overflow data from the data to be sent, encode the overflow data, and splice the target sending data with the encoded overflow data to obtain spliced data. In this way, the data sending end can send the spliced data to the data receiving end so that the data receiving end decodes the spliced data to obtain the correct data to be sent. In this way, it is possible to avoid a significant increase in the space occupied by data, ensure the transmission efficiency of data, and improve the compatibility of data. In addition, it is helpful to quickly and efficiently transmit data to the data receiving end accurately when there is no data overflow.
[0067] Figure 5 is a flow chart of a data processing method provided by an embodiment of the present disclosure. Figure 5 As shown, the embodiment of the present disclosure provides a data processing method applicable to a data receiving end, which may include:
[0068] S51, the data receiving end obtains the spliced data sent by the data sending end. The spliced data is obtained by the data sending end when there is overflow in the data to be sent, by determining the target sending data and the overflow data from the data to be sent, and splicing the target sending data and the encoded overflow data.
[0069] S52, the data receiving end decodes the spliced data to obtain data to be sent.
[0070] Optionally, the data receiving end decodes the spliced data, which may include: the data receiving end starts from the head of the spliced data, obtains the data corresponding to the preset data length, and uses the data corresponding to the preset data length as the target transmission data, and uses the remaining data in the spliced data as the overflow data; the data receiving end starts from the head of the overflow data, obtains the third encoding result separated by the separation identifier pair, and decodes the third encoding result to obtain the overflow amount; the data receiving end continues to obtain the key-value pair separated by the separation identifier pair from the overflow data, and decodes the key-value pair to obtain the overflow position and overflow content; the data receiving end restores the target transmission data according to the overflow amount, the overflow position and the overflow content. In this way, when the data receiving end decodes the overflow data, it can give priority to parsing to obtain the overflow amount, so as to give priority to judging the decoding end time, and avoid the decoding conflict of the data receiving end when there are other data to be decoded at the tail of the overflow data. In addition, it is helpful to accurately restore the data to be sent according to the overflow position and overflow content obtained by decoding, avoid the transmission error caused by the data overflow, and help to ensure the transmission efficiency of the data and improve the compatibility of the data.
[0071] Combined with the above example, the separation mark pair takes 0xFA added to the head and tail of the encoding result respectively, and the spliced data is 0x16 0x29 0x1 0x10 0xFA0x1 0xFA 0xFA 0x3 0xFA 0xFA0xE1 0xFA. The preset data lengths corresponding to the three data of the detected temperature value, the detected humidity value and the device identification of the temperature and humidity sensor are 1 unit length, 1 unit length and 2 unit lengths respectively.
[0072] Thus, the target send data of 4 units of length obtained by the data receiving end from the head of the spliced data is 0x16 0x29 0x1 0x10, and the overflow data is 0xFA 0x1 0xFA 0xFA 0x3 0xFA 0xFA 0xE1 0xFA.
[0073] Correspondingly, the data receiving end starts from the header of the overflow data and first obtains 0xFA 0x10xFA. The data is the third encoding result separated by the separation identifier pair. The data receiving end decodes the third encoding result 0x1 and obtains that the overflow amount is 1 data. Further, the data receiving end continues to obtain 0xFA 0x3 0xFA 0xFA0xE1 0xFA from the overflow data. The data is a key-value pair separated by the separation identifier pair. The data receiving end decodes the key-value pair with 0x3 as the key and 0xE1 as the value, and obtains that the overflow position is the third data and the overflow content is 0xE1.
[0074] Furthermore, the data receiving end restores the target sending data 0x16 0x29 0x1 0x10 according to the overflow amount 1 data, the third data of the overflow position and the overflow content 0xE1 to obtain the data to be sent 0x16 0x290x110E1.
[0075] In summary, by using the data processing method provided by the embodiment of the present disclosure, the data receiving end can accurately decode the spliced data sent by the data sending end to obtain the correct data to be sent. In this way, it is possible to avoid a significant increase in the space occupied by data, ensure data transmission efficiency, and improve data compatibility.
[0076] In addition, if the data receiving end obtains the spliced data sent by the data sending end, and the spliced data is obtained by the data sending end splicing the no overflow mark to the tail of the data to be sent when there is no overflow in the data to be sent, then the data receiving end decodes the spliced data, which may include: the data receiving end obtains the data corresponding to the preset data length from the head of the spliced data, and uses the data corresponding to the preset data length as the target sending data. The data receiving end restores the target sending data according to the data volume of the data to be sent. In this way, it is helpful for the data receiving end to decode quickly and accurately when there is no overflow in the data, thereby improving the compatibility of the data.
[0077] Combined with the above example, the overflow mark takes 0x1 as an example, and the concatenated data is 0x19 0x27 0xC 0x930x1. The preset data lengths corresponding to the three data of the detected temperature value, the detected humidity value and the device identification of the temperature and humidity sensor are 1 unit length, 1 unit length and 2 unit lengths respectively.
[0078] Thus, the data receiving end obtains 4 units of target transmission data starting from the header of the spliced data, which are 0x19 0x27 0xC 0x93. Furthermore, since the amount of data to be transmitted is 3 data, the data receiving end splices the target transmission data into 0x19 0x27 0xC93 to restore the data to be transmitted.
[0079] Figure 6 is a flow chart of a data processing method provided by an embodiment of the present disclosure. Figure 6 As shown, the present disclosure provides a data processing method, which may include:
[0080] S61, when there is overflow in the data to be sent, the data sending end determines target sending data and overflow data from the data to be sent.
[0081] S62, the data transmitting end encodes the overflow data, and splices the target transmission data with the encoded overflow data to obtain spliced data.
[0082] S63, the data sending end sends the spliced data to the data receiving end.
[0083] S64, the data receiving end obtains the spliced data.
[0084] S65, the data receiving end decodes the spliced data to obtain data to be sent.
[0085] By adopting the data processing method provided by the embodiment of the present disclosure, when there is overflow in the data to be sent, the data sending end can determine the target sending data and the overflow data from the data to be sent, encode the overflow data, and splice the target sending data with the encoded overflow data to obtain spliced data. In this way, the data sending end can send the spliced data to the data receiving end so that the data receiving end decodes the spliced data to obtain the correct data to be sent. In this way, it is possible to avoid a significant increase in the space occupied by data, ensure data transmission efficiency, and improve data compatibility.
[0086] Figure 7 Schematic diagram of a data processing device provided by an embodiment of the present disclosure. Figure 7 As shown, an embodiment of the present disclosure provides a data processing device, including a processor 100 and a memory 101. Optionally, the device may also include a communication interface 102 and a bus 103. The processor 100, the communication interface 102, and the memory 101 may communicate with each other through the bus 103. The communication interface 102 may be used for information transmission. The processor 100 may call the logic instructions in the memory 101 to execute the data processing method of the above embodiment.
[0087] In addition, the logic instructions in the memory 101 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.
[0088] The memory 101 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the methods in the embodiments of the present disclosure. The processor 100 executes functional applications and data processing by running the program instructions / modules stored in the memory 101, that is, implementing the data processing method in the above-mentioned embodiments.
[0089] The memory 101 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 101 may include a high-speed random access memory and may also include a non-volatile memory.
[0090] An embodiment of the present disclosure provides a storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the above-mentioned data processing method.
[0091] The above-mentioned storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0092] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.
[0093] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0094] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0095] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and 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 on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0096] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A data processing method, characterized in that: include: The data transmitting end determines target transmission data and overflow data from the data to be transmitted when there is overflow in the data to be transmitted; Encoding the overflow data, and splicing the target transmission data with the encoded overflow data to obtain spliced data; Sending the spliced data to a data receiving end, so that the data receiving end decodes the spliced data to obtain the data to be sent; The method further comprises: when there is no overflow in the data to be sent, splicing a no overflow mark to the end of the data to be sent, and sending the mark to the data receiving end, so that the data receiving end decodes the spliced data to obtain the data to be sent; The data receiving end first parses the overflow amount to determine the end time of decoding, so as to avoid decoding conflicts at the data receiving end when there are other data to be decoded at the end of the overflow data.
2. The method according to claim 1, characterized in that The encoding of the overflow data comprises: Obtaining the overflow position, overflow content and overflow amount of the overflow data; The overflow position, the overflow content and the overflow amount are encoded respectively to obtain an encoding result.
3. The method according to claim 2, characterized in that The respectively encoding the overflow position, the overflow content and the overflow amount comprises: Encoding the overflow position, the overflow content, and the overflow amount according to a preset encoding format to obtain a first encoding result corresponding to the overflow position, a second encoding result corresponding to the overflow content, and a third encoding result corresponding to the overflow amount; The first encoding result, the second encoding result and the third encoding result are separated by separation mark pairs respectively.
4. The method according to claim 3, characterized in that The encoding of the overflow position, the overflow content and the overflow amount respectively further includes: A key-value pair is constructed by taking the first encoding result after the separation of the separation identifier pair as the key and the second encoding result after the separation of the separation identifier pair as the value.
5. The method according to claim 4, characterized in that The step of splicing the target transmission data with the encoded overflow data comprises: The third encoding result separated by the separation identifier pair and the key-value pair are sequentially concatenated to the end of the target sending data.
6. The method according to claim 2, characterized in that Also includes: When one or more of the encoding results are identical to one of the delimiter identifier pairs, an escape identifier is added to the one or more encoding results.
7. A data processing method, characterized in that: include: The data receiving end obtains the spliced data sent by the data sending end, wherein the spliced data is obtained by the data sending end determining target sending data and overflow data from the data to be sent when there is overflow in the data to be sent, and splicing the target sending data and the encoded overflow data; Decoding the spliced data to obtain the data to be sent; The data receiving end receives the spliced data of the data sending end by splicing the non-overflow mark to the tail of the data to be sent when the data to be sent does not have overflow; The data receiving end preferentially parses the overflow amount to determine the decoding end time, so as to avoid decoding conflicts at the data receiving end when there are other data to be decoded at the end of the overflow data.
8. A data processing device, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to perform the data processing method according to any one of claims 1 to 6 when executing the program instructions.
9. A data processing device, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to perform the data processing method according to claim 7 when executing the program instructions.
Citation Information
Patent Citations
Data processing device and method, and recording device and method
CN1290453A