CN116346797A - Remote upgrading method of steady flow water distribution device for oil field - Google Patents

Remote upgrading method of steady flow water distribution device for oil field Download PDF

Info

Publication number
CN116346797A
CN116346797A CN202111608614.4A CN202111608614A CN116346797A CN 116346797 A CN116346797 A CN 116346797A CN 202111608614 A CN202111608614 A CN 202111608614A CN 116346797 A CN116346797 A CN 116346797A
Authority
CN
China
Prior art keywords
program module
application program
chip memory
turning
content
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111608614.4A
Other languages
Chinese (zh)
Inventor
王金宁
杨政
肖海龙
黄鑫
张硕
张暄翊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Aerospace Science and Industry Inertia Technology Co Ltd
Original Assignee
Aerospace Science and Industry Inertia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Aerospace Science and Industry Inertia Technology Co Ltd filed Critical Aerospace Science and Industry Inertia Technology Co Ltd
Priority to CN202111608614.4A priority Critical patent/CN116346797A/en
Publication of CN116346797A publication Critical patent/CN116346797A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a remote upgrading method of a steady flow water distribution device for an oil field, which comprises the following steps: s10, dividing a singlechip of the steady-flow water distribution device for the oil field into a Bootloader program module and an application program module; s20, the Bootloader program module reads preset address content of the off-chip memory, judges whether to update the application program module from the off-chip memory, if yes, goes to S30, otherwise, goes to S40; s30, updating the application program module through the off-chip memory; s40, the Bootloader program module reads the content of the on-chip reset vector, judges whether to update the application program module from the serial port, if yes, goes to S50, otherwise, goes to S60; s50, updating an application program module by the upper computer through the serial port; s60, starting an application program module. The invention can solve the technical problem that the upgrading of the steady flow water distribution device for the oil field in the prior art can take a great deal of time and money.

Description

