Column transmission-based data transmission method and device, terminal equipment and medium

CN116866362BActive Publication Date: 2026-09-15SHENZHEN INST OF COMPUTING SCI
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310974232.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-03
Publication Date
2026-09-15
Estimated Expiration
2043-08-03

AI Technical Summary

Technical Problem

[0004]有鉴于此,本发明实施例提供了一种基于列传输的数据传输方法、装置、终端设备及介质,以解决现有技术中采用行为最小单元填充报文进行数据传输导致传输的报文数量较多,数据传输效率较低的问题

Benefits of technology

[0022] The data transmission method, apparatus, terminal device, and medium of the present invention, through a customized first protocol format, fills each target data segment with columns as the smallest unit, in a message. This allows a row of data to be sent in multiple batches instead of being bound to the same message. Each message is sent only after filling all columns of the target data in the current row as much as possible. Compared with the prior art, the present invention can maximize the use of message space, increase the effective data volume of each frame, reduce the number of messages sent with the same amount of data, improve message transmission utilization, shorten the total data transmission time, and thus improve data transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116866362B_ABST
    Figure CN116866362B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of data transmission method, device, terminal equipment and medium based on column transmission.The method is filled in message by column as minimum unit to each target data in the form of data section constituted by two identifiers and data content with the first protocol format defined by itself, so that a line of data can not be bound in the same message for sending, but can be sent in multiple batches of messages, each message is sent after filling the columns of target data of the current line as much as possible. Compared with the prior art, the present application can maximize the use of message space, improve the effective data amount of each frame message transmission, reduce the number of sent messages under the same data amount, improve the utilization rate of message sending, the total length of data transmission is shorter, and then improve the transmission efficiency of data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communications, and particularly to a data transmission method, apparatus, terminal equipment, and medium based on column transmission. Background Technology

[0002] In existing technologies, line-based transmission (i.e., transmission using lines as the smallest unit) is typically used to transmit data between the client and server. This involves filling one or more entire lines of data into a single message. If the last line of data in the message is too long, it cannot be filled into the currently incomplete message. When transmitting a large amount of data, this results in many messages being sent before being fully filled, leading to low message utilization and limiting the data transmission length and efficiency of a single transmission. From a performance perspective, this method requires sending more batches of messages to ensure data transmission for the same amount of data, extending transmission time and resulting in low data transmission efficiency. Furthermore, existing line-based transmission methods cannot handle scenarios where the line width exceeds the maximum message length, failing to provide compatible transmission of excessively long data.

[0003] Therefore, improving data transmission efficiency has become an urgent problem to be solved. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a data transmission method, apparatus, terminal device and medium based on column transmission, to solve the problem that the data transmission efficiency is low due to the large number of transmitted messages caused by using the smallest unit of the row to fill the message for data transmission in the prior art.

[0005] Firstly, a column-based data transmission method is provided for use in a server. The data transmission method includes the following steps:

[0006] Obtain the target data in the current i-th row and j-th column of the message to be filled, and determine whether the target data in the i-th row and j-th column is of the first type of data; where i and j are positive integers.

[0007] When the target data in the i-th row and j-th column is determined to be of the first type, the target data in the i-th row and j-th column is filled into the message according to the set first protocol format; the first type of data according to the first protocol format includes a data segment, the data segment includes: a first identifier for representing the data type, a second identifier for representing the data length, and the specific data content;

[0008] Repeat the above data filling process, filling the message with the next target data according to the preset data row and column order, until the message is filled with the target data in a certain row and column, and then send the message.

[0009] The next message is filled according to the data filling process until the target data in each row and column is filled into the corresponding message in accordance with the preset data row and column order, and then the next message is sent.

[0010] Secondly, a column-based data transmission method is provided for application in a client. The data transmission method includes the following steps:

[0011] Receive the current message containing the target data sent by the server, and determine whether the received target data meets the preset number of rows;

[0012] When it is determined that the received target data does not meet the preset number of rows, the target data of each column in the current row of the current message is obtained, and it is determined whether some of the first type of data is truncated to the next message;

[0013] When it is determined that some of the first type of data has been truncated into the next message, a new message reception request is sent to the server.

[0014] Repeat the above process until it is determined that no data of the first type is truncated into the next message.

[0015] Thirdly, a data transmission device based on column transmission is provided, the data transmission device comprising:

