Method for changing length of data frame, electronic equipment and storage medium

The controller sends specific commands and data frame structures in the optical transport network to ensure that the OSU avoids recognition errors when switching frame lengths, realizes lossless switching of frame lengths and lossless transmission of data frames, and solves the problem of frame length recognition errors and Data corruption issues.

CN118677567AActive Publication Date: 2024-09-20ZTE CORP

Patent Information

Application Number
CN202310315996.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-16
Publication Date
2024-09-20
Estimated Expiration
2043-03-16

AI Technical Summary

Technical Problem

In the optical transport network, it is difficult with existing technology to avoid frame length identification errors when OSU data frame length is switched, and to ensure that the overhead and payload of the data frame are lossless, especially when bit errors exist.

Method used

A series of commands are sent through the controller to ensure that the receiving end and the sending end change the length of the data frame at the same time. The frame length overhead is used for frame length identification, and the frame positioning overhead is included in the data frame to determine the frame positioning position to ensure that frame length switching is lossless.

Benefits of technology

It avoids frame length identification errors in most cases and keeps the overhead and payload of the data frame lossless when the data frame length changes, improving OSU's ability to support different frame lengths.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118677567A
    Figure CN118677567A
Patent Text Reader

Abstract

The invention discloses a method for changing the length of a data frame, electronic equipment and a storage medium, and belongs to the technical field of communication, and the method comprises the steps that when a controller determines that the length of the data frame is changed from a first length to a second length, a first command is sent to a receiving end, the first command is used for indicating the receiving end to determine the length of the received data frame according to the frame length overhead in the data frame, the data frame comprises the frame length overhead, and the frame length overhead is used for indicating the length of the data frame; the controller sends a second command to the sending end under the condition of determining that the receiving end successfully executes the first command, the second command carries a numerical value used for indicating a second length, and the second command is used for indicating that the length of the data frame sent by the sending end is changed into the second length; and the controller sends a third command to the receiving end under the condition of determining that the sending end successfully executes the second command, and the third command carries the numerical value of the second length and is used for indicating the receiving end to determine the length of the received data frame according to the second length.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and specifically relates to a method for changing the length of a data frame, an electronic device, and a storage medium. Background Art

[0002] In an Optical Transport Network (OTN), low-speed services are usually configured in an Optical Service Unit (OSU). The framing time of an OSU data frame is related to the rate of the OSU data frame and the length of the OSU data frame. Since framing must be completed within a certain period of time, when the rate of the OSU data frame is very low, the length of the OSU data frame must be short enough to meet the framing time requirement. For a high-speed OSU, a shorter frame length means a very short framing time, but the framing time only needs to be 3 milliseconds. A framing time that is too short has no additional benefits except wasting overhead bandwidth. Therefore, an OSU data frame with at least two frame lengths is required. When the OSU rate is low, a data frame with a shorter frame length is used, and when the OSU rate is high, a data frame with a longer frame length is used.

[0003] Based on the requirement of supporting two frame lengths, there are two implementation schemes. Scheme 1 is that the controller sets the frame length of the sender and the receiver. Scheme 2 is that the controller only sets the frame length of the sender. The frame length information is stored in the frame length overhead. The receiver identifies the frame length based on the frame length overhead. Since there are only two frame lengths, the receiver can first set the frame according to one length. If the frame setting fails, it can set the frame according to the other length. Repeated attempts are made. If the sender sends one of the two frame lengths, the receiver can always achieve frame setting. After the frame setting is successful, the receiver can determine the frame length based on the frame length overhead, thereby ensuring that the accurate frame header position can always be identified. The OSU needs to support lossless bandwidth adjustment when installing Packet services. At this time, it is necessary to support lossless switching of frame lengths, that is, changing the frame length will not cause overhead or payload errors. Analyzing the above two solutions, the advantage of Solution 1 is that it is reliable, that is, the bit errors introduced during the OSU transmission process cannot cause frame length recognition errors, but it cannot support lossless switching of frame lengths, because the frame length change command sent by the controller is too slow and has a delay, and it cannot be guaranteed that the sender and the receiver will receive the switching command at the same time, and the delay generated during the frame transmission process is also uncertain. The advantage of Solution 2 is that it supports lossless switching of frame lengths, but if there are bit errors during the OSU transmission process, and the bit errors cause errors in the frame length overhead, frame length recognition errors will occur, resulting in serious damage to the services in the OSU. In addition, the receiving end needs to switch repeatedly between the two frame lengths during the framing period, which will further extend the framing time for the OSU with a lower rate.

[0004] Thus, there is no good solution that allows the OSU to support two different frame lengths while solving the shortcomings of the above solutions. Therefore, there is an urgent need for a method to change the data frame length so that in most cases, even if there is a bit error, it will not lead to frame length recognition errors. At the same time, the overhead and payload of the data frame are not lost when the data frame length is changed. Summary of the invention

[0005] The embodiments of the present application provide a method, electronic device and storage medium for changing the length of a data frame, which can prevent frame length recognition errors in most cases even if there are bit errors, and at the same time, the overhead and payload of the data frame are not lost when the data frame length is changed.

[0006] In a first aspect, an embodiment of the present application provides a method for changing the length of a data frame, the method comprising: when the controller determines to change the length of the data frame from a first length to a second length, the controller sends a first command to the receiving end, wherein the first command is used to instruct the receiving end to determine the length of the received data frame according to the frame length overhead in the data frame, the data frame includes the frame length overhead, and the frame length overhead is used to indicate the length of the data frame, the transmitting end is used to send the data frame, and the receiving end is used to receive the data frame sent by the transmitting end; when the controller determines that the receiving end executes the first command successfully, the controller sends a second command to the transmitting end, wherein the second command carries a value indicating the second length, and the second command is used to instruct the length of the data frame sent by the transmitting end to change to the second length; when the controller determines that the transmitting end executes the second command successfully, the controller sends a third command to the receiving end, wherein the third command carries the value of the second length, and the third command is used to instruct the receiving end to determine the length of the received data frame according to the second length.

[0007] In a second aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0008] In a third aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0009] In an embodiment of the present application, when the controller determines to change the length of the data frame from the first length to the second length, the controller sends a first command to the receiving end, wherein the first command is used to instruct the receiving end to determine the length of the received data frame according to the frame length overhead in the data frame, the data frame includes a frame length overhead, the frame length overhead is used to indicate the length of the data frame, the transmitting end is used to send the data frame, and the receiving end is used to receive the data frame sent by the transmitting end; when the controller determines that the receiving end executes the first command successfully, the controller sends a second command to the transmitting end, wherein the second command carries a numerical value for indicating the second length, and the second command is used to instruct the length of the data frame sent by the transmitting end to be changed to the second length; when the controller determines that the transmitting end executes the second command successfully, the controller sends a third command to the receiving end, wherein the third command carries a numerical value for the second length, and the third command is used to instruct the receiving end to determine the length of the received data frame according to the second length, which can, in most cases, not cause frame length recognition errors even if there are bit errors, and at the same time, ensure that the overhead and payload of the data frame are lossless when changing the length of the data frame. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 It is a flowchart of a method for changing the length of a data frame provided in an embodiment of the present application;

[0011] Figure 2 It is a structural schematic diagram of a system for changing the length of a data frame provided in an embodiment of the present application;

[0012] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0013] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0014] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0015] In conjunction with the accompanying drawings, the method for changing the data frame length, the electronic device and the storage medium provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.

[0016] Figure 1 A method for changing the length of a data frame provided by an embodiment of the present application is shown, and the method comprises the following steps:

[0017] Step 102: When the controller determines to change the length of the data frame from the first length to the second length, the controller sends a first command to the receiving end.

[0018] In this step, the administrator can issue commands on the controller. When the controller receives a command from the user to change the length of the data frame, it can determine that the length of the data frame needs to be changed from the first length to the second length, and then send a first command to the receiving end, the first command is used to instruct the receiving end to determine the length of the received data frame according to the frame length overhead in the data frame. The data frame includes a frame length overhead, the frame length overhead is used to indicate the length of the data frame, the receiving end is used to receive the data frame sent by the sending end, the sending end is used to send the data frame, after receiving the first command, the receiving end sets the method of identifying the data frame to determine the length of the data frame by the frame length overhead in the data frame, and then frames the data frame by the length of the data frame.

[0019] As an example, a data frame is composed of B rows of data blocks, one data block includes a fixed number of bits, and one row of data blocks includes C data blocks, that is, the data frame includes B*C data blocks. Among the B*C data blocks of the data frame, the first N data blocks are fixed overheads, and the last B*CN data blocks are fixed payloads. There is a frame length overhead in the fixed overhead of the data frame, and the frame length overhead is used to indicate the length of the data frame. The length of the data frame is B*C, and the length unit is data block, that is, the length of the data frame is B*C data blocks. If a data block includes D bits, the length of the data frame is B*C*D bits. The content of the frame length overhead may be B*C or B*C*D.

[0020] In the data frame, the frame length overhead of the data frame always exists. When the receiving end receives the first command, it can identify the frame length overhead, determine the length of the data frame through the frame length overhead, and then frame the data frame.

[0021] In this way, when the length of the data frame sent by the subsequent sending end changes from the first length to the second length, the receiving end can identify the frame length overhead of the data frame and determine the second length of the data frame based on the frame length overhead, and then frame the received data frame. In this way, the sending end and the receiving end can change the frame length at the same time, ensuring that the data frame can be correctly identified during the data frame length switching process, thereby realizing lossless switching of the data frame length.

[0022] Step 104: When the controller determines that the receiving end executes the first command successfully, the controller sends a second command to the sending end.

[0023] Specifically, when it is determined that the receiving end has successfully executed the first command, a second command may be sent to the sending end, the second command carrying a numerical value indicating the second length, and the second command is used to indicate that the length of the data frame sent by the sending end is changed to the second length. That is, after receiving the second command, the sending end may change the length of the sent data frame from the first length to the second length according to the second command. Since the frame length overhead in the data frame always exists, when the frame length of the data frame is changed to the second length, the frame length overhead corresponding to the data frame also corresponds to the second length. It should be understood that after receiving the second command, the sending end may not immediately change the length of the sent data frame to the second length, and may generate a data frame according to the second length in the second command after sending a preset number of data frames. The preset number can be set in advance and is not specifically limited here. As an example, assuming that the first length of the data frame sent by the transmitter is L1, the controller sends a second command to the transmitter, and the second command includes a numerical value L2 for indicating the second length. After receiving the second command, the transmitter can change the length of the data frame to be sent from the first length L1 to the second length L2, and then send a data frame with a frame length of L2.

[0024] After determining that the receiving end of the data frame has been set to determine the length of the data frame by the frame length overhead in the received data frame, the second command is sent to the sending end. In this way, when the frame length of the data frame sent by the sending end changes, the receiving end can frame the data frame according to the frame length overhead in the data frame, so that the sending end and the receiving end can change the frame length at the same time, ensuring lossless switching of the data frame length.

[0025] Step 106: When the controller determines that the sending end executes the second command successfully, the controller sends a third command to the receiving end.

[0026] In this step, when the controller determines that the transmitting end has successfully executed the above-mentioned second command, it indicates that the transmitting end has changed the transmitted data frame from the first length to the second length, and can send a third command to the receiving end, the third command carrying the value of the second length, the third command is used to instruct the receiving end to determine the length of the received data frame according to the second length, and then frame the data frame according to the second length. Since the length of the data frame received by the receiving end has been changed from the first length to the second length, after receiving the third command, the receiving end no longer needs to determine the length of the received data frame according to the frame length overhead in the received data frame, and can determine the length of the received data frame according to the second length in the third command, and then frame the received data frame, so that the length of the data frame will not be incorrectly identified due to errors in the content of the frame length overhead.

[0027] As an example, assuming that the third command carries the second length value L2, the controller can send the third command to the receiving end when it determines that the sending end executes the second command successfully. After receiving the third command, the receiving end no longer determines the length of the data frame based on the frame length overhead in the received data frame, but can determine the length of the received data frame based on the second length L2, and then frame the received data frame.

[0028] In an embodiment of the present application, when the controller determines to change the length of the data frame from the first length to the second length, the controller sends a first command to the receiving end, wherein the first command is used to instruct the receiving end to determine the length of the received data frame according to the frame length overhead in the data frame, the data frame includes a frame length overhead, the frame length overhead is used to indicate the length of the data frame, the receiving end is used to receive the data frame sent by the sending end, and the sending end is used to send the data frame; when the controller determines that the receiving end executes the first command successfully, the controller sends a second command to the sending end, wherein the second command carries a value for indicating the second length, and the second command is used to indicate that the length of the data frame sent by the sending end is changed to the second length; when the controller determines that the sending end executes the second command successfully, the controller sends a third command to the receiving end, wherein the third command carries a value for the second length, and the third command is used to instruct the receiving end to determine the length of the received data frame according to the second length. After determining that the sending end has been set to perform framing through the frame length overhead in the received data frame, the controller sends the second command to the sending end. In this way, when the frame length of the data frame sent by the sending end changes, the receiving end can change the frame length of the sending end and the receiving end at the same time, ensuring lossless switching of the data frame length.

