Data processing method and device, equipment, storage medium and program product

By preprocessing and type determination of the initial data, frame formation or deframe processing is realized, solving the problem of high complexity of the existing data transmission system, simplifying the system architecture and improving convenience.

CN119513096APending Publication Date: 2025-02-25CHINA SATELLITE NETWORK EXPLORATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411648347.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The existing data transmission system needs to set up a separate data interface and meet strict format requirements during the framing and disassembly process, resulting in high system complexity.

Method used

By preprocessing the initial data, determining the data processing type, and performing frame-grouping or deframe processing according to the type, the architecture of the data transmission system is simplified and the individual setting of the frame-grouping subsystem and the deframe-frame subsystem are avoided.

Benefits of technology

It reduces the format requirements for input data in the data transmission system, simplifies the system architecture, and improves the convenience of maintenance and use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513096A_ABST
    Figure CN119513096A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and device, equipment, a storage medium and a program product, and is applied to a data transmission system in data processing equipment, the method comprises the following steps: obtaining to-be-processed initial data, and preprocessing the initial data to obtain intermediate data; determining a data processing type corresponding to the intermediate data, wherein the data processing type comprises a framing type or a de-framing type; and according to the data processing type, performing framing processing or de-framing processing on the intermediate data to obtain target data. According to the method, the initial data are preprocessed to obtain the intermediate data, the format requirement of the data transmission system on the input initial data is reduced, different intermediate data are subjected to framing or de-framing shunting processing according to the data processing types of the intermediate data, a framing subsystem and a de-framing subsystem do not need to be independently arranged, and the data processing efficiency is improved. And the architecture of the data transmission system is simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of communication technology, and in particular, to a data processing method, apparatus, device, storage medium, and program product. Background Art

[0002] The data transmission system may transmit data based on various transport layer protocols. For example, the transport layer protocol may include a serial port multiplexing (CMUX) protocol.

[0003] When transmitting data based on the transport layer protocol, two processes of data framing and deframing may be involved. In the related art, the data transmission system includes a framing subsystem and a deframing subsystem which are independent of each other. The framing subsystem is used to perform the data framing process, and the deframing subsystem is used to perform the data deframing process.

[0004] In this way, the data transmission system needs to set up separate data interfaces for the framing subsystem and the deframing subsystem respectively, and has strict format requirements for the input data of each data interface, which makes the data transmission system more complicated. Summary of the invention

[0005] The embodiments of the present application provide a data processing method, apparatus, device, storage medium and program product to solve the more complex technical problems of data transmission systems in related technologies.

[0006] In a first aspect, an embodiment of the present application provides a data processing method, which is applied to a data transmission system in a data processing device, and the method includes:

[0007] Acquire initial data to be processed, and preprocess the initial data to obtain intermediate data;

[0008] Determine a data processing type corresponding to the intermediate data, where the data processing type includes a framing type or a deframing type;

[0009] According to the data processing type, the intermediate data is subjected to framing processing or deframing processing to obtain target data.

[0010] In a possible implementation, preprocessing the initial data to obtain intermediate data includes:

[0011] Determining an initial data format of the initial data;

[0012] Determining a verification rule corresponding to the initial data format;

[0013] Performing verification processing on the initial data according to the verification rule to obtain a verification result;

[0014] When the verification result is that the verification is passed, the initial data is standardized to obtain the intermediate data.

[0015] In a possible implementation, the initial data is standardized to obtain the intermediate data, including:

[0016] Performing format conversion processing on the initial data to obtain format-processed data, wherein the data format of the format-processed data is the target data format;

[0017] Determining whether there is characteristic data of a preset type in the format-processed data;

[0018] If the characteristic data exists, preprocessing the characteristic data in the format-processed data to obtain the intermediate data;

[0019] If the characteristic data does not exist, the format-processed data is determined as the intermediate data.

[0020] In a possible implementation manner, determining the data processing type corresponding to the intermediate data includes:

[0021] Determining whether a target frame flag exists in the intermediate data;

[0022] If the target frame flag exists in the intermediate data and the number of the target frame flags is the target number, determining that the data processing type is the deframing type;

[0023] If the target frame mark does not exist in the intermediate data, or the number of the target frame marks is not the target number, the data processing type is determined to be the framing type.

[0024] In a possible implementation, the data processing type is a framing type; and according to the data processing type, performing framing processing on the intermediate data to obtain target data includes:

[0025] Determining indication data and user data in the intermediate data, wherein the indication data is used to indicate attribute information of the user data;

[0026] After the indication data is verified, generating first verification data according to the indication data and / or the user data;

[0027] The target frame flag, the indication data, the user data and the first verification data are subjected to framing processing based on a framing template to obtain the target data.

[0028] In a possible implementation manner, generating first verification data according to the indication data and / or the user data includes:

[0029] Determine, according to the indication data and / or the user data, M bytes arranged in a preset order and sub-data of each byte, where M is an integer greater than 1;

[0030] Determine a first check code according to the first sub-data of the first byte of the M bytes;

[0031] Determine a first code value according to the first check code and the initial code value;

[0032] Determine an i-th check code according to an i-th sub-data corresponding to an i-th byte in the M bytes, and determine an i-th code value according to the i-th check code and an i-1-th code value;

[0033] Among them, i is 2, 3, ..., M in sequence until the Mth coding value is obtained, and the Mth coding value is determined as the first verification data.

[0034] In a possible implementation, determining a first check code according to first sub-data of a first byte of the M bytes includes:

[0035] Splitting the first sub-data to obtain high-order four-bit data and low-order four-bit data corresponding to the first sub-data;

[0036] Searching the first remainder corresponding to the upper four bits of data in the first data table, and searching the second remainder corresponding to the lower four bits of data in the second data table;

[0037] The first check code is determined according to the first remainder and the second remainder.

[0038] In a possible implementation, the data processing type is a deframing type; and according to the data processing type, performing deframing processing on the intermediate data to obtain target data includes:

[0039] Parsing the intermediate data to obtain indication data, user data and second verification data;

[0040] Calculating third verification data according to the indication data and / or the user data;

[0041] When it is determined that the third verification data is consistent with the second verification data, the user data is determined as the target data.

[0042] In a second aspect, an embodiment of the present application provides a data processing device, which is applied to a data transmission system in a data processing device, including:

