A method, device, electronic device and medium for remotely updating computer programs
By remotely updating computer programs, the update systems of upper, lower and hosts are used to solve the problem that firmware cannot be upgraded on unmanned vehicles, unmanned satellite or unmanned underwater equipment, and the computer software and firmware are realized Flexible upgrade and maintenance.
Patent Information
- Application Number
- CN202410761579.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-06-13
AI Technical Summary
The existing technology cannot upgrade and maintain software and firmware on unmanned vehicles, unmanned satellite or unmanned underwater equipment, limiting the flexibility of computer upgrades.
By remotely updating computer programs, the updating system of the upper, lower and host computers is used to realize automatic software and firmware updates without disassembling the host.
Improves the flexibility of upgrade and maintenance of computer software and firmware, and realizes stable maintenance and updates of computers without disassembling the host.
Smart Images

Figure CN118733080B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method, device, electronic device and medium for remotely updating a computer program. Background Art
[0002] In the computer field, computers are used in special fields such as airborne, vehicle-mounted, and underwater unmanned equipment, and on-site maintainability is poor, especially in unmanned vehicle-mounted, unmanned satellite-mounted, or unmanned underwater equipment. It is impossible to open the chassis of the host or perform upgrades and maintenance operations on the programs on the host (system software and system firmware).
[0003] With the current hardware generalization and software-defined architecture and trends, the popularization and popularity of artificial intelligence, software upgrades and AI algorithm and model upgrades can directly change the application scenarios and computing power accuracy of domestic computers. Firmware is the underlying support software for software and AI algorithms. Therefore, software and firmware upgrades and maintenance are necessary means to improve performance and reduce vulnerabilities.
[0004] Currently, software and firmware upgrades face a major bottleneck. Opening the host to upgrade and maintain software and firmware limits the upgrade flexibility of the computer. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a method, device, electronic device and medium for remotely updating a computer program, so as to solve the above-mentioned problems existing in the prior art and improve the flexibility of upgrading and maintaining computer software and firmware.
[0006] In a first aspect, a method for remotely updating a computer program is provided, the method being applied to an update system including a host computer, a slave computer and a host computer, the method may include:
[0007] The host computer stores the acquired new version of the target program data in a first folder, and determines a mapping relationship between a target name of the target program data and a physical location of the first folder;
[0008] The host computer updates the server directory in the server of the host according to the mapping relationship to obtain a new server directory;
[0009] The upper computer sends the target name to the lower computer;
[0010] The lower computer obtains the physical location of the first folder according to the target name and the new server directory, and sends the obtained target program data to the host;
[0011] The lower computer determines an update mode of the target program according to a program type of the target program corresponding to the target program data;
[0012] The host stores the received target program data in a second folder;
[0013] After reading the target program data in the second file, the host automatically updates the target program according to the update mode.
[0014] In a possible implementation, the host includes a mainboard chip and an external chip; the program type includes a first type and a second type;
[0015] The update process of the target program corresponding to the first type requires restarting the host system of the host; the target program corresponding to the first type runs in the mainboard chip;
[0016] The update process of the target program corresponding to the second type does not require restarting the host system of the host; the target program corresponding to the second type runs in the external chip.
[0017] In a possible implementation, the lower computer determines the update mode of the target program according to the program type of the target program corresponding to the target program data, including:
[0018] If the type of the target program is the first type, the lower computer configures the update mode of the host to be a restart mode.
[0019] In a possible implementation, the method further includes:
[0020] If the type of the target program is the second type, the lower computer configures the update mode of the host to be a non-restart mode.
[0021] In a possible implementation, the host reads the target program data in the second file, including:
[0022] When the type of the target program is the second type, the external chip obtains the target program data in the second folder through the serial port and asynchronous file transfer protocol with the mainboard chip.
[0023] In a possible implementation, after the host reads the target program data in the second file and automatically updates the target program according to the update mode, the method further includes:
[0024] The lower computer receives the update success instruction fed back by the target program, and sends the update success instruction to the upper computer.
[0025] In a possible implementation, the method further includes:
[0026] The upper computer sends the acquired status checking instruction for the host to the lower computer;
[0027] The lower computer sends the received status check instruction to the host computer;
[0028] The host obtains the status information according to the status viewing instruction, and sends the status information to the upper computer via the hypertext transfer protocol and the lower computer.
[0029] In a second aspect, a device for remotely updating a computer program is provided, which is applied to an update system including a host computer, a slave computer and a host computer, and the device may include:
[0030] A storage unit, used for the host computer to store the acquired new version of the target program data in a first folder, and determine a mapping relationship between the target name of the target program data and the physical location of the first folder;
[0031] An updating unit, used for the host computer to update the server directory in the server of the host according to the mapping relationship to obtain a new server directory;
[0032] A sending unit, used for the upper computer to send the target name to the lower computer;
[0033] An acquisition unit, configured for the lower computer to acquire the physical location of the first folder according to the target name and the new server directory;
[0034] The sending unit is also used for the lower computer to send the acquired target program data to the host computer;
[0035] A determination unit, configured for the lower computer to determine an update mode of the target program according to a program type of the target program corresponding to the target program data;
[0036] The storage unit is further used for the host to store the received target program data in a second folder;
[0037] The updating unit is further configured to automatically update the target program according to the updating mode after the host reads the target program data in the second file.
[0038] In a third aspect, an electronic device is provided, the electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0039] Memory, used to store computer programs;
[0040] The processor is used to implement any method step described in the first aspect when executing the program stored in the memory.
[0041] In a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.
[0042] The present application provides a method for remotely updating a computer program, the method comprising: the upper computer stores the acquired new version of the target program data in a first folder, and determines the mapping relationship between the target name of the target program data and the physical location of the first folder; the upper computer updates the server directory in the server of the host according to the mapping relationship to obtain a new server directory; the upper computer sends the target name to the lower computer; the lower computer obtains the physical location of the first folder according to the target name and the new server directory, and sends the acquired target program data to the host; the lower computer determines the update mode of the target program according to the program type of the target program corresponding to the target program data; the host stores the received target program data in a second folder; after reading the target program data in the second file, the host automatically updates the target program according to the update mode. The method can stably maintain and update the software and firmware of the computer without unpacking the host. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 A system architecture diagram of a method for remotely updating a computer program provided in an embodiment of the present application;
[0045] Figure 2 A flowchart of a method for remotely updating a computer program provided in an embodiment of the present application;
[0046] Figure 3 A schematic diagram of the structure of a device for remotely updating a computer program provided in an embodiment of the present application;
[0047] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0049] A method for remotely updating a computer program provided in an embodiment of the present application can be applied to Figure 1 In the system architecture shown in Figure 1 As shown, the update system may include: an upper computer, a lower computer and a host computer;
[0050] Among them, the host computer control program lnxUpdateGui.exe in the host computer supports sending data commands and receiving feedback on system status, which includes an http server and a TCP client.
[0051] The lower computer control program lnxUpdateEngine of the lower computer is a program running in the mainboard chip of the host, which includes an http client and a TCP server. The lower computer control program controls the upgrade of the programs running in the mainboard chip and the external chip by receiving data commands from the network.
[0052] The command interaction between the upper computer control program and the lower computer control program is implemented by the TCP protocol. After the program is running, the upper computer acts as a TCP client and the lower computer program acts as a TCP server. The upper computer needs to connect to the upper and lower computers first. When the connection fails or the connection is interrupted, the upper computer's connection button will prompt, which is convenient for users to judge the connection status of the system.
[0053] When the client needs to be upgraded, the upper computer is used to send a data packet. After the lower computer receives the data packet and verifies that there is no problem, it will perform different operations according to the command.
[0054] In the computer field, computers are used in special fields such as airborne, vehicle-mounted, and underwater unmanned equipment, and on-site maintainability is poor, especially in unmanned vehicle-mounted, unmanned satellite-mounted, or unmanned underwater equipment. It is impossible to open the chassis of the host or perform upgrades and maintenance operations on the programs on the host (system software and system firmware).
[0055] With the current hardware generalization and software-defined architecture and trends, the popularization and popularity of artificial intelligence, software upgrades and AI algorithm and model upgrades can directly change the application scenarios and computing power accuracy of domestic computers. Firmware is the underlying support software for software and AI algorithms. Therefore, software and firmware upgrades and maintenance are necessary means to improve performance and vulnerabilities.
[0056] Currently, software and firmware upgrades face a major bottleneck. Upgrading and maintaining software and firmware by opening the host computer limits the upgrade flexibility of the computer.
[0057] Therefore, the present application provides a method for remotely updating computer programs, which can greatly improve the flexibility and scalability of reinforced domestic computers by upgrading all software, firmware and operating systems of reinforced domestic computers and clusters through software and hardware fusion design and Ethernet.
[0058] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.
[0059] Figure 2 A flowchart of a method for remotely updating a computer program provided in an embodiment of the present application is shown below. Figure 2 As shown, the method is applied to an update system including a host computer, a slave computer and a host, and the method may include:
[0060] Step S210: The host computer stores the acquired new version of the target program data in a first folder, and determines a mapping relationship between the target name of the first folder and the physical location of the folder.
[0061] The target program data includes system software and system firmware. The system firmware may include: BIOS firmware, X100 firmware, IPMC firmware and FPGA firmware. The system software may be understood as the host system of the host.
[0062] There is a first folder named file in the running directory of the host computer. After the user selects the corresponding target program data in the host computer, the mapping relationship between the target name of the target program data and the physical location of the first folder is automatically updated to the file directory.
[0063] Afterwards, the host computer updates the server directory in the server of the host according to the mapping relationship to obtain a new server directory;
[0064] In actual applications, the file directory is also the http server directory. When the file directory is updated, the http server directory is also updated accordingly.
[0065] After that, the upper computer sends the target name to the lower computer.
[0066] Step S220: The lower computer obtains the physical location of the first folder according to the target name and the new server directory, and sends the obtained target program data to the host.
[0067] Specifically, the lower computer obtains the physical location of the first folder according to the target name and the new server directory.
[0068] According to the physical location of the first folder, the target program data corresponding to the target name is actively downloaded from the first folder, and the downloaded target program data is sent to the host.
[0069] At the same time, the lower computer determines the update mode of the target program according to the program type of the target program corresponding to the target program data.
[0070] The program types include a first type and a second type.
[0071] The update process of the target program corresponding to the first type requires restarting the host system of the host.
[0072] The update process of the target program corresponding to the second type does not require restarting the host system of the host.
[0073] If the type of the target program is the first type, the lower computer configures the update mode of the host computer to be the restart mode.
[0074] If the type of the target program is the second type, the host computer is configured by the lower computer to have an update mode that is a non-restart mode; that is, the host system does not need to be restarted during the update of the second type of target program.
[0075] Step S230: The host receives the target program data, and processes the target program corresponding to the target program data to obtain a processing result.
[0076] The host includes a mainboard chip and an external chip.
[0077] Furthermore, the target program corresponding to the first type runs in the mainboard chip; the target program corresponding to the second type runs in the external chip.
[0078] Processing the target program corresponding to the target program data to obtain a processing result, which may specifically include:
[0079] First, the host receives the target program data and stores it in its own second folder, and reports the current status (feedback command that the target program data has been stored in the second folder), and the host performs corresponding operations on its own system according to the update mode.
[0080] When the update mode in the processing result is the restart mode, the target program in the mainboard chip automatically reads the target program data in the second folder for update. After the update is completed, the host system will automatically restart and the update is completed.
[0081] When the update mode in the processing result is non-restart mode, it indicates that the corresponding target program is running in the external chip. At this time, the external chip obtains the target program data in the second folder through the serial port and asynchronous file transfer protocol with the mainboard chip to realize the update of the target program. After the update is completed, the target program running in the external chip will automatically restart and the update is completed.
[0082] For the above steps S210 to S230, examples are given according to the program type of the firmware:
[0083] Example 1: BIOS firmware and X100 firmware require the host system to restart and enter upgrade mode for upgrade.
[0084] Specifically, taking BIOS firmware as an example, the upgrade process of the BIOS firmware is as follows:
[0085] There is a file folder in the running directory of the host computer. After the user selects the BIOS upgrade file in the host computer, the file will be automatically placed in this file directory. This directory is also the service directory of http.
[0086] After the upper computer selects the file, the lower computer will actively download the BIOS.FD file from the http service directory according to the BIOS.FD file name sent by the upper computer. The downloaded BIOS file will be placed in the / boot / efi file directory of the motherboard chip. After that, the lower computer configures the next startup mode of the system to update the BIOS mode (restart mode), and reports the current status after the configuration is completed.
[0087] After that, enter the automatic update process in BIOS, and the motherboard chip will automatically extract the BIOS file from / boot / efi to update the BIOS. After the update is completed, the system will automatically restart, and the update is completed.
[0088] Example 2: IPMC firmware and FPGA firmware require the host system to be restarted without restarting, and the corresponding firmware enters restart to achieve upgrade.
[0089] Specifically, taking IPMC firmware as an example, the upgrade process of the IPMC firmware is as follows:
[0090] There is a file folder in the running directory of the host computer. After the user selects the IPMC upgrade file in the host computer, the file will be automatically placed in this file directory. This directory is also the service directory of http.
[0091] After the upper computer selects the file, the lower computer will actively download the IPMC.FD file from the http service directory according to the IPMC.FD file name sent by the upper computer. The downloaded IPMC file will be placed in the / boot / efi file directory of the motherboard chip. After that, the lower computer configures the next startup mode of the system to update IPMC mode (non-restart mode), and reports the current status after the configuration is completed.
[0092] After the IPMC firmware is downloaded to the board chip, it is sent to the MCU (external chip) through the serial port using the xmodem protocol. After the MCU receives the target program data, it returns a successful reception command through the serial port, indicating that the target program data has been successfully received. After the target program data is successfully received, the MCU starts to update the IPMC. After the IPMC update is completed, it returns a successful update command through the serial port. At this time, the motherboard chip will send a restart command to the MCU. After the MCU restarts, the IPMC firmware update is completed.
[0093] In some embodiments, the host system update of the host is based on the PXE function of the network card, and the host computer needs to run TFTPD, DHCP, and HTTP servers to implement system updates.
[0094] Among them, tftpd is used to transfer the upgraded minimal file system.
[0095] DHCP is used to assign IP addresses to lower computers.
[0096] http is used to transfer system files.
[0097] The host system update process may specifically include:
[0098] When the upper computer receives a host system update instruction including a new version of the host system, the upper computer will send the instruction to the lower computer, and the lower computer will forward the instruction to the host.
[0099] The host will restart and enter the pxe upgrade function; at this time, dhcp assigns an IP address to the host and transfers the new version of the host system to the minimum system through tftpd.
[0100] Automatically install the corresponding scripts of the new version of the host system through the minimum system.
[0101] Configure the host system's IP and ssh functions through the script.
[0102] Afterwards, the environment required by the new version of the host system is downloaded to the mainboard chip through the http server.
[0103] When the host system installation is completed, the host will automatically restart and the installation result feedback will be achieved by connecting to the host system through the ssh function (encrypted network protocol).
[0104] In some embodiments, if the upper computer obtains an instruction to view the version of the host system, it sends the instruction to the lower computer, the lower computer forwards the instruction to the host, the host uploads the corresponding version information to the lower computer via http, and forwards it to the upper computer through the lower computer, so that the upper computer can display the version information corresponding to the instruction to view the version of the host system through the visualization function.
[0105] The instruction may also be a status check instruction, and the process may specifically include: the upper computer sends the acquired status check instruction for the host to the lower computer; the lower computer sends the received status check instruction to the host; the host obtains status information according to the status check instruction, and sends the status information to the upper computer through the hypertext transfer protocol and the lower computer. The status information may be information related to the operation or non-operation of the host system.
[0106] The present application provides a method for remotely updating a computer program, the method comprising: a host computer stores a target program data of a new version obtained in a first folder, and determines a mapping relationship between a target name of the target program data and a physical location of the first folder; the host computer updates a server directory in a server of a host computer according to the mapping relationship to obtain a new server directory; the host computer sends the target name to a slave computer; the slave computer obtains the physical location of the first folder according to the target name and the new server directory, and sends the obtained target program data to the host computer; the slave computer determines an update mode of the target program according to a program type of the target program corresponding to the target program data; the host computer stores the received target program data in a second folder; after reading the target program data in the second file, the host computer automatically updates the target program according to the update mode. Firstly, the present application can realize remote upgrade of most software and firmware through software and hardware integration design; secondly, the present application designs a remote automatic upgrade agent program, which is dedicated to responding to remote update commands and performing specific update operations; the existing firmware upgrades often use a burner for burning and upgrading, and the upgrade process is complicated. The present application can complete the full automatic upgrade of the firmware through a remote automatic upgrade agent program, which only requires Ethernet, without a burner and contact equipment; finally, the present application designs a host computer visualization software that controls the upgrade process, which can issue upgrade commands and transmit and verify files to be upgraded. This method can stably maintain and update the computer's software and firmware without unpacking the host.
[0107] Corresponding to the above method, the embodiment of the present application also provides a device for remotely updating a computer program, such as Figure 3As shown, the device is applied to an update system including a host computer, a slave computer and a host, and the device includes:
[0108] The storage unit 310 is used for the host computer to store the acquired new version of the target program data in the first folder, and determine the mapping relationship between the target name of the target program data and the physical location of the first folder;
[0109] An updating unit 320 is used for the host computer to update the server directory in the server of the host according to the mapping relationship to obtain a new server directory;
[0110] A sending unit 330, used for the upper computer to send the target name to the lower computer;
[0111] An acquisition unit 340 is used for the lower computer to acquire the physical location of the first folder according to the target name and the new server directory;
[0112] The sending unit 330 is also used for the lower computer to send the acquired target program data to the host computer;
[0113] A determination unit 350, configured for the lower computer to determine an update mode of the target program according to a program type of the target program corresponding to the target program data;
[0114] The storage unit 310 is also used for the host to store the received target program data in a second folder;
[0115] The updating unit 320 is further configured to automatically update the target program according to the updating mode after the host reads the target program data in the second file.
[0116] The functions of each functional unit of a device for remotely updating a computer program provided in the above-mentioned embodiment of the present application can be realized through the above-mentioned method steps. Therefore, the specific working process and beneficial effects of each unit in a device for remotely updating a computer program provided in the embodiment of the present application will not be repeated here.
[0117] The present application also provides an electronic device, such as Figure 4 As shown, it includes a processor 410 , a communication interface 420 , a memory 430 and a communication bus 440 , wherein the processor 410 , the communication interface 420 , and the memory 430 communicate with each other via the communication bus 440 .
[0118] Memory 430, for storing computer programs;
[0119] The processor 410 is used to execute the program stored in the memory 530 to implement the following steps:
[0120] The host computer stores the acquired new version of the target program data in a first folder, and determines a mapping relationship between a target name of the target program data and a physical location of the first folder;
[0121] The host computer updates the server directory in the server of the host according to the mapping relationship to obtain a new server directory;
[0122] The upper computer sends the target name to the lower computer;
[0123] The lower computer obtains the physical location of the first folder according to the target name and the new server directory, and sends the obtained target program data to the host;
[0124] The lower computer determines an update mode of the target program according to a program type of the target program corresponding to the target program data;
[0125] The host stores the received target program data in a second folder;
[0126] After reading the target program data in the second file, the host automatically updates the target program according to the update mode.
[0127] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0128] The communication interface is used for communication between the above electronic device and other devices.
[0129] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0130] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0131] The implementation methods and beneficial effects of the components of the electronic device in the above embodiments to solve the problems can be seen in Figure 2 The various steps in the illustrated embodiment are implemented, therefore, the specific working process and beneficial effects of the electronic device provided by the embodiment of the present application are not repeated here.
[0132] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is executed on a computer, the computer executes a method for remotely updating a computer program as described in any of the above embodiments.
[0133] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute a method for remotely updating a computer program as described in any one of the above embodiments.
[0134] Those skilled in the art will appreciate that the embodiments in the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt a complete hardware embodiment, a complete software embodiment, or a form of an embodiment combining software and hardware. Moreover, the present application may adopt a form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0135] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0136] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0137] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0138] Unless otherwise defined, the technical terms or scientific terms used in this application should be understood by people with ordinary skills in the field to which the present invention belongs. "First", "second" and similar words used in this application do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect", "couple" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0139] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the present application embodiments are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application embodiments.
[0140] Obviously, those skilled in the art can make various changes and modifications to the embodiments in the present application without departing from the spirit and scope of the embodiments in the present application. Thus, if these modifications and variations of the embodiments in the present application are within the scope of the embodiments in the present application and their equivalents, the embodiments in the present application are also intended to include these modifications and variations.
Claims
1. A method for remotely updating a computer program, applied to an update system including a host computer, a slave computer and a host computer, wherein: The upper computer control program in the upper computer supports sending data commands and receiving feedback on system status, and includes an http server and a TCP client; the lower computer control program of the lower computer is a program running in the mainboard chip in the host, and includes an http client and a TCP server; the lower computer control program controls the upgrade of the running programs in the mainboard chip and the external chip by receiving data commands from the network; the command interaction between the upper computer control program and the lower computer control program is realized by the TCP protocol, and after the program runs, the upper computer acts as a TCP client, and the lower computer program acts as a TCP server; the method comprises: The host computer stores the acquired new version of the target program data in a first folder, and determines a mapping relationship between a target name of the target program data and a physical location of the first folder; specifically, there is a first folder named file in a running directory in the host computer, and after a user in the host computer selects corresponding target program data, the mapping relationship between the target name of the target program data and the physical location of the first folder is automatically updated to the file directory, and the file directory is also a server directory of the http server. When the file directory is updated, the server directory of the http server is also updated accordingly; The host computer updates the server directory in the server of the host according to the mapping relationship to obtain a new server directory; The upper computer sends the target name to the lower computer; The lower computer obtains the physical location of the first folder according to the target name and the new server directory, and sends the obtained target program data to the host; The lower computer determines an update mode of the target program according to a program type of the target program corresponding to the target program data; The host stores the received target program data in a second folder; After reading the target program data in the second file, the host automatically updates the target program according to the update mode.
2. The method according to claim 1, characterized in that The host includes a mainboard chip and an external chip; the program types include a first type and a second type; The update process of the target program corresponding to the first type requires restarting the host system of the host; the target program corresponding to the first type runs in the mainboard chip; The update process of the target program corresponding to the second type does not require restarting the host system of the host; the target program corresponding to the second type runs in the external chip.
3. The method according to claim 2, characterized in that The lower computer determines an update mode of the target program according to the program type of the target program corresponding to the target program data, including: If the type of the target program is the first type, the lower computer configures the update mode of the host to be a restart mode.
4. The method according to claim 3, characterized in that The method further comprises: If the type of the target program is the second type, the lower computer configures the update mode of the host to be a non-restart mode.
5. The method according to claim 4, characterized in that The host reads the target program data in the second file, including: When the type of the target program is the second type, the external chip obtains the target program data in the second folder through the serial port and asynchronous file transfer protocol with the mainboard chip.
6. The method according to claim 1, characterized in that After the host reads the target program data in the second file and automatically updates the target program according to the update mode, the method further includes: The lower computer receives the update success instruction fed back by the target program, and sends the update success instruction to the upper computer.
7. The method according to claim 1, characterized in that The method further comprises: The upper computer sends the acquired status checking instruction for the host to the lower computer; The lower computer sends the received status check instruction to the host computer; The host obtains the status information according to the status viewing instruction, and sends the status information to the upper computer via the hypertext transfer protocol and the lower computer.
8. A device for remotely updating a computer program, characterized in that: The invention is applied to an update system including an upper computer, a lower computer and a host computer, wherein the upper computer control program in the upper computer supports sending data commands and receiving feedback of system status, and includes an http server and a TCP client; the lower computer control program of the lower computer is a program running in a mainboard chip in the host computer, and includes an http client and a TCP server; the lower computer control program controls the upgrade of the programs running in the mainboard chip and the external chip by receiving data commands from the network; the command interaction between the upper computer control program and the lower computer control program is realized by the TCP protocol, and after the program runs, the upper computer acts as a TCP client, and the lower computer program acts as a TCP server; the device is characterized in that: A storage unit is used for the host computer to store the acquired new version of the target program data in a first folder, and determine the mapping relationship between the target name of the target program data and the physical location of the first folder; specifically, there is a first folder of file in the running directory of the host computer, and after the user in the host computer selects the corresponding target program data, the mapping relationship between the target name of the target program data and the physical location of the first folder is automatically updated to the file directory, and the file directory is also the server directory of the http server. When the file directory is updated, the server directory of the http server is also updated accordingly; An updating unit, used for the host computer to update the server directory in the server of the host according to the mapping relationship to obtain a new server directory; A sending unit, used for the upper computer to send the target name to the lower computer; An acquisition unit, configured for the lower computer to acquire the physical location of the first folder according to the target name and the new server directory; The sending unit is also used for the lower computer to send the acquired target program data to the host computer; A determination unit, configured for the lower computer to determine an update mode of the target program according to a program type of the target program corresponding to the target program data; The storage unit is further used for the host to store the received target program data in a second folder; The updating unit is further configured to automatically update the target program according to the updating mode after the host reads the target program data in the second file.
9. An electronic device, characterized in that: The electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Single-board or multi-board system based on ZYNQ and on-line updating method
CN105573800A
method for realizing remote upgrading of an FPGA program based on a ZYNQ chip
CN109656593A