[0029] In addition, when it is determined that the sending end has successfully executed the second command, the third command is sent to the receiving end. Since the length of the data frame received by the receiving end has been changed from the first length to the second length, the receiving end no longer needs to determine the length of the received data frame according to the frame length overhead in the received data frame after receiving the third command. The receiving end can determine the length of the received data frame according to the second length in the third command, and then perform a framing operation on the received data frame, so that the length of the data frame will not be incorrectly identified due to an error in the content of the frame length overhead, and at the same time, the overhead and payload of the data frame are guaranteed to be lossless when the length of the data frame is changed.

[0030] In one implementation, the data frame also includes a frame length overhead, the content of the frame length overhead is used to determine the length of the data frame where the frame length overhead is located, and the sending end writes the length of the data frame into the frame length overhead according to the length of the data frame currently being sent; the data frame also includes a frame positioning overhead, the content of the frame positioning overhead is fixed bit information, the sending end fixedly writes the fixed bit information into the frame positioning overhead, and the receiving end determines the expected frame positioning overhead position of the data frame according to the length of the data frame and the content of the frame positioning overhead.

[0031] Specifically, the data frame also includes a frame length overhead, and the content in the frame length overhead is used to determine the length of the data frame where the frame length overhead is located. Regardless of whether the sending end receives the second command, the sending end needs to write the length of the data frame into the frame length overhead according to the length of the data frame. When the sending end receives the second command, it also needs to modify the content of the frame length overhead of the data frame according to the second length. In the process of generating the data frame, the sending end can write the frame alignment overhead in the frame alignment overhead of the data frame. The frame alignment overhead is usually located at the starting position of the data frame, and the content of the frame alignment overhead can be fixed bit information. After receiving the data frame, the receiving end can find and identify the fixed bit information in the data frame. When the fixed bit information is identified, the frame alignment overhead of the data frame can be determined. In addition, the receiving end can frame the data frame according to the frame length overhead of the data frame or the predetermined length of the data frame, and can determine the expected frame alignment overhead position of the next received data frame according to the length of the data frame and the content of the frame alignment overhead. In this way, after receiving the next data frame, the frame alignment overhead of the data frame can be found according to the expected frame alignment overhead position.

[0032] In one implementation, the receiving end determines the expected frame alignment overhead position of the data frame according to the length of the data frame and the content of the frame alignment overhead, including:

[0033] When the receiving end fails to find the fixed bit information at the expected frame positioning overhead position, the expected frame positioning overhead position is searched again according to the fixed bit information and the length of the data frame; when the receiving end finds the fixed bit information at the expected frame positioning overhead position, the expected frame positioning overhead position is used as the frame positioning overhead position, and the expected frame positioning overhead position is moved backward by the length of the data frame as the new expected frame positioning overhead position; when the receiving end finds the fixed bit information at the expected frame positioning overhead position, the contents of all the overheads of the data frame are valid contents; when the receiving end fails to find the fixed bit information at the expected frame positioning overhead position, the contents of all the overheads of the data frame are invalid contents.

[0034] Specifically, after receiving the data frame, the receiving end can search for the fixed bit information at the expected frame positioning overhead position. When the receiving end does not find the fixed bit information at the expected frame positioning overhead position, it can continue to identify and search for the fixed bit information backward, and after finding the fixed bit information, move the position of the fixed bit information backward by the length of the data frame as the expected frame positioning overhead position, and then continue to search for whether the fixed bit information exists at the expected frame positioning overhead position, wherein the backward movement means moving in the direction of the data frame that has not been received, and the length of the data frame can be determined by the frame length overhead in the data frame, or by a fixed value in the received command.

[0035] When the receiving end can find the fixed bit information in the expected frame alignment overhead position, the expected frame alignment overhead position can be determined as the frame alignment overhead position of the current data frame, and the expected frame alignment overhead position can be moved backward by the length of the data frame as the new expected frame alignment overhead position, wherein the length of the data frame can be determined by the frame length overhead in the data frame or by a fixed value in the received command.

[0036] In this way, when the fixed bit information is not found in the expected frame positioning overhead position, the fixed bit information can be continuously identified and searched for, and after the fixed bit information is identified, the position of the fixed bit information is moved backward by the length of the data frame in combination with the length of the data frame where the fixed bit information is located as the expected frame positioning overhead position, and then the expected frame positioning overhead position is continuously searched for whether the fixed bit information exists. When the fixed bit information is found in the expected frame positioning overhead position, the expected frame positioning overhead position can be determined as the frame positioning overhead position of the current data frame, and the expected frame positioning overhead position is moved backward by the length of the data frame as the new expected frame positioning overhead position, and then the new expected frame positioning overhead position is continuously searched for whether the fixed bit information exists. The above processing can ensure that the receiving end correctly identifies the accurate position of the overhead and payload of the data frame based on the fixed bit information and the data frame length.

[0037] In addition, when the receiving end finds the fixed bit information at the expected frame positioning overhead position, the contents of all the overheads of the data frame where the current fixed bit information is located are valid contents, that is, the contents of all the overheads of the data frame can be used normally. When the receiving end does not find the fixed bit information at the expected frame positioning overhead position, that is, an error occurs in searching for the data frame, the contents of all the overheads of the data frame where the expected frame positioning overhead position is currently located are invalid, that is, all the overheads of the current data frame cannot be used.

[0038] In one implementation, the re-searching the expected frame alignment overhead position according to the fixed bit information and the length of the data frame includes:

[0039] The receiving end searches for the fixed bit information in all received bits until the fixed bit information is found; after finding the fixed bit information, the position of the fixed bit information is moved backward by the length of the data frame as the expected frame positioning overhead position.

[0040] Specifically, the data frame received by the receiving end is actually presented in the form of bits. The receiving end can only consider the expected value of the frame positioning overhead position as the position of the frame positioning overhead if the fixed bit information is found in the expected value of the frame positioning overhead position. At the beginning, any position can be used as the expected frame positioning overhead position. If the fixed bit information is found in the expected value of the frame positioning overhead position, the expected value of the frame positioning overhead position is considered to be the position of the frame positioning overhead, and the expected value of the frame positioning overhead is moved backward by the length of the data frame as the new expected frame positioning overhead position; if the fixed bit information cannot be found in the expected value of the frame positioning overhead position, continue to search backwards bit by bit until the fixed bit information position is found, and the found fixed bit information position is moved backward by the length of the data frame as the new expected frame positioning overhead position. The above process is repeated.

[0041] In order to prevent the bit error from affecting the search for fixed bit information, it may be required that the frame alignment overhead position of the expected value is considered to be the position where the frame alignment overhead is located only after the fixed bit information is found in the frame alignment overhead position of the expected value for multiple consecutive times, and the frame alignment overhead position of the expected value is always maintained as the position where the frame alignment overhead is located until the fixed bit information cannot be found in the frame alignment overhead position of the expected value for multiple consecutive times. When the frame alignment overhead position of the expected value is considered to be the position where the frame alignment overhead is located, if the fixed bit information cannot be found in the frame alignment overhead position of the expected value for multiple consecutive times, it is considered that the frame alignment overhead position cannot be found until the fixed bit information is found in the frame alignment overhead position of the expected value for multiple consecutive times.

[0042] In one implementation, after sending the first command to the receiving end, the method further includes:

[0043] When the first command does not carry the numerical value for indicating the second length and the receiving end finds the fixed bit information in the expected frame positioning overhead position, the content of the frame length overhead is valid, and the receiving end uses the content of the frame length overhead as the length of the data frame, and moves the expected frame positioning overhead position backward by the length of the data frame as the new expected frame positioning overhead position; when the first command does not carry the numerical value for indicating the second length and the receiving end does not find the fixed bit information in the expected frame positioning overhead position, the content of the frame length overhead is invalid, and the receiving end uses the content of the frame length overhead when it was valid last time as the length of the data frame, and re-searches for the expected frame positioning overhead position based on the fixed bit information and the length of the data frame.

[0044] Specifically, after the controller sends the first command to the receiving end, when the first command does not carry a value for indicating the second length and the receiving end finds fixed bit information at the expected frame positioning overhead position, the content of the frame length overhead of the data frame where the current expected frame positioning overhead position is located is valid, and the length of the corresponding data frame can be determined by the content of the frame length overhead, and then the content of the frame length overhead can be used as the length of the data frame to determine the new expected frame positioning overhead position, and the length of the data frame is moved backward at the current expected frame positioning overhead position as the new expected frame positioning overhead position, and the above-mentioned backward movement is to move in the direction of the data frame that has not been received. In this way, after receiving the next data frame, the above-mentioned operation can be continued to be performed to check whether there is fixed bit information at the new expected frame positioning overhead position, so as to determine whether the frame positioning overhead of a new data frame is at the new expected frame positioning overhead position.

[0045] When the first command does not carry a numerical value for indicating the second length and the receiving end does not find the fixed bit information at the expected frame positioning overhead position, the content of the frame length overhead of the current data frame is invalid, and the receiving end can use the content when the frame length overhead was valid last time as the length of the data frame. The receiving end re-searches for the fixed bit information in all received bits. After finding the fixed bit information, the content when the frame length overhead was valid last time can be used as the length of the data frame, and the content when the frame length overhead was valid last time is moved backward at the position of the fixed bit information as the new expected frame positioning overhead position. In this way, the above operations can be continued to check whether there is fixed bit information at the new expected frame positioning overhead position, thereby determining whether the frame positioning overhead of a new data frame is at the new expected frame positioning overhead position.

[0046] In one implementation, when the first command carries the value indicating the second length and the receiving end finds the fixed bit information in the expected frame alignment overhead position, the content of the frame length overhead is valid, and the receiving end uses the content of the frame length overhead as the length of the data frame, and moves the expected frame alignment overhead position backward by the length of the data frame as the new expected frame alignment overhead position;

[0047] When the first command carries the numerical value indicating the second length and the receiving end fails to find the fixed bit information in the expected frame alignment overhead position, the content of the frame length overhead is invalid, and the receiving end uses the second length as the length of the data frame and re-searches for the expected frame alignment overhead position based on the fixed bit information and the length of the data frame.

[0048] Specifically, after the controller sends the first command to the receiving end, when the first command carries a value for indicating the second length and the receiving end finds the fixed bit information at the expected frame positioning overhead position, the content of the frame length overhead of the data frame where the current expected frame positioning overhead position is located is valid, and the length of the corresponding data frame can be determined by the content of the frame length overhead, and then the content of the frame length overhead can be used as the length of the data frame to determine the new expected frame positioning overhead position, and the length of the data frame is moved backward at the current expected frame positioning overhead position as the new expected frame positioning overhead position, and the above-mentioned backward movement is to move in the direction of the data frame that has not been received. In this way, after receiving the next data frame, the above-mentioned operation can be continued to be performed to check whether there is fixed bit information at the new expected frame positioning overhead position, so as to determine whether the frame positioning overhead of a new data frame is at the new expected frame positioning overhead position.

[0049] When the first command carries a numerical value indicating the second length and the receiving end has not found the fixed bit information at the expected frame positioning overhead position, the content of the frame length overhead of the current data frame is invalid, and the receiving end can use the second length as the length of the data frame. The receiving end re-searches for the fixed bit information in the received bits. After finding the fixed bit information, the second length can be used as the length of the data frame, and the second length is moved backward at the position of the fixed bit information as the new expected frame positioning overhead position. In this way, the above operations are continued to be performed to check whether the fixed bit information exists at the new expected frame positioning overhead position, thereby determining whether the frame positioning overhead of a new data frame is at the new expected frame positioning overhead position.

[0050] In one implementation, the second command carries a value indicating the second length, and after sending the second command to the sending end, the method further includes:

[0051] The transmitting end writes the value of the second length into the frame length overhead, and uses the second length as the length of the data frame.

[0052] Specifically, the second command sent by the controller carries a numerical value of the second length. After the controller sends the second command to the sending end, the sending end can write the numerical value of the second length into the frame length overhead of the data frame during the process of generating the data frame, and use the second length as the length of the generated data frame. In this way, after the receiving end first receives the first command, and then the sending end receives the second command, the length of the generated data frame is changed to the second length. The sending end and the receiving end can change the frame length at the same time, ensuring that the data frame can be correctly identified during the data frame length switching process, thereby realizing lossless switching of the data frame length.

[0053] In one implementation, after sending the third command to the receiving end, the method further includes:

[0054] The receiving end uses the second length as the length of the data frame, and determines the expected frame alignment overhead position of the data frame according to the length of the data frame and the content of the frame alignment overhead position.