[0043] An acquisition module, used to acquire initial data to be processed;

[0044] A processing module, used for preprocessing the initial data to obtain intermediate data;

[0045] The processing module is further used to determine a data processing type corresponding to the intermediate data, where the data processing type includes a framing type or a deframing type;

[0046] The processing module is further used to perform framing processing or deframing processing on the intermediate data according to the data processing type to obtain target data.

[0047] In a possible implementation, the processing module is specifically used for:

[0048] Determining an initial data format of the initial data;

[0049] Determining a verification rule corresponding to the initial data format;

[0050] Performing verification processing on the initial data according to the verification rule to obtain a verification result;

[0051] When the verification result is that the verification is passed, the initial data is standardized to obtain the intermediate data.

[0052] In a possible implementation, the processing module is further configured to:

[0053] Performing format conversion processing on the initial data to obtain format-processed data, wherein the data format of the format-processed data is the target data format;

[0054] Determining whether there is characteristic data of a preset type in the format-processed data;

[0055] If the characteristic data exists, preprocessing the characteristic data in the format-processed data to obtain the intermediate data;

[0056] If the characteristic data does not exist, the format-processed data is determined as the intermediate data.

[0057] In a possible implementation, the processing module is further configured to:

[0058] Determining whether a target frame flag exists in the intermediate data;

[0059] If the target frame flag exists in the intermediate data and the number of the target frame flags is the target number, determining that the data processing type is the deframing type;

[0060] If the target frame mark does not exist in the intermediate data, or the number of the target frame marks is not the target number, the data processing type is determined to be the framing type.

[0061] In a possible implementation manner, the data processing type is a framing type; and the processing module is further configured to:

[0062] Determining indication data and user data in the intermediate data, wherein the indication data is used to indicate attribute information of the user data;

[0063] After the indication data is verified, generating first verification data according to the indication data and / or the user data;

[0064] The target frame flag, the indication data, the user data and the first verification data are subjected to framing processing based on a framing template to obtain the target data.

[0065] In a possible implementation, the processing module is further configured to:

[0066] Determine, according to the indication data and / or the user data, M bytes arranged in a preset order and sub-data of each byte, where M is an integer greater than 1;

[0067] Determine a first check code according to the first sub-data of the first byte of the M bytes;

[0068] Determine a first code value according to the first check code and the initial code value;

[0069] Determine an i-th check code according to an i-th sub-data corresponding to an i-th byte in the M bytes, and determine an i-th code value according to the i-th check code and an i-1-th code value;

[0070] Among them, i is 2, 3, ..., M in sequence until the Mth coding value is obtained, and the Mth coding value is determined as the first verification data.

[0071] In a possible implementation, the processing module is further configured to:

[0072] Splitting the first sub-data to obtain high-order four-bit data and low-order four-bit data corresponding to the first sub-data;

[0073] Searching the first remainder corresponding to the upper four bits of data in the first data table, and searching the second remainder corresponding to the lower four bits of data in the second data table;

[0074] The first check code is determined according to the first remainder and the second remainder.

[0075] In a possible implementation manner, the data processing type is a deframing type; and the processing module is further configured to:

[0076] Parsing the intermediate data to obtain indication data, user data and second verification data;

[0077] Calculating third verification data according to the indication data and / or the user data;

[0078] When it is determined that the third verification data is consistent with the second verification data, the user data is determined as the target data.

[0079] In a third aspect, an embodiment of the present application provides a data processing device, including:

[0080] at least one processor; and

[0081] a memory communicatively connected to the at least one processor; wherein,

[0082] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform any method described in the first aspect.

[0083] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in any one of the first aspects.

[0084] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements any method in the first aspect when executed by a processor.

[0085] The data processing method, device, equipment, storage medium and program product provided by the embodiment of the present application can obtain the initial data to be processed, and pre-process the initial data to obtain intermediate data; determine the data processing type corresponding to the intermediate data; and perform framing or de-framing on the intermediate data according to the data processing type to obtain the target data. In this method, the data transmission system can pre-process the initial data to obtain intermediate data that meets the framing or de-framing processing requirements, which is conducive to reducing the format requirements of the data transmission system for the input initial data; the data transmission system can perform framing or de-framing diversion processing on different intermediate data according to the data processing type of the intermediate data, without the need to set up a separate framing subsystem and a de-framing subsystem, making the architecture of the data transmission system simpler and more convenient for later maintenance and use. BRIEF DESCRIPTION OF THE DRAWINGS

[0086] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0087] Figure 1A A schematic diagram of a data processing scenario provided in an embodiment of the present application;

[0088] Figure 1B A schematic diagram of another data processing scenario provided in an embodiment of the present application;

[0089] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;

[0090] Figure 3 A flowchart of another data processing method provided in an embodiment of the present application;

[0091] Figure 4 A schematic diagram of a framing template provided in an embodiment of the present application;

[0092] Figure 5 A flowchart of a verification data generation method provided in an embodiment of the present application;

[0093] Figure 6 A schematic diagram of the principle of a split CRC table lookup method provided in an embodiment of the present application;

[0094] Figure 7 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;

[0095] Figure 8 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application.

[0096] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0097] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0098] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0099] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of data and other information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0100] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0101] First, the terms involved in the embodiments of the present application are explained.

[0102] Connection Multiplexing (CMUX) protocol: refers to the use of a physical serial port to virtualize multiple logical serial ports to achieve multiplexing of a single physical serial port. The data transmission process can be implemented based on the CMUX protocol. In this process, the data needs to be framed and deframed. When data transmission is performed based on the CMUX protocol, a cyclic redundancy check (CRC) check code can be used to detect the accuracy and completeness of data transmission.

[0103] In order to facilitate understanding of the technical solutions of the embodiments of the present application, the application scenarios of the embodiments of the present application are introduced below.

[0104] Figure 1A A schematic diagram of a data processing scenario provided in an embodiment of the present application. Figure 1A The data processing device is provided with a data transmission system, which can realize data transmission between object A and object B based on the transport layer protocol.

[0105] In some embodiments, the data processing device may be a physical server, or may be a smart phone, a smart watch, a tablet computer, a laptop computer, a smart vehicle-mounted device, a desktop computer, a portable laptop computer, or a virtual reality / augmented reality / mixed reality device, etc.

[0106] Object A may be an upper-layer communication object, for example, object A may be an application.