[0016] The data transmission acquisition and judgment module is used to acquire the target data in the current i-th row and j-th column of the message to be filled, and to determine whether the target data in the i-th row and j-th column is of the first type of data; where i and j are positive integers.

[0017] The data filling module is used to fill the target data in the i-th row and j-th column into the message according to a set first protocol format when the target data in the i-th row and j-th column is determined to be first type data; the first type data according to the first protocol format includes a data segment, the data segment includes: a first identifier for representing the data type, a second identifier for representing the data length, and specific data content;

[0018] The filling control module is used to control the acquisition and judgment module and the data filling module to repeat the above data filling process, and fill the next target data in the message according to the preset data row and column order, until the message is filled with the target data in a certain row and column, and then send the message; and to fill the next message according to the data filling process, until the target data in each row and column is filled into the corresponding message according to the preset data row and column order, and then send the next message.

[0019] Fourthly, embodiments of the present invention provide a terminal device, the terminal device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the data transmission method based on column transmission as described in the first aspect.

[0020] Fifthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the column-based data transmission method as described in the first aspect.

[0021] The advantages of this invention compared to the prior art are:

[0022] The data transmission method, apparatus, terminal device, and medium of the present invention, through a customized first protocol format, fills each target data segment with columns as the smallest unit, in a message. This allows a row of data to be sent in multiple batches instead of being bound to the same message. Each message is sent only after filling all columns of the target data in the current row as much as possible. Compared with the prior art, the present invention can maximize the use of message space, increase the effective data volume of each frame, reduce the number of messages sent with the same amount of data, improve message transmission utilization, shorten the total data transmission time, and thus improve data transmission efficiency. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a schematic diagram of an application environment for a data transmission method based on column transmission according to an embodiment of the present invention;

[0025] Figure 2 This is a schematic flowchart of a data transmission method based on column transmission according to an embodiment of the present invention;

[0026] Figure 3 This is a schematic diagram of a first type of data packet filling provided in an embodiment of the present invention;

[0027] Figure 4 This is a schematic flowchart of a data transmission method based on column transmission according to an embodiment of the present invention;

[0028] Figure 4-1 This is a schematic diagram of first and second type data packet filling provided in an embodiment of the present invention;

[0029] Figure 5 This is an embodiment of the present invention based on Figure 4 A flowchart illustrating the data transmission method;

[0030] Figure 6 This is an embodiment of the present invention based on Figure 5 A flowchart illustrating the data transmission method;

[0031] Figure 7 This is a schematic flowchart of a data transmission method applied to a client according to an embodiment of the present invention;

[0032] Figure 8 This is an embodiment of the present invention based on Figure 7 A flowchart illustrating the data transmission method;

[0033] Figure 9 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of the present invention;

[0034] Figure 10 This is a schematic diagram of another data transmission device provided in an embodiment of the present invention;

[0035] Figure 11 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present invention. Detailed Implementation

[0036] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.

[0037] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0038] It should also be understood that the term “and / or” as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0039] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0040] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0041] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0042] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0043] To illustrate the technical solution of the present invention, specific embodiments are described below.

[0044] An embodiment of the present invention provides a data transmission method based on column transmission, which can be applied to, for example... Figure 1 In this application environment, the client and server communicate with each other. Clients include, but are not limited to, handheld computers, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud terminal devices, and personal digital assistants (PDAs). The server can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0045] See Figure 2This is a schematic flowchart of a data transmission method based on column transmission according to an embodiment of the present invention. The above data transmission method can be applied to... Figure 1 The server-side component connects to relevant databases and rule bases to retrieve data. These same computer devices can also connect to clients to collect requests from client users and send messages to them. For example... Figure 2 As shown, the data transmission method based on column transmission may include the following steps:

[0046] Step S201: Obtain the target data in the current i-th row and j-th column to be filled into the message, and determine whether the target data in the i-th row and j-th column is of the first type; where i and j are positive integers;

[0047] The target data to be filled into the message consists of N rows and M columns. The target data in the i-th row and j-th column needs to be obtained in a certain order, where i = 1, 2, ..., N; j = 1, 2, ..., M. For example, first obtain the data in the 1st row and 1st column, and determine whether the target data is of the first type.