[0055] Specifically, after the controller sends the third command to the receiving end, since the third command carries the value of the second length, the receiving end uses the second length as the length of all received data frames, determines the expected frame positioning overhead position of the data frame according to the length of the data frame and the fixed bit information, and checks whether there is fixed bit information at the expected frame positioning overhead position, thereby determining whether the frame positioning overhead of the data frame is at the expected frame positioning overhead position.

[0056] In one implementation, the method further includes:

[0057] When the receiving end receives the first command, it returns a response message indicating that the first command has been successfully executed; when the sending end receives the second command, it returns a response message indicating that the second command has been successfully executed; when the receiving end receives the third command, it returns a response message indicating that the third command has been successfully executed.

[0058] Specifically, when the receiving end receives the first command, it can return a response message indicating that the first command has been successfully executed to the controller. When the sending end receives the second command, it can return a response message indicating that the second command has been successfully executed to the controller. When the receiving end receives the third command, it can return a response message indicating that the third command has been successfully executed to the controller.

[0059] In this way, the controller can determine whether the receiving end successfully executes the first command or the third command based on whether the response information sent by the receiving end is received, and can also determine whether the sending end successfully executes the second command based on whether the response information sent by the sending end is received.

[0060] In one implementation, after sending the first command to the receiving end, the method further includes:

[0061] The controller waits until receiving a response message that the first command is successfully executed, and then determines that the receiving end has successfully executed the first command, or waits until a preset time has expired without receiving a response message that the first command is successfully executed; the controller determines that the receiving end has failed to execute the first command if it has sent the first command a preset number of times and has not received a response message that the first command is successfully executed within the preset time after each sending of the first command; after sending a second command to the sending end, the method further includes: the controller waits until receiving a response message that the second command is successfully executed, and then determines that the sending end has successfully executed the second command, or waits until the preset time has expired without receiving a response message that the second command is successfully executed; the controller After the controller sends the second command for the preset number of times and does not receive a response message that the second command is successfully executed within the preset time after each sending of the second command, it is determined that the sending end has failed to execute the second command; after sending a third command to the receiving end, the method also includes: the controller waits until a response message that the third command is successfully executed is received, and then determines that the receiving end has successfully executed the third command or waits until the preset time is reached without receiving a response message that the third command is successfully executed; after the controller sends the third command for the preset number of times and does not receive a response message that the third command is successfully executed within the preset time after each sending of the third command, it is determined that the receiving end has failed to execute the third command.

[0062] Specifically, after sending the first command to the receiving end, the controller can wait until it receives a response message indicating that the first command is successfully executed, and then it can be determined that the receiving end has successfully executed the first command, or it can wait until a preset time is reached and if no response message indicating that the first command is successfully executed is received, then it can resend the first command to the receiving end. After sending the first command a preset number of times and if no response message indicating that the first command is successfully executed is received within a preset time after each sending of the first command, the controller can determine that the receiving end has failed to execute the first command. In this way, the controller can determine whether the receiving end has successfully executed the first command after determining whether it has received a response message indicating that the first command is successfully executed from the receiving end. The above-mentioned preset time and preset number of times can be set according to actual needs and are not specifically limited here.

[0063] After sending the second command to the sending end, the controller may wait until receiving a response message indicating that the second command is successfully executed, and may determine that the sending end has successfully executed the second command, or wait until a preset time has passed without receiving a response message indicating that the second command is successfully executed, and then resend the second command to the sending end. After the controller sends the second command a preset number of times and does not receive a response message indicating that the second command is successfully executed within a preset time after each sending of the second command, it is determined that the sending end has failed to execute the second command. In this way, the controller can determine whether the sending end has successfully executed the second command after determining whether it has received a response message indicating that the second command is successfully executed sent by the sending end.

[0064] After sending the third command to the receiving end, the controller may wait until receiving a response message indicating that the third command is successfully executed, and then determine that the receiving end has successfully executed the third command, or wait until a preset time has passed and if no response message indicating that the third command is successfully executed is received, then the controller may resend the third command to the receiving end. After the controller sends the third command a preset number of times and does not receive a response message indicating that the third command is successfully executed within a preset time after each sending of the third command, it may be determined that the receiving end has failed to execute the third command. In this way, the controller may determine whether the receiving end has successfully executed the third command when determining whether a response message indicating that the third command sent by the receiving end is successfully executed is received.

[0065] In one implementation, after sending the third command to the receiving end, the method further includes:

[0066] The controller determines that the length of the data frame is successfully changed from the first length to the second length after determining that the receiving end has successfully executed the third command; the controller determines that the length of the data frame is failed to change from the first length to the second length after determining that the receiving end has failed to execute the first command, that the sending end has failed to execute the second command, or that the receiving end has failed to execute the third command.

[0067] Specifically, after the controller determines that the receiving end has successfully executed the third command, it can determine that the sending end has sent a data frame with a second length. The receiving end can also use the second length as the length of the received data frame, and then frame the received data frame. In this way, it can be determined that the length of the data frame has been successfully changed from the first length to the second length.

[0068] In addition, after the controller determines that the receiving end fails to execute the first command, determines that the sending end fails to execute the second command, or determines that the receiving end fails to execute the third command, it can determine that changing the length of the data frame from the first length to the second length fails.

[0069] It should be noted that the method for changing the length of a data frame provided in the embodiment of the present application can be executed by a device for changing the length of a data frame, or a control module in the device for changing the length of a data frame for executing the method for changing the length of a data frame. In the embodiment of the present application, the device for changing the length of a data frame provided in the embodiment of the present application is described by taking the method for changing the length of a data frame performed by the device for changing the length of a data frame as an example.

[0070] Figure 2 is a schematic diagram of the structure of a system for changing the length of a data frame according to an embodiment of the present application. Figure 2 As shown, the system 200 for changing the length of a data frame includes: a controller 210 , a receiving end 220 and a transmitting end 230 .

[0071] When determining that the length of the data frame is changed from the first length to the second length, the controller 210 sends a first command to the receiving end 220, wherein the first command is used to instruct the receiving end 220 to determine the length of the received data frame according to the frame length overhead in the data frame, the data frame includes the frame length overhead, and the frame length overhead is used to indicate the length of the data frame, the transmitting end 230 is used to send the data frame, and the receiving end 220 is used to receive the data frame sent by the transmitting end 230; when determining that the receiving end 220 executes the first command successfully, the controller 210 sends a second command to the transmitting end 230, wherein the second command carries a value indicating the second length, and the second command is used to instruct the length of the data frame sent by the transmitting end 230 to change to the second length; when determining that the transmitting end 230 executes the second command successfully, the controller 210 sends a third command to the receiving end 220, wherein the third command carries a value of the second length, and the third command is used to instruct the receiving end 220 to determine the length of the received data frame according to the second length.

[0072] In one implementation, the data frame also includes a frame length overhead, the content of the frame length overhead is used to determine the length of the data frame where the frame length overhead is located, and the transmitting end 230 writes the length of the data frame into the frame length overhead according to the length of the data frame currently being sent; the data frame also includes a frame positioning overhead, the content of the frame positioning overhead is fixed bit information, the transmitting end 230 fixedly writes the fixed bit information into the frame positioning overhead, and the receiving end 220 determines the expected frame positioning overhead position of the data frame according to the length of the data frame and the content of the frame positioning overhead.

[0073] In one implementation, when the receiving end 220 fails to find the fixed bit information at the expected frame positioning overhead position, the expected frame positioning overhead position is re-searched based on the fixed bit information and the length of the data frame; when the receiving end 220 finds the fixed bit information at the expected frame positioning overhead position, the expected frame positioning overhead position is used as the frame positioning overhead position, and the expected frame positioning overhead position is moved backward by the length of the data frame as the new expected frame positioning overhead position; when the receiving end 220 finds the fixed bit information at the expected frame positioning overhead position, the content of all overheads of the data frame is valid content; when the receiving end 220 fails to find the fixed bit information at the expected frame positioning overhead position, the content of all overheads of the data frame is invalid content.

[0074] In one implementation, the receiving end 220 searches for the fixed bit information in all received bits until the fixed bit information is found; after finding the fixed bit information, the position of the fixed bit information is moved backward by the length of the data frame as the expected frame positioning overhead position.

[0075] In one implementation, when the first command does not carry the numerical value for indicating the second length and the receiving end 220 finds the fixed bit information at the expected frame positioning overhead position, the content of the frame length overhead is valid, and the receiving end 220 uses the content of the frame length overhead as the length of the data frame, and moves the expected frame positioning overhead position backward by the length of the data frame as the new expected frame positioning overhead position; when the first command does not carry the numerical value for indicating the second length and the receiving end 220 does not find the fixed bit information at the expected frame positioning overhead position, the content of the frame length overhead is invalid, and the receiving end 220 uses the content of the frame length overhead when it was valid last time as the length of the data frame, and re-searches for the expected frame positioning overhead position based on the fixed bit information and the length of the data frame.

[0076] In one implementation, when the first command carries the value used to indicate the second length and the receiving end 220 finds the fixed bit information in the expected frame positioning overhead position, the content of the frame length overhead is valid, and the receiving end 220 uses the content of the frame length overhead as the length of the data frame, and moves the expected frame positioning overhead position backward by the length of the data frame as the new expected frame positioning overhead position; when the first command carries the value used to indicate the second length and the receiving end 220 does not find the fixed bit information in the expected frame positioning overhead position, the content of the frame length overhead is invalid, and the receiving end 220 uses the second length as the length of the data frame, and re-searches for the expected frame positioning overhead position based on the fixed bit information and the length of the data frame.

[0077] In one implementation, the transmitter 230 writes the value of the second length into the frame length overhead, and uses the second length as the length of the data frame.

[0078] In one implementation, the receiving end 220 uses the second length as the length of the data frame, and determines the expected frame alignment overhead position of the data frame according to the length of the data frame and the content of the frame alignment overhead position.

[0079] In one implementation, when the receiving end 220 receives the first command, it returns a response message indicating that the first command has been successfully executed; when the sending end 230 receives the second command, it returns a response message indicating that the second command has been successfully executed; when the receiving end 220 receives the third command, it returns a response message indicating that the third command has been successfully executed.

[0080] In one implementation, the controller 210 waits until receiving a response message indicating that the first command is successfully executed, and then determines that the receiving end 220 has successfully executed the first command or waits until a preset time has expired without receiving a response message indicating that the first command is successfully executed; the controller 210 determines that the receiving end 220 has failed to execute the first command if it has not received a response message indicating that the first command is successfully executed after sending the first command a preset number of times and within the preset time after each sending of the first command; the controller 210 waits until receiving a response message indicating that the second command is successfully executed, and then determines that the sending end 230 has successfully executed the second command or waits until the preset time has expired without receiving a response message indicating that the second command is successfully executed. ; After the controller 210 sends the second command for the preset number of times and does not receive a response message indicating the successful execution of the second command within the preset time after each sending of the second command, it is determined that the sending end 230 fails to execute the second command; The controller 210 waits until a response message indicating the successful execution of the third command is received, and then it is determined that the receiving end 220 successfully executes the third command or waits until the preset time is reached without receiving a response message indicating the successful execution of the third command; After the controller 210 sends the third command for the preset number of times and does not receive a response message indicating the successful execution of the third command within the preset time after each sending of the third command, it is determined that the receiving end 220 fails to execute the third command.

[0081] In one implementation, the controller 210 determines that the length of the data frame is successfully changed from the first length to the second length after determining that the receiving end 220 has successfully executed the third command; the controller 210 determines that the length of the data frame is failed to be changed from the first length to the second length after determining that the receiving end 220 has failed to execute the first command, determining that the sending end 230 has failed to execute the second command, or determining that the receiving end 220 has failed to execute the third command.

[0082] The system for changing the length of a data frame provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0083] Alternatively, if Figure 3As shown, an embodiment of the present application further provides an electronic device 300, including a processor 301 and a memory 302, wherein the memory 302 stores a program or instruction that can be run on the processor 301, and the program or instruction is implemented when the processor 301 executes: when the controller determines to change the length of the data frame from the first length to the second length, the controller sends a first command to the receiving end, wherein the first command is used to instruct the receiving end to determine the length of the received data frame according to the frame length overhead in the data frame, the data frame includes the frame length overhead, and the frame length overhead is used to indicate the length of the data frame, and the sending end is used to send the data frame, The receiving end is used to receive the data frame sent by the sending end; when the controller determines that the receiving end executes the first command successfully, the controller sends a second command to the sending end, wherein the second command carries a value indicating the second length, and the second command is used to instruct the length of the data frame sent by the sending end to change to the second length; when the controller determines that the sending end executes the second command successfully, the controller sends a third command to the receiving end, wherein the third command carries the value of the second length, and the third command is used to instruct the receiving end to determine the length of the received data frame according to the second length.

[0084] In one implementation, the data frame also includes a frame length overhead, the content of which is used to determine the length of the data frame in which the frame length overhead is located, and the transmitting end writes the length of the data frame into the frame length overhead according to the length of the data frame currently being sent; the data frame also includes a frame alignment overhead, the content of which is fixed bit information, and the transmitting end fixedly writes the fixed bit information into the frame alignment overhead, and the receiving end determines the expected frame alignment overhead position of the data frame according to the length of the data frame and the content of the frame alignment overhead, and determines whether the frame alignment overhead of the data frame is at the expected frame alignment overhead position.

[0085] In one implementation, when the receiving end fails to find the fixed bit information at the expected frame positioning overhead position, the expected frame positioning overhead position is re-searched based on the fixed bit information and the length of the data frame; when the receiving end finds the fixed bit information at the expected frame positioning overhead position, the expected frame positioning overhead position is used as the frame positioning overhead position, and the expected frame positioning overhead position is moved backward by the length of the data frame as the new expected frame positioning overhead position; when the receiving end finds the fixed bit information at the expected frame positioning overhead position, the content of all overheads of the data frame is valid content; when the receiving end fails to find the fixed bit information at the expected frame positioning overhead position, the content of all overheads of the data frame is invalid content.

[0086] In one implementation, the data frame also includes a frame length overhead, and the content of the frame length overhead is used to determine the length of the data frame where the frame length overhead is located. The sending end writes the length of the data frame into the frame length overhead based on the length of the data frame currently being sent; the receiving end searches for the fixed bit information in all received bits until the fixed bit information is found; after finding the fixed bit information, the position of the fixed bit information is moved backward by the length of the data frame as the expected frame positioning overhead position.

[0087] In one implementation, after sending a first command to the receiving end, when the first command does not carry the numerical value for indicating the second length and the receiving end finds the fixed bit information in the expected frame positioning overhead position, the content of the frame length overhead is valid, and the receiving end uses the content of the frame length overhead as the length of the data frame, and moves the expected frame positioning overhead position backward by the length of the data frame as the new expected frame positioning overhead position; when the first command does not carry the numerical value for indicating the second length and the receiving end does not find the fixed bit information in the expected frame positioning overhead position, the content of the frame length overhead is invalid, and the receiving end uses the content of the frame length overhead when it was valid last time as the length of the data frame, and re-searches for the expected frame positioning overhead position based on the fixed bit information and the length of the data frame.

[0088] In one implementation, after sending a first command to the receiving end, when the first command carries the numerical value indicating the second length and the receiving end finds the fixed bit information in the expected frame positioning overhead position, the content of the frame length overhead is valid, and the receiving end uses the content of the frame length overhead as the length of the data frame, and moves the expected frame positioning overhead position backward by the length of the data frame as the new expected frame positioning overhead position; when the first command carries the numerical value indicating the second length and the receiving end does not find the fixed bit information in the expected frame positioning overhead position, the content of the frame length overhead is invalid, and the receiving end uses the second length as the length of the data frame, and re-searches for the expected frame positioning overhead position based on the fixed bit information and the length of the data frame.

[0089] In one implementation, the second command carries a value indicating the second length. After sending the second command to the sending end, the sending end writes the value of the second length in the frame length overhead and uses the second length as the length of the data frame.

[0090] In one implementation, after sending the third command to the receiving end, the receiving end uses the second length as the length of the data frame, and determines the expected frame alignment overhead position of the data frame based on the length of the data frame and the content of the frame alignment overhead position.

[0091] In one implementation, when the receiving end receives the first command, it returns a response message indicating that the first command has been successfully executed; when the sending end receives the second command, it returns a response message indicating that the second command has been successfully executed; when the receiving end receives the third command, it returns a response message indicating that the third command has been successfully executed.

[0092] In one implementation, after sending the first command to the receiving end, the controller waits until it receives a response message indicating that the first command is successfully executed, and then determines that the receiving end has successfully executed the first command or has waited until a preset time has expired without receiving a response message indicating that the first command is successfully executed; if the controller has sent the first command a preset number of times and has not received a response message indicating that the first command is successfully executed within the preset time after each sending of the first command, then it determines that the receiving end has failed to execute the first command; if the controller waits until it receives a response message indicating that the second command is successfully executed, then it determines that the sending end has successfully executed the second command or has waited until the preset time has expired without receiving the second command a response message of successful execution; after the controller sends the second command for the preset number of times and does not receive a response message of successful execution of the second command within the preset time after each sending of the second command, it is determined that the sending end has failed to execute the second command; the controller waits until a response message of successful execution of the third command is received, then it is determined that the receiving end has successfully executed the third command or waits until the preset time is reached without receiving a response message of successful execution of the third command; after the controller sends the third command for the preset number of times and does not receive a response message of successful execution of the third command within the preset time after each sending of the third command, it is determined that the receiving end has failed to execute the third command.

[0093] In one implementation, after sending the third command to the receiving end, the controller determines that the length of the data frame is successfully changed from the first length to the second length after determining that the receiving end successfully executes the third command; the controller determines that the length of the data frame is failed to be changed from the first length to the second length after determining that the receiving end fails to execute the first command, determines that the sending end fails to execute the second command, or determines that the receiving end fails to execute the third command.

[0094] The specific execution steps can refer to the various steps of the above-mentioned method embodiment for changing the data frame length, and can achieve the same technical effect. To avoid repetition, they will not be repeated here.

[0095] It should be noted that the electronic devices in the embodiments of the present application include: servers, terminals, or other devices except terminals.

[0096] The above electronic device structure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, the input unit may include a graphics processing unit (GPU) and a microphone, and the display unit may be configured with a display panel in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit includes a touch panel and at least one of other input devices. The touch panel is also called a touch screen. Other input devices may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0097] The memory can be used to store software programs and various data. The memory may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory may include a volatile memory or a non-volatile memory, or the memory may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DRRAM).

[0098] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor.

[0099] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned method embodiment for changing the length of a data frame are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0100] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as ROM, RAM, magnetic disk or optical disk.

[0101] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0102] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0103] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for changing the length of a data frame, characterized in that: include: When determining to change the length of the data frame from the first length to the second length, the controller sends a first command to the receiving end, wherein the first command is used to instruct the receiving end to determine the length of the received data frame according to the frame length overhead in the data frame, the data frame includes the frame length overhead, the frame length overhead is used to indicate the length of the data frame, the sending end is used to send the data frame, and the receiving end is used to receive the data frame sent by the sending end; When determining that the receiving end executes the first command successfully, the controller sends a second command to the sending end, wherein the second command carries a value indicating the second length, and the second command is used to instruct the length of the data frame sent by the sending end to change to the second length; When determining that the sending end executes the second command successfully, the controller sends a third command to the receiving end, wherein the third command carries the value of the second length, and the third command is used to instruct the receiving end to determine the length of the received data frame according to the second length.