Remote upgrading method of steady flow water distribution device for oil field
Technical Field
The invention relates to the technical field of remote upgrading of field equipment, in particular to a remote upgrading method of a steady flow water distribution device for an oil field.
Background
The steady flow water distribution device for the oil field is multipurpose intelligent water distribution equipment, and integrates a flowmeter, a flow regulating device, an intelligent controller and the like, and can remotely realize steady flow control of water distribution through a wireless communication network.
However, many oil fields are in remote places, and when the device needs to update an application program or upgrade the program of the device, a large amount of installation and debugging work is often required, and the program upgrade is often time-consuming and money-consuming due to factors such as traffic.
Disclosure of Invention
In order to solve one of the technical problems, the invention provides a remote upgrading method of a steady flow water distribution device for an oil field, which can solve the technical problem that upgrading of the steady flow water distribution device for the oil field in the prior art can take a great deal of time and money.
According to an aspect of the present invention, there is provided a remote upgrade method of a steady flow water distribution device for an oil field, the method comprising:
s10, dividing a singlechip of the steady-flow water distribution device for the oil field into a Bootloader program module and an application program module;
s20, the Bootloader program module reads preset address content of the off-chip memory, judges whether to update the application program module from the off-chip memory, if yes, goes to S30, otherwise, goes to S40;
s30, updating the application program module through the off-chip memory;
s40, the Bootloader program module reads the content of the on-chip reset vector, judges whether to update the application program module from the serial port, if yes, goes to S50, otherwise, goes to S60;
s50, updating an application program module by the upper computer through the serial port;
s60, starting an application program module.
Preferably, in S30, updating the application module by the off-chip memory includes:
s31, judging whether preset address content of a current page of an upgrade program area of the off-chip memory is marked with 0x55, if so, updating program codes of an application program module, and turning to S32, otherwise, directly turning to S32;
s32, judging whether preset address content of a current page of an upgrade program area of the off-chip memory is a sign 0xaa, if so, updating an interrupt vector table code of an application program module, and turning to S33, otherwise, directly turning to S33;
s33, judging whether preset address content of a current page of an upgrade program area of the off-chip memory is a mark 0x5a, if so, starting an application program module after the off-chip memory program is erased, and turning to S34, otherwise, directly turning to S34;
s34, repeating S31 to S33 until all pages of the upgrade program area of the off-chip memory are traversed.
Preferably, in S50, updating the application module by the upper computer through the serial port includes:
s51, the serial port upgrading module receives an application program code packet sent by the upper computer;
s52, judging whether a single-line content end mark exists in codes in an application program code packet received by the serial port upgrading module, if so, analyzing the received single-line codes, and turning to S53, otherwise, continuing to execute S52;
s53, judging whether the single-line initial character of the single-line code after analysis is q, if so, starting an application program module, otherwise, turning to S54;
s54, judging whether the single-line initial character of the single-line code after analysis is @, if yes, acquiring an address of a program to be written, and turning to S55, otherwise, directly turning to S55;
s55, writing the analyzed single-line codes into an application program module, and turning to S51;
wherein q is an end character; the first character of a single row is @, and the subsequent content is the starting address of the program; the first character of a single line is not @, and the subsequent content is program content.
According to another aspect of the present invention there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing any of the methods described above when executing the computer program.
By applying the technical scheme of the invention, the singlechip of the steady-flow water distribution device for the oil field is divided into a Bootloader program module and an application program module; reading preset address content of the off-chip memory by using the Bootloader program module to judge whether to update the application program module from the off-chip memory; reading the content of the on-chip reset vector by a Bootloader program module, and judging whether to update the application program module from the serial port; thereby realizing the remote upgrading of the steady flow water distribution device for the oil field. The invention solves the technical problem that the upgrading of the steady flow water distribution device for the oil field in the prior art can take a great deal of time and money.
Drawings
The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention. It is evident that the drawings in the following description are only some embodiments of the present invention and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 shows a flow chart of a method for remotely upgrading a steady flow water distribution device for an oilfield, provided in accordance with one embodiment of the present invention;
FIG. 2 illustrates a flow chart of a program for updating from off-chip memory provided in accordance with one embodiment of the invention;
FIG. 3 shows a flow chart of a slave serial update procedure provided in accordance with one embodiment of the present invention.
Detailed Description
It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other. The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. The following description of at least one exemplary embodiment is merely exemplary in nature and is in no way intended to limit the invention, its application, or uses. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments in accordance with the present application. As used herein, the singular is also intended to include the plural unless the context clearly indicates otherwise, and furthermore, it is to be understood that the terms "comprises" and/or "comprising" when used in this specification are taken to specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof.
The relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless it is specifically stated otherwise. Meanwhile, it should be understood that the sizes of the respective parts shown in the drawings are not drawn in actual scale for convenience of description. Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but should be considered part of the specification where appropriate. In all examples shown and discussed herein, any specific values should be construed as merely illustrative, and not a limitation. Thus, other examples of the exemplary embodiments may have different values. It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
As shown in fig. 1, the invention provides a remote upgrading method of a steady flow water distribution device for an oil field, which comprises the following steps:
s10, dividing a singlechip of the steady-flow water distribution device for the oil field into a Bootloader program module and an application program module;
s20, the Bootloader program module reads preset address content of the off-chip memory, judges whether to update the application program module from the off-chip memory, if yes, goes to S30, otherwise, goes to S40;
s30, updating the application program module through the off-chip memory;
s40, the Bootloader program module reads the content of the on-chip reset vector, judges whether to update the application program module from the serial port, if yes, goes to S50, otherwise, goes to S60;
s50, updating an application program module by the upper computer through the serial port;
s60, starting an application program module.
The invention divides the singlechip of the steady-flow water distribution device for the oil field into a Bootloader program module and an application program module; reading preset address content of the off-chip memory by using the Bootloader program module to judge whether to update the application program module from the off-chip memory; reading the content of the on-chip reset vector by a Bootloader program module, and judging whether to update the application program module from the serial port; thereby realizing the remote upgrading of the steady flow water distribution device for the oil field. The invention solves the technical problem that the upgrading of the steady flow water distribution device for the oil field in the prior art can take a great deal of time and money.
In order to meet the requirement of remote upgrading, the singlechip of the steady-flow water distribution device for the oil field is divided into a Bootloader program module and an application program module.
Specifically, the singlechip of the steady flow water distribution device for the oil field can adopt an MSP430F2418 singlechip.
For example, the invention changes the space allocation of MSP430F2418 SCM. In normal use, the user code occupies 3100-FFBF and 10000-1 FFFF areas, and the interrupt vector is FFC 0-FFFF. And after the modification, the space is allocated with a program module and an application program module which contain Bootloader. Wherein, the Bootloader program module occupies a part of code areas 3100 to 3FFF and occupies interrupt vectors FFC0 to FFFF; the code area occupied by the application program module is changed into 4000-FCC 0 and 10000-1 FFFF, and the occupied interrupt vector table is changed into FCC 0-FD 00.
In the invention, the main function of the Bootloader program module is to call each program module to execute each module function, and the control task of the whole system is coordinated and completed. Mainly consists of 3 modes: the on-chip application is updated from off-chip memory, the on-chip application is updated from a serial port, and the application is started. The entry into the three states is determined according to the specific address content of the off-chip memory and the reset vector. After the system is powered on and initialized, reading a mark stored in a specific address of the off-chip memory to judge whether to update the on-chip application program from the off-chip memory, judging that the program is required to be updated, executing the program module updating function from the off-chip memory, and otherwise, continuing executing the program. And then, reading the content of the on-chip reset vector to judge whether to update the on-chip application program from the serial port, if the content of the reset vector of the application program is 0xffff, indicating that the application program is not available, executing the function of updating the on-chip application program module from the serial port, otherwise, executing the application program in a jumping mode.
In the present invention, the program module is updated from off-chip memory mainly consists of 3 parts: updating program codes, updating an interrupt vector table, and starting an application program after erasing the off-chip FLASH program. The three states are decided to be entered according to the specific address content of each page of the off-chip memory upgrade program area.
In accordance with one embodiment of the present invention, as shown in FIG. 2, in S30, updating the application program module by the off-chip memory includes:
s31, judging whether preset address content of a current page of an upgrade program area of the off-chip memory is marked with 0x55, if so, updating program codes of an application program module, and turning to S32, otherwise, directly turning to S32;
s32, judging whether preset address content of a current page of an upgrade program area of the off-chip memory is a sign 0xaa, if so, updating an interrupt vector table code of an application program module, and turning to S33, otherwise, directly turning to S33;
s33, judging whether preset address content of a current page of an upgrade program area of the off-chip memory is a mark 0x5a, if so, starting an application program module after the off-chip memory program is erased, and turning to S34, otherwise, directly turning to S34;
s34, repeating S31 to S33 until all pages of the upgrade program area of the off-chip memory are traversed.
In the invention, the serial port upgrading program module is connected with the serial port of the upper computer through the serial port, the upper computer is communicated with the singlechip, and an application program needing to run in the singlechip is written into the singlechip. The application program generated by the singlechip is a txt file, the single-row content of the file is finished by carriage return and line feed, the single-row initial character is @ subsequent content is the starting address of the program, and otherwise, the single-row initial character is the program content. The program ends with the character q.
In accordance with one embodiment of the present invention, as shown in fig. 3, in S50, the upper computer updates the application module through the serial port, including:
s51, the serial port upgrading module receives an application program code packet sent by the upper computer;
s52, judging whether a single-line content end mark exists in codes in an application program code packet received by the serial port upgrading module, if so, analyzing the received single-line codes, and turning to S53, otherwise, continuing to execute S52;
s53, judging whether the single-line initial character of the single-line code after analysis is q, if so, starting an application program module, otherwise, turning to S54;
s54, judging whether the single-line initial character of the single-line code after analysis is @, if yes, acquiring an address of a program to be written, and turning to S55, otherwise, directly turning to S55;
s55, writing the analyzed single-line codes into an application program module, and turning to S51;
wherein q is an end character; the first character of a single row is @, and the subsequent content is the starting address of the program; the first character of a single line is not @, and the subsequent content is program content.
In the invention, the function related to remote upgrade in the application program module is to complete data transmission of the upgrade file and write the upgrade file into the off-chip memory. In order to realize accurate upgrading, the original upgrading code is packed firstly, then the corresponding data packet ID number and the corresponding check code are added, each data packet is numbered, and the length of the data packet is less than or equal to 256 bytes. Due to the effects of terrain and environmental factors, blockage or disconnection may occur during remote upgrades. If the response signal of the remote terminal is not received within a certain time, retransmitting, if the three retransmissions fail, storing the successfully received data block ID number and the successfully received data check code, and entering breakpoint continuous transmission. After receiving the data packet of the upgrade file, the application program module writes the data into the corresponding page of the upgrade program area of the off-chip memory, and meanwhile judges whether the data packet is the code of the upgrade file or the interrupt vector table of the upgrade file, if the data packet is the code, the specific address of each page is written with 0x55, and if the data packet is the interrupt vector table, the specific address of each page is written with 0xaa. After the application program module receives all the data, one page needs to be added to write 0x5a at a specific address as an upgrade program ending mark. Finally, the application program needs to be upgraded by writing the corresponding content mark in the specific address of the off-chip memory. After the upgrade is finished, the application program module executes and exits, and the Bootloader program module starts to update the upgrade program. After the application program module finishes the upgrade preparation work, the Bootloader program module needs to read the specific address of the off-chip memory and write the corresponding content mark to judge whether the application program needs to be upgraded or not, and the specific address content of each page judges the code, the interrupt vector table and the end of the upgrade program.
The invention also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing any of the methods described above when executing the computer program.
Spatially relative terms, such as "above … …," "above … …," "upper surface at … …," "above," and the like, may be used herein for ease of description to describe one device or feature's spatial location relative to another device or feature as illustrated in the figures. It will be understood that the spatially relative terms are intended to encompass different orientations in use or operation in addition to the orientation depicted in the figures. For example, if the device in the figures is turned over, elements described as "above" or "over" other devices or structures would then be oriented "below" or "beneath" the other devices or structures. Thus, the exemplary term "above … …" may include both orientations of "above … …" and "below … …". The device may also be positioned in other different ways (rotated 90 degrees or at other orientations) and the spatially relative descriptors used herein interpreted accordingly.
In addition, the terms "first", "second", etc. are used to define the components, and are only for convenience of distinguishing the corresponding components, and the terms have no special meaning unless otherwise stated, and therefore should not be construed as limiting the scope of the present invention.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (4)