[0048] In this step, the first type of data refers to data whose length does not exceed the first preset value, i.e., ordinary data; when the length of the target data is greater than the second preset value, the target data is the second type of data, i.e., extra-long data. The first and second preset values ​​can be set according to specific circumstances. It should be noted that the first preset value in this step is less than or equal to the second preset value, that is, the length of ordinary data is less than the length of extra-long data.

[0049] Step S202: When the target data in the i-th row and j-th column is determined to be first type data, the target data in the i-th row and j-th column is filled into the message according to the set first protocol format; the first type data according to the first protocol format includes a data segment, the data segment includes: a first identifier for representing the data type, a second identifier for representing the data length, and specific data content;

[0050] The data structure of a data segment in the first protocol format is shown in the table below:

[0051]

[0052] In the table above, Len represents the first identifier, longlen represents the second identifier, and Data represents the actual data content.

[0053] In one embodiment, the first identifier can be a placeholder for the second type of data, 0xFE, used to represent excessively long data; the second identifier represents the length of the data within Data, for example, the maximum length of the data can be 32767.

[0054] In one embodiment, the first identifier may also be a length indicator 0xFD, used to indicate that the second identifier is used to represent the data length; correspondingly, the second identifier represents the data length within Data. In other embodiments, the first identifier may also be a length indicator, such as <0xFD, used to represent the data length within Data, in which case the field of the second identifier is omitted.

[0055] Step S203: Repeat the above data filling process, and fill the next target data into the message according to the preset data row and column order until the message is filled with the target data of a certain row and column, and then send the message.

[0056] In the process of repeatedly acquiring and filling data in steps S201 and S202, the preset data row and column order for acquiring and filling data can be in the manner of row first and column second. That is, first acquire and fill the target data in the first row and first column, then acquire and fill the target data in the second row and second column, and so on, until the target data in the first row and M column is acquired; then, from the first column of the second row to the M column of the second row, the target data in each column of the second row is acquired and filled in turn; until the target data in each column of the Nth row is acquired and filled.

[0057] Step S204: Fill the next message according to the data filling process until the target data of each row and column is filled into the corresponding message according to the preset data row and column order, and send the next message.

[0058] For example, taking a result set of three rows and three columns (i.e., the target data) as an example, such as... Figure 3 As shown, three columns are all type 1 data, i.e., ordinary data. Following steps S201 to S203, the target data in the first row, first column, first row, second column, and first row, third column are filled respectively until the target data in the second row, first column is filled, at which point the first message is complete and then packaged and sent. Then, step S204 is executed, filling the target data in the second row, second column, second row, third column, third row, first column, and third row, second column into the second message, and sending the second message. Finally, the remaining target data in the third row, third column is filled into the third message, and the message is sent.

[0059] pass Figure 3It can display the possible truncation of each line of target data in the message. That is, the target data of the second line is divided into two parts, which are filled into the first message and the second message respectively and sent in sequence; the target data of the second line is also divided into two parts, which are filled into the second message and the third message respectively and sent in sequence.

[0060] The data transmission method of this embodiment uses a custom first protocol format to fill each target data segment with columns as the smallest unit. This allows a row of data to be sent in multiple batches instead of being bound to the same message. Each message is sent only after filling all columns of the current row with target data as much as possible. Compared to existing technologies, this invention maximizes the use of message space, increases the effective data volume of each frame, reduces the number of messages sent with the same amount of data, improves message transmission utilization, and shortens the total data transmission time, thereby improving data transmission efficiency.

[0061] See Figure 4 This is a flowchart illustrating a data transmission method based on column transmission according to an embodiment of the present invention. Figure 2 After step S201, the data transmission method may include the following steps:

[0062] Step S401: When it is determined that the target data in the i-th row and j-th column is second type data, and the length of the second type data is greater than the length of the first type data; the target data in the i-th row and j-th column is filled into the message according to the set second protocol format; the second type data according to the second protocol format includes at least two data segments and a data end identifier;

[0063] One of the second types of data structures in a second protocol format can be shown in the table below:

[0064]

[0065] The table above indicates that the second type of data includes two data segments and a data end identifier 0. The structure of each data segment is described in step S202 of the previous embodiment, and will not be repeated in this embodiment. In other embodiments, the second type of data may also include three or more data segments, and the number of data segments can be set according to specific needs.

[0066] In step S402, during the process of filling the data segment of the second type of data, if it is determined that the message is full, the message is sent; and in the next message, the remaining data segment of the second type of data and the data end identifier are continued to be filled.