[0107] The object B may be an underlying physical transmission link, for example, the object B may be a Universal Asynchronous Receiver / Transmitter (UART).

[0108] In some embodiments, the data transmission system may be a CMUX system, and the CMUX system may transmit data based on a CMUX protocol.

[0109] See also Figure 1A In (a), the data transmission system may be provided with a mutually independent framing subsystem and a deframing subsystem. The data transmission system needs to set data interface 1 and data interface 2 for the framing subsystem. Object A can input data A to the framing subsystem through data interface 1. The framing subsystem can perform framing processing on the data A to obtain data A1, and input data A1 to object B based on data interface 2. The data transmission system needs to set data interface 3 and data interface 4 for the deframing subsystem. Object B can input data B to the deframing subsystem based on data interface 3. The deframing subsystem can perform parsing processing on the data B to obtain data B1, and input data B1 to object A based on data interface 4.

[0110] In this process, the data transmission system needs to set up separate data interfaces for the framing subsystem and the deframing subsystem respectively, and has strict requirements on the format of input data of each data interface, which makes the data transmission system more complicated and the data processing efficiency lower.

[0111] In view of this, the present application embodiment proposes Figure 1A The data transmission system shown in (b) can obtain data A and data B to be processed; preprocess data A to obtain data A1, and preprocess data B to obtain data B1; determine that the data processing type of data A1 is a framing type, perform framing processing on data A1, and obtain data frame A2; determine that the data processing type of data B1 is a deframing type, perform deframing processing on data B1, and obtain parsed data B2.

[0112] Compared to Figure 1A The data transmission system shown in (a) in FIG. Figure 1A The data transmission system shown in (b) does not need to set up separate data interfaces for the framing subsystem and the deframing subsystem, making the data transmission system architecture simpler; and after obtaining data A and data B, Figure 1AThe data transmission system shown in (b) can pre-process data A and data B to obtain data A1 and data B1 whose data formats meet the framing or deframing processing requirements, thereby reducing the format requirements for input data, and can perform framing or deframing diversion processing on different data according to the data processing type corresponding to each data, making the data transmission system easier to use.

[0113] Figure 1B This is a schematic diagram of another data processing scenario provided by an embodiment of the present application. Figure 1B In this data processing scenario, the data processing device 1 and the data processing device 2 may be respectively provided with a data transmission system, and the data processing device 1 may perform preprocessing and framing processing on the data A to obtain data A1, and send the data to the data processing device 2. The data processing device 2 may perform preprocessing and deframing processing on the data A1 to obtain data A. Similarly, the data processing device 2 may perform preprocessing and framing processing on the data B1 to obtain data B, and send the data to the data processing device 1. The data processing device 1 may perform preprocessing and deframing processing on the data B to obtain data B1.

[0114] The embodiment of the present application provides a data processing method, which is applied to a data transmission system in a data processing device. The method can obtain the initial data to be processed, and pre-process the initial data to obtain intermediate data; determine the data processing type corresponding to the intermediate data; and perform framing or de-framing on the intermediate data according to the data processing type to obtain the target data. In this method, the data transmission system can pre-process the initial data to obtain intermediate data that meets the framing or de-framing processing requirements, which is conducive to reducing the format requirements of the data transmission system for the input initial data; the data transmission system can perform framing or de-framing diversion processing on different intermediate data according to the data processing type of the intermediate data, without the need to set up a separate framing subsystem and a de-framing subsystem, making the architecture of the data transmission system simpler and more convenient for later maintenance and use.

[0115] The method shown in the present application is described below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be described repeatedly in different embodiments.

[0116] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application. Figure 2 , the method may include:

[0117] S201, obtaining initial data to be processed, and preprocessing the initial data to obtain intermediate data.

[0118] This method can be Figure 1A or Figure 1B The data processing device in the embodiment is executed, or is executed by a data transmission system in the data processing device.

[0119] The data transmission system can provide a data interface to the outside world, and the data transmission system can obtain initial data sent by other systems based on the data interface.

[0120] The initial data may be data composed of visible characters such as letters, numbers, and symbols, and the user may directly read the initial data. For example, the initial data may be the number "1".

[0121] In some embodiments, the initial data can be preprocessed in the following manner: determine the initial data format of the initial data; determine the verification rules corresponding to the initial data format; verify the initial data according to the verification rules to obtain a verification result; when the verification result is verification passed, standardize the initial data to obtain intermediate data.

[0122] The initial data format may be a text data format, which may also be referred to as a “character data format” and a “hexadecimal text format” in some embodiments.

[0123] Exemplarily, the initial data in character data format may be “AT”, and the initial data in hexadecimal text format may be “41 54 0d 0a”.

[0124] In some embodiments, if the initial data format of the initial data is "hexadecimal text format", before the initial data is verified, it can also be determined whether there are spaces in the initial data. If there are spaces in the initial data, the spaces in the initial data need to be cleared.

[0125] For example, the initial data in the hexadecimal text format may be "41 54 0d 0a". There are spaces in the initial data. After the spaces in the initial data are cleared, the obtained data is "41540d0a".

[0126] Verification rules corresponding to different data formats can be pre-configured, and a mapping relationship between data formats and verification rules can be established. After the initial data format is determined, the verification rules corresponding to the initial data format can be determined based on the initial data format and the mapping relationship.

[0127] In some embodiments, the initial data can be verified based on the following verification rules: clearing redundant spaces in the initial data; checking whether the number of character bits in the initial data is an even number to determine whether the data length of the initial data is an integer number of bytes; and verifying the validity of the characters of the initial data to determine that the initial data is valid data.

[0128] For example, for the initial data in hexadecimal text format, its characters need to be between '0'-'9', 'A'-'F' or 'a'-'f'. When it is detected that each character in the initial data is between '0'-'9', 'A'-'F' or 'a'-'f', the initial data is determined to be valid data; when it is detected that there is at least one character in the initial data that is not between '0'-'9', 'A'-'F' or 'a'-'f', the initial data is determined to be invalid data, and the verification result of the initial data is determined to be verification failure.

[0129] It should be noted that the standardization of the initial data will be Figure 3 The details are described in the examples.

[0130] S202: Determine the data processing type corresponding to the intermediate data.

[0131] The data processing type may include a framing type or a deframing type.