1. A method for remotely upgrading a steady flow water distribution device for an oil field, the method comprising:
s10, dividing a singlechip of the steady-flow water distribution device for the oil field into a Bootloader program module and an application program module;
s20, the Bootloader program module reads preset address content of the off-chip memory, judges whether to update the application program module from the off-chip memory, if yes, goes to S30, otherwise, goes to S40;
s30, updating the application program module through the off-chip memory;
s40, the Bootloader program module reads the content of the on-chip reset vector, judges whether to update the application program module from the serial port, if yes, goes to S50, otherwise, goes to S60;
s50, updating an application program module by the upper computer through the serial port;
s60, starting an application program module.
2. The method of claim 1, wherein in S30, updating the application program module by the off-chip memory comprises:
s31, judging whether preset address content of a current page of an upgrade program area of the off-chip memory is marked with 0x55, if so, updating program codes of an application program module, and turning to S32, otherwise, directly turning to S32;
s32, judging whether preset address content of a current page of an upgrade program area of the off-chip memory is a sign 0xaa, if so, updating an interrupt vector table code of an application program module, and turning to S33, otherwise, directly turning to S33;
s33, judging whether preset address content of a current page of an upgrade program area of the off-chip memory is a mark 0x5a, if so, starting an application program module after the off-chip memory program is erased, and turning to S34, otherwise, directly turning to S34;
s34, repeating S31 to S33 until all pages of the upgrade program area of the off-chip memory are traversed.
3. The method according to claim 1 or 2, wherein in S50, the upper computer updating the application module through the serial port includes:
s51, the serial port upgrading module receives an application program code packet sent by the upper computer;
s52, judging whether a single-line content end mark exists in codes in an application program code packet received by the serial port upgrading module, if so, analyzing the received single-line codes, and turning to S53, otherwise, continuing to execute S52;
s53, judging whether the single-line initial character of the single-line code after analysis is q, if so, starting an application program module, otherwise, turning to S54;
s54, judging whether the single-line initial character of the single-line code after analysis is @, if yes, acquiring an address of a program to be written, and turning to S55, otherwise, directly turning to S55;
s55, writing the analyzed single-line codes into an application program module, and turning to S51;
wherein q is an end character; the first character of a single row is @, and the subsequent content is the starting address of the program; the first character of a single line is not @, and the subsequent content is program content.
4. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any of claims 1-3 when the computer program is executed.
CN202111608614.4A 2021-12-24 2021-12-24 Remote upgrading method of steady flow water distribution device for oil field Pending CN116346797A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111608614.4A CN116346797A (en) 2021-12-24 2021-12-24 Remote upgrading method of steady flow water distribution device for oil field

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111608614.4A CN116346797A (en) 2021-12-24 2021-12-24 Remote upgrading method of steady flow water distribution device for oil field