[0067] In the process of filling the data segment of the second type of data in the current message, it is very likely that a data segment that has only been filled with the second type of data will be encountered, and the message will be completely filled. Therefore, when filling the next message, it is necessary to continue filling the remaining data segment and filling the identifier used to indicate the end of the second type of data.

[0068] For example, such as Figure 4-1 As shown, after filling in the target data in the first row and first column, according to Figure 2 In step S201, it is determined that the target data in the second column of the first row is not type 1 data, but type 2 data (i.e., excessively long data). The placeholder 0xFE for type 2 data is filled in. The process continues to determine and fill the target data in the third column of the first row. After the target data in the last column of the current row is filled, steps S401 and S402 are executed. After data segment 1 of the target data in the second column of the first row is filled, the first message is immediately filled and sent. Then, the remaining data segments of the target data in the second column of the first row, namely data segment 2, data segment 3, and the end-of-line character 0, are filled in the second message. After all the target data (type 1 data and type 2 data) in the first row is filled, the first and second types of data in each column of the second row are filled in the second message. The filling method is the same as that for the first row, and will not be repeated here.

[0069] The data transmission method of this embodiment, when the target data is ultra-long data of the second type, expands the upper limit of message filling and transmission with columns as the smallest unit by using a custom second protocol format, which includes at least two data segments. This allows ultra-long data to be sent in multiple batches instead of being bound to the same message. Each message is sent only after filling all data segments of the current row of ultra-long data as much as possible. This invention decouples the size of the custom service message from the size of a row and column of data, freeing the protocol from the constraint of the custom message upper limit. It avoids the coupling between the size of the row transmission service message and the data length specification, fundamentally solving the problem of data length being constrained by message size, thereby improving data transmission efficiency.

[0070] See Figure 5 In one embodiment, based on Figure 4 Step S401, when it is determined that the target data in the i-th row and j-th column is second type data, fills the target data in the i-th row and j-th column into the message according to the set second protocol format, specifically including:

[0071] Step S501: Set the placeholder identifier for the second type of data and fill it into the message;

[0072] For example, such as Figure 4-1 As shown, if the target data in the first row and second column is determined to be second type data, a placeholder identifier 0xFE is set and filled into the first message; if the target data in the second row and second column is determined to be second type data, a placeholder identifier 0xFE is set and filled into the second message after the target data in the second row and first column; if the target data in the third row and second column is determined to be second type data, since the data in the second message is already filled, a placeholder identifier 0xFE is set and filled into the third message.

[0073] Step S502: Determine whether the target data in the remaining columns of the current row, excluding the second type of data, has been completely filled;

[0074] For example, such as Figure 4-1 As shown, taking the first row as the current row as an example, after setting the placeholder flag 0xFE and filling the first message, it can be determined that in addition to the second type of data, the current row also has target data in the third column of the first row that has not been filled, and the process returns to... Figure 2 In step S201, a judgment is made. If the data is determined to be of the first type, then steps S202 to S204 are executed. If the data is determined to be of the second type, then steps S501 and S502 are executed as described above, until it is determined that the target data in the remaining columns of the current row, except for the data of the second type, has been filled.

[0075] Step S503: When it is determined that the data has been filled, determine whether there is any unfilled second type of data.

[0076] For example, such as Figure 4-1 As shown, according to step S502 above, it has been determined that the target data in the remaining columns of the first row, except for the second type of data, has been filled. Then, step S503 above is executed, and it can be determined that there is still second type of data (including data segment 1, data segment 2 and data segment 3, and the end symbol 0) in the second column of the first row that has not been filled.

[0077] Step S504: When it is determined that there is unfilled second type data, determine whether the current message is filled;

[0078] For example, such as Figure 4-1 As shown, based on the preceding step S503, it can be determined that there is still second-type data in the first row and second column, including data segment 1, data segment 2, and data segment 3, and the terminator 0 is not filled. Then, based on the data filling situation in the message, it can be determined that the first message is not yet fully filled.

[0079] Step S505: If it is determined that the current message is not full, fill the current message with the second type of data in units of the largest byte, until the current message is full or the second type of data has been completely filled.

[0080] For example, such as Figure 4-1 As shown, based on the previous step S503, it can be determined that the first message is not yet filled. Then, the data segments in the first row and second column are filled into the first message. After data segment 1 is filled, the first message is randomly filled, which means that all data segments in the first row and second column are not filled in the first message.