[0132] In some embodiments, it can be determined whether there is a target frame flag in the intermediate data; if there is a target frame flag in the intermediate data and the number of target frame flags is the target number, the data processing type is determined to be a deframing type; if there is no target frame flag in the intermediate data, or the number of target frame flags is not the target number, the data processing type is determined to be a framing type.

[0133] The target frame marker may be used to indicate the boundary of frame data transmitted by the data transmission system.

[0134] When the transport layer protocol used by the data transmission system is different, the target frame flag is different. In some embodiments, based on the transport layer protocol used by the data transmission system, the target frame flag corresponding to the transport layer protocol can be pre-configured in the data transmission system.

[0135] For example, when the data transmission system may be a CMUX system, the CMUX system may transmit data based on the CMUX protocol, and the target frame flag may be 0xF9 or 0x7E.

[0136] It is understandable that when performing framing or deframing based on different transport layer protocols, the number of target frame flags set may be different. For example, transport layer protocol 1 may need to set the target frame flag in the first byte, transport layer protocol 2 may need to set the target frame flag in the last byte, and transport layer protocol 3 may need to set the target frame flag in both the first byte and the last byte.

[0137] The number of targets can be, but is not limited to, 1 or 2.

[0138] S203: Perform framing or deframing on the intermediate data according to the data processing type to obtain target data.

[0139] It can be understood that when the data processing type is a framing type, the intermediate data can be subjected to framing processing to obtain target data; when the data processing type is a deframing type, the intermediate data can be subjected to deframing processing to obtain target data.

[0140] It should be noted that the framing or deframing process of the intermediate data will be Figure 3 The details are described in the examples.

[0141] The embodiment of the present application provides a data processing method, which can obtain the initial data to be processed, and pre-process the initial data to obtain intermediate data; determine the data processing type corresponding to the intermediate data; and perform framing or de-framing on the intermediate data according to the data processing type to obtain target data. In this method, the data transmission system can pre-process the initial data to obtain intermediate data that meets the framing or de-framing processing requirements, which is conducive to reducing the format requirements of the data transmission system for the input initial data; the data transmission system can perform framing or de-framing diversion processing on different intermediate data according to the data processing type of the intermediate data, without the need to set up a separate framing subsystem and a de-framing subsystem, making the architecture of the data transmission system simpler and more convenient for later maintenance and use.

[0142] Figure 3 A flowchart of another data processing method provided in an embodiment of the present application. Figure 3 , the method may include:

[0143] S301, obtaining initial data to be processed.

[0144] It should be noted that the specific execution process of obtaining the initial data in step S301 can refer to the specific execution process of obtaining the initial data in step S201, which will not be repeated here.

[0145] In a possible implementation, after the initial data is acquired, the initial data may be preprocessed to obtain intermediate data by referring to steps S302 to S305 as shown below.

[0146] S302: Determine the initial data format of the initial data.

[0147] Optionally, some format parsing tools may be used to determine the initial data format of the initial data. For example, the format parsing tool may use a regular expression to determine the initial data format of the initial data.

[0148] S303: Determine the verification rule corresponding to the initial data format.

[0149] It can be understood that the verification rules may include multiple sub-rules. When the initial data is verified based on the verification rules, if the sub-verification result corresponding to each sub-rule in the multiple sub-rules is verification passed, then the verification result of the initial data is determined to be verification passed; if there is at least one sub-rule in the multiple sub-rules whose corresponding sub-verification result is verification failed, then the verification result of the initial data is determined to be verification failed.

[0150] For example, for initial data in hexadecimal text format, if the number of character bits of the initial data is not an even number, or the initial data is invalid data, then the initial data verification result is determined to be a verification failure.

[0151] S304: Perform verification processing on the initial data according to the verification rules to obtain the verification result.

[0152] The verification result can be verification passed or verification failed.

[0153] In some embodiments, when the verification result is that the verification fails, the initial data can be discarded to wait for the next data verification process; when the verification result is that the verification passes, step S305 is executed.

[0154] S305: When the verification result is that the verification is passed, the initial data is standardized to obtain intermediate data.

[0155] Optionally, the intermediate data can be obtained in the following manner: format conversion processing is performed on the initial data to obtain format-processed data, and the data format of the format-processed data is the target data format; it is determined whether there is characteristic data of a preset type in the format-processed data; if there is characteristic data, the characteristic data in the format-processed data is pre-processed to obtain intermediate data; if there is no characteristic data, the format-processed data is determined to be intermediate data.

[0156] In some embodiments, the target data format may be a preset American Standard Code for Information Interchange (ASCII) format.

[0157] For example, assuming that the target data format is binary ASCII, the initial data "A" in the character data format can be converted to "01000001". The initial data "41" in the hexadecimal text format can be converted to "01000001".

[0158] A format conversion tool can be used to convert the format of the initial data.

[0159] The preset type may be an AT command type, and the characteristic data may include at least one AT command. For example, the characteristic data may include: AT command 1 and AT command 2.

[0160] In some embodiments, when the characteristic data is an AT command, the AT command may be pre-processed including but not limited to at least one of the following: character uppercase processing and lowercase processing, tail line feed processing, or data completion processing.

[0161] In a possible implementation, after the intermediate data is obtained, steps S306 to S308 shown below may be performed to determine the data processing type corresponding to the intermediate data.

[0162] S306: Determine whether there is a target frame flag in the intermediate data.

[0163] It should be noted that the specific execution process of step S306 can refer to the specific execution process of step S202, which will not be repeated here.

[0164] S307: If the target frame mark does not exist in the intermediate data, or the number of the target frame marks is not the target number, determine that the data processing type is a framing type.

[0165] S308: If the target frame flag exists in the intermediate data, and the number of the target frame flags is the target number, determine that the data processing type is a deframing type.

[0166] In some embodiments, if the transport layer protocol is the CMUX protocol, the CMUX frame transmitted based on the CMUX protocol may include two target frame flags, one target frame flag is located at the first byte of the CMUX frame, and the other target frame flag is located at the last byte of the CMUX frame.

[0167] After determining that the transport layer protocol is the CMUX protocol, when it is determined that there are 2 target frame flags in the intermediate data, and the target frame flag is 0xF9 or 0x7E, the data processing type of the intermediate data is determined to be deframing processing; when it is determined that there is 1 target frame flag in the intermediate data, or the target frame flag is not 0xF9 or 0x7E, the data processing type of the intermediate data is determined to be framing processing.