2. The method according to claim 1, characterized in that The data frame also includes a frame length overhead, and the content of the frame length overhead is used to determine the length of the data frame where the frame length overhead is located. The transmitting end writes the length of the data frame into the frame length overhead according to the length of the data frame currently being sent; The data frame also includes a frame alignment overhead, the content of the frame alignment overhead is fixed bit information, the sending end fixedly writes the fixed bit information in the frame alignment overhead, and the receiving end determines the expected frame alignment overhead position of the data frame based on the length of the data frame and the content of the frame alignment overhead.

3. The method according to claim 2, characterized in that The receiving end determines the expected frame alignment overhead position of the data frame according to the length of the data frame and the content of the frame alignment overhead, including: When the receiving end fails to find the fixed bit information in the expected frame alignment overhead position, re-searching the expected frame alignment overhead position according to the fixed bit information and the length of the data frame; When the receiving end finds the fixed bit information at the expected frame alignment overhead position, the expected frame alignment overhead position is used as the frame alignment overhead position, and the expected frame alignment overhead position is shifted backward by the length of the data frame as the new expected frame alignment overhead position; When the receiving end finds the fixed bit information at the expected frame alignment overhead position, the contents of all the overheads of the data frame are valid contents; When the receiving end fails to find the fixed bit information at the expected frame alignment overhead position, the contents of all the overheads of the data frame are invalid contents.

4. The method according to claim 3, characterized in that The re-searching the expected frame alignment overhead position according to the fixed bit information and the length of the data frame includes: The receiving end searches for the fixed bit information in all received bits until the fixed bit information is found; After finding the fixed bit information, the position of the fixed bit information is moved backward by the length of the data frame as the expected frame alignment overhead position.

5. The method according to claim 4, characterized in that After sending the first command to the receiving end, the method further includes: When the first command does not carry the value for indicating the second length and the receiving end finds the fixed bit information in the expected frame alignment overhead position, the content of the frame length overhead is valid, the receiving end uses the content of the frame length overhead as the length of the data frame, and moves the expected frame alignment overhead position backward by the length of the data frame as the new expected frame alignment overhead position; When the first command does not carry the numerical value for indicating the second length and the receiving end does not find the fixed bit information in the expected frame alignment overhead position, the content of the frame length overhead is invalid, and the receiving end uses the content when the frame length overhead was last valid as the length of the data frame, and re-searches for the expected frame alignment overhead position based on the fixed bit information and the length of the data frame.

6. The method according to claim 4, characterized in that After sending the first command to the receiving end, the method further includes: When the first command carries the value indicating the second length and the receiving end finds the fixed bit information in the expected frame alignment overhead position, the content of the frame length overhead is valid, and the receiving end uses the content of the frame length overhead as the length of the data frame, and moves the expected frame alignment overhead position backward by the length of the data frame as the new expected frame alignment overhead position; When the first command carries the numerical value indicating the second length and the receiving end fails to find the fixed bit information in the expected frame alignment overhead position, the content of the frame length overhead is invalid, and the receiving end uses the second length as the length of the data frame and re-searches for the expected frame alignment overhead position based on the fixed bit information and the length of the data frame.

7. The method according to claim 2, wherein the second command carries a value indicating the second length, and after sending the second command to the sending end, further comprising: The transmitting end writes the value of the second length into the frame length overhead, and uses the second length as the length of the data frame.

8. The method according to claim 4, characterized in that After sending the third command to the receiving end, the method further includes: The receiving end uses the second length as the length of the data frame, and determines the expected frame alignment overhead position of the data frame according to the length of the data frame and the content of the frame alignment overhead position.

9. The method according to claim 1, characterized in that: The method further comprises: When the receiving end receives the first command, the receiving end returns a response message that the first command is successfully executed; When the sending end receives the second command, the sending end returns a response message that the second command is successfully executed; When the receiving end receives the third command, the receiving end returns a response message indicating that the third command is successfully executed.

10. The method according to claim 9, characterized in that After the controller sends the first command to the receiving end, the method further includes: The controller waits until receiving a response message indicating that the first command is successfully executed, and then determines that the receiving end has successfully executed the first command, or waits until a preset time has expired without receiving a response message indicating that the first command is successfully executed; The controller determines that the receiving end fails to execute the first command if the controller fails to receive a response message of successful execution of the first command within the preset time after sending the first command for a preset number of times and each time after sending the first command; After sending the second command to the sending end, the method further includes: The controller waits until receiving a response message indicating that the second command is successfully executed, and then determines that the sending end has successfully executed the second command, or waits until the preset time has expired without receiving a response message indicating that the second command is successfully executed; After the controller sends the second command for the preset number of times and does not receive a response message indicating that the second command is successfully executed within the preset time after each sending of the second command, it is determined that the sending end fails to execute the second command; After sending the third command to the receiving end, the method further includes: The controller waits until receiving a response message indicating that the third command is successfully executed, and then determines that the receiving end has successfully executed the third command, or waits until the preset time has expired without receiving a response message indicating that the third command is successfully executed; After the controller sends the third command for the preset number of times and does not receive response information indicating successful execution of the third command within the preset time after each sending of the third command, it is determined that the receiving end fails to execute the third command.

11. The method according to claim 10, characterized in that After sending the third command to the receiving end, the method further includes: After determining that the receiving end executes the third command successfully, the controller determines that the length of the data frame is changed from the first length to the second length successfully; The controller determines that changing the length of the data frame from the first length to the second length fails after determining that the receiving end fails to execute the first command, determines that the sending end fails to execute the second command, or determines that the receiving end fails to execute the third command.

12. An electronic device, characterized in that: The electronic device includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the method for changing the data frame length as described in any one of claims 1 to 11 are implemented.

13. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the method for changing the data frame length as described in any one of claims 1-11 are implemented.

Citation Information

Patent Citations

  • Frame configuration method, device and system

    CN104079397A

  • Service data processing method and device

    CN111740782A

  • Adaptive variable frame length telemetry data framing method and system

    CN111740806A

  • Transmission performance protection method and system

    CN113541885A

  • Electronic device for transmitting / receiving data during UWB ranging, and method therefor

    WO2022231205A1

Cited By

  • Method for bandwidth reduction, and device

    WO2026124483A1