[0081] In another embodiment, such as Figure 4-1 As shown, after the data in the second row and third column is filled into the third message, the data segments in the second row and second column are filled into the third message through steps S503 to S505 above, until all data segments in the second row and second column are filled.

[0082] The data transmission method of this embodiment provides a streaming mechanism to accommodate the padding and transmission of second-type data of any possible length when the length of the column data to be transmitted exceeds the upper limit of the customer-defined message length. Furthermore, this invention supports custom communication protocols with multiple functions based on command words, allowing data transmission between the database client and server in a customized manner.

[0083] See Figure 6 In one embodiment, based on Figure 5 Step S502, after determining that there are remaining columns of target data besides the second type of data that have not been completely filled, also includes the following steps:

[0084] Step S601: Obtain and determine whether the target data in the remaining columns is of the second type;

[0085] The data type can be determined based on the target data length of the remaining columns. Specifically, a length threshold can be set. Data exceeding the threshold is classified as second-type data, while data not exceeding the threshold is classified as first-type data.

[0086] Step S602: If it is determined that the data is not of the second type, then determine whether the current message is filled; if it is determined that it is not filled, then fill the target data of the remaining columns into the current message according to the first protocol format.

[0087] In step S601 above, based on the comparison result of the target data length being less than the length threshold, it can be determined that the target data in the remaining columns is of the first type, i.e., not the second type. Then, based on the data filling status in the current message, it is determined whether the message is already filled. If it is not filled, the remaining target data in each column is filled accordingly.

[0088] In step S603, if the data is determined to be of the second type, it is determined whether the current message is filled; if it is determined that the message is not filled, the process returns to the step of "setting the placeholder identifier for the second type of data and filling it into the message".

[0089] In this process, based on step S601 above, by comparing the data length of the target data with the length threshold, it can be determined that the target data of the remaining columns is of the second type. Furthermore, if it is determined that the current message is not fully filled, execution returns to the previous step. Figure 5 Steps S501 to S505 in the process.

[0090] The data transmission method in this embodiment prioritizes the filling of first-type data in the current message. After all first-type data in the current line has been filled, second-type data in the current line is then filled.

[0091] In one embodiment, based on Figure 2 Step S203, the data row and column order used for data filling may include:

[0092] First, fill in the target data for each column of the first row, then fill in the target data for each column of the second row, and so on, until finally filling in the target data for each column of the last row.

[0093] Specifically, when filling the target data in each column of the first row, you can prioritize filling the first type of data in each column of the first row, and then fill the second type of data in each column of the first row; the target data in each column of the second row to the target data in the last row can all be filled in the same way, prioritizing the first type of data and then filling the second type of data.

[0094] See Figure 7 This is a schematic flowchart of a data transmission method based on column transmission according to an embodiment of the present invention. The above data transmission method can be applied to... Figure 1 For clients in a given context, the data transmission method may include the following steps:

[0095] Step S701: Receive the current message containing target data sent by the server, and determine whether the received target data meets the preset number of rows;

[0096] In step S701, it is necessary to receive the message sent by the server in any of the previous embodiments, and the client receives and parses the message, and judges the parsed target data.

[0097] Step S702: When it is determined that the received target data does not meet the preset number of rows, the target data of each column of the current row in the current message is obtained, and it is determined whether some of the first type of data is truncated to the next message.

[0098] Specifically, it can copy the first type of data in the current message to the user buffer. If the current data is truncated to the next message, it requests a new message from the server and then copies it. If a 0xFE placeholder is encountered during the copying process, it is temporarily skipped.

[0099] Step S703: When it is determined that some of the first type of data has been truncated into the next message, a new message receiving request is sent to the server.

[0100] Step S704: Repeat the above process until it is determined that no first type of data is truncated into the next message.

[0101] The data transmission method applied to the client in this embodiment, in conjunction with the data transmission method applied to the server in any of the above embodiments, is responsible for obtaining the message containing target data sent by the server, and then copying the target data in the message to the user's binding buffer.

[0102] See Figure 8 In one embodiment, in Figure 7 Following step S702, the data transmission method further includes the following steps:

[0103] Step S801: When it is determined that no first type of data is truncated into the next message, determine whether there is second type of data at the end of the current line target data;