[0168] When it is determined that the data processing type is a framing type, you can refer to and execute steps S309 to S311 as shown below to perform framing processing on the intermediate data to obtain target data; when it is determined that the data processing type is a deframing type, you can refer to and execute steps S312 to S314 as shown below to perform deframing processing on the intermediate data to obtain target data.

[0169] S309: Determine the indication data and the user data in the intermediate data.

[0170] User data may be data that needs to be actually transmitted by the data transmission system.

[0171] The indication data may be used to indicate attribute information of the user data, and the attribute information may include address information, control information, and length indication information.

[0172] Exemplarily, the indication data may include a logical channel identifier and a frame type, the channel identifier may be used to indicate address information of the user data, and the frame type may be used to indicate control information of the user data.

[0173] The indication data and the user data can be extracted from the intermediate data based on the keyword extraction method.

[0174] S310: After the indication data is verified, generate first verification data according to the indication data and / or user data.

[0175] After obtaining the indication data and the user data, the indication data may be verified to further ensure the reliability of the user data.

[0176] In some embodiments, if the indication data fails to be verified, the intermediate data may be discarded to reduce the amount of data processing in the subsequent data transmission system.

[0177] It should be noted that the process of generating the first verification data according to the indication data and / or the user data will be Figure 5 The details are described in the examples.

[0178] S311 , performing framing processing on the target frame flag, indication data, user data and first verification data based on the framing template to obtain target data.

[0179] It is understandable that for different transport layer protocols, the framing templates used by the data transmission system are different. In some embodiments, when the transport layer protocol is the CMUX protocol, its framing template can be as follows: Figure 4 shown.

[0180] Figure 4 A schematic diagram of a framing template provided in an embodiment of the present application. Figure 4 The frame template includes 7 padding areas, which are: first flag field, address field, control field, length indication field, information field, check field and second flag field in order from left to right, where:

[0181] The first flag field and the second flag field are used to fill the target frame flag. The first flag field may occupy the first byte of the framing template, and the second flag field may occupy the last byte of the framing template.

[0182] The address field may be filled with address information in the indication data, for example, the address information may include a logical channel identifier. The address field may occupy 1 byte, and the address field is located between the first flag field and the control field.

[0183] The control field can be used to fill in the control information in the indication data, for example, the control information can include the frame type. The control field can occupy 1 byte, and the control field is located between the address field and the length indication field.

[0184] The length indication field can be used to fill the length indication information in the indication data, and the length indication information can be used to indicate the length of the data filled in the information field. The control field can occupy 1 to 2 bytes, and the length indication field is located between the control field and the information field.

[0185] The information field can be used to fill in user data. The information field can be located between the length indication field and the check field.

[0186] The check field can be used to fill the first check data. The check field can occupy 1 byte. The check field is located between the information field and the second flag field.

[0187] Next, in conjunction with steps S312 to S314, the process of performing de-framing processing on the intermediate data to obtain the target data is described in detail.

[0188] S312: Analyze and process the intermediate data to obtain indication data, user data and second verification data.

[0189] For different transport layer protocols, the parsing methods corresponding to the data frames of each transport layer protocol can be pre-configured. When it is determined that the intermediate data needs to be parsed and processed, the parsing method corresponding to the transport layer protocol can be called according to the transport layer protocol adopted by the data transmission system to parse and process the intermediate data.

[0190] In some embodiments, when the transport layer protocol is the CMUX protocol, a pre-configured parsing method corresponding to the CMUX protocol may be called to parse the intermediate data to obtain indication data, user data, and second verification data.

[0191] S313: Calculate third verification data according to the indication data and / or the user data.

[0192] It should be noted that the process of generating the third verification data according to the indication data and / or the user data will be Figure 5 The details are described in the examples.

[0193] S314: When it is determined that the third verification data is consistent with the second verification data, the user data is determined as the target data.

[0194] It should be noted that the third verification data is consistent with the second verification data, which can also be expressed as the third verification data is the same as the second verification data.

[0195] It is understandable that when the third verification data is determined to be consistent with the second verification data, it can be determined that the user data has not changed during the transmission process. By verifying the second verification data, the accuracy and correctness of the data processing device during the data transmission process can be determined to avoid errors in the data transmission process.

[0196] The embodiment of the present application provides a data processing method, which can obtain the initial data to be processed, and pre-process the initial data to obtain intermediate data; determine the data processing type corresponding to the intermediate data; and perform framing or de-framing on the intermediate data according to the data processing type to obtain target data. In this method, the data transmission system can pre-process the initial data to obtain intermediate data that meets the framing or de-framing processing requirements, which is conducive to reducing the format requirements of the data transmission system for the input initial data; the data transmission system can perform framing or de-framing diversion processing on different intermediate data according to the data processing type of the intermediate data, without the need to set up a separate framing subsystem and a de-framing subsystem, making the architecture of the data transmission system simpler and more convenient for later maintenance and use.

[0197] In some embodiments, when the data transmission system transmits data based on the CMUX protocol, a CRC check code may be used to detect the accuracy and integrity of the CMUX protocol data transmission by the data processing device. The process of calculating the CRC check code is described in detail below:

[0198] Before transmitting data, the sender and receiver can jointly agree on a preset polynomial.

[0199] Before sending, the sender may perform modulo-2 division on the indication data and / or user data and the preset polynomial to obtain a CRC check code, and append the CRC check code to the end of the user data.

[0200] After receiving the data, the receiver can parse and process the received data to obtain the indication data, user data and the CRC check code, and perform modulo-2 division on the indication data and / or user data with the preset polynomial to obtain a newly calculated CRC check code, and compare the newly calculated CRC check code with the CRC check code obtained by parsing; if the newly calculated CRC check code is consistent with the CRC check code obtained by parsing, it is determined that the data transmission is accurate and complete; if the newly calculated CRC check code is inconsistent with the CRC check code obtained by parsing, it is determined that there is a problem with the data transmission.

[0201] The CRC verification method is relatively flexible and can be applied to various data types and transmission modes; the method can also detect different types of errors, such as single-bit or multi-bit errors. Therefore, when performing de-framing or framing based on the CMUX protocol, the CRC verification method can be used to generate verification data to quickly find out whether the data is transmitted incorrectly.

