Data processing method and device, data transmission terminal and storage medium
By adopting ring cache and chain structure cache in the data transmission terminal, the problem of high packet loss rate during the transmission process of the data transmission terminal is solved, and high reliability and efficiency of data transmission are achieved.
Patent Information
- Application Number
- CN202411996961.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-02
AI Technical Summary
The packet loss rate of data transmission terminals is high during transmission, and data packets may be discarded or delayed due to weak or unstable signals, network congestion, etc.
Data is stored in a circular cache and a chain structure cache. The circular cache is used to store the first data sent by the first device, and the chain structure cache is used to store the second data to be sent to the second device. In this way, the data transmission terminal can store data when it cannot process data in time, reduce data loss or overflow, and retransmit if an error occurs during the transmission process.
It improves the reliability and transmission efficiency of data transmission, reduces the packet loss rate of data transmitted by data transmission terminals, and ensures the real-time and integrity of data.
Smart Images

Figure CN119922157A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, device, data transmission terminal and storage medium. Background Art
[0002] A data transmission terminal is an intermediate device used to transfer data from one device to another. Usually, a data transmission terminal connects different networks and devices to achieve data transmission and exchange. For example, a data transmission terminal can transmit data from a sensor or other acquisition device to a remote server via a wireless or wired network. However, due to the weak or unstable signal or network congestion during the transmission process, the data packet may be discarded or delayed, which can easily lead to an increase in the packet loss rate. Summary of the invention
[0003] The purpose of the present application is to provide a data processing method, device, data transmission terminal and storage medium, so as to solve the problem of high packet loss rate in the transmission process of the data transmission terminal in the related art.
[0004] In order to achieve the above-mentioned object, the first aspect of the present application provides a data processing method, which is applied to a data transmission terminal, and the data transmission terminal communicates with a first device and a second device respectively. The data processing method includes:
[0005] When first data sent by a first device is received, the first data is sequentially stored in a first node in a first storage area, the first storage area includes a plurality of first nodes for storing the first data, and the plurality of first nodes are sequentially connected in a ring;
[0006] Parsing the first data to determine whether the first data is second data to be sent to the second device;
[0007] If the first data is second data to be sent to a second device, the data blocks storing the second data are used as second nodes and are sequentially stored in the second storage area, and the connection mode between the multiple second nodes is link connection.
[0008] In an embodiment of the present application, storing the first data in sequence in the first node of the first storage area includes:
[0009] Acquire a first storage area of a data transmission terminal, each first node has a different first priority, the first nodes are connected in a ring in sequence according to the first priorities, and the to-be-stored location of the first data is updated in the order of the first priorities;
[0010] After writing the first data into the current first node corresponding to the current location to be stored, updating the location to be stored to the next first node of the current first node according to the first priority;
[0011] If the priority of the current first node is the end priority in the first priority, the location to be stored is updated to the first node corresponding to the head priority in the first priority.
[0012] In an embodiment of the present application, writing the first data into the current first node corresponding to the current location to be stored includes:
[0013] Determine whether there is historical data for the current first node;
[0014] If the current first node has historical data, the first data is written into the current first node after the historical data is deleted.
[0015] In the embodiment of the present application, the data blocks storing the second data are used as the second nodes and are sequentially stored in the second storage area, including:
[0016] Acquire a second storage area of the data transmission terminal, and calculate the remaining space of the second storage area;
[0017] Determine whether the remaining space is greater than or equal to the data size of the second data to be stored;
[0018] If the remaining space is greater than or equal to the data size of the second data to be stored, storing the second data in the second storage area;
[0019] The data block storing the second data in the second storage area is used as the second node, and the second priority is allocated to the second node.
[0020] In the implementation of the present application, the data blocks storing the second data are used as the second nodes and are sequentially stored in the second storage area, and further include:
[0021] If the remaining space is smaller than the data size of the second data, the second data in the second nodes in the second storage area are deleted in sequence according to the second priority of each second node in the second storage area until the remaining space is greater than or equal to the data size of the second data.
[0022] In the embodiment of the present application, the data processing method further includes:
[0023] In response to the second device establishing a network connection with the data transmission terminal, reading the second data in the second storage area according to a third priority order;
[0024] In response to the second data being sent successfully, a second node corresponding to the second data in the second storage area is formatted.
[0025] In the embodiment of the present application, the data processing method further includes:
[0026] Sending a read instruction to the first device according to the set time;
[0027] When feedback data returned by the first device in response to the read instruction is received, it is determined that the first data sent by the first device is received.
[0028] A second aspect of the present application provides a data processing device, which is applied to a data transmission terminal, where the data transmission terminal communicates with a first device and a second device respectively, and the data processing device includes:
[0029] A first storage module is used for, when receiving first data sent by a first device, sequentially storing the first data in a first node in a first storage area, the first storage area comprising a plurality of first nodes for storing the first data, the plurality of first nodes being sequentially connected in a ring;
[0030] A parsing module, used to parse the first data and determine whether the first data is second data to be sent to the second device;
[0031] The second storage module is used to store the data block storing the second data as the second node in sequence in the second storage area if the first data is the second data to be sent to the second device, and the connection mode between the multiple second nodes is link connection.
[0032] A third aspect of the present application provides a data transmission terminal, including:
[0033] a memory configured to store instructions; and
[0034] The processor is configured to call the instructions from the memory and implement the above data processing method when executing the instructions.
[0035] A fourth aspect of the present application provides a computer-readable storage medium having instructions stored thereon, which, when executed by a processor, configure the processor to execute the above-mentioned data processing method.
[0036] The data transmission terminal of the present application communicates with the first device via a serial connection, and communicates with the second device via a network connection. First, the first data sent by the first device is stored in a circular buffer. In this way, when the data transmission terminal cannot process the received first data in time, the first data can be stored first. At the same time, the circular buffer can ensure the real-time and integrity of the first data, reducing the loss or overflow of the first data. Then, the second data to be sent to the second device in the first data is stored in a chain structure cache. If the chain structure is congested or delayed, the second data cached by the chain structure can alleviate the pressure of data transmission. In addition, when the second data is erroneous or lost during the transmission process, it can be retransmitted through a copy of the second data cached by the chain structure. In summary, the data caching method adopted by the data transmission terminal of the present application can improve the reliability and efficiency of data transmission and reduce the packet loss rate of data transmitted by the data transmission terminal.
[0037] Other features and advantages of the present application will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0039] Figure 1 A schematic diagram of an application scenario of a data processing method provided in an embodiment of the present application;
[0040] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;
[0041] Figure 3 A schematic diagram of a ring buffer provided in an embodiment of the present application;
[0042] Figure 4 A schematic diagram of a chain structure cache provided in an embodiment of the present application;
[0043] Figure 5 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;
[0044] Figure 6 This is a structural block diagram of a data transmission terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0046] In the description of the present application, it should be understood that the terms "first" and "second" are used only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined. In the present application, the word "exemplary" is used to mean "used as an example, illustration or description". Any embodiment described as "exemplary" in the present application is not necessarily interpreted as being more preferred or more advantageous than other embodiments. In order to enable any technician in the field to implement and use the present application, the following description is given. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can also be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid unnecessary details that make the description of the present application obscure. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in the present application.
[0047] The data processing method in the embodiment of the present application is applied to a data transmission terminal. Figure 1 As shown, Figure 1 This is a schematic diagram of an application scenario of a data processing method in an embodiment of the present application. The application scenario of the data processing method in an embodiment of the present application includes a data transmission terminal 110, a first device 120 and a second device 130 used for the data processing method.
[0048] The data transmission terminal 110 is a device for realizing remote data transmission. The data transmission terminal 110 is integrated with a data transmission device to run a computer-readable storage medium corresponding to the data processing method to execute the steps of the data processing method. As an example, the data transmission terminal 110 can be a data transmission unit (Data Transfer Unit, DTU), which can convert serial port data into network data and transmit it to a remote server or other remote communication device through the network data.
[0049] The first device 120 communicates with the data transmission terminal 110. Therefore, the data transmission terminal 110 can receive the first data sent by the first device 120. As an example, the first data can be serial port data, which is data transmitted through a physical serial port line and has a short transmission distance. The first device 120 can be a device serially connected to the data transmission terminal 110, such as a sensor, an instrument, a control device, and a security device.
[0050] The second device 130 communicates with the data transmission terminal 110. Therefore, the data transmission terminal 110 can send the second data to the second device 130. The second data refers to the data to be sent to the second device 130, and the second data is at least a part of the first data. As an example, the second data can be network data, which refers to data transmitted through the network to achieve remote communication and data exchange, and the transmission distance is relatively long. The second device 130 can be a device such as a cloud server that communicates remotely with the data transmission terminal 110.
[0051] Therefore, the data transmission terminal 110 can forward the second data that needs to be remotely transmitted in the first data sent by the first device 120 to the second device 130. As an example, the data transmission terminal 110 can forward the network data in the serial port data to the cloud server of remote communication.
[0052] In the related art, if network communication fluctuations or serial communication congestion occur during data transmission, data loss is likely to occur. Therefore, in the embodiment of the present application, a buffer is set in the data transmission terminal 110 to cache the first data sent by the first device 120 and the second data to be sent to the second device 130, thereby improving the reliability and efficiency of data transmission of the data transmission terminal 110.
[0053] Understandably, Figure 1 The data transmission terminal in the application scenario of the data processing method shown, or the device included in the data transmission terminal, does not constitute a limitation on the embodiments of the present application, that is, the number of devices and types of devices included in the application scenario of the data processing method, or the number of devices and types of devices included in each device do not affect the overall implementation of the technical solution in the embodiments of the present application, and can all be regarded as equivalent replacements or derivatives of the technical solution claimed to be protected in the embodiments of the present application.
[0054] The data transmission terminal 110 in the embodiment of the present application may be an independent device, or a device network or device cluster composed of devices. For example, the data transmission terminal 110 described in the embodiment of the present application includes but is not limited to a computer, a network host, a single network device, a plurality of network device sets or a cloud device composed of a plurality of devices. The cloud device is composed of a large number of computers or network devices based on cloud computing.
[0055] Those skilled in the art will understand that Figure 1 The application scenario shown in the figure is only an application scenario corresponding to the technical solution of the present application, and does not constitute a limitation on the application scenario of the technical solution of the present application. Other application scenarios may also include Figure 1 More or fewer electronic devices shown in, or electronic device network connection relationships, such as Figure 1 Only one electronic device is shown. It can be understood that the scenario of the data processing method can also include one or more other electronic devices, which are not specifically limited here.
[0056] It should be noted that Figure 1 The application scenario of the data processing method shown is merely an example. The application scenario of the data processing method described in the embodiment of the present application is intended to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided in the embodiment of the present application.
[0057] Based on the application scenario of the above data processing method, an embodiment of the data processing method is proposed, which is described in detail below with reference to the accompanying drawings.
[0058] Figure 2 Schematic diagram of a data processing method provided in an embodiment of the present application. Figure 2 As shown, the data processing method can execute steps 201-203 and the like by the processor in the above-mentioned data transmission terminal 110, which will be described in detail below.
[0059] Step 201: When first data sent by a first device is received, the first data is sequentially stored in a first node in a first storage area, where the first storage area includes a plurality of first nodes for storing the first data, and the plurality of first nodes are sequentially connected in a ring.
[0060] Step 202: parse the first data to determine whether the first data is second data to be sent to the second device.
[0061] Step 203: If the first data is second data to be sent to a second device, the data block storing the second data is used as a second node and is sequentially stored in a second storage area, and the connection mode between the multiple second nodes is a link connection.
[0062] In the embodiment of the present application, the data storage area of the data transmission terminal 110 can be divided into a first storage area and a second storage area.
[0063] The first storage area may include a plurality of first nodes for storing the first data, and the plurality of first nodes are connected in a ring. The first node refers to a sub-area in the first storage area for storing the first data. Therefore, the first storage area is a continuous ring storage area, and the tail of the ring storage area is connected to the head.
[0064] The second storage area is a storage area connected in a chain structure, which can be used to store the second data to be sent to the second device. When the second data is stored in the second storage area as a data block, the data block can be used as a second node, and the connection between the second nodes is a link connection.
[0065] In an embodiment of the present application, the storage method of the first node storing the first data in sequence in the first storage area is a ring cache method. The ring cache method refers to setting a storage area with a ring structure in the storage area, that is, the first storage area. When the first data arrives at the serial port of the data transmission terminal, the first data can be stored in the first storage area in a certain order. The first storage area can be used cyclically. When the space in the first storage area is full, there is no need to move the data. It is only necessary to overwrite the previously stored first data with the newly stored first data. In this way, the read and write efficiency and integrity of the first data transmitted serially can be improved.
[0066] As an example of an embodiment of the present application, the first data can be read once every period of time by means of timed polling. In one example, each time the first data is read, it can be read according to the set maximum value. The maximum value can be set according to demand, so as to control the amount of data read each time the first data is read, so as to be more efficient and controllable during data processing, and reduce the problems such as low processing efficiency or memory overflow caused by too much reading of data. Specifically, the data transmission terminal can send a read instruction to the first device according to the set time. Among them, the read instruction refers to an instruction that needs to read the data of the first device. For example, assuming that the set time is 5 seconds, a read instruction can be sent every 5 seconds, and then it is determined whether the first device sends the first data. When the feedback data returned by the first device for the read instruction is received, it can be determined that the first data sent by the first device is received. By reading the first data by means of timed polling, the time interval and the maximum reading amount of reading the first data can be flexibly adjusted according to demand to meet the needs of different application scenarios.
[0067] The first data transmitted by serial transmission is usually packaged into a data packet of a unified format for transmission, and the parameter information such as the type and protocol of the first data needs to be obtained by parsing. Therefore, after receiving the first data, the data transmission terminal needs to parse the received first data and extract the key information of the first data to facilitate the classification of the first data. For example, the first data may contain second data that needs to be sent to the second device, and the second data usually follows a specific protocol format. The first data may also contain local data, and the local data does not need to be sent to the second device. Usually, the parameter information of the local data matches the setting parameter information stored in the data transmission terminal in advance. Therefore, the parameter information of the parsed first data can be compared with the setting parameter information. If the parameter information of the first data does not match the setting parameter information, it can be determined that the first data is the second data to be sent to the second device. If the parameter information of the first data matches the setting parameter information, it is determined to be local data that does not need to be sent to the second device.
[0068] After classifying the parsed first data, the data block storing the second data can be used as the second node and stored in the second storage area in sequence. This storage method is a chain structure cache method. The chain structure cache method refers to setting a chain structure storage area in the storage area, that is, the second storage area, and then storing the second data to be sent to the second device in the second storage area in sequence according to the order of link connection. Through the chain structure cache method, in the case where the second device cannot process the data in time, the second data to be sent can be temporarily stored, reducing the loss of the second data. If an error occurs during the transmission process, the second data in the second storage area can be retransmitted or restored, thereby improving the reliability of the second data transmission.
[0069] On the one hand, the embodiment of the present application stores the first data sent by the first device in a circular buffer. In this way, when the data transmission terminal cannot process the received first data in time, the first data can be stored first. In addition, the circular buffer can make full use of the limited memory space, realize recycling, and reduce the problem of memory space waste of the data transmission terminal. At the same time, the circular buffer can make the first data real-time and complete, and reduce the loss or overflow of the first data.
[0070] On the other hand, the embodiment of the present application stores the second data to be sent to the second device in the first data by means of a chain structure cache. If the chain structure is congested or delayed, the second data cached by the chain structure can relieve the pressure of data transmission and improve the efficiency of data transmission. In addition, when an error or loss occurs in the second data during transmission, the copy of the second data cached by the chain structure can be retransmitted to improve the reliability of data transmission.
[0071] In summary, the data transmission terminal in the embodiment of the present application can improve the reliability of data transmission and reduce the packet loss rate of data transmitted by the data transmission terminal through caching.
[0072] The following describes in detail the first storage area storing the first data and the second storage area storing the second data.
[0073] In step 201 of the embodiment of the present application, the first storage area of the data transmission terminal may be obtained first, wherein each first node has a different first priority, each first node is connected in a ring in sequence according to the first priority, and the storage location of the first data is updated in the order of the first priority.
[0074] In an embodiment of the present application, each first node stores a first data transmitted serially. The first priority refers to the priority order of storing the first data in the first storage area. Then, after the first data is written into the current first node corresponding to the current position to be stored, the position to be stored is updated to the next first node of the current first node according to the first priority. Among them, if the priority of the current first node is the end priority in the first priority, the position to be stored is updated to the first node corresponding to the head priority in the first priority.
[0075] by Figure 3 For example, Figure 3 A schematic diagram of a circular buffer provided in an embodiment of the present application. Figure 3 The annular storage area shown is the first storage area. Assume that the first storage area is divided into 11 sub-areas, which are marked from 0 to 10, and each sub-area corresponds to a first node. The order of the first priority of the first node is from 0 to 10, that is, 0 is the first priority, which can be called the head priority. 10 is the last priority, which can be called the end priority.
[0076] The first nodes 0 to 10 are connected in a ring in the order of the first priority, wherein the head-end priority and the end-end priority are adjacent. Each time a first data is received, the first data can be stored in a first node. The first node storing the first data is used as the location to be stored. After the first node is stored, the location to be stored is updated to the first node whose first priority is after the first priority of the current first node.
[0077] For example, assuming that the current location to be stored is the first node labeled 1, after the first data is stored in the first node labeled 1, the location to be stored is updated to the first node labeled 2. Assuming that the current band storage location is the first node labeled 10, it means that the first node of the terminal priority has been reached. After the first data is stored in the first node labeled 10, the location to be stored can be updated to the first node labeled 0. In this way, the first storage area can be recycled and the storage efficiency of the first data can be improved.
[0078] In an embodiment of the present application, when writing the first data to the current first node corresponding to the current location to be stored, it can be determined whether the current first node has historical data. The historical data refers to the first data previously stored in the first node. If the current first node has historical data, the first data is written to the current first node after deleting the historical data. In this way, the newer data can replace the older data, ensuring that the data in the first storage area is updated in a timely manner, reducing the waste of storage space, and reducing the storage burden of the first storage area, thereby improving the read and write efficiency of the first data.
[0079] The second storage area in the embodiment of the present application has a maximum capacity, which can be set according to the device status of the data transmission terminal and user needs. In step 203 of the embodiment of the present application, the second storage area of the data transmission terminal can be obtained first, and the remaining space of the second storage area can be calculated. The remaining space is the difference between the maximum capacity of the second storage area and the capacity of the second data stored.
[0080] Then, determine whether the remaining space is greater than or equal to the data size of the second data to be stored. If the remaining space is greater than or equal to the data size of the second data to be stored, it means that the remaining space of the current second storage area can meet the storage requirements of the second data, and the second data is directly stored in the second storage area. After storing the second data, the data block storing the second data in the second storage area is used as the second node, and the second node is assigned a second priority. Among them, the second node refers to the data block storing the second data. The second priority refers to the storage order of the second node, for example, the first-in-first-out order is used as the second priority order of the second node, etc.
[0081] by Figure 4 For example, Figure 4 A schematic diagram of a chain structure cache provided in an embodiment of the present application. Figure 4The storage area of the chain structure shown is the second storage area. When caching data, the first received second data is stored in data block 1, and data block 1 is used as the second node with the second priority ranked first in the second storage area. Correspondingly, the second received second data is stored in data block 2, and data block 2 is used as the second data with the second priority ranked second in the second storage area. The Nth received second data is stored in data block N, and data block N is used as the second data with the second priority ranked Nth in the second storage area. In this way, a chain structure caching method of the second data in the second storage area can be implemented, and the number of data blocks can be increased or decreased according to the second data, which has high flexibility. At the same time, if there is network instability, etc., the second data can be retransmitted, thereby reducing the packet loss rate of the second data transmitted over the network.
[0082] In an embodiment of the present application, when storing by means of a chain structure cache, if the remaining space is less than the data size of the second data, it means that the current second data cannot be stored with the current remaining space. Therefore, the second data in the second node in the second storage area can be deleted in sequence according to the second priority of each second node in the second storage area until the remaining space is greater than or equal to the data size of the second data. As an example, when the space in the second storage area is full, it is only necessary to delete the second data in the second node at the head of the chain structure in the second storage area until the second storage area has enough space to cache the current second data. In this way, older data can be deleted and replaced with newer data. Without increasing the storage burden of the second storage area, the stored data information can be updated in time, thereby improving the utilization rate of the second storage area, maintaining the storage of new second data, reducing the delay and accumulation of second data transmission, and improving the performance and efficiency of the chain structure cache.
[0083] In an embodiment of the present application, in response to the second device establishing a network connection with the data transmission terminal, the second data in the second storage area can be read in a third priority order. The third priority order refers to the order in which the second data in the second storage area is read. For example, the second data stored in the end data block in the second storage area can be read sequentially toward the second data stored in the head data block. Figure 4 As shown, the second data in data block N can be read first, and then the second data in data block N-1 can be read, until the second data in data block 1 is read. Since data collection is usually related to time, newer data will be continuously written to the end of the second storage area, and older data will be gradually moved to the beginning of the second storage area. Therefore, when reading the second data from the end data block, the newer second data can be read first, and then the older second data can be read, so that the timing of the data is maintained and the newer data can be read in time.
[0084] Since there may be fluctuations during network transmission, resulting in transmission interruption, etc. Therefore, in response to the second data being successfully sent, the embodiment of the present application formats the second node corresponding to the second data in the second storage area. In this way, when the second data is not successfully sent to the second device, the second data is not deleted, thereby reducing the packet loss rate of the second data during network transmission.
[0085] Figure 5 FIG. 5 is a schematic diagram of the structure of a data processing device 500 provided in an embodiment of the present application. Figure 5 As shown, the embodiment of the present application provides a data processing device 500, which is applied to Figure 1 The data transmission terminal shown, the data processing device 500 may include a first storage module 501, a parsing module 502, and a second storage module 503. The first storage module 501 is used to store the first data in the first node of the first storage area in sequence when receiving the first data sent by the first device. The first storage area includes multiple first nodes for storing the first data, and the multiple first nodes are connected in a ring in sequence. The parsing module 502 is used to parse the first data to determine whether the first data is the second data to be sent to the second device. The second storage module 503 is used to store the data block storing the second data as the second node in sequence in the second storage area if the first data is the second data to be sent to the second device. The connection mode between the multiple second nodes is link connection.
[0086] Among them, the first storage module 501, the analysis module 502 and the second storage module 503 can be used to execute steps 201-203 in the embodiments corresponding to the above-mentioned data processing method respectively. For the specific implementation methods of these modules and more details, please refer to the corresponding method part, which will not be repeated here.
[0087] Figure 6 1 is a structural block diagram of a data transmission terminal 110 provided in an embodiment of the present application. Figure 6 As shown, the data transmission terminal 110 may include a memory 601 and a processor 602. The memory 601 is configured to store instructions. The processor 602 is configured to call the instructions from the memory and implement the above data processing method when executing the instructions.
[0088] An embodiment of the present application also provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the above-mentioned data processing method.
[0089] Since the instructions stored in the data transmission terminal and the computer-readable storage medium can execute the steps in any data processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any data processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0090] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0091] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0092] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0093] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0094] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0095] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0096] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated communication signals and carrier waves.
[0097] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0098] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A data processing method, applied to a data transmission terminal, wherein the data transmission terminal communicates with a first device and a second device respectively, characterized in that: The data processing method comprises: When receiving first data sent by the first device, the first data is sequentially stored in first nodes in a first storage area, where the first storage area includes a plurality of first nodes for storing the first data, and the plurality of first nodes are sequentially connected in a ring; parsing the first data to determine whether the first data is second data to be sent to the second device; If the first data is second data to be sent to the second device, the data block storing the second data is used as a second node and stored in the second storage area in sequence, and the connection mode between multiple second nodes is link connection.
2. The data processing method according to claim 1, characterized in that: The step of sequentially storing the first data in a first node in a first storage area includes: Acquire a first storage area of the data transmission terminal, each of the first nodes has a different first priority, the first nodes are connected in a ring in sequence according to the first priorities, and the to-be-stored location of the first data is updated in the order of the first priorities; After writing the first data into the current first node corresponding to the current position to be stored, updating the position to be stored to the next first node of the current first node according to the first priority; If the priority of the current first node is the end priority in the first priorities, the location to be stored is updated to the first node corresponding to the head priority in the first priorities.
3. The data processing method according to claim 2, characterized in that: The step of writing the first data into the current first node corresponding to the current location to be stored includes: Determine whether the current first node has historical data; If the historical data exists in the current first node, the first data is written into the current first node after deleting the historical data.
4. The data processing method according to any one of claims 1, characterized in that: The step of using the data blocks storing the second data as second nodes and sequentially storing them in a second storage area includes: Acquire a second storage area of the data transmission terminal, and calculate a remaining space of the second storage area; Determining whether the remaining space is greater than or equal to the data size of the second data currently to be stored; If the remaining space is greater than or equal to the data size of the second data to be stored, storing the second data in the second storage area; A data block storing the second data in the second storage area is used as a second node, and a second priority is allocated to the second node.
5. The data processing method according to claim 4, characterized in that: The method further comprises: taking the data blocks storing the second data as second nodes and sequentially storing them in the second storage area; If the remaining space is smaller than the data size of the second data, the second data in the second nodes in the second storage area are deleted in sequence according to the second priority of each second node in the second storage area until the remaining space is greater than or equal to the data size of the second data.
6. The data processing method according to claim 4, characterized in that: Also includes: In response to the second device establishing a network connection with the data transmission terminal, reading the second data in the second storage area according to a third priority order; In response to the second data being sent successfully, the second node corresponding to the second data in the second storage area is formatted.
7. The data processing method according to any one of claims 1 to 6, characterized in that: Also includes: Sending a read instruction to the first device according to a set time; When feedback data returned by the first device in response to the read instruction is received, it is determined that the first data sent by the first device is received.
8. A data processing device, applied to a data transmission terminal, characterized in that: The data transmission terminal communicates with the first device and the second device respectively, and the data processing device includes: A first storage module is configured to, when receiving first data sent by the first device, sequentially store the first data in a first node in a first storage area, wherein the first storage area includes a plurality of first nodes for storing the first data, and the plurality of first nodes are sequentially connected in a ring; a parsing module, configured to parse the first data to determine whether the first data is second data to be sent to the second device; The second storage module is used to store the data block storing the second data as a second node in sequence in the second storage area if the first data is the second data to be sent to the second device, and the connection mode between multiple second nodes is link connection.
9. A data transmission terminal, characterized in that: include: a memory configured to store instructions; as well as A processor is configured to call the instructions from the memory and implement the data processing method according to any one of claims 1 to 7 when executing the instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, which, when executed by a processor, enable the processor to be configured to execute the data processing method according to any one of claims 1 to 7.