[0104] Step S802: When it is determined that there is second type data at the end of the current line target data, the second type data in the current message is obtained; it is determined whether the second type data in the current line target data has been completely obtained.

[0105] Step S803: When it is determined that the second type of data has not been fully acquired, a new message receiving request is sent to the server, and the second type of data in the new message is acquired, until the second type of data is determined and acquired, and then the process returns to the step of "determining whether the received target data meets the preset number of rows".

[0106] If the current line contains second-type data, the data is copied from the message to the user buffer in units of data segments. If it is determined that the current second-type data is truncated to the next message, a new message is requested from the server and a new data segment is copied, until the end-of-line character 0 of the second-type data is obtained.

[0107] The data transmission method applied between the client and the server in this invention supports a variety of custom communication protocols based on command words, allowing data transmission between the database client and the server in a custom form; it supports data transmission of arbitrary length and target data transmission of any custom message length combination, and the data transmission performance is higher than that of traditional line transmission methods.

[0108] Corresponding to the data transmission method applied to the server in the above embodiments, Figure 9 A structural block diagram of a column-based data transmission device according to an embodiment of the present invention is shown. This data transmission device is applied to a server, which connects to a target database through a preset application programming interface (API). When the target database is driven to run and execute corresponding tasks, corresponding task logs are generated, which can be collected through the API. For ease of explanation, only the parts relevant to the embodiment of the present invention are shown.

[0109] See Figure 9 The data transmission device includes:

[0110] The data transmission acquisition and judgment module 91 is used to acquire the target data in the current i-th row and j-th column to be filled into the message, and to determine whether the target data in the i-th row and j-th column is of the first type of data; where i and j are positive integers.

[0111] The first type data filling module 92 is used to fill the target data in the i-th row and j-th column into the message according to a set first protocol format when the target data in the i-th row and j-th column is determined to be first type data; the first type data according to the first protocol format includes a data segment, the data segment includes: a first identifier for representing the data type, a second identifier for representing the data length, and specific data content;

[0112] The first filling control module 93 is used to control the acquisition and judgment module and the data filling module to repeat the above data filling process, and fill the next target data in the message according to the preset data row and column order, until the message is filled with the target data in a certain row and column, and then send the message; and to fill the next message according to the data filling process, until the target data in each row and column is filled into the corresponding message according to the preset data row and column order, and then send the next message.

[0113] Optionally, the above-mentioned data transmission device further includes:

[0114] The second type of data filling module is used to fill the target data in the i-th row and j-th column into the message according to a set second protocol format when it is determined that the target data in the i-th row and j-th column is second type data and the length of the second type data is greater than the length of the first type data; the second type of data according to the second protocol format includes at least two data segments and a data end identifier;

[0115] The second filling control module is used to determine when the message is filled during the process of filling the data segment of the second type of data, and then send the message; and continue to fill the remaining data segment of the second type of data and the data end identifier in the next message.

[0116] Optionally, the second type of data filling module mentioned above includes:

[0117] A placeholder generation and filling unit is used to set the placeholder identifier for the second type of data and fill it into the message;

[0118] The first judgment unit is used to determine whether the target data of the remaining columns of the current row, excluding the second type of data, has been completely sent.

[0119] The second judgment unit is used to determine whether there is any unsent second type of data when it is determined that the transmission has been completed;

[0120] The third judgment unit is used to determine whether the current message is full when it is determined that there is unsent second type data;

[0121] The first filling unit is used to fill the current message with the second type of data in units of the largest byte if it is determined that the current message is not full, until the current message is full or the second type of data has been completely filled.

[0122] Optionally, the second type of data filling module mentioned above also includes:

[0123] The fourth judgment unit is used to obtain and judge whether the target data of the remaining columns is the second type of data;

[0124] The second filling unit is used to determine whether the current message is filled if it is determined that the data is not of the second type; if it is determined that the data is not filled, the target data of the remaining columns is filled into the current message according to the first protocol format.

[0125] The fifth judgment unit is used to determine whether the current message is filled if it is determined to be the second type of data; if it is determined not to be filled, it returns to the placeholder generation and filling unit.

[0126] Optionally, the preset data row and column order includes:

[0127] First, fill in the target data for each column of the first row, then fill in the target data for each column of the second row, and so on, until finally filling in the target data for each column of the last row.

[0128] Corresponding to the data transmission method applied to the client in the above embodiments, Figure 10 A structural block diagram of a column-based data transmission device according to an embodiment of the present invention is shown. This data transmission device is applied to a client. For ease of explanation, only the parts relevant to the embodiment of the present invention are shown.

[0129] See Figure 10 The data transmission device includes:

[0130] The data acquisition and judgment module 101 is used to receive the current message containing target data sent by the server and determine whether the received target data meets the preset number of rows.

[0131] The data truncation judgment module 102 is used to obtain the target data of each column of the current row in the current message when it is determined that the received target data does not meet the preset number of rows, and to determine whether some of the first type of data has been truncated to the next message;

[0132] The first message request module 103 is used to send a new message receiving request to the server when it is determined that some of the first type of data has been truncated into the next message.

[0133] The control module 104 is used to control the repetition of the above process until it is determined that no first type of data is truncated into the next message.

[0134] Optionally, the above-mentioned data transmission device further includes:

[0135] The second type of data judgment module is used to determine whether there is second type of data at the end of the current line target data when it is determined that no first type of data is truncated to the next message;

[0136] The data extraction and judgment module is used to obtain the second type of data in the current message when it is determined that there is second type of data at the end of the current line of target data; and to determine whether the second type of data in the current line of target data has been completely obtained.

[0137] The second message request module is used to send a new message receiving request to the server when it is determined that the second type of data has not been fully acquired, and to acquire the second type of data in the new message, until it is determined that the second type of data has been fully acquired, and then return to execute the data acquisition and judgment module.

[0138] It should be noted that the information interaction and execution process between the above modules are based on the same concept as the method embodiments of the present invention. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.

[0139] Figure 11 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present invention. Figure 11 As shown, the terminal device of this embodiment includes: at least one processor ( Figure 11 Only one is shown in the diagram), a memory, and a computer program stored in the memory and executable on at least one processor, which, when executed by the processor, implements the steps in any of the above-described data transmission method embodiments.

[0140] The terminal device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 5 This is merely an example of a terminal device and does not constitute a limitation on the terminal device. A terminal device may include more or fewer components than shown in the figure, or a combination of certain components, or different components, such as network interfaces, displays, and input devices.

[0141] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0142] The memory includes readable storage media, internal memory, etc., wherein the internal memory can be the main memory of the terminal device, and the internal memory provides an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of the terminal device, or in some embodiments, it can be an external storage device of the terminal device, such as a plug-in hard drive, a Smart Media Card (SMC), a Secure Digital Card (SD), or a Flash Card. Furthermore, the memory can include both internal storage units and external storage devices of the terminal device. The memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. The memory can also be used to temporarily store data that has been output or will be output.

[0143] Those skilled in the art will understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the functions described above can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this invention. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the methods of the above embodiments by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0144] The present invention can implement all or part of the processes in the above embodiments of the method, or it can be accomplished by a computer program product. When the computer program product is run on a terminal device, the terminal device executes the steps in the above method embodiments.

[0145] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0146] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0147] In the embodiments provided by this invention, it should be understood that the disclosed apparatus / terminal devices and methods can be implemented in other ways. For example, the apparatus / terminal device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0148] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0149] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A data transmission method based on column transmission, applied in a server, characterized in that, The method includes the following steps: Obtain the target data in the current i-th row and j-th column to be filled into the message, and determine whether the target data in the i-th row and j-th column is of the first type of data; where i and j are positive integers; When the target data in the i-th row and j-th column is determined to be of the first type, the target data in the i-th row and j-th column is filled into the message according to the set first protocol format; the first type of data according to the first protocol format includes a data segment, the data segment includes: a first identifier for representing the data type, a second identifier for representing the data length, and the specific data content; Repeat the above data filling process, filling the message with the next target data according to the preset data row and column order, until the message is filled with the target data in a certain row and column, and then send the message. The next message is filled according to the data filling process until the target data in each row and column is filled into the corresponding message according to the preset data row and column order, and then the next message is sent. When the target data in the i-th row and j-th column is determined to be second type data, and the length of the second type data is greater than the length of the first type data; the target data in the i-th row and j-th column is filled into the message according to the set second protocol format; the second type data according to the second protocol format includes at least two data segments and a data end identifier; During the process of filling the data segment of the second type of data, when it is determined that the message is full, the message is sent; and the remaining data segment of the second type of data and the data end identifier are continued to be filled in the next message. In this process, each target data is populated into the message using columns as the smallest unit. The preset data row and column order includes: First, fill in the target data for each column of the first row, then fill in the target data for each column of the second row, and so on, until finally filling in the target data for each column of the last row.

2. The data transmission method based on column transmission according to claim 1, characterized in that, When the target data in the i-th row and j-th column is determined to be second type data, filling the target data in the i-th row and j-th column into the message according to the set second protocol format includes: Set a placeholder identifier for the second type of data and fill it into the message; Determine whether the target data in the remaining columns of the current row, excluding the data of the second type, has been completely filled; When it is determined that the data has been filled, check whether there is any unfilled second type of data. When it is determined that there is unfilled second type of data, it is determined whether the current message is already filled; If it is determined that the current message is not full, the second type of data is filled into the current message in units of the largest byte, until the current message is full or the second type of data has been completely filled.

3. The data transmission method based on column transmission according to claim 2, characterized in that, After determining that there are remaining columns of target data besides the second type of data that have not been completely filled, the following steps are also included: Obtain and determine whether the target data in the remaining columns is of the second type; If it is determined that the data is not of the second type, then it is determined whether the current message is filled; if it is determined that it is not filled, then the target data of the remaining columns are filled into the current message according to the first protocol format. If the data is determined to be of the second type, then it is determined whether the current message is already filled; if it is determined that it is not filled, then the process returns to the step of setting the placeholder identifier for the second type of data and filling it into the message.

4. A data transmission method based on column transmission, applied in a client, characterized in that, The data transmission method includes the following steps: Receive a current message containing target data sent by the server of the data transmission method based on column transmission as described in any one of claims 1 to 3, and determine whether the received target data meets the preset number of rows; When it is determined that the received target data does not meet the preset number of rows, the target data of each column in the current row of the current message is obtained, and it is determined whether some of the first type of data is truncated to the next message; When it is determined that some of the first type of data has been truncated into the next message, a new message reception request is sent to the server. Repeat the above process until it is determined that no data of the first type is truncated into the next message.

5. The data transmission method based on column transmission according to claim 4, characterized in that, The data transmission method further includes the following steps: If it is determined that no first type of data is truncated to the next message, determine whether there is second type of data at the end of the current line target data; When it is determined that there is second type data at the end of the current line target data, the second type data in the current message is retrieved; it is then determined whether the second type data in the current line target data has been completely retrieved. When it is determined that the second type of data has not been fully acquired, a new message receiving request is sent to the server, and the second type of data in the new message is acquired, until the second type of data is determined and acquired, and then the process returns to the step of determining whether the received target data meets the preset number of rows.

6. A data transmission device based on column transmission, characterized in that, The data transmission device includes: The acquisition and judgment module is used to acquire the target data in the current i-th row and j-th column of the message to be filled, and to determine whether the target data in the i-th row and j-th column is of the first type of data; where i and j are positive integers. The data filling module is used to fill the target data in the i-th row and j-th column into the message according to a set first protocol format when the target data in the i-th row and j-th column is determined to be first type data; the first type data according to the first protocol format includes a data segment, the data segment includes: a first identifier for representing the data type, a second identifier for representing the data length, and specific data content; The filling control module is used to control the acquisition and judgment module and the data filling module to repeat the above data filling process, and fill the next target data in the message according to the preset data row and column order, until the message is filled with the target data in a certain row and column, and then send the message; and to fill the next message according to the data filling process, until the target data in each row and column is filled into the corresponding message according to the preset data row and column order, and then send the next message. The second type of data filling module is used to fill the target data in the i-th row and j-th column into the message according to a set second protocol format when it is determined that the target data in the i-th row and j-th column is second type data and the length of the second type data is greater than the length of the first type data; the second type of data according to the second protocol format includes at least two data segments and a data end identifier; The second filling control module is used to determine when the message is filled during the process of filling the data segment of the second type of data, send the message, and continue to fill the remaining data segment of the second type of data and the data end identifier in the next message; In this process, each target data is populated into the message using columns as the smallest unit. The preset data row and column order includes: First, fill in the target data for each column of the first row, then fill in the target data for each column of the second row, and so on, until finally filling in the target data for each column of the last row.

7. A terminal device, characterized in that, The terminal device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the column-based data transmission method as described in any one of claims 1 to 3.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the column-based data transmission method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Efficient variable packing method and system

    CN116260549A