Scrambling method, descrambling method, scrambling circuit and descrambling circuit
By negotiating data transmission parameters between data transmission terminals and dynamically switching the scrambling code polynomial of the scrambling circuit, the problem of fixed channel scrambling code capability and clock recovery capability in the prior art is solved, and the adaptive scrambling solution of data sequences is realized , improves transmission flexibility and efficiency.
Patent Information
- Application Number
- CN202011409205.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-04
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2040-12-04
AI Technical Summary
The existing addition and descrambling technology cannot adapt to the needs of different transmission scenarios, resulting in fixed channel scrambling code capability and clock recovery capability, and cannot effectively suppress the length of 0 and 1 in the data sequence, increasing the risk of crosstalk between codes.
By negotiating data transmission parameters between the sending terminal and the receiving terminal, dynamically switching the scrambling code polynomial of the scrambling circuit, selecting the appropriate scrambling code polynomial and parallel bit width according to different data transmission rates and scenarios, realizing adaptive scrambling of the data sequence Reconcile.
It improves the clock recovery capability of data sequences, reduces inter-code crosstalk, enhances the flexibility and efficiency of data transmission, and reduces hardware resource consumption and power consumption.
Smart Images

Figure CN114598416B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data transmission, and in particular to a scrambling method, a descrambling method, a scrambling circuit, and a descrambling circuit. Background Art
[0002] In the process of digital signal transmission, if a certain data is transmitted for a long time, when the data remains unchanged for a long time, the shape of the 0 and 1 signals will not change, thus generating a series of relatively fixed frequency points and generating large external noise and electromagnetic interference. In order to prevent the data code stream from generating a sequence of long consecutive "1" and long consecutive "0" and to make the signal contain sufficient bit timing components, the signal must be scrambled before sending. Scrambling can not only improve the transmission characteristics of the signal, increase the conversion density of "0" and "1", and improve the confidentiality of the communication data, but also help the receiving end to recover the clock and reduce inter-code interference, thereby improving the accuracy of data reception.
[0003] Existing scrambling and descrambling technologies all use fixed scrambling polynomials and initial scrambling seeds to scramble signals, making the channel scrambling capability relatively fixed and the clock signal recovery capability fixed, so it is impossible to guarantee correct data recovery. In addition, different scrambling polynomials and scrambling seeds have different suppression effects on consecutive 0s and consecutive 1s and continuous repetition of fixed shapes. Different scenarios have different requirements for clock recovery and inter-code interference, so using fixed scrambling polynomials and initial scrambling seeds to scramble signals cannot meet the needs of various scenarios.
[0004] In addition, the prior art often uses a self-synchronous scrambling method and a frame-synchronous scrambling method for scrambling. However, when the self-synchronous scrambling method is used to scramble the signal, once an error occurs in the scrambled signal, the error rate of the signal received by the receiving end will double. When the frame-synchronous scrambling method is used for scrambling, an additional clock needs to be added for synchronization, and when the signal cannot be synchronized, synchronization must be re-established, resulting in additional hardware or software resource consumption. Summary of the invention
[0005] In view of the above, it is necessary to provide a scrambling method, a descrambling method, a scrambling circuit and a descrambling circuit to scramble the data sequence using different scrambling code polynomials in different transmission scenarios, enhance the ability to suppress the length of consecutive 0s and consecutive 1s in the data sequence, improve the clock recovery capability of the data sequence and reduce inter-code crosstalk.
[0006] In the first aspect, the first aspect of the present application provides a scrambling method, which is applied to a sending terminal, and the method includes: the sending terminal negotiates data transmission parameters with the receiving terminal, wherein the sending terminal and the receiving terminal are in a connected state; the sending terminal confirms the scrambling code polynomial according to the data transmission parameters; the sending terminal switches the scrambling circuit of the sending terminal according to the scrambling code polynomial so that the switched scrambling circuit has a circuit structure corresponding to the scrambling code polynomial; the sending terminal controls the switched scrambling circuit to scramble the data sequence to be scrambled to obtain a scrambled data sequence. Through the above technical solution, different scrambling code polynomials are used to scramble the data sequence in transmission scenarios with different data transmission parameters, and the ability to suppress the length of consecutive 0s and consecutive 1s in the data sequence is enhanced, the clock recovery capability of the data sequence is improved, and inter-code crosstalk is reduced.
[0007] In a possible implementation, the sending terminal confirming the scrambling code polynomial according to the data transmission parameters includes: the sending terminal obtaining the scrambling code polynomial from the data transmission parameters. Through the above technical solution, the sending terminal can obtain the scrambling code polynomial from the data transmission parameters.
[0008] In a possible implementation, the transmitting terminal confirms the scrambling polynomial according to the data transmission parameter, including: the transmitting terminal obtains the data transmission rate of the transmitting terminal, and determines the scrambling polynomial corresponding to the data transmission rate according to the data transmission rate and the first configuration relationship, wherein the first configuration relationship includes the correspondence between the data transmission rate and the scrambling polynomial. Through the above technical solution, it is realized that different scrambling polynomials are used to scramble the data sequence in transmission scenarios with different data transmission rates, the ability to suppress the length of consecutive 0s and consecutive 1s in the data sequence is enhanced, the clock recovery capability of the data sequence is improved, and the inter-code interference is reduced.
[0009] In a possible implementation, the transmitting terminal switches the scrambling circuit of the transmitting terminal according to the scrambling code polynomial so that the switched scrambling circuit has a circuit structure corresponding to the scrambling code polynomial, including: the transmitting terminal performs closing control and opening control on a switch in the scrambling circuit of the transmitting terminal according to the scrambling code polynomial so that the scrambling circuit switches to the circuit structure corresponding to the scrambling code polynomial. Through the above technical solution, the scrambling circuit automatically switches to the circuit structure corresponding to the scrambling code polynomial according to the scrambling code polynomial.
[0010] In a possible implementation, the transmitting terminal includes a plurality of the scrambling circuits, each of which has a scrambling code polynomial. The transmitting terminal switches the scrambling circuit of the transmitting terminal according to the scrambling code polynomial so that the switched scrambling circuit has a circuit structure corresponding to the scrambling code polynomial, including: the transmitting terminal selects a scrambling circuit having the scrambling code polynomial as the scrambling circuit of the transmitting terminal according to the scrambling code polynomial. Through the above technical solution, it is possible to select a scrambling circuit corresponding to the data transmission rate according to the data transmission rate for data scrambling, thereby realizing the use of different scrambling circuits to scramble the data sequence in transmission scenarios with different data transmission rates.
[0011] In a possible implementation, the transmitting terminal controls the switched scrambling circuit to scramble the data sequence to be scrambled to obtain the scrambled data sequence, including: the transmitting terminal scrambles the data sequence to be scrambled according to the formula The scrambled data sequence is calculated, wherein Bk is the input sequence to be scrambled, Ck is the scrambled data sequence, L is the highest order of the scrambling code polynomial, m is the number of D flip-flops in the scrambling code circuit, k is the sequence number of the data sequence to be scrambled, Dk-i is the output sequence of the i-th level D flip-flop in the scrambling code circuit, Ai is the feedback coefficient, which takes a value of 0 or 1, wherein Ai is 0, which means that the output sequence of the i-th level D flip-flop in the scrambling code circuit participates in the scrambling operation. Through the above technical solution, the data sequence to be scrambled can output a scrambled data sequence after the scrambling process of the scrambling circuit.
[0012] In a possible implementation, the negotiation of data transmission parameters between the sending terminal and the receiving terminal includes: the sending terminal sends the data transmission parameters to the receiving terminal; the receiving terminal determines whether to agree with the data transmission parameters; if the receiving terminal disagrees with the data transmission parameters, the receiving terminal modifies the data transmission parameters, stores the modified data transmission parameters, and sends a first confirmation code stream containing the modified data transmission parameters to the sending terminal; the sending terminal obtains the modified data transmission parameters from the first confirmation code stream, and updates the data transmission parameters with the modified data transmission parameters; or if the receiving terminal agrees with the data transmission parameters, the receiving terminal stores the data transmission parameters and sends a second confirmation code stream to the sending terminal. Through the above technical solution, the sending terminal and the receiving terminal can negotiate data transmission parameters.
[0013] In a possible implementation, the method further includes: the sending terminal sending the scrambled data sequence to the receiving terminal. Through the above technical solution, the scrambled data sequence can be transmitted from the sending terminal to the receiving terminal.
[0014] In a possible implementation, the sending terminal sending the scrambled data sequence to the receiving terminal includes: the sending terminal obtaining the parallel bit width from the data transmission parameter; the sending terminal sending the scrambled data sequence to the receiving terminal according to the parallel bit width. Through the above technical solution, when the scrambled data sequence performs data transmission rate switching, there is no need to change the clock frequency of the scrambling circuit, which can reduce power consumption and hardware costs.
[0015] In a possible implementation, after the transmitting terminal switches the scrambling circuit of the transmitting terminal according to the scrambling code polynomial so that the switched scrambling circuit has a circuit structure corresponding to the scrambling code polynomial, the method further includes: the transmitting terminal obtains a scrambling code seed from the data transmission parameter; and performs pre-scrambling using the scrambling code seed as an initial value of the scrambling circuit. The above technical solution can realize pre-scrambling of the scrambling circuit.
[0016] In the second aspect, the embodiment of the present application provides a descrambling method, which is applied in a receiving terminal, and the descrambling method includes: the receiving terminal confirms the scrambling code polynomial according to the data transmission parameters sent by the sending terminal; the receiving terminal switches the descrambling circuit of the receiving terminal according to the scrambling code polynomial so that the descrambling circuit has a circuit structure corresponding to the scrambling code polynomial; the receiving terminal receives the scrambled data sequence sent by the sending terminal, and descrambles the scrambled data sequence according to the switched descrambling circuit. Through the above technical solution, it is realized that different scrambling code polynomials are used to descramble the data sequence in the transmission scenarios of different data transmission parameters, and the ability to suppress the length of consecutive 0s and consecutive 1s in the data sequence is enhanced, the clock recovery capability of the data sequence is improved, and the inter-code interference is reduced.
[0017] In a possible implementation, the receiving terminal switches the descrambling circuit of the receiving terminal according to the scrambling polynomial so that the descrambling circuit has a circuit structure corresponding to the scrambling polynomial, including: the receiving terminal performs closing control and opening control on a switch in the descrambling circuit according to the scrambling polynomial so that the descrambling circuit switches to the circuit structure corresponding to the scrambling polynomial. Through the above technical solution, the descrambling circuit automatically switches to the circuit structure corresponding to the scrambling polynomial according to the scrambling polynomial.
[0018] In a possible implementation, the method further includes: the receiving terminal obtaining a scrambling code seed from the data transmission parameter; and performing pre-descrambling using the scrambling code seed as an initial value of the descrambling circuit. Through the above technical solution, pre-descrambling of the descrambling circuit can be achieved.
[0019] In a third aspect, an embodiment of the present application provides a scrambling circuit, including a linear feedback shift register and a switch group, the linear feedback shift register including a D flip-flop group and an XOR gate circuit group, the D flip-flop group including M D flip-flops, the M D flip-flops of the D flip-flop group are connected in series to form the 1st to the Mth level D flip-flops, M is a positive integer greater than or equal to 1, and the output end of each level of the D flip-flops in the 1st to the Mth level D flip-flops is respectively connected to the input end of a first XOR gate circuit in the XOR gate circuit group through a switch in the switch group. In the embodiment of the present application, by setting the opening and closing of each switch in the scrambling circuit, the scrambling code polynomial of the scrambling circuit can be switched.
[0020] In a possible implementation, the linear feedback shift register further includes an input terminal, a feedback terminal, an output terminal and a second XOR gate circuit, the input terminal is connected to the data sequence, the input terminal and the feedback terminal of the linear feedback shift register are connected to the two input terminals of the second XOR gate circuit, the output terminal of the second XOR gate circuit is respectively connected to the input terminal of the first-stage D flip-flop and the output terminal of the linear feedback shift register, the output data of the output terminal of the first-stage D flip-flop to the M-stage D flip-flop is XOR-operated through all the first XOR gate circuits to obtain an XOR operation result, and the XOR operation result is used as the output result of the feedback terminal. Through the above technical solution, the terminal device based on the Ethernet communication protocol can realize data scrambling through the scrambling circuit of the above structure.
[0021] In a possible implementation, the scrambling circuit is a scrambling circuit with a self-synchronous scrambling structure. Through the above technical solution, the scrambled data sequence obtained by scrambling the data sequence by the scrambling circuit itself carries synchronization information, so the scrambling circuit does not need to add an additional synchronization mechanism.
[0022] In a possible implementation, the linear feedback shift register further includes an input terminal, a feedback terminal, an output terminal and a second XOR gate circuit, the input terminal of the linear feedback shift register is connected to a data sequence, the output terminal of the Mth level D flip-flop and the input terminal of the linear feedback shift register are respectively connected to two input terminals of the second XOR gate circuit, the output terminal of the second XOR gate circuit is connected to the output terminal of the linear feedback shift register, the output data of the output terminal of the first level D flip-flop to the output terminal of the Mth level D flip-flop is XOR-operated through all the first XOR gate circuits to obtain an XOR operation result, the XOR operation result is used as the output result of the feedback terminal, and the feedback terminal is connected to the input terminal of the first level D flip-flop. Through the above technical solution, a terminal device based on the C / D-PHY communication protocol, a terminal device based on the M-PHY communication protocol or a terminal device based on the CEDI-PHY communication protocol can realize data scrambling through the scrambling circuit of the above structure.
[0023] In a possible implementation, the scrambling circuit is a scrambling circuit of a frame synchronization scrambling structure. Through the above technical solution, the scrambled data sequence obtained by scrambling by the scrambling circuit can avoid the problem of error rate doubling during transmission.
[0024] In a fourth aspect, an embodiment of the present application provides a descrambling circuit, including a linear feedback shift register, the descrambling circuit also includes a switch group, the linear feedback shift register includes a D flip-flop group and an XOR gate circuit group, the D flip-flop group includes M D flip-flops, the M D flip-flops of the D flip-flop group are connected in series to form the 1st to Mth level D flip-flops, M is a positive integer greater than or equal to 1, and the output end of each level of the D flip-flops in the 1st to Mth level D flip-flops is respectively connected to the input end of a first XOR gate circuit in the XOR gate circuit group through a switch in the switch group. In the embodiment of the present application, by setting the opening and closing of each switch in the descrambling circuit, the scrambling code polynomial of the scrambling circuit can be switched.
[0025] In a possible implementation, the linear feedback shift register further includes an input terminal, a feedback terminal, an output terminal and a second XOR gate circuit, the input terminal is connected to the scrambled data sequence, the input terminal and the feedback terminal of the linear feedback shift register are respectively connected to the two input terminals of the second XOR gate circuit, the output terminal of the second XOR gate circuit is connected to the output terminal of the linear feedback shift register, the output data of the output terminal of the 1st level D flip-flop to the Mth level D flip-flop is XOR-operated through all the first XOR gate circuits to obtain an XOR operation result, and the XOR operation result is used as the output result of the feedback terminal. Through the above technical solution, the terminal device based on the Ethernet communication protocol can realize data scrambling through the descrambling circuit of the above structure.
[0026] In a possible implementation, the descrambling circuit is a descrambling circuit with a self-synchronous scrambling structure. Through the above technical solution, the descrambling circuit descrambles the scrambled data sequence to obtain a data sequence that carries synchronization information, so that the descrambling circuit does not need to add an additional synchronization mechanism.
[0027] In a possible implementation, the linear feedback shift register further includes an input terminal, a feedback terminal, an output terminal and a second XOR gate circuit, the input terminal of the linear feedback shift register is connected to the data sequence, the output terminal of the Mth level D flip-flop and the input terminal of the linear feedback shift register are respectively connected to the two input terminals of the second XOR gate circuit, the output terminal of the second XOR gate circuit is connected to the output terminal of the linear feedback shift register, the output data of the output terminal of the first level D flip-flop to the output terminal of the Mth level D flip-flop is XOR-operated through all the first XOR gate circuits to obtain an XOR operation result, the XOR operation result is used as the output result of the feedback terminal, and the feedback terminal is connected to the input terminal of the first level D flip-flop. Through the above technical solution, a terminal device based on the C / D-PHY communication protocol, a terminal device based on the M-PHY communication protocol or a terminal device based on the CEDI-PHY communication protocol can realize descrambling of the scrambled data sequence through the descrambling circuit of the above structure.
[0028] In a possible implementation, the descrambling circuit is a descrambling circuit of a frame synchronization scrambling structure. Through the above technical solution, descrambling the scrambled data sequence by the descrambling circuit of the above structure can avoid the problem of error rate doubling in the descrambled data sequence. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 This is a schematic diagram of a process of sending a data sequence by a sending terminal in an embodiment of the present application;
[0030] Figure 2 A schematic diagram of a shift register in an embodiment of the present application;
[0031] Figure 3A-3B This is an application scenario diagram of the scrambling method in one embodiment of the present application;
[0032] Figure 4 This is a flow chart of a scrambling method in one embodiment of the present application;
[0033] Figure 5 This is a structural diagram of an application environment of a scrambling method in an embodiment of the present application;
[0034] Figure 6 This is a flow chart of a sending terminal and a receiving terminal negotiating data transmission parameters in an embodiment of the present application;
[0035] Figure 7A-7B This is a schematic diagram of the structure of a scrambling circuit in another embodiment of the present application;
[0036] Figure 8 This is a flow chart of a scrambling method in another embodiment of the present application;
[0037] Fig. 9 This is a flow chart of a scrambling method in another embodiment of the present application;
[0038] Fig.10 This is a flow chart of a scrambling method in another embodiment of the present application;
[0039] Fig.11 This is a flowchart of a descrambling method in an embodiment of the present application;
[0040] Fig.12 This is a schematic diagram of the structure of the descrambling circuit in an embodiment of the present application;
[0041] Fig.13 This is a flowchart of a descrambling method in another embodiment of the present application;
[0042] Fig.14 This is a flowchart of a descrambling method in another embodiment of the present application;
[0043] Fig.15 Schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.
[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field in this application. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. It should be understood that, unless otherwise specified in this application, " / " means or. For example, A / B can represent A or B. "And / or" in this application is only a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. "At least one" means one or more. "Multiple" means two or more than two. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, a, b and c seven situations.
[0046] During the transmission of a data sequence, if the "0" and "1" sequences remain unchanged for a long time, not only will the data sequence generate large external noise and electromagnetic interference, and generate inter-code crosstalk, but the data sequence will also lack a bit timing component, making it difficult for the data sequence to be accurately received at the receiving end. Therefore, the data sequence needs to be scrambled before transmission to increase the conversion density of the "0" and "1" signals. Data scrambling is to perform an XOR operation on the original data sequence and the scrambling code generated by the scrambling circuit (scrambler) to generate a pseudo-random sequence (scrambled data sequence) with white noise characteristics, so that the scrambled pseudo-random sequence can change continuously, so as not to cause continuous repetition of "0" and "1" sequences. Reference Figure 1 , which is a schematic diagram of a process of sending a data sequence by a sending terminal 1 in an embodiment of the present application. In this embodiment, the sending terminal 1 performs a check process on the original data sequence to add a check bit to the data sequence, and performs a channel coding process on the data sequence with the check bit to obtain an encoded data sequence. The sending terminal 1 performs a scrambling process on the encoded data sequence to generate a scrambled data sequence, and sends the scrambled data sequence.
[0047] In this embodiment, the scrambled data sequence (ie, pseudo-random sequence) is generated by a linear feedback shift register (LinearFeedfackShiftRegister, L). Figure 2, which is a schematic diagram of a shift register 20 in an embodiment of the present application. The shift register 20 includes a plurality of D flip-flops 202. The plurality of D flip-flops 202 are connected in series to form the 1st to Nth stage D flip-flops, where N is the number of flip-flops 202. The D flip-flops 202 include an input terminal 2021, a clock signal input terminal 2022, a positive output terminal 2023, and a negative output terminal 2024. The input terminal 2022 of the 1st stage D flip-flop serves as a receiving terminal of the shift register 20 for receiving a data sequence. The positive output terminal 2023 of the first-stage D flip-flop is connected to the input terminal 2021 of the second-stage D flip-flop (i.e., the next-stage D flip-flop of the first-stage D flip-flop), the positive output terminal 2023 of the second-stage D flip-flop (i.e., the next-stage D flip-flop of the first-stage D flip-flop) is connected to the input terminal 2021 of the third-stage D flip-flop (i.e., the next-stage D flip-flop of the second-stage D flip-flop), and the remaining D flip-flops are connected in this way until the positive output terminal 2023 of the N-1-stage D flip-flop is connected to the input terminal 2021 of the N-stage D flip-flop. The positive output terminal 2022 of the N-stage D flip-flop is used as the output terminal of the shift register 20 to output the data sequence. The output terminal of the shift register 20 (i.e., the positive output terminal 2022 of the N-stage D flip-flop) is connected to the input terminal of the shift register 20 (i.e., the input terminal 2021 of the first-stage D flip-flop) to form a linear feedback shift register. In this embodiment, different scrambling circuits can be constructed based on the linear feedback shift register. Specifically, the forward output terminals 2023 of the D flip-flops at different stages in the linear feedback shift register are connected to the input terminals of the linear feedback shift register through one or more XOR gate circuits to construct different scrambling circuits (refer to Fig. 7A ). Thus, the input data sequence is scrambled by the constructed scrambling circuit to obtain a scrambled data sequence. In this embodiment, different scrambling circuits have different scrambling polynomials. For example, the scrambling code polynomial corresponding to the scrambling circuit is 1+X 39 +X 58 , X represents the data bit to be scrambled of the current data in the scrambling circuit 11, and the data bit is used to represent the data bit involved in the scrambling operation (or XOR operation). 39 and X 58 They respectively represent that the 39th and 58th bits of the current data in the current scrambling circuit 11 participate in the scrambling operation.
[0048] refer to Figure 3AAs shown, it is an application scenario diagram of a scrambling method in an embodiment of the present application. The scrambling method is applied to a sending terminal 1 and a receiving terminal 2. In this embodiment, the sending terminal 1 and the receiving terminal 2 are connected in communication via a wired connection. For example, the sending terminal 1 and the receiving terminal 2 are connected via a cable, an optical fiber, a telephone line, or a network cable. In this embodiment, the sending terminal 1 is a camera and the receiving terminal 2 is a mobile phone to describe the application environment structure diagram of the scrambling method. In this embodiment, the camera sends the captured image to the mobile phone. Since the high-pixel transmission scenario of the camera (such as the transmission of an image taken with 100 million pixels) requires a higher data transmission rate, a high data transmission rate requires a higher parallel bit width and a high anti-electromagnetic interference capability. Therefore, in a high-pixel transmission scenario, the scrambling circuit of the self-synchronous scrambling structure or the scrambling circuit of the frame-synchronous scrambling structure in the camera needs to use a high-order scrambling polynomial to scramble the image data, and send the scrambled image data to the mobile phone through a high parallel bit width. In this embodiment, the parallel bit width refers to the amount of information transmitted between an input device (such as a camera) and an output device (such as a mobile phone) at one time when a single channel is transmitted in parallel. For example, in high-pixel transmission scenarios, the camera uses the scrambling polynomial 1+X 39 +X 58 The image data is scrambled to obtain scrambled data, and the scrambled data is sent to the mobile phone through a 64-bit parallel bit width. The camera uses the scrambling polynomial 1+X 39 +X 58 When scrambling, the 39th and 58th bits of the scrambling circuit are added to the input data sequence for scrambling to generate a scrambling sequence. However, the camera requires a lower data transmission rate, a lower parallel bit width, and a lower anti-electromagnetic interference capability in low-pixel transmission scenarios (such as transmitting images taken with one million pixels). Therefore, the camera needs to use a low-order scrambling polynomial to scramble the image data in low-pixel scenarios and send the scrambled data sequence to the mobile phone through a low parallel bit width. For example, in low-pixel transmission scenarios, the camera uses the scrambling polynomial 1+X 6 +X 7 After scrambling the image data, the scrambled data is obtained, and the scrambled data is sent to the mobile phone through an 8-bit parallel bit width. However, the scrambling polynomial of the scrambling circuit with a self-synchronous scrambling structure or the scrambling circuit with a frame synchronous scrambling structure used in the existing scrambling method is fixed, so that the channel scrambling capability is relatively fixed and the ability to recover the clock signal is fixed, so it cannot meet the needs of various data transmission scenarios. At the same time, the parallel bit width of the scrambling circuit with a self-synchronous scrambling structure or the scrambling circuit with a frame synchronous scrambling structure used in the existing scrambling method is also fixed. When switching the data transmission rate, the clock frequency of the scrambling circuit must be changed, which complicates the structure of the camera's scrambling circuit.
[0049] refer to Figure 3B As shown, it is an application scenario diagram of another scrambling method in an embodiment of the present application. The scrambling method is applied to a sending terminal 1 and a receiving terminal 2. In this embodiment, the sending terminal 1 is a virtual reality (VR) device or an augmented reality (AR) device. The VR device or AR device is connected to the mobile phone through a wired connection. In the process of transmitting image data to the mobile phone, the VR device or AR device adopts a high parallel bit width, which causes high power consumption and high cost. However, users do not need extremely high transmission rates all the time. For example, users use mobile phones to receive data transmitted by VR devices or AR devices for VR viewing, which requires a higher data transmission rate. However, the transmission rate required for users to use mobile phones to receive data transmitted by VR devices or AR devices for VR games is not high. However, the scrambling circuit of the self-synchronous scrambling structure or the scrambling circuit of the frame synchronous scrambling structure used in the existing scrambling method cannot meet the needs of various data transmission scenarios because the scrambling code polynomial and the parallel bit width are fixed. , resulting in high power consumption and high cost of VR devices or AR devices.
[0050] refer to Figure 4 FIG. 1 is a flowchart of a scrambling method in an embodiment of the present application. Figure 5 As shown, it is an application environment structure diagram of the scrambling method in one embodiment of the present application. The scrambling method can be applied in a sending terminal 1 and a receiving terminal 2, and the sending terminal 1 includes a scrambling circuit 11. The receiving terminal 2 includes a descrambling circuit 21. In the scrambling method of this embodiment, the receiving terminal 2 receives the data transmission parameters sent by the sending terminal 1, and the scrambling method adaptively switches the scrambling circuit 11 according to the data transmission parameters, and scrambles according to the switched scrambling circuit 11, which may specifically include the following steps.
[0051] Step S401: The sending terminal 1 negotiates data transmission parameters with the receiving terminal 2, wherein the sending terminal 1 and the receiving terminal 2 are in a connected state.
[0052] In this embodiment, the data transmission parameters include a combination of one or more of the data transmission rate, the scrambling code polynomial, the parallel bit width, and the scrambling code seed. In this embodiment of the application, the transmitting terminal 1 negotiates the data transmission parameters with the receiving terminal 2. For details, please refer to Figure 6 The process diagram shown in the figure and the following Figure 6 Detailed description.
[0053] Step S402: The transmitting terminal 1 confirms the scrambling code polynomial according to the data transmission parameters.
[0054] Optionally, in an embodiment of the present application, the data transmission parameters include a scrambling code polynomial, and the transmitting terminal 1 obtains the scrambling code polynomial from the data transmission parameters.
[0055] Optionally, in another embodiment of the present application, the transmitting terminal 1 includes a first configuration relationship, and the first configuration relationship includes at least a correspondence between a data transmission rate and a scrambling code polynomial. The transmitting terminal 1 obtains the data transmission rate of the transmitting terminal 1, and determines a scrambling code polynomial corresponding to the data transmission rate according to the data transmission rate and the first configuration relationship.
[0056] Step S403: the transmitting terminal 1 switches the scrambling circuit 11 of the transmitting terminal 1 according to the scrambling code polynomial so that the scrambling circuit 11 has a circuit structure corresponding to the scrambling code polynomial.
[0057] refer to Fig. 7A As shown, it is a schematic diagram of the structure of the scrambling circuit 11 in an embodiment of the present application. In this embodiment, the scrambling circuit 11 is a self-synchronous scrambling structure. Specifically, the scrambling circuit 11 includes a linear feedback shift register 111 and a switch group 112. The linear feedback shift register 111 includes a D trigger group 113, an XOR gate circuit group 114 composed of a plurality of first XOR gate circuits 1141, an input terminal 115, a feedback terminal 116, an output terminal 117 and a second XOR gate circuit 118. The XOR gate circuit group 114 includes a plurality of first XOR gate circuits 1141. The D trigger group 113 includes M D triggers. The M D triggers are connected in series to form the 1st to Mth stage D triggers. In this embodiment, M is a power of 2.
[0058] In this embodiment, the input terminal 115 of the linear feedback shift register 111 receives the data sequence to be scrambled. The input terminal 115 and the feedback terminal 116 of the linear feedback shift register 111 are respectively connected to the two input terminals of the second XOR gate circuit 118. The output terminal of the second XOR gate circuit 118 is respectively connected to the input terminal of the first-stage D flip-flop and the output terminal 117 of the linear feedback shift register 111. The output terminal 117 of the linear feedback shift register 111 outputs the scrambled data sequence. The output terminal of each stage of the D flip-flop from the first stage to the Mth stage is connected to the input terminal of a second XOR gate circuit in the XOR gate circuit group 114 through a switch in the switch group 112, and all the first XOR gate circuits 1141 in the XOR gate circuit group 114 are connected in series. The output data of the output terminal of each stage of the D flip-flop from the first stage to the Mth stage is XORed by all the first XOR gate circuits 1141 in the XOR gate circuit group 114 to obtain the XOR result. The XOR operation result is used as the output result of the feedback terminal 116 of the linear feedback shift register 111. In this embodiment, the number of D flip-flops in the D flip-flop group 113, the number of switches in the switch group 112, and the number of first XOR gate circuits 1141 in the XOR gate circuit group 114 are the same.
[0059] In this embodiment, the scrambled data sequence obtained by scrambling the data sequence through the scrambling circuit 11 of the self-synchronous scrambling structure itself carries the synchronization information. Therefore, the scrambling circuit 11 of the self-synchronous scrambling structure does not need to have an additional synchronization mechanism. In this embodiment, the scrambling circuit 11 of the self-synchronous scrambling structure is applied to a terminal device based on an Ethernet communication protocol (such as a TCP / IP protocol). In this embodiment, by setting the opening and closing of each switch in the scrambling circuit 11, the scrambling code polynomial of the scrambling circuit 11 can be switched. For example, if the scrambling code polynomial of the switched scrambling circuit 11 is 1+X 6 +X 7 , the scrambling code polynomial of the scrambling circuit 11 can be switched to 1+X by simply closing the switch connected to the output end of the 6th stage D flip-flop and the switch connected to the output end of the 7th stage D flip-flop in the scrambling circuit 11 and opening the remaining switches in the switch group 112. 6 +X 7 For example, the switch connected to the output of the 39th-stage D flip-flop and the switch connected to the output of the 58th-stage D flip-flop are closed, and the remaining switches in the switch group 112 are opened, so that the scrambling code polynomial of the scrambling circuit 11 can be switched to 1+X 39 +X 58 .
[0060] refer to Figure 7B As shown, it is a schematic diagram of the structure of the scrambling circuit 11 in another embodiment of the present application. In this embodiment, the scrambling circuit 11 is a frame synchronization scrambling structure. In this embodiment, the structure of the scrambling circuit 11 with a frame synchronization scrambling structure is basically the same as the structure of the scrambling circuit with the self-synchronization scrambling structure described above, except that: in the scrambling circuit 11 with a frame synchronization scrambling structure, the output end of the Mth stage D flip-flop of the linear feedback shift register 111 and the input end 115 of the linear feedback shift register 111 are respectively connected to the two input ends of the second XOR gate circuit 118; the output end of the second XOR gate circuit 118 is connected to the output end 117 of the linear feedback shift register 111; the feedback end 116 of the linear feedback shift register 111 is connected to the input end of the first stage D flip-flop.
[0061] In this embodiment, the scrambling circuit 11 of the frame synchronization scrambling structure is applied to a terminal device based on a C / D-PHY communication protocol, a terminal device based on an M-PHY communication protocol, or a terminal device based on a CEDI-PHY communication protocol. After the scrambling circuit 11 of the frame synchronization scrambling structure is used to scramble the data sequence, the problem of doubling the error rate of the scrambled data sequence during the transmission process can be avoided.
[0062] In this embodiment, step S403 includes: the transmitting terminal 1 performs closing control and opening control on the switch in the scrambling circuit 11 of the transmitting terminal 1 according to the scrambling code polynomial so that the scrambling circuit switches to the circuit structure corresponding to the scrambling code polynomial. For example, if the scrambling code polynomial is 1+X 6 +X 7 The transmitting terminal 1 closes the switch connected to the output of the 6th-stage D flip-flop and the switch connected to the output of the 7th-stage D flip-flop in the scrambling circuit 11, and opens the remaining switches in the switch group 112 to switch the scrambling code polynomial of the scrambling circuit 11 to 1+X 6 +X 7 For example, if the scrambling code polynomial is 1+X 39 +X 58 The transmitting terminal 1 closes the switch connected to the output end of the 39th-stage D flip-flop and the switch connected to the output end of the 58th-stage D flip-flop in the scrambling circuit 11, and opens the remaining switches in the switch group 112, so that the scrambling code polynomial of the scrambling circuit 11 can be switched to 1+X 39 +X 58 .
[0063] In other embodiments, the transmitting terminal 1 includes multiple scrambling circuits 11, each scrambling circuit 11 has a scrambling code polynomial. Step S403 includes: the transmitting terminal 1 selects the scrambling circuit 11 having the scrambling code polynomial as the scrambling circuit 11 of the transmitting terminal 1 according to the scrambling code polynomial.
[0064] Step S404: the transmitting terminal 1 controls the switched scrambling circuit 11 to scramble the data sequence to be scrambled to obtain a scrambled data sequence.
[0065] In this embodiment, the sending terminal 1 scrambles the data sequence to be scrambled according to the formula The scrambled data sequence is calculated, where B k is the input sequence, C k is the output scrambled data sequence, L is the highest order of the scrambling code polynomial, m is the number of D flip-flops in the scrambling code circuit 11, k is the serial number of the data sequence, D k-i is the output sequence of the i-th stage D flip-flop in the scrambling circuit 11, A i is the feedback coefficient, which takes a value of 0 or 1, where A i is 0, indicating that the output sequence of the i-th stage D flip-flop in the scrambling circuit 11 participates in the scrambling operation, that is, A i The i-th bit representing the current data in the scrambling circuit 11 participates in the scrambling operation.
[0066] In this embodiment, the flowchart of the negotiation between the transmitting terminal 1 and the receiving terminal 2 for data transmission parameters is shown in FIG. Figure 6 , which may specifically include the following steps.
[0067] Step S601 : the sending terminal 1 sends data transmission parameters to the receiving terminal 2 .
[0068] Step S602, the receiving terminal 2 determines whether it agrees with the data transmission parameters. If the receiving terminal 2 does not agree with the data transmission parameters, step S603 is executed. If the receiving terminal 2 agrees with the data transmission parameters, step S606 is executed.
[0069] Step S603: In response to disagreeing with the data transmission parameters, the receiving terminal 2 modifies the data transmission parameters.
[0070] Step S604 : the receiving terminal 2 stores the modified data transmission parameters, and sends a first confirmation code stream including the modified data transmission parameters to the sending terminal 1 .
[0071] Step S605: The sending terminal 1 obtains the modified data transmission parameters from the first confirmation code stream, and updates the data transmission parameters with the modified data transmission parameters.
[0072] Step S606 , in response to agreeing to the data transmission parameters, the receiving terminal 2 stores the data transmission parameters and sends a second confirmation code stream to the sending terminal 1 .
[0073] In this embodiment, the method further includes after step S403: the transmitting terminal 1 obtains a scrambling code seed, and uses the scrambling code seed as the initial value of the scrambling circuit 11 for pre-scrambling. The scrambling code seed is the initial value of the linear feedback shift register 111 in the scrambling circuit 11. In this embodiment, the scrambling code seed is stored in a register of the transmitting terminal 1, and the transmitting terminal 1 obtains the scrambling code seed from the register storing the scrambling code seed. After obtaining the scrambling code seed, the transmitting terminal 1 also sends the scrambling code seed to the receiving terminal 2, so that the scrambling code seed is used as the initial value of the descrambling circuit 21 of the receiving terminal 2. In other embodiments, the data transmission parameters include the scrambling code seed, and the transmitting terminal 1 and the receiving terminal 2 obtain the scrambling code seed from the data transmission parameters.
[0074] In this embodiment, the method further includes after step S404: the sending terminal 1 sends the scrambled data sequence to the receiving terminal 2.
[0075] In the present application, the transmitting terminal 1 can determine the scrambling polynomial according to the data transmission parameters, and switch the scrambling circuit 11 of the transmitting terminal 1 according to the scrambling code polynomial so that the scrambling circuit 11 has the scrambling code polynomial, and control the scrambling circuit 11 to scramble the data sequence according to the scrambling code polynomial, thereby realizing the use of different scrambling code polynomials to scramble the data sequence in transmission scenarios with different data transmission rates, enhancing the ability to suppress the length of consecutive 0s and consecutive 1s in the data sequence, improving the clock recovery capability of the data sequence and reducing inter-code crosstalk.
[0076] Optionally, in an embodiment of the present application, the data transmission parameters include a first configuration relationship, and the first configuration relationship includes at least a configuration rule between a data transmission rate, a scrambling code polynomial, and a parallel bit width. The transmitting terminal 2 and the receiving terminal 2 negotiate the first configuration relationship, and adaptively switch the scrambling circuit 11 according to the negotiation result and the data transmission rate of the transmitting terminal 1, and scramble according to the switched scrambling circuit 11, which may specifically include the following steps (refer to Figure 8 ).
[0077] Step S801: The sending terminal 1 sends a first configuration relationship to the receiving terminal 2.
[0078] In this embodiment, the first configuration relationship includes the correspondence between different data transmission rates, different scrambling code polynomials, and different parallel bit widths. In this embodiment, the parallel bit width can determine the data transmission rate in a single channel at different clock frequencies. Therefore, by switching the parallel bit width, the data transmission rate can be changed without changing the clock frequency. In this embodiment, the parallel bit width includes 8bit, 16bit, 32bit, 64bit and 128bit. Specifically, in the first configuration relationship, the scrambling code polynomial corresponding to the high-speed data transmission rate (e.g., 16GBPS) is 1+X 39 +X 58 The parallel bit width corresponding to the high-speed data transmission rate is 64 bits, and the scrambling code polynomial corresponding to the low-speed data transmission rate (for example, 16kBPS) is 1+X 6 +X 7 , and the parallel bit width corresponding to the low-speed data transmission rate is 8 bits. In this embodiment, in the first configuration relationship, the highest order of the scrambling code polynomial must be smaller than the parallel bit width corresponding to the scrambling code polynomial. For example, the scrambling code polynomial is 1+X 39 +X 58 When the corresponding parallel bit width cannot be less than 58, the scrambling code polynomial is 1+X 39 +X 58 The corresponding parallel bit width can be set to 64bit or 128bit. In this embodiment, in the first configuration relationship, the highest order of the scrambling polynomial corresponding to the high-speed data transmission rate is greater than the highest order of the scrambling polynomial for the low-speed data transmission rate. In this embodiment, the transmitting terminal 1 stores the first configuration relationship in a register.
[0079] Step S802: the receiving terminal 2 receives the first configuration relationship.
[0080] Step S803, the receiving terminal 2 determines whether it agrees with the first configuration relationship. If the receiving terminal 2 does not agree with the first configuration relationship, step S804 is executed, otherwise, if the receiving terminal 2 agrees with the first configuration relationship, step S807 is executed.
[0081] Step S804: In response to disagreeing with the first configuration relationship, the receiving terminal 2 modifies the configuration rules among the data transmission rate, the scrambling code polynomial, and the parallel bit width of the first configuration relationship to obtain a second configuration relationship.
[0082] In this embodiment, the receiving terminal 2 obtains the hardware condition information of the receiving terminal 2, and determines whether the hardware condition information satisfies the first configuration relationship. If the hardware condition information satisfies the first configuration relationship, the receiving terminal 2 determines to agree to the first configuration relationship; otherwise, if the hardware condition information does not satisfy the first configuration relationship, the receiving terminal 2 determines to disagree with the first configuration relationship. In a specific implementation, the hardware condition information includes, but is not limited to, the maximum data transmission rate of the receiving terminal 2, the number of D flip-flops of the descrambling circuit 21, and the data bit width of the receiving terminal 2. In this embodiment, after the receiving terminal 2 obtains the maximum data transmission rate of the receiving terminal 2, the number of D flip-flops of the descrambling circuit 21, and the data bit width of the receiving terminal 2, it is determined whether the data transmission rate in the first configuration relationship is less than the maximum data transmission rate of the receiving terminal 2; it is determined whether the highest number of bits of the scrambling code polynomial in the first configuration relationship is less than the number of D flip-flops of the descrambling circuit 21; it is determined whether the parallel bit width in the first configuration relationship is less than the data bit width of the receiving terminal 2; when the data transmission rate in the first configuration relationship is less than the maximum data transmission rate of the receiving terminal 2, the highest number of bits of the scrambling code polynomial in the first configuration relationship is less than the number of D flip-flops of the descrambling circuit 21, and the parallel bit width in the first configuration relationship is less than the data bit width of the receiving terminal 2, the receiving terminal 2 determines that it agrees with the first configuration relationship; when the data transmission rate in the first configuration relationship is not less than the maximum data transmission rate of the receiving terminal 2, or the highest number of bits of the scrambling code polynomial in the first configuration relationship is not less than the number of D flip-flops of the descrambling circuit 21, or the parallel bit width in the first configuration relationship is not less than the data bit width of the receiving terminal 2, the receiving terminal 2 determines that it does not agree with the first configuration relationship.
[0083] In this embodiment, in response to disagreement with the first configuration relationship, the receiving terminal 2 modifies the configuration rules between the data transmission rate, the scrambling code polynomial, and the parallel bit width of the first configuration relationship to obtain the second configuration relationship, including: if the data transmission rate in the first configuration relationship is not less than the maximum data transmission rate of the receiving terminal 2, the receiving terminal 2 modifies the data transmission rate to be less than the maximum data transmission rate of the receiving terminal 2; if the highest number of bits of the scrambling code polynomial in the first configuration relationship is not less than the number of D flip-flops of the descrambling circuit 21; the receiving terminal 2 modifies the highest number of bits of the scrambling code polynomial to be less than the number of D flip-flops of the descrambling circuit 21; if the parallel bit width in the first configuration relationship is not less than the data bit width of the receiving terminal 2, the receiving terminal 2 modifies the parallel bit width in the first configuration relationship to be less than the data bit width of the receiving terminal 2.
[0084] Step S805 : the receiving terminal 2 stores the second configuration relationship, and sends a first confirmation code stream including the second configuration relationship to the sending terminal 1 .
[0085] Step S806, in response to the first confirmation code stream, the transmitting terminal 1 obtains the data transmission rate of the transmitting terminal 1, and determines the scrambling code polynomial and parallel bit width corresponding to the data transmission rate according to the data transmission rate and the second configuration relationship. After step S806 is executed, step S809 is executed.
[0086] In this embodiment, the data transmission rate is stored in the register of the sending terminal 1 as the state information of the sending terminal 1, and the sending terminal 1 obtains the data transmission rate from the register of the sending terminal 1. The sending terminal 1 determines the scrambling code polynomial and the parallel bit width corresponding to the data transmission rate according to the data transmission rate and the first configuration relationship.
[0087] Step S807 , in response to agreeing to the first configuration relationship, the receiving terminal 2 stores the first configuration relationship and sends a second confirmation code stream to the sending terminal 1 .
[0088] Step S808: In response to the second confirmation code stream, the transmitting terminal 1 obtains the data transmission rate of the transmitting terminal 1, and determines the scrambling code polynomial and the parallel bit width corresponding to the data transmission rate according to the data transmission rate and the first configuration relationship.
[0089] Step S809: the transmitting terminal 1 switches the scrambling circuit 11 of the transmitting terminal 1 according to the scrambling code polynomial so that the scrambling circuit 11 has a circuit structure corresponding to the scrambling code polynomial.
[0090] Step S810: the transmitting terminal 1 controls the scrambling circuit 11 to scramble the data sequence according to the scrambling code polynomial to obtain a scrambled data sequence.
[0091] Step S811: the transmitting terminal 1 sends the scrambled data sequence to the receiving terminal 2 according to the parallel bit width.
[0092] In this embodiment, the method further includes before step S810: the transmitting terminal 1 obtains a scrambling code seed, and uses the scrambling code seed as the initial value of the scrambling circuit 11 for pre-scrambling. The scrambling code seed is the initial value of the linear feedback shift register 111 in the scrambling circuit 11. In this embodiment, the scrambling code seed is stored in the register of the transmitting terminal 1, and the transmitting terminal 1 obtains the scrambling code seed from the register storing the scrambling code seed. In this embodiment, after obtaining the scrambling code seed, the transmitting terminal 1 also sends the scrambling code seed and the data transmission rate of the transmitting terminal 1 to the receiving terminal 2. In response to the data transmission rate of the transmitting terminal 1, the receiving terminal 2 determines the scrambling code polynomial corresponding to the data transmission rate of the transmitting terminal 1 according to the data transmission rate of the transmitting terminal 1 and the stored first configuration relationship or the second configuration relationship, and switches the descrambling circuit 21 to a circuit structure corresponding to the scrambling code polynomial. The receiving terminal 2 is also used to respond to the scrambling code seed and use the scrambling code seed as the initial value of the descrambling circuit 21 to pre-descramble the descrambling circuit 21.
[0093] Optionally, in another embodiment of the present application, the first configuration relationship or the second configuration relationship includes configuration rules between data transmission rate, scrambling code polynomial, parallel bit width and scrambling code seed. The transmitting terminal 1 obtains the data transmission rate of the transmitting terminal 1, and determines the scrambling code seed corresponding to the data transmission rate according to the data transmission rate and the first configuration relationship or the second configuration relationship. After obtaining the scrambling code seed, the transmitting terminal 1 also sends the data transmission rate of the transmitting terminal 1 to the receiving terminal 2. In response to the data transmission rate of the transmitting terminal 1, the receiving terminal 2 determines the scrambling code polynomial and scrambling code seed corresponding to the data transmission rate of the transmitting terminal 1 according to the data transmission rate of the transmitting terminal 1 and the stored first configuration relationship or the second configuration relationship, switches the descrambling circuit 21 to a circuit structure corresponding to the scrambling code polynomial, and pre-descrambles the descrambling circuit 21 according to the scrambling code seed.
[0094] In this embodiment, after completing the pre-descrambling, the receiving terminal 2 also sends a reply message to the sending terminal 1. After receiving the reply message, the sending terminal 1 sends the scrambled data sequence to the receiving terminal 2 according to the parallel bit width.
[0095] In the present application, the transmitting terminal 1 can determine the scrambling polynomial according to the data transmission rate, and according to the scrambling polynomial, the switch in the scrambling circuit 11 of the transmitting terminal 1 is closed and opened to switch the scrambling circuit 11 to the scrambling polynomial corresponding to the data transmission rate, and scramble the data sequence according to the scrambling polynomial, so as to realize the use of different scrambling polynomials to scramble the data sequence in the transmission scenarios of different data transmission rates, enhance the ability to suppress the length of consecutive 0s and consecutive 1s in the data sequence, improve the clock recovery ability of the data sequence and reduce inter-code crosstalk. In addition, the transmitting terminal 1 can also determine the parallel bit width according to the data transmission rate, and send the scrambled data sequence according to the parallel bit width, which can reduce power consumption and reduce costs. Moreover, when there is a need to change the transmission rate of the scrambled data sequence, it is only necessary to change the parallel bit width of the scrambled data sequence to change the transmission rate of the scrambled data sequence, so there is no need to change the clock frequency, which simplifies the circuit structure of the transmitting terminal 1.
[0096] For example, refer to Figure 3A As shown, when the camera is used as the transmitting terminal 11, the data transmission rate obtained by the camera in the high-pixel scene is the high-speed transmission rate. The scrambling code polynomial corresponding to the high-speed transmission rate is determined to be 1+X according to the first configuration relationship found in the high-speed transmission rate. 39 +X 58 The parallel bit width corresponding to the high-speed transmission rate is 64 bits. The camera controls the switch in the camera's scrambling circuit 11 to close and open according to the scrambling code polynomial, so that the scrambling circuit 11 switches to 1+X 39 +X 58 The camera controls the scrambling circuit 11 according to the scrambling code polynomial 1+X 39 +X 58 The data sequence is scrambled to obtain a scrambled data sequence, and the scrambled data sequence is sent to the mobile phone according to the 64-bit parallel bit width. When the camera works in a low-pixel scene, the data transmission rate obtained by the camera is a low-speed transmission rate. According to the low-speed transmission rate, the first configuration relationship is searched to determine that the scrambling code polynomial corresponding to the low-speed transmission rate is 1+X 6 +X 7 , and the parallel bit width corresponding to the low-speed transmission rate is 8 bits. The camera controls the switch in the camera's scrambling circuit 11 to close and open according to the scrambling code polynomial, so that the scrambling circuit 11 switches to 1+X 6 +X 7 The camera controls the scrambling circuit 11 according to the scrambling code polynomial 1+X 6 +X 7The data sequence is scrambled to obtain a scrambled data sequence, and the scrambled data sequence is sent to the mobile phone according to the 8-bit parallel bit width. In this way, the camera can determine different scrambling code polynomials to scramble the data sequence to be transmitted according to the high-pixel transmission scenario and the low-pixel transmission scenario, thereby enhancing the ability to suppress the length of consecutive 0s and consecutive 1s in the data sequence, improving the clock recovery ability of the data sequence and reducing inter-code crosstalk. In addition, the camera determines different parallel bit widths to transmit the scrambled data sequence according to the high-pixel transmission scenario and the low-pixel transmission scenario, which can reduce power consumption and reduce costs. Moreover, when switching the transmission rate of the scrambled data sequence, it is only necessary to change the parallel bit width of the scrambled data sequence to change the transmission rate of the scrambled data sequence without changing the clock frequency, thereby simplifying the circuit structure of the camera. Optionally, in another embodiment of the present application, the receiving terminal 2 does not need to negotiate the first configuration relationship sent by the sending terminal 1, and can directly agree to the first configuration relationship sent by the sending terminal 1. The scrambling method adaptively switches the scrambling code polynomial of the scrambling circuit 11 according to the negotiation result and the data transmission rate of the transmission scenario, and scrambles according to the switched scrambling circuit 11. Reference Fig. 9 As shown, it is a flow chart of the scrambling method in another embodiment of the present application, which may specifically include the following steps.
[0097] Step S901: The transmitting terminal 1 sends a first configuration relationship to the receiving terminal 2, where the first configuration relationship includes configuration rules among data transmission rate, scrambling code polynomial, parallel bit width, and scrambling code seed.
[0098] In this embodiment, the transmitting terminal 1 sets the corresponding relationship between different data transmission rates, different scrambling code polynomials, different parallel bit widths and different scrambling code seeds, and records the corresponding relationship in the first configuration relationship. Specifically, in the first configuration relationship, the scrambling code polynomial corresponding to the high-speed data transmission rate (for example, 16GBPS) is 1+X 39 +X 58 , the parallel bit width corresponding to the high-speed data transmission rate is 64 bits, and the scrambling code seed corresponding to the high-speed data transmission rate is an arbitrary binary value of 128 bits. The scrambling code polynomial corresponding to the low-speed data transmission rate (for example, 16kBPS) is 1+X 6 +X 7 , the parallel bit width corresponding to the low-speed data transmission rate is 8 bits, and the scrambling code seed corresponding to the low-speed data transmission rate is an arbitrary binary value of 128 bits. In this embodiment, in the first configuration relationship, the highest order of the scrambling code polynomial must be less than the parallel bit width corresponding to the scrambling code polynomial. In this embodiment, in the first configuration relationship, the number of data bits of the scrambling code seed is the same as the D flip-flop of the scrambling circuit 11 of the transmitting terminal 1 (reference Fig. 7AIn this embodiment, in the first configuration relationship, the highest order of the scrambling code polynomial corresponding to the high-speed data transmission rate is greater than the highest order of the scrambling code polynomial for the low-speed data transmission rate.
[0099] In this embodiment, after completing the setting of the first configuration relationship, the sending terminal 1 may store the first configuration relationship in a register.
[0100] Step S902: The receiving terminal 2 replies with a first confirmation code stream to the sending terminal 1 in response to the first configuration relationship.
[0101] In this embodiment, the receiving terminal 2 replies to the sending terminal 1 with a first confirmation code stream in response to the first configuration relationship, and stores the first configuration relationship.
[0102] Step S903, the transmitting terminal 1 obtains the data transmission rate of the transmitting terminal 1 in response to the first confirmation code stream, and determines the scrambling code polynomial, parallel bit width and scrambling code seed corresponding to the data transmission rate according to the data transmission rate and the first configuration relationship.
[0103] Step S904: the transmitting terminal 1 switches the scrambling circuit 11 of the transmitting terminal 1 according to the scrambling code polynomial so that the scrambling circuit 11 has a circuit structure corresponding to the scrambling code polynomial.
[0104] In this embodiment, step S904 includes: the transmitting terminal 1 performs closing control and opening control on a switch in the scrambling circuit 11 of the transmitting terminal 1 according to the scrambling code polynomial so that the scrambling circuit switches to the scrambling code polynomial.
[0105] For example, if the scrambling polynomial is 1+X 39 +X 58 The transmitting terminal 1 closes the switch connected to the output of the 39th-stage D flip-flop and the switch connected to the output of the 58th-stage D flip-flop in the scrambling circuit 11, and opens the remaining switches in the switch group 112 to switch the scrambling code polynomial of the scrambling circuit 11 to 1+X 39 +X 58 .
[0106] Step S905 , the transmitting terminal 1 uses the scrambling code seed as the initial value of the scrambling circuit 11 for pre-scrambling.
[0107] Step S906: The receiving terminal 2 determines the scrambling code polynomial and the scrambling code seed.
[0108] In this embodiment, the receiving terminal 2 receives the data transmission rate sent by the transmitting terminal 1, and determines the scrambling polynomial and scrambling seed corresponding to the data transmission rate according to the data transmission rate and the first configuration relationship. In another embodiment, the data transmission rate, the scrambling polynomial, the parallel bit width, and the scrambling seed are stored in the first configuration relationship in the form of a table. The transmitting terminal 2 determines the position information of the scrambling polynomial and the scrambling seed corresponding to the data transmission rate in the first configuration relationship, and sends the position information to the receiving terminal 2. The receiving terminal 2 determines the scrambling polynomial and the scrambling seed corresponding to the position information according to the position information. Among them, the position information can be an index of a table. That is, the receiving terminal 2 determines the scrambling polynomial and the scrambling seed corresponding to the index in the first configuration relationship according to the index.
[0109] In step S907 , the receiving terminal 3 controls the descrambling circuit 21 to switch to the circuit corresponding to the scrambling code polynomial, and controls the switched descrambling circuit 21 to use the scrambling code seed as the initial value of the descrambling circuit 21 for pre-descrambling.
[0110] Step S908: After completing pre-descrambling, the receiving terminal 2 replies with a second confirmation code stream to the sending terminal 1.
[0111] Step S909: the transmitting terminal 1 responds to the second confirmation code stream and controls the scrambling circuit 11 to scramble the data sequence according to the scrambling code polynomial to obtain a scrambled data sequence.
[0112] Step S910: The transmitting terminal 1 sends the scrambled data sequence to the receiving terminal 2 according to the parallel bit width.
[0113] Optionally, in another embodiment of the present application, the confirmation code stream sent by the sending terminal 1 includes the data transmission rate, the scrambling code polynomial, and the scrambling code seed, but does not include the parallel bit width. Fig.10 As shown, it is a flowchart of the scrambling method in another embodiment of the present application, which may specifically include the following steps.
[0114] Step S1001: The transmitting terminal 1 sends a first configuration relationship to the receiving terminal 2, where the first configuration relationship includes a correspondence between a data transmission rate, a scrambling code polynomial, and a scrambling code seed.
[0115] Step S1002 : The receiving terminal replies with a first confirmation code stream to the sending terminal 1 in response to the first configuration relationship.
[0116] In this embodiment, the receiving terminal 2 replies to the sending terminal 1 with a first confirmation code stream in response to the first configuration relationship, and stores the first configuration relationship.
[0117] Step S1003: The transmitting terminal 1 obtains the data transmission rate of the transmitting terminal 1 in response to the first confirmation signal, and determines a scrambling code polynomial and a scrambling code seed corresponding to the data transmission rate according to the data transmission rate and the first configuration relationship.
[0118] Step S1004: the transmitting terminal 1 switches the scrambling circuit 11 of the transmitting terminal 1 according to the scrambling code polynomial so that the scrambling circuit 11 has the scrambling code polynomial.
[0119] Step S1005 , the transmitting terminal 1 uses the scrambling code seed as the initial value of the scrambling circuit 11 for pre-scrambling.
[0120] Step S1006: The receiving terminal 2 determines the scrambling code polynomial and the scrambling code seed.
[0121] In step S1007 , the receiving terminal 2 controls the descrambling circuit 21 to switch to the scrambling code polynomial, and controls the descrambling circuit 21 to use the scrambling code seed as the initial value of the descrambling circuit 21 for pre-descrambling.
[0122] Step S1008: After completing pre-descrambling, the receiving terminal 2 replies with a second confirmation code stream to the sending terminal 1.
[0123] Step S1009: the transmitting terminal 1 responds to the second confirmation code stream and controls the scrambling circuit 11 to scramble the data sequence according to the scrambling code polynomial to obtain a scrambled data sequence.
[0124] Step S1010 , the transmitting terminal 1 sends the scrambled data sequence to the receiving terminal 2 .
[0125] In the present application, the transmitting terminal 1 can determine the scrambling polynomial according to the data transmission rate, and switch the scrambling circuit 11 of the transmitting terminal 1 according to the scrambling code polynomial so that the scrambling circuit 11 has the scrambling code polynomial, and control the scrambling circuit 11 to scramble the data sequence according to the scrambling code polynomial, thereby realizing the use of different scrambling code polynomials to scramble the data sequence in transmission scenarios with different data transmission rates, enhancing the ability to suppress the length of consecutive 0s and consecutive 1s in the data sequence, improving the clock recovery capability of the data sequence and reducing inter-code crosstalk.
[0126] In this embodiment, after the transmitting terminal 1 sends the scrambled data sequence to the receiving terminal 2, the receiving terminal 2 descrambles the scrambled data sequence. Fig.11 FIG. 2 is a flowchart of a descrambling method in an embodiment of the present application. The receiving terminal 2 adaptively switches the descrambling circuit 21 according to the data transmission parameters sent by the sending terminal 1, and performs descrambling according to the switched descrambling circuit 21, which may specifically include the following steps.
[0127] Step S1101 : the receiving terminal 2 confirms the scrambling code polynomial according to the data transmission parameters sent by the sending terminal 1 .
[0128] Optionally, in an embodiment of the present application, the data transmission parameters include a scrambling code polynomial, and the receiving terminal 2 obtains the scrambling code polynomial from the data transmission parameters.
[0129] Optionally, in another embodiment of the present application, the receiving terminal 2 includes a first configuration relationship, and the first configuration relationship includes at least a correspondence between a data transmission rate and a scrambling code polynomial. The sending terminal 1 obtains the data transmission rate of the sending terminal 1, and determines a scrambling code polynomial corresponding to the data transmission rate according to the data transmission rate and the first configuration relationship.
[0130] In step S1102, the receiving terminal 2 switches the descrambling circuit 21 of the receiving terminal 2 according to the scrambling code polynomial so that the descrambling circuit 21 has a circuit structure corresponding to the scrambling code polynomial.
[0131] refer to Fig.12 As shown, it is a schematic diagram of the structure of the descrambling circuit 21 in the embodiment of the present application. In this embodiment, the descrambling circuit 21 is a self-synchronous descrambling structure. Specifically, the descrambling circuit 21 includes a linear feedback shift register 211 and a switch group 212. The linear feedback shift register 211 includes a D trigger group 213, an XOR gate circuit group 214 composed of a plurality of first XOR gate circuits 2141, an input terminal 215, a feedback terminal 216, an output terminal 217 and a second XOR gate circuit 218. The D trigger group 213 includes M D triggers. The M D triggers in the D trigger group 213 are connected in series to form the 1st to Mth stage D triggers. In this embodiment, M is a power of 2.
[0132] In this embodiment, the input end 215 of the linear feedback shift register 211 receives the scrambled data sequence. The input end 215 and the feedback end 216 of the linear feedback shift register 211 are respectively connected to the two input ends of the second XOR gate circuit 218. The output end of the second XOR gate circuit 218 is connected to the output end 217 of the linear feedback shift register 211. The output end 217 of the linear feedback shift register 211 outputs the descrambled data sequence. The input end 215 of the linear feedback shift register 211 is connected to the input end of the first-stage D flip-flop. The output end of each stage of the D flip-flop from the first stage to the M-th stage D flip-flop is connected to the input end of a second XOR gate circuit in the XOR gate circuit group 214 through a switch in the switch group 212, and all the first XOR gate circuits 2141 in the XOR gate circuit group 214 are connected in series. The output data of the output end of each stage of the D flip-flop in the M-stage D flip-flop is XORed through all the first XOR gate circuits 2141 to obtain the XOR operation result. The XOR operation result is used as the output result of the feedback terminal 216 of the linear feedback shift register 211. In this embodiment, the number of D flip-flops in the D flip-flop group 213, the number of switches in the switch group 212, and the number of first XOR gate circuits 2141 in the XOR gate circuit group 214 are the same.
[0133] In this embodiment, the scrambling polynomial of the descrambling circuit 21 of the receiving terminal 2 is set to the same scrambling polynomial as the scrambling circuit of the transmitting terminal 3, so as to achieve descrambling of the scrambled data sequence of the transmitting terminal 3. For example, the transmitting terminal 3 uses the scrambling polynomial 1+X 39 +X 58 When the data sequence is scrambled to obtain a scrambled data sequence and the scrambled data sequence is sent to the receiving terminal 2, the receiving terminal 2 closes the switch connected to the output end of the 39th-stage D flip-flop in the descrambling circuit 21 and the switch connected to the output end of the 58th-stage D flip-flop, and opens the remaining switches in the switch group 212, so that the scrambling code polynomial of the descrambling circuit 21 can be set to 1+X 39 +X 58 , in order to realize the descrambling of the scrambled data sequence at the sending end.
[0134] In this embodiment, the descrambling circuit 21 is a self-synchronizing descrambling structure. Since the circuit structure of the descrambling circuit 21 of the frame synchronization scrambling structure is the same as the circuit structure of the scrambling circuit 11 of the frame synchronization scrambling structure, the description of the circuit structure of the descrambling circuit 21 of the frame synchronization scrambling structure refers to the circuit structure of the scrambling circuit 11 of the frame synchronization scrambling structure.
[0135] Step S1103 , the receiving terminal 2 receives the scrambled data sequence sent by the transmitting terminal 1 , and descrambles the scrambled data sequence according to the switched descrambling circuit 21 .
[0136] In this embodiment, the method further includes after step S1102: the receiving terminal 2 acquires a scrambling code seed, and uses the scrambling code seed as an initial value of the descrambling circuit 21 to perform pre-descrambling on the descrambling circuit 21.
[0137] Optionally, in one embodiment of the application, the receiving terminal 2 receives a scrambling code seed from the transmitting terminal 1 , and uses the scrambling code seed as an initial value of the descrambling circuit 21 to perform pre-descrambling on the descrambling circuit 21 .
[0138] Optionally, in another embodiment of the application, the data transmission parameters include a scrambling code seed, the receiving terminal 2 obtains the scrambling code seed from the data transmission parameters, and uses the obtained scrambling code seed as the initial value of the descrambling circuit 21 to pre-descramble the descrambling circuit 21.
[0139] The descrambling method in the present application can switch the descrambling circuit 21 according to the scrambling code polynomial, and descramble the scrambled data sent by the sending terminal 1 according to the switched descrambling circuit, thereby enhancing the ability to suppress the length of consecutive 0s and consecutive 1s in the data sequence, improving the clock recovery capability of the data sequence and reducing inter-code interference.
[0140] In this embodiment, the data transmission parameters include a first configuration relationship, and the first configuration relationship includes at least a configuration rule between a data transmission rate and a scrambling code polynomial. Fig.13 , which is a flow chart of a descrambling method in an embodiment of the present application. The descrambling method negotiates the first configuration relationship sent by the sending terminal 1, and adaptively switches the descrambling circuit 21 according to the negotiation result and the data transmission rate sent by the sending terminal 1, and descrambles according to the switched descrambling circuit 21, which may specifically include the following steps.
[0141] Step S1301: Receiving terminal 2 receives a first configuration relationship sent by sending terminal 1.
[0142] Step S1302, the receiving terminal 2 determines whether it agrees with the first configuration relationship. If the receiving terminal 2 does not agree with the first configuration relationship, step S1303 is executed, otherwise, if the receiving terminal 2 agrees with the first configuration relationship, step S1305 is executed.
[0143] Step S1303: In response to disagreeing with the first configuration relationship, the receiving terminal 2 modifies the configuration rules between the data transmission rate and the scrambling code polynomial of the first configuration relationship to obtain a second configuration relationship.
[0144] Step S1304: the receiving terminal 2 stores the second configuration relationship, and sends a first confirmation code stream including the second configuration relationship to the sending terminal 1.
[0145] Step S1305 , in response to agreeing to the first configuration relationship, the receiving terminal 2 stores the first configuration relationship and sends a second confirmation code stream to the sending terminal 1 .
[0146] Step S1306: The receiving terminal 2 determines a scrambling code polynomial according to the first configuration relationship or the second configuration relationship.
[0147] Optionally, in an embodiment of the present application, the transmitting terminal 1 responds to the first confirmation code stream or the second confirmation code stream, obtains the data transmission rate of the transmitting terminal 1, and sends the data transmission rate to the receiving terminal 2. The receiving terminal 3 determines a scrambling code polynomial corresponding to the data transmission rate according to the data transmission rate and the first configuration relationship or the second configuration relationship.
[0148] Optionally, in another embodiment of the present application, the data transmission rate and the scrambling code polynomial are stored in the first configuration relationship or the second configuration relationship in the form of a table. The sending terminal 2 determines the position information of the scrambling code polynomial corresponding to the data transmission rate in the first configuration relationship or the second configuration relationship, and sends the position information to the receiving terminal 2. The receiving terminal 2 determines the scrambling code polynomial corresponding to the position information according to the position information. The position information is an index of the table.
[0149] Step S1307: the receiving terminal 2 determines a scrambling code polynomial corresponding to the data transmission rate according to the data transmission rate of the transmitting terminal 1 and the first configuration relationship or the second configuration relationship, and switches the descrambling circuit 21 to a circuit structure corresponding to the scrambling code polynomial.
[0150] Step S1308 , the receiving terminal 2 receives the scrambled data sequence sent by the transmitting terminal 1 , and descrambles the scrambled data sequence according to the switched descrambling circuit 21 .
[0151] Optionally, in another embodiment of the present application, the descrambling method does not need to negotiate the first configuration relationship sent by the sending terminal 1, and can directly agree to the first configuration relationship sent by the sending terminal 1, and adaptively change the scrambling code polynomial of the descrambling circuit 21 according to the first configuration relationship, and decode according to the changed descrambling circuit 21. Fig.14 As shown, it is a flow chart of the scrambling method in another embodiment of the present application, which may specifically include the following steps.
[0152] Step S1401, the receiving terminal 2 receives the first configuration relationship sent by the transmitting terminal 1, the first configuration relationship includes a first correspondence table, the first correspondence table includes correspondences between different data transmission rates, different scrambling code polynomials, different parallel bit widths, and different scrambling code seeds.
[0153] Step S1402 : Receiving terminal 2 responds to the first configuration relationship and replies a first confirmation code stream to sending terminal 1 .
[0154] Step S1403: The receiving terminal 2 determines a scrambling code polynomial and a scrambling code seed according to the first configuration relationship.
[0155] In this embodiment, the transmitting terminal 1 responds to the first confirmation code stream, obtains the data transmission rate of the transmitting terminal 1, and sends the data transmission rate to the receiving terminal 2. The receiving terminal 2 determines the scrambling code polynomial and scrambling code seed corresponding to the data transmission rate according to the data transmission rate and the first configuration relationship.
[0156] Step S1404: the receiving terminal 2 controls the descrambling circuit 21 to switch to a circuit structure corresponding to the scrambling code polynomial.
[0157] In this embodiment, step S1404 includes: the receiving terminal 2 performs closing control and opening control on a switch in the descrambling circuit 21 of the receiving terminal 2 according to the scrambling code polynomial so that the descrambling circuit 21 switches to the scrambling code polynomial.
[0158] For example, if the scrambling polynomial is 1+X 6 +X 7 The receiving terminal 2 closes the switch connected to the output end of the 6th-stage D flip-flop and the switch connected to the output end of the 7th-stage D flip-flop in the descrambling circuit 21, and opens the remaining switches in the switch group 112 to switch the scrambling code polynomial of the descrambling circuit 21 to 1+X 6 +X 7 .
[0159] In other embodiments, the receiving terminal 2 includes multiple descrambling circuits 21, each of which has a scrambling polynomial. Step S1404 includes: the receiving terminal 2 selects the descrambling circuit 21 having the scrambling polynomial as the descrambling circuit 21 of the receiving terminal 2 according to the scrambling polynomial.
[0160] In step S1405 , the receiving terminal 2 responds to the scrambling code seed and controls the descrambling circuit 21 to perform pre-descrambling using the scrambling code seed as an initial value of the descrambling circuit 21 .
[0161] Step S1406: After completing pre-descrambling, the receiving terminal 2 replies with a second confirmation signal to the sending terminal 3.
[0162] Step S1407 , the receiving terminal 2 receives the scrambled data sequence sent by the transmitting terminal 1 , and descrambles the scrambled data sequence according to the descrambling circuit 21 .
[0163] Some embodiments of the present application also provide an electronic device, such as Fig.15As shown, the electronic device may include: one or more communication units 1501; a processor 1502; a memory 1503; and one or more computer programs 1504. The above components may be connected via one or more communication buses 1505. The one or more computer programs 1504 are stored in the above memory 1503 and are configured to be executed by the one or more processors 1502. The one or more computer programs 1504 include instructions, which may be used to execute the following: Figure 4-5 , Figure 7A-13 The steps performed by the sending terminal 1 or the receiving terminal 2 in the corresponding embodiment. Of course, Fig.15 The electronic device shown may also include other devices such as a sensor module, an audio module, and a SIM card interface, and the present application embodiment does not impose any restrictions on this. In this embodiment, the electronic device may be a mobile phone, a tablet computer, a laptop computer, a personal digital assistant, a smart TV, a smart screen, a camera, a vehicle-mounted device, a wearable device, etc. The communication unit 1501 may be a cable, an optical fiber, a telephone line, or a network cable.
[0164] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0165] This embodiment also provides a computer-readable storage medium, which includes instructions. When the instructions are executed on an electronic device, the electronic device executes Figure 4 , 6 , Figure 8-14 The relevant method steps in the embodiment are used to implement the method in the above embodiment.
[0166] This embodiment also provides a computer program product including instructions. When the computer program product is run on an electronic device, the electronic device executes the following Figure 4 , 6 , Figure 8-14 The relevant method steps in the embodiment are used to implement the method in the above embodiment.
[0167] This embodiment further provides a control device, the control device includes a processor and a memory, the memory is used to store computer program code, the computer program code includes computer instructions, when the processor executes the computer instructions, the control device executes as follows Figure 4 , 6 , Figure 8-14The method in the above embodiment is implemented by the relevant method steps in the control device. The control device can be an integrated circuit IC or a system on a chip SOC. The integrated circuit can be a general integrated circuit, a field programmable gate array FPGA, or an application-specific integrated circuit ASIC.
[0168] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0169] In the several embodiments provided in this embodiment, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0170] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0171] In addition, each functional unit in each embodiment of the present embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0172] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of each embodiment method. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk and other media that can store program codes.
[0173] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A scrambling method, applied to a sending terminal, characterized in that: The method comprises: The sending terminal negotiates data transmission parameters with the receiving terminal, wherein the sending terminal and the receiving terminal are in a connected state; The sending terminal confirms the scrambling code polynomial according to the data transmission parameter; The transmitting terminal switches the scrambling circuit of the transmitting terminal according to the scrambling code polynomial so that the switched scrambling circuit has a circuit structure corresponding to the scrambling code polynomial; The scrambling circuit after the switching of the control of the transmitting terminal scrambles the data sequence to be scrambled to obtain a scrambled data sequence; The transmitting terminal obtains the data transmission rate of the transmitting terminal, and determines a scrambling code polynomial corresponding to the data transmission rate according to the data transmission rate and the first configuration relationship, and the transmitting terminal performs closing control and opening control on a switch in a scrambling circuit of the transmitting terminal according to the scrambling code polynomial so that the scrambling circuit switches to a circuit structure corresponding to the scrambling code polynomial; The first configuration relationship includes a corresponding relationship between the data transmission rate and the scrambling code polynomial.
2. The scrambling method according to claim 1, characterized in that: The transmitting terminal confirming the scrambling code polynomial according to the data transmission parameter includes: The transmitting terminal obtains a scrambling code polynomial from the data transmission parameters.
3. The scrambling method according to claim 1, characterized in that: The transmitting terminal includes a plurality of the scrambling circuits, each of the scrambling circuits has a scrambling code polynomial, and the transmitting terminal switches the scrambling circuit of the transmitting terminal according to the scrambling code polynomial so that the switched scrambling circuit has a circuit structure corresponding to the scrambling code polynomial. The circuit structure includes: The transmitting terminal selects a scrambling circuit having the scrambling code polynomial according to the scrambling code polynomial as the scrambling circuit of the transmitting terminal.
4. The scrambling method according to claim 1, characterized in that: The scrambling circuit after the control switching of the transmitting terminal scrambles the data sequence to be scrambled to obtain the scrambled data sequence, including: The sending terminal scrambles the data sequence to be scrambled according to the formula The scrambled data sequence is obtained by calculation, wherein Bk is the data sequence to be scrambled, Ck is the scrambled data sequence, L is the highest order of the scrambling code polynomial, m is the number of D flip-flops in the scrambling code circuit, k is the sequence number of the data sequence to be scrambled, Dk-i is the output sequence of the i-th stage D flip-flop in the scrambling code circuit, Ai is the feedback coefficient, and the value is 0 or 1, wherein Ai is 0, which represents that the output sequence of the i-th stage D flip-flop in the scrambling code circuit participates in the scrambling operation.
5. The scrambling method according to claim 1, characterized in that: The negotiation of data transmission parameters between the sending terminal and the receiving terminal includes: The sending terminal sends the data transmission parameters to the receiving terminal; The receiving terminal determines whether to agree with the data transmission parameter; If the receiving terminal disagrees with the data transmission parameters, The receiving terminal modifies the data transmission parameters, stores the modified data transmission parameters, and sends a first confirmation code stream including the modified data transmission parameters to the sending terminal; The sending terminal obtains the modified data transmission parameter from the first confirmation code stream, and updates the data transmission parameter with the modified data transmission parameter; or If the receiving terminal agrees with the data transmission parameters, the receiving terminal stores the data transmission parameters and sends a second confirmation code stream to the sending terminal.
6. The scrambling method according to claim 1, characterized in that: The method further includes: the transmitting terminal sending the scrambled data sequence to the receiving terminal.
7. The scrambling method according to claim 6, characterized in that: The sending terminal sending the scrambled data sequence to the receiving terminal includes: The sending terminal obtains the parallel bit width from the data transmission parameter; The transmitting terminal sends the scrambled data sequence to the receiving terminal according to the parallel bit width.
8. The scrambling method according to claim 1, characterized in that: After the transmitting terminal switches the scrambling circuit of the transmitting terminal according to the scrambling code polynomial so that the switched scrambling circuit has a circuit structure corresponding to the scrambling code polynomial, the method further includes: The transmitting terminal obtains a scrambling code seed from the data transmission parameters; The scrambling code seed is used as an initial value of the scrambling circuit for pre-scrambling.
9. A descrambling method, applied in a receiving terminal, characterized in that: The descrambling method comprises: The receiving terminal confirms the scrambling code polynomial according to the data transmission parameters sent by the sending terminal; The receiving terminal switches a descrambling circuit of the receiving terminal according to the scrambling code polynomial so that the descrambling circuit has a circuit structure corresponding to the scrambling code polynomial; The receiving terminal receives the scrambled data sequence sent by the sending terminal, and descrambles the scrambled data sequence according to the switched descrambling circuit; The receiving terminal receives a first configuration relationship sent by the sending terminal, where the first configuration relationship includes a correspondence between the data transmission rate and the scrambling code polynomial, and the receiving terminal determines a scrambling code polynomial corresponding to the data transmission rate according to the data transmission rate and the first configuration relationship; The receiving terminal performs closing control and opening control on a switch in the descrambling circuit according to the scrambling code polynomial so that the descrambling circuit switches to a circuit structure corresponding to the scrambling code polynomial.
10. The descrambling method according to claim 9, characterized in that: The method further comprises: The receiving terminal obtains a scrambling code seed from the data transmission parameters; The scrambling code seed is used as an initial value of the descrambling circuit for pre-descrambling.