[0202] In some embodiments, the CRC check value may be calculated in the following two ways.

[0203] Method 1: Serial CRC calculation method

[0204] The serial CRC calculation method calculates the CRC check code based on the generation principle of the CRC check code. The remainder obtained by raising the frame data to a power and dividing it by the generating polynomial using modulo-2 division is the CRC check data. In this process, each bit of data must be shifted or XORed multiple times, which requires a large amount of calculation and is slow.

[0205] Method 2: Table-based CRC calculation method

[0206] The table-lookup CRC calculation method is to determine the possible data, calculate the CRC check code corresponding to each data in advance, and store each data and the CRC check code corresponding to each data in a data table in the order corresponding to each data. In the actual CRC check code calculation process, each time the data is updated, the CRC check code corresponding to the updated data is directly obtained by querying the data table, without multiple shifts and XORs, which can save a lot of calculation time and improve the running speed.

[0207] In some embodiments, a CRC-32 lookup algorithm may be used to calculate the CRC check code. However, if a CRC-32 lookup algorithm is used, 256×4 bytes of space are required to store the data table in advance, which will result in a larger space occupied by the system memory.

[0208] In view of this, the method also provides a split CRC table lookup method to determine the CRC check code. The method divides 1 byte of data into high 4-bit data and low 4-bit data, converts the high 4-bit data and the low 4-bit data into two polynomials for remainder operation, and performs XOR operation on the two generated remainders to obtain the CRC check code of the number. The method can also further generate check data based on the generated CRC check code. Figure 5 , the process of calculating the CRC check code based on the split CRC lookup table method and generating the check data is described in detail.

[0209] Figure 5 A flow chart of a verification data generation method provided in an embodiment of the present application. It should be noted that the method can be applied to the framing processing or deframing processing scenario in the data processing method provided in an embodiment of the present application, and can also be applied to other scenarios where a CRC check code needs to be generated, and verification data is generated based on the CRC check code. The embodiment of the present application does not limit the application scenario of generating the CRC check code and the verification data.

[0210] See also Figure 5 , the method may include the following steps:

[0211] S501. Determine, according to indication data and / or user data, M bytes arranged in a preset order and sub-data of each byte.

[0212] Wherein, M is an integer greater than 1.

[0213] In some embodiments, the preset order may be an order from small to large byte encoding.

[0214] In some embodiments, assuming that the indication data includes address information, control information, and length indication information, the bytes corresponding to the address information, the control information, the length indication information, and the user data can be determined in the M bytes respectively; according to the framing template ( Figure 4 ), determine the arrangement order of the address information, control information, length indication information and user data; and arrange the bytes corresponding to the address information, control information, length indication information and user data based on the arrangement order.

[0215] Optionally, the first check code may be determined according to the first sub-data of the first byte of the M bytes. In some embodiments, the first check code may be determined by referring to steps S502 to S506.

[0216] S502: Split the first sub-data to obtain high four-bit data and low four-bit data corresponding to the first sub-data.

[0217] The first sub-data, the upper four-bit data and the fourth-bit data may include 8 bits, wherein the data of the first four bits of the upper four-bit data are the same as the data of the first four bits of the first sub-data; the data of the last four bits of the lower four-bit data may be the same as the data of the last four bits of the first sub-data.

[0218] In some embodiments, the first data may be subjected to a shift splitting process to obtain high four-bit data and low four-bit data corresponding to the first sub-data.

[0219] For example, the first sub-data is (b7b6b5b4b3b2b1b0), the upper four bits of data may be (b7b6b5b40000), and the lower four bits of data may be (0000b3b2b1b0).

[0220] S503 , query the first data table for a first remainder corresponding to the upper four bits of data, and query the second data table for a second remainder corresponding to the lower four bits of data.

[0221] The first data table may include a plurality of upper four-bit data and a remainder corresponding to each upper four-bit data. The second data table may include a plurality of lower four-bit data and a remainder corresponding to each lower four-bit data.

[0222] For any 8-bit sub-data, the first four bits of the upper four bits may have two situations: 0 or 1, and the last four bits are all 0. 4 There are 16 cases, that is, the upper four bits of data in these 16 cases can be determined to be calculated with the preset polynomial to obtain the remainder corresponding to the upper four bits of data in each case, and the remainder corresponding to the upper four bits of data in each case can be stored in the first data table.

[0223] For any 8-bit sub-data, each of the last four bits of the lower four bits may be 0 or 1, and if the first four bits are all 0, then the lower four bits may also be 2. 4 There are 16 cases, that is, the lower four bits of data in these 16 cases can be determined to be calculated with the preset polynomial to obtain the remainder corresponding to the lower four bits of data in each case, and the remainder corresponding to the lower four bits of data in each case can be stored in the second data table.

[0224] In some embodiments, a first query address can be determined based on the upper four bits of data, and a second query address can be determined based on the lower four bits of data; based on the first query address, a first remainder corresponding to the upper four bits of data is queried in the first data table; based on the second query address, a second remainder corresponding to the lower four bits of data is queried in the second data table.

[0225] S504: Determine a first check code according to the first remainder and the second remainder.

[0226] The first check code may be a CRC check code, and a split CRC table lookup method may be used to determine the CRC check code.

[0227] Assume that the first sub-data is (b7b6b5b4b3b2b1b0), the polynomial corresponding to the first sub-data is F(x); the upper four bits of the first sub-data are (b7b6b5b40000), and the polynomial corresponding to the upper four bits is F(x); the lower four bits of the first sub-data are (0000b3b2b1b0), and the polynomial corresponding to the lower four bits is F l (x); then: F(x)=F h (x)+F l (x).

[0228] The calculation process of the CRC check code can satisfy the following formula:

[0229]

[0230] Where H(x) is a preset polynomial agreed upon by the sender and the receiver; x 32 Indicates CRC-32 check; F(x)x 32 Indicates that F(x) is shifted left by 32 bits. This formula can be used to convert the remainder operation of F(x) into the remainder operation of F h (x) and F l (x) by the remainder operation, we can h (x) The first remainder obtained by the modulo operation and F l (x) performing an XOR operation on the second remainder of the remainder operation to obtain a first check code corresponding to the first sub-data.

[0231] Next, combine Figure 6 , the principle of the split CRC lookup table method is explained in detail.