Publications (1)

Publication Number Publication Date
CN116346797A true CN116346797A (en) 2023-06-27

Family

ID=86890323

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111608614.4A Pending CN116346797A (en) 2021-12-24 2021-12-24 Remote upgrading method of steady flow water distribution device for oil field

Country Status (1)

Country Link
CN (1) CN116346797A (en)

Similar Documents

Publication Publication Date Title
CN109656597A (en) Firmware upgrade method, device and computer readable storage medium
CN100386743C (en) Debugging method of embedded system and its system
CN112270149B (en) Verification platform automatic integration method and system, electronic equipment and storage medium
CN100504810C (en) Embedded system debug method
CN108804118B (en) Firmware upgrading method, device and storage medium
CN110618830B (en) Remote upgrading method and system based on NBIOT network
CN101430662B (en) Method for debugging Java language program and virtual machine program together
CN101963910A (en) General USB (Universal Serial Bus) based equipment firmware updating method
CN103077058A (en) Method and device for installing application program
CN107402776A (en) A kind of mobile phone wireless upgrading stm32 singlechip controller firmware methods based on bluetooth 4
CN109614126B (en) Embedded system online program upgrading method and device
CN110851163B (en) Software updating method compatible with multi-equipment platform based on CAN communication
CN107479531B (en) The access device communication protocol frame format information of Embedded PLC remotely determines method
CN103853663A (en) Application program test method and system
CN104519105A (en) Method and device for acquiring applications matched with terminals
CN115220758B (en) Method for on-line upgrading of single chip microcomputer firmware
CN102662688A (en) An update method and apparatus for Nor flash
CN105830021A (en) Updatable integrated-circuit radio
CN104428751A (en) Program data updating method and equipment
CN116346797A (en) Remote upgrading method of steady flow water distribution device for oil field
CN111562436B (en) Equipment driving method and device of double-core intelligent electric meter
CN101593123A (en) The curing of flash recordable plug-in component and terminal device
CN107729090A (en) A kind of user program method for down loading based on Serial Port Transmission
US5956480A (en) Terminal and online system for tracking version of data and program
CN109933345B (en) Undisturbed downloading method and related device for controller

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination