Optimization method for underground setting control module
By adopting two-way demodulation circuits and power-on self-test process in the downhole seating control module, the problem of low reliability of the seating control module in the existing technology is solved, and higher communication reliability and motor control reliability are achieved, avoiding operation failure and resource waste.
Patent Information
- Application Number
- CN202411952515.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-05-09
AI Technical Summary
The existing downhole seating control module has low reliability, resulting in the failure of communication and motor control functions during the bridge plug seating process, resulting in operation failure and waste of resources.
By using two demodulation circuits in the seating control module to input communication signals, and designing a power-on self-test process to detect the control interface, communication interface, motor interface and on-board peripherals, the state accuracy and redundant design of the module are enhanced and communication reliability is improved.
It enhances the communication reliability of the downhole seating control module and traceability of the motor position information, ensures the correctness of the module status, and avoids operation failures and resource waste.
Smart Images

Figure CN119957122A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of equipment control, and in particular to an optimization method for a downhole setting control module. Background Art
[0002] At present, most of the combined operations of bridge plugging and perforating in oil and gas wells use a single-line cable to pump the instrument pipe string to the predetermined position in the well. The ground control system and the setting control module communicate and power supply through a single-core single-line cable, and then drive the motor through the setting control module to complete the bridge plug setting function.
[0003] During the process of bridge plug setting, single-core communication and motor control are key functions of the setting control module. Failure of any of these functions will lead to operation failure, causing manpower, material and economic losses. Summary of the invention
[0004] In view of the technical problem of low reliability of a setting control module in the prior art, the present invention proposes an optimization method for a downhole setting control module.
[0005] In order to achieve the above object, the present invention provides the following technical solutions:
[0006] An optimization method for a downhole setting control module specifically comprises the following steps:
[0007] The communication signal in the single-core cable is input to the single-chip microcomputer through two demodulation circuits, and the motor signal is input to the single-chip microcomputer through two interfaces;
[0008] When the setting control module is powered on, the control interface, communication interface, motor interface and onboard peripherals are powered on and self-checked respectively;
[0009] Upgrade the application of the setting control module based on a single-core cable.
[0010] Preferably, the power-on self-test process of the control interface is:
[0011] After the application is initialized, the control list is initialized with the control interface involved in the sealing module. The control list includes I channels, and the detection flag is initialized to 0; then switch to the i-th channel, 1≤i≤I; initialize the detection flag to 0, and invert the detection flag, the i-th channel outputs the flag state, and after a delay of T1 time, the detection interface determines whether the input level is consistent with the flag state. If so, the loop detection is performed 10 times, and then the i+1-th channel self-test is performed; otherwise, the i-th channel self-test is marked as failed, and the loop detection is performed 10 times, and then the i+1-th channel self-test is performed; determine whether to traverse the detection list, if so, end, if not, switch to the i+1-th channel.
[0012] Preferably, the power-on self-test process of the communication interface is:
[0013] Initialize the receiving list with the receiving interface involved in the communication with the sealing module, the receiving list includes M channels, and configure the detection interface as output; switch to the mth channel, 1≤m≤M; the detection interface sends a self-test command, and the mth channel identifies whether the self-test command is received; if not, mark the mth channel self-test failure, and then switch to the m+1th channel; if yes, mark the mth channel self-test success, and switch to the m+1th channel; determine whether to traverse the receiving list, if yes, end, if not, switch to the m+1th channel.
[0014] Preferably, the power-on self-test process of the motor interface is:
[0015] Initialize the acquisition list with the motor signal. The motor interface includes J channels, and configure the detection interface as output; initialize the detection flag to 0; switch to the jth channel, 1≤j≤J; invert the detection flag, and the jth channel outputs the flag state. After a delay of T2 time, the acquisition interface determines whether the input level is consistent with the flag state. If so, mark the jth channel self-test as successful, and loop the detection for 10 times, and then perform the self-test of the j+1th channel; if not, mark the jth channel self-test as failed, and loop the detection for 10 times, and then perform the self-test of the j+1th channel; determine whether to traverse the acquisition list, if so, end, if not, switch to the j+1th channel.
[0016] Preferably, the power-on self-test process of the onboard peripheral is:
[0017] The detection interface is configured as an analog input, and the onboard peripheral AD5245 chip is controlled to output a first voltage. The detection interface determines whether the analog input is within a preset range; if so, the onboard peripheral AD5245 is marked as functioning normally; if not, the onboard peripheral AD5245 is marked as functioning abnormally, and the voltage output is reset.
[0018] Preferably, the setting control module is provided with a guide unit, an application unit, an application information area and a reserved area; the guide unit upgrade process includes waiting for request, information aggregation, upgrade storage, upgrade verification and application jump.
[0019] Preferably, the waiting request process is:
[0020] After the power-on initialization is completed, the boot unit enters the waiting request state and starts the counter at the same time. When the counter exceeds the first time, if the upgrade request command frame sent by the ground system is received within the first time, the 3s counter is restarted, the request success reply is sent, and the information summary is entered; if it exceeds the first time, the application jump is entered.
[0021] Preferably, the information aggregation process is:
[0022] After entering the information summary, check in real time whether the counter exceeds the second time; if within the second time, after receiving the upgrade information frame header data frame sent by the ground system, destroy the counter and record the received upgrade information, including the total data size, the total number of data packets and the upgrade starting address; if the upgrade information is reasonable, the expected packet number is set to 1, the amount of successfully received data is cleared, and a correct information response is sent to enter the upgrade storage; if the upgrade information is abnormal, an information abnormal response is sent and the request is returned to the waiting state; if it exceeds the second time, the application jump is entered.
[0023] Preferably, the upgrade storage process is:
[0024] After entering the upgrade storage, continue to wait for the upgrade data packet of the ground system; when receiving the upgrade data packet, determine whether the received packet number is consistent with the expected packet number, if not, send a storage failure response command; if so, store the data according to the upgrade starting address and packet number, the expected packet number is incremented by 1, the amount of successfully received data is increased by the current received data size, and then determine whether the received packet number is consistent with the total number of packets, if so, send a storage completion response command to enter the upgrade verification, if not, send a storage success response command.
[0025] Preferably, the upgrade verification process is:
[0026] After entering the upgrade verification, continue to wait for the verification command frame of the ground system. After receiving the verification command frame, determine whether the total data size and the amount of successfully received data are equal; if not, mark the number as wrong and directly send a verification failure response; if so, perform a CRC32 check on the storage area of the upgrade storage to determine whether the calculated value is equal to the verification information in the verification command. If so, send a verification success response and enter the application jump; if not, mark the verification value as wrong and send a verification failure response.
[0027] In summary, due to the adoption of the above technical solution, compared with the prior art, the present invention has at least the following beneficial effects:
[0028] The present invention enhances the reliability of communication through redundant design, ensuring that the motor position information can be tracked; at the same time, the module status can be ensured to be correct through power-on self-test;
[0029] The present invention can realize programming or reprogramming of the module through a single-core cable, avoids damaging the shell and removing the potting glue, causing waste of manpower, material resources and the like, and improves safety and reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 Schematic diagram of an optimization method for a downhole sealing control module according to an exemplary embodiment of the present invention.
[0031] Figure 2The figure is a schematic diagram of a power-on self-test process of a control interface according to an exemplary embodiment of the present invention.
[0032] Figure 3 The figure is a schematic diagram of a power-on self-test process of a communication interface according to an exemplary embodiment of the present invention.
[0033] Figure 4 The figure is a schematic diagram of a power-on self-test process of a motor interface according to an exemplary embodiment of the present invention.
[0034] Figure 5 The figure is a schematic diagram of a power-on self-test process of an onboard peripheral according to an exemplary embodiment of the present invention.
[0035] Figure 6 A schematic diagram of Flash space allocation according to an exemplary embodiment of the present invention.
[0036] Figure 7 FIG. 4 is a schematic diagram of an upgrade process of a boot unit according to an exemplary embodiment of the present invention.
[0037] Figure 8 FIG. 4 is a schematic diagram of a waiting request flow according to an exemplary embodiment of the present invention.
[0038] Fig. 9 The figure is a schematic diagram of an information aggregation process according to an exemplary embodiment of the present invention.
[0039] Fig.10 FIG. 4 is a schematic diagram of an upgrade storage process according to an exemplary embodiment of the present invention.
[0040] Fig.11 Schematic diagram of an upgrade verification process according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0041] The present invention is further described in detail below in conjunction with the examples and specific implementation methods. However, this should not be understood as the scope of the above subject matter of the present invention being limited to the following examples, and all technologies realized based on the content of the present invention belong to the scope of the present invention.
[0042] In the description of the present invention, it is necessary to understand that the terms "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0043] like Figure 1As shown, the present invention provides an optimization method for a downhole setting control module, which specifically includes the following steps:
[0044] S1: Input the external communication signal into the first interface of the sealing control module through the first demodulation circuit, and input the communication signal into the second interface of the sealing control module through the second demodulation circuit; and input the external first motor signal into the third interface of the control module, and input the external second motor signal into the fourth interface of the control module.
[0045] In this embodiment, since there are many noises in the carrier signal on the single-core cable during the actual perforating operation, the carrier signal is not easy to collect after the motor is running; the main improvement design is to perform redundant backup on the key signals of the MCU, such as communication signals and motor signals.
[0046] In this embodiment, the demodulation circuit is an existing circuit, so it is not described in detail; the technical improvement is that the communication signal is input into the sealing control module through two demodulation circuits, which increases the reliability of signal acquisition.
[0047] In this embodiment, a simple cyclic priority decision algorithm is designed to realize the dynamic switching of communication signal and motor signal link. When making a decision, first find the highest priority in the decision queue and execute the corresponding service function. If the service is normal, the service result is obtained. Otherwise, the current priority is placed at the end of the queue, and the remaining priorities are incremented by 1, and the search and execution process is repeated. Through the cyclic priority decision algorithm, the reliability of communication is enhanced and the motor position information can be tracked.
[0048] Among them, the priority is the dual-channel communication interface as one group of priorities, and the dual-channel motor interface as another group of priorities; when the software of each group is started, channel 1 has the highest priority by default, but it will be switched during operation according to the actual situation of the control module; the input signal of the channel with the higher priority will be selected.
[0049] The control software designs a circular priority decision tree structure, which mainly includes priority, total number, port, and port number. Priority is the priority of the service object, total number refers to the total number of services, port refers to the port used by the object, and port number refers to the port number used by the object, such as the PB6 port used by the communication receiving interface 1.
[0050] In this embodiment, a communication service function interface int ComRcvData(RoundRobinArbiter*rra) is also designed, including a first interface and a second interface, which are used to realize the reception and parsing of single-core communication data. The return value is used to determine whether the communication port is working normally, and the communication service result data is stored in the global array gu8_ComBuf.
[0051] In this embodiment, a motor position information reading service interface int ReadMotorHall(RoundRobinArbiter*rra) is designed, including a third interface and a fourth interface, which are used to realize the collection of motor Hall signals. The return value is used to determine whether the motor hall collection port is working normally. The collected Hall number is stored in the global variable gu32_MotorHallSwitchCnt.
[0052] S2: When the setting control module is powered on, a power-on self-test is performed on the control interface, communication interface, motor interface and onboard peripheral interface respectively.
[0053] In this embodiment, the control interface includes a motor enable control interface, a motor direction control interface, a first communication sending interface, and a second communication sending interface; the communication interface includes a first communication receiving interface and a second communication receiving interface; the motor interface includes a first motor signal acquisition interface and a second motor signal acquisition interface; and the onboard peripheral interface includes a programmable resistor AD5245.
[0054] In this embodiment, the setting control module enters the application unit to perform initialization, and after the initialization is completed, the power-on self-test process is performed. The purpose of the power-on self-test is to ensure that the module is in the correct state. This solution uses hardware to add a multiplexer MAX396 to perform connection detection on the detection interface, and the signal is input to the detection interface. The detection interface defaults to a floating input.
[0055] Detection of the control interface: The control interface repeatedly outputs a 1Khz pulse signal 10 times to determine whether the control interface is normal;
[0056] Detection of the communication interface: configure the communication interface to output mode, and control the interface to simulate single-core communication to output a self-test pulse signal, so as to determine whether the communication interface is normal;
[0057] Detection of the motor interface: configure the detection interface to output mode, and control the detection interface to output 10 1Khz pulse signals to determine whether the motor interface is normal;
[0058] Detection of onboard peripheral interface: configure the detection interface to analog input mode, control the output of a first voltage (1.2V), and detect whether the voltage is within the threshold range (1.2±0.1v). If so, it means that the onboard peripheral interface is normal, otherwise it means that the onboard peripheral interface is abnormal.
[0059] like Figure 2 As shown in the figure, the power-on self-test process of the control interface is as follows:
[0060] The sealing control module enters the application unit to perform initialization (the self-test result is 0), and uses the control interface involved in the sealing module to initialize the control list (including I channels, each channel corresponds to a control interface), and switches to the i-th channel, 1≤i≤I; the detection flag (that is, a uchar type local variable in the self-test function) is initialized to 0, and the detection flag is inverted (that is, 0->1, 1->0 operations, the purpose is to allow the detection interface to switch the output high and low levels), the i-th channel outputs the flag state (the detection flag state is consistent, the detection flag is 1 when the output is high, and the detection flag is 0 when the output is low). Level), after a delay of T1 time (for example, 0.5s), the detection interface (the detection interface is the selector output of MAX396 directly connected to port PB0 on the microcontroller) determines whether the input level is consistent with the flag state. If so, it loops and detects 10 times (if not 10 times, the detection flag is inverted), and then the self-test of the next control interface (i+1 channel) is performed; if not, the self-test of the i-th channel is marked as failed, and the self-test is looped and tested 10 times, and then the self-test of the next control interface (i+1 channel) is performed; it is determined whether to traverse the control list, if so, it ends, if not, it switches to the next channel (i+1 channel).
[0061] In this embodiment, if the first communication sending interface self-tests normally, the first communication sending interface is used; if the first communication sending interface self-test fails, the second communication sending interface is used to play a redundancy role and ensure that the module can work normally.
[0062] like Figure 3 As shown in the figure, the power-on self-test process of the communication interface is as follows:
[0063] Initialize the receiving list (including M channels, each channel corresponds to a receiving interface) with the receiving interface involved in the communication with the sealing module, and configure the detection interface as output; switch to the mth channel, 1≤m≤M; the mth channel sends a self-test command, and the detection port identifies whether the self-test command is received; if not, mark the mth channel self-test as failed, and then switch to the next channel (m+1th channel); if so, mark the mth channel self-test as successful, and switch to the next channel (m+1th channel); determine whether to traverse the receiving list, if so, end, if not, switch to the next channel (m+1th channel).
[0064] In this embodiment, if the first communication receiving interface self-checks normally, the first communication receiving interface is used; if the first communication receiving interface self-checks unsuccessfully, the second communication receiving interface is used, which plays a redundancy role and ensures that the module can work normally.
[0065] like Figure 4 As shown in the figure, the power-on self-test process of the motor interface is as follows:
[0066] Initialize the acquisition list with the motor signal (including J channels, each channel corresponds to an acquisition interface), and configure the detection interface as output; switch to the j-th channel, 1≤j≤J; initialize the detection flag to 0, and invert the detection flag, the j-th channel outputs the flag state, and after a delay of T2 time (for example, 0.5s), the acquisition interface determines whether the input level is consistent with the flag state. If so, loop the detection for 10 times (if not 10 times, invert the detection flag), and then perform self-test on the next acquisition interface (j+1-th channel); if not, mark the j-th channel self-test as failed, and loop the detection for 10 times, and then perform self-test on the next acquisition interface (j+1-th channel); determine whether to traverse the acquisition list, if so, end, if not, switch to the next channel (j+1-th channel).
[0067] In this embodiment, if the first motor signal acquisition interface self-tests normally, the first motor signal acquisition interface is used; if the first motor signal acquisition interface self-test fails, the second motor signal acquisition interface is used to play a redundancy role and ensure that the module can work normally.
[0068] like Figure 5 As shown in the figure, the power-on self-test process of the onboard peripherals is as follows:
[0069] Configure the detection interface as analog input, adjust the voltage (programmable resistor AD5245) to output 1.2V, and the detection interface determines whether the analog input is within the preset range (1.1V-1.3V); if so, mark the voltage output as successful; otherwise, mark the voltage output as failed; the detection is completed and the voltage output is reset.
[0070] S3: In order to protect the circuit board components, a potting process is performed before leaving the factory. Therefore, there is no reserved programming interface on the external interface of the sealing control module. When reprogramming or troubleshooting the module, the shell must be destroyed and the potting glue must be removed first, resulting in a waste of manpower, material resources and other resources, seriously affecting the progress, and there is a risk of damaging the module circuit components.
[0071] Based on this, an optimized solution for single-core upgrade was designed, including a guide unit and an application unit. The sealing control module can be programmed or reprogrammed through a single-core cable.
[0072] In this embodiment, when the setting control module passes the self-test, it first enters the boot unit (BootLoader), and enters the application unit (App) if no upgrade request is received within 1 second or the upgrade is completed.
[0073] The main control MCU used in the sealing control module is Stm8AF6268, the Flash space is 32Kbyte, and the boot unit and application unit are deployed in the Flash space. According to the size of the compiled program, the Flash space is allocated and designed. The allocation scheme is as follows: Figure 6 The boot unit occupies 10Kbytes of space, the application unit occupies 19Kbytes of space, the application information area occupies 1Kbytes of space, and the reserved area occupies 2Kbytes of space.
[0074] In this embodiment, the single-core upgrade process of the boot unit includes waiting for request, information aggregation, upgrade storage, upgrade verification and application jump, such as Figure 7 As shown, the specific steps include:
[0075] A-1: If Figure 8 As shown, after the power-on initialization is completed, the boot unit enters the waiting request, and starts a counter at the same time. During operation, it queries the counter in real time whether it exceeds the first time (the first time is 1s). If the upgrade request command frame sent by the ground system is received within the first time, the 3s counter is restarted, the request success reply is sent, and the information is summarized. If it exceeds the first time, the application jump is entered.
[0076] A-2: If Fig. 9 As shown, after entering the information summary, check in real time whether the counter exceeds the second time. If the upgrade information frame header data frame sent by the ground system is received within the second time, the counter is destroyed, and the received upgrade information is recorded, including the total data size, the total number of data packets and the upgrade start address. If the upgrade information is reasonable (the upgrade start address and the total data size meet the requirements of the application software area allocated by Flash), the expected packet number is set to 1, the amount of successfully received data is cleared, and the correct information response is sent to enter the upgrade storage; if the upgrade information is abnormal (the upgrade start address and the total data size do not meet the requirements of the application software area allocated by Flash), an abnormal information response is sent and the request is returned to the waiting time. If the second time is exceeded, the application jump is entered.
[0077] A-3: If Fig.10 As shown, after entering the upgrade storage, continue to wait for the upgrade data packet of the ground system; when receiving the upgrade data packet, determine whether the received packet number is consistent with the expected packet number, if not, send a storage failure response command; if so, store the data according to the upgrade starting address and packet number, the expected packet number is incremented by 1, the amount of successfully received data is increased by the current received data size, and then determine whether the received packet number is consistent with the total number of packets, if so, send a storage completion response command to enter the upgrade verification, if not, send a storage success response command.
[0078] A-4: If Fig.11As shown, after entering the upgrade verification, continue to wait for the verification command frame of the ground system. After receiving the verification command frame, determine whether the total data size and the amount of successfully received data are equal; if not, mark the number as wrong and directly send a verification failure response; if so, perform a crc32 check on the storage area of the upgrade storage to determine whether the calculated value is equal to the verification information in the verification command. If so, send a verification success response and enter the application jump; if not, mark the verification value as wrong and send a verification failure response.
[0079] In this embodiment, after entering the application unit (i.e., application jump), the port, Flash, timer and other resources initialized by the boot unit are reset, and the jump code is executed to complete the software upgrade. The jump code is "asm("LDW X,SP"); asm("LD A,$FF"); asm("LD XL,A"); asm("LDW SP,X"); asm("JPF,$A800");".
[0080] Those skilled in the art will appreciate that the above-mentioned embodiments are specific examples for implementing the present invention, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present invention.
Claims
1. An optimization method for a downhole setting control module, characterized in that: The specific steps include: The communication signal in the single-core cable is input to the single-chip microcomputer through two demodulation circuits, and the motor signal is input to the single-chip microcomputer through two interfaces; When the setting control module is powered on, the control interface, communication interface, motor interface and onboard peripherals are powered on and self-checked respectively; Upgrade the application of the setting control module based on a single-core cable.
2. The optimization method for a downhole setting control module according to claim 1, characterized in that: The power-on self-test process of the control interface is as follows: After the application is initialized, the control list is initialized with the control interface involved in the sealing module. The control list includes I channels, and the detection flag is initialized to 0; then switch to the i-th channel, 1≤i≤I; initialize the detection flag to 0, and invert the detection flag, the i-th channel outputs the flag state, and after a delay of T1 time, the detection interface determines whether the input level is consistent with the flag state. If so, the loop detection is performed 10 times, and then the i+1-th channel self-test is performed; otherwise, the i-th channel self-test is marked as failed, and the loop detection is performed 10 times, and then the i+1-th channel self-test is performed; determine whether to traverse the detection list, if so, end, if not, switch to the i+1-th channel.
3. The optimization method for a downhole setting control module according to claim 1, characterized in that: The power-on self-test process of the communication interface is as follows: Initialize the receiving list using the receiving interface involved in the communication with the setting module. The receiving list includes M channels, and configure the detection interface as output; switch to the mth channel, 1≤m≤M; The detection interface sends a self-test command, and the mth channel identifies whether the self-test command is received; if not, mark the mth channel self-test failure and then switch to the m+1th channel; if yes, mark the mth channel self-test success and switch to the m+1th channel; determine whether to traverse the receiving list, if yes, end, if not, switch to the m+1th channel.
4. The optimization method for a downhole setting control module according to claim 1, characterized in that: The power-on self-test process of the motor interface is as follows: Initialize the acquisition list with the motor signal. The motor interface includes J channels, and configure the detection interface as output; initialize the detection flag to 0; switch to the jth channel, 1≤j≤J; invert the detection flag, and the jth channel outputs the flag state. After a delay of T2 time, the acquisition interface determines whether the input level is consistent with the flag state. If so, mark the jth channel self-test as successful, and loop the detection for 10 times, and then perform the self-test of the j+1th channel; if not, mark the jth channel self-test as failed, and loop the detection for 10 times, and then perform the self-test of the j+1th channel; determine whether to traverse the acquisition list, if so, end, if not, switch to the j+1th channel.
5. The optimization method for a downhole setting control module according to claim 1, characterized in that: The power-on self-test process of the onboard peripherals is as follows: The detection interface is configured as an analog input, and the onboard peripheral AD5245 chip is controlled to output a first voltage. The detection interface determines whether the analog input is within a preset range; if so, the onboard peripheral AD5245 is marked as functioning normally; if not, the onboard peripheral AD5245 is marked as functioning abnormally, and the voltage output is reset.
6. The optimization method for a downhole setting control module according to claim 1, characterized in that: The sealing control module is provided with a guide unit, an application unit, an application information area and a reserved area; the guide unit upgrade process includes waiting for request, information aggregation, upgrade storage, upgrade verification and application jump.
7. The optimization method for a downhole setting control module according to claim 6, characterized in that: The waiting request process is as follows: After the power-on initialization is completed, the guidance unit enters the waiting request state and starts the counter at the same time. When the counter exceeds the first time, if the upgrade request command frame sent by the ground system is received within the first time, the 3s counter is restarted, a request success reply is sent, and the information summary is entered; If it exceeds the first time, enter the application jump.
8. The optimization method for a downhole setting control module according to claim 6, characterized in that: The information aggregation process is as follows: After entering the information summary, check in real time whether the counter exceeds the second time; If the upgrade information frame header data frame sent by the ground system is received within the second time, the counter is destroyed to record the received upgrade information, including the total data size, the total number of data packets and the upgrade start address; If the upgrade information is reasonable, the expected packet number is set to 1, the amount of successfully received data is cleared to zero, and the correct response is sent to enter the upgrade storage; If the upgrade information is abnormal, an abnormal information response is sent and the system returns to the waiting request; If it exceeds the second time, the application jump will be entered.
9. The optimization method for a downhole setting control module according to claim 6, characterized in that: The upgrade storage process is as follows: After entering the upgrade storage, continue to wait for the upgrade data packet of the ground system; when receiving the upgrade data packet, determine whether the received packet number is consistent with the expected packet number, if not, send a storage failure response command; if so, store the data according to the upgrade starting address and packet number, the expected packet number is incremented by 1, the amount of successfully received data is increased by the current received data size, and then determine whether the received packet number is consistent with the total number of packets, if so, send a storage completion response command to enter the upgrade verification, if not, send a storage success response command.
10. The optimization method for a downhole setting control module according to claim 6, characterized in that: The upgrade verification process is as follows: After entering the upgrade verification, continue to wait for the verification command frame of the ground system. After receiving the verification command frame, determine whether the total data size and the amount of successfully received data are equal; if not, mark the number as wrong and directly send a verification failure response; if so, perform a CRC32 check on the storage area of the upgrade storage to determine whether the calculated value is equal to the verification information in the verification command. If so, send a verification success response and enter the application jump; if not, mark the verification value as wrong and send a verification failure response.