[0232] Figure 6 This is a schematic diagram of the principle of a split CRC lookup table method provided in the embodiment of the present application. Figure 6 , including a first data table, a second data table and a third data table.

[0233] For any 8-bit sub-data, each bit of data may be 0 or 1. 8In some embodiments, an unsplit CRC table lookup algorithm may be used to calculate the sub-data in each of the 256 cases with a preset polynomial to obtain a check code corresponding to the sub-data in each case, and the check code corresponding to the sub-data in each case may be stored in the third data table.

[0234] In some embodiments, after obtaining the first sub-data, the address corresponding to the first sub-data can be determined, and the check code corresponding to the first sub-data can be queried in the third data table according to the address. Although this method can quickly query the check code corresponding to the first sub-data, this method needs to occupy 1024 bytes in the system memory to store the third data table, resulting in a large system memory occupation.

[0235] In view of this, the present application adopts a split CRC calculation method, splits the first sub-data into high four-bit data and low four-bit data, and makes a first data table according to the address and remainder corresponding to the high four-bit data in each case, and makes a second data table according to the address and remainder corresponding to the low four-bit data in each case. After obtaining the high four-bit data and low four-bit data corresponding to the first sub-data, the first remainder corresponding to the high four-bit data can be queried in the first data table according to the address of the high four-bit data, and the second remainder corresponding to the low four-bit data can be queried in the second data table according to the address of the low four-bit data, and the first remainder and the second remainder are XORed to obtain a first check code.

[0236] It should be noted that the split CRC table lookup method provided in the embodiment of the present application can be applied to the frame processing or de-frame processing scenario in the data processing method provided in the embodiment of the present application, and can also be applied to other scenarios that require CRC table lookup processing. The embodiment of the present application does not limit the application scenario of the split CRC table lookup method.

[0237] When a split CRC table lookup algorithm is used to determine the first check code corresponding to the first sub-data, only 64 bytes of system memory are needed to store the first data table and 64 bytes are needed to store the second data table, occupying a total of 128 bytes of system memory. Compared with the case where the unsplit CRC table lookup algorithm is used to determine the first check code corresponding to the first sub-data, 896 bytes of system memory can be saved, which is beneficial to saving system memory and can be applicable to data transmission systems with limited system memory.

[0238] S505: Determine a first coding value according to the first check code and the initial coding value.

[0239] The first check code and the initial code value may be subjected to an XOR process to obtain a first code value.

[0240] S506. Initialize i to 2.

[0241] Among them, i is 2, 3, ..., M respectively.

[0242] S507: Determine an i-th check code according to the i-th sub-data corresponding to the i-th byte in the M bytes, and determine an i-th coding value according to the i-th check code and the i-1-th coding value.

[0243] It should be noted that the specific execution process of determining the i-th check code according to the i-th sub-data may refer to the specific execution process of determining the first check code according to the first sub-data in steps S502 to S504, which will not be described in detail here.

[0244] The i-th check code and the i-1-th code value may be XORed to obtain the i-th code value.

[0245] S508: Determine whether i is less than M.

[0246] If yes, execute step S509;

[0247] If not, execute step S510.

[0248] S509: Update i to i+1.

[0249] After executing step S509, return to step

[0250] S510, obtaining an Mth coding value, and determining the Mth coding value as first verification data.

[0251] The data processing method provided in the embodiment of the present application can use a split CRC table lookup algorithm to calculate the check code corresponding to the sub-data of each byte, which is beneficial to speed up the speed of determining the check code corresponding to the sub-data of each byte, thereby speeding up the speed of determining the first check data, and further speeding up the speed of framing processing or deframing processing; and the use of a split CRC table lookup algorithm is also beneficial to saving the byte occupancy of the system memory, further saving the system memory space.

[0252] Figure 7 This is a schematic diagram of the structure of a data processing device provided in an embodiment of the present application. The data processing device may be a chip or a chip module. Figure 7 The data processing device 10 can be applied to a data transmission system in a data processing device, and the data processing device 10 includes:

[0253] An acquisition module 11 is used to acquire initial data to be processed;

[0254] A processing module 12, used for preprocessing the initial data to obtain intermediate data;

[0255] The processing module 12 is further used to determine a data processing type corresponding to the intermediate data, where the data processing type includes a framing type or a deframing type;

[0256] The processing module 12 is further configured to perform framing processing or deframing processing on the intermediate data according to the data processing type to obtain target data.

[0257] In a possible implementation, the processing module 12 is specifically configured to:

[0258] Determining an initial data format of the initial data;

[0259] Determining a verification rule corresponding to the initial data format;

[0260] Performing verification processing on the initial data according to the verification rule to obtain a verification result;

[0261] When the verification result is that the verification is passed, the initial data is standardized to obtain the intermediate data.

[0262] In a possible implementation, the processing module 12 is further configured to:

[0263] Performing format conversion processing on the initial data to obtain format-processed data, wherein the data format of the format-processed data is the target data format;

[0264] Determining whether there is characteristic data of a preset type in the format-processed data;

[0265] If the characteristic data exists, preprocessing the characteristic data in the format-processed data to obtain the intermediate data;

[0266] If the characteristic data does not exist, the format-processed data is determined as the intermediate data.

[0267] In a possible implementation, the processing module 12 is further configured to:

[0268] Determining whether a target frame flag exists in the intermediate data;

[0269] If the target frame flag exists in the intermediate data and the number of the target frame flags is the target number, determining that the data processing type is the deframing type;

[0270] If the target frame mark does not exist in the intermediate data, or the number of the target frame marks is not the target number, the data processing type is determined to be the framing type.

[0271] In a possible implementation, the data processing type is a framing type; the processing module 12 is further configured to:

[0272] Determining indication data and user data in the intermediate data, wherein the indication data is used to indicate attribute information of the user data;

[0273] After the indication data is verified, generating first verification data according to the indication data and / or the user data;

[0274] The target frame flag, the indication data, the user data and the first verification data are subjected to framing processing based on a framing template to obtain the target data.

[0275] In a possible implementation, the processing module 12 is further configured to:

[0276] Determine, according to the indication data and / or the user data, M bytes arranged in a preset order and sub-data of each byte, where M is an integer greater than 1;

[0277] Determine a first check code according to the first sub-data of the first byte of the M bytes;

[0278] Determine a first code value according to the first check code and the initial code value;

[0279] Determine an i-th check code according to an i-th sub-data corresponding to an i-th byte in the M bytes, and determine an i-th code value according to the i-th check code and an i-1-th code value;

[0280] Among them, i is 2, 3, ..., M in sequence until the Mth coding value is obtained, and the Mth coding value is determined as the first verification data.

[0281] In a possible implementation, the processing module 12 is further configured to:

[0282] Splitting the first sub-data to obtain high-order four-bit data and low-order four-bit data corresponding to the first sub-data;

[0283] Searching the first remainder corresponding to the upper four bits of data in the first data table, and searching the second remainder corresponding to the lower four bits of data in the second data table;

[0284] The first check code is determined according to the first remainder and the second remainder.

[0285] In a possible implementation, the data processing type is a deframing type; and the processing module 12 is further configured to:

[0286] Parsing the intermediate data to obtain indication data, user data and second verification data;

[0287] Calculating third verification data according to the indication data and / or the user data;

[0288] When it is determined that the third verification data is consistent with the second verification data, the user data is determined as the target data.

[0289] The data processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0290] Figure 8 This is a schematic diagram of the structure of the data processing device provided in the embodiment of the present application. Figure 8 The data processing device 20 may include: a memory 21 and a processor 22. Exemplarily, the memory 21 and the processor 22 are interconnected via a bus 23.

[0291] The memory 21 is used to store program instructions;

[0292] The processor 22 is used to execute the program instructions stored in the memory, so as to enable the data processing device 20 to execute the method shown in the above method embodiment.

[0293] It is understood that the data processing device 20 may include at least one processor and a memory connected to the at least one processor in communication. The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method shown in the above embodiment.

[0294] The data processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0295] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the above-mentioned data processing method.

[0296] The embodiment of the present application may also provide a computer program product, including a computer program, which can implement the above-mentioned data processing method when executed by a processor.

[0297] All or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (ROM), random access memory (RAM), flash memory, hard disk, solid state drive, magnetic tape, floppy disk, optical disc and any combination thereof.

[0298] The present application embodiment is described with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the present application embodiment. It should be understood that each process and / or box in the flowchart and / or block diagram and the combination of the process and / or box in the flowchart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processing unit of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device produce a device for realizing the function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.

[0299] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0300] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0301] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

[0302] In the present application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". The terms "first", "second", etc. in the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In the present application, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.

Claims

1. A data processing method, characterized in that: A data transmission system applied to a data processing device, the method comprising: Acquire initial data to be processed, and preprocess the initial data to obtain intermediate data; Determine a data processing type corresponding to the intermediate data, where the data processing type includes a framing type or a deframing type; According to the data processing type, the intermediate data is subjected to framing processing or deframing processing to obtain target data.

2. The method according to claim 1, characterized in that Preprocessing the initial data to obtain intermediate data includes: Determining an initial data format of the initial data; Determining a verification rule corresponding to the initial data format; Performing verification processing on the initial data according to the verification rule to obtain a verification result; When the verification result is that the verification is passed, the initial data is standardized to obtain the intermediate data.

3. The method according to claim 2, characterized in that The initial data is subjected to standardization processing to obtain the intermediate data, including: Performing format conversion processing on the initial data to obtain format-processed data, wherein the data format of the format-processed data is the target data format; Determining whether there is characteristic data of a preset type in the format-processed data; If the characteristic data exists, preprocessing the characteristic data in the format-processed data to obtain the intermediate data; If the characteristic data does not exist, the format-processed data is determined as the intermediate data.

4. The method according to any one of claims 1 to 3, characterized in that: Determining a data processing type corresponding to the intermediate data includes: Determining whether a target frame flag exists in the intermediate data; If the target frame flag exists in the intermediate data and the number of the target frame flags is the target number, determining that the data processing type is the deframing type; If the target frame mark does not exist in the intermediate data, or the number of the target frame marks is not the target number, the data processing type is determined to be the framing type.

5. The method according to any one of claims 1 to 4, characterized in that: The data processing type is a framing type; and according to the data processing type, framing processing is performed on the intermediate data to obtain target data, including: Determining indication data and user data in the intermediate data, wherein the indication data is used to indicate attribute information of the user data; After the indication data is verified, generating first verification data according to the indication data and / or the user data; The target frame flag, the indication data, the user data and the first verification data are subjected to framing processing based on a framing template to obtain the target data.

6. The method according to claim 5, characterized in that Generating first verification data according to the indication data and / or the user data includes: Determine, according to the indication data and / or the user data, M bytes arranged in a preset order and sub-data of each byte, where M is an integer greater than 1; Determine a first check code according to the first sub-data of the first byte of the M bytes; Determine a first code value according to the first check code and the initial code value; Determine an i-th check code according to an i-th sub-data corresponding to an i-th byte in the M bytes, and determine an i-th code value according to the i-th check code and an i-1-th code value; Among them, i is 2, 3, ..., M in sequence until the Mth coding value is obtained, and the Mth coding value is determined as the first verification data.

7. The method according to claim 6, characterized in that Determining a first check code according to first sub-data of a first byte of the M bytes includes: Splitting the first sub-data to obtain high-order four-bit data and low-order four-bit data corresponding to the first sub-data; Searching the first remainder corresponding to the upper four bits of data in the first data table, and searching the second remainder corresponding to the lower four bits of data in the second data table; The first check code is determined according to the first remainder and the second remainder.

8. The method according to any one of claims 1 to 4, characterized in that: The data processing type is a deframing type; and according to the data processing type, the intermediate data is deframing processed to obtain target data, including: Parsing the intermediate data to obtain indication data, user data and second verification data; Calculating third verification data according to the indication data and / or the user data; When it is determined that the third verification data is consistent with the second verification data, the user data is determined as the target data.

9. A data processing device, characterized in that: Data transmission systems used in data processing equipment include: An acquisition module, used to acquire initial data to be processed; A processing module, used for preprocessing the initial data to obtain intermediate data; The processing module is further used to determine a data processing type corresponding to the intermediate data, where the data processing type includes a framing type or a deframing type; The processing module is further used to perform framing processing or deframing processing on the intermediate data according to the data processing type to obtain target data.

10. A data processing device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when the computer-executable instructions are executed by a processor.

12. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 8 when being executed by a processor.