CN113885918B - Method and device for updating program, electronic equipment and storage medium - Google Patents

Method and device for updating program, electronic equipment and storage medium Download PDF

Info

Publication number
CN113885918B
CN113885918B CN202111226608.2A CN202111226608A CN113885918B CN 113885918 B CN113885918 B CN 113885918B CN 202111226608 A CN202111226608 A CN 202111226608A CN 113885918 B CN113885918 B CN 113885918B
Authority
CN
China
Prior art keywords
program
updated
area
files
artificial satellite
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.)
Active
Application number
CN202111226608.2A
Other languages
Chinese (zh)
Other versions
CN113885918A (en
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.)
Beijing Weina Starry Sky Technology Co ltd
Original Assignee
Beijing MinoSpace 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 Beijing MinoSpace Technology Co Ltd filed Critical Beijing MinoSpace Technology Co Ltd
Priority to CN202111226608.2A priority Critical patent/CN113885918B/en
Publication of CN113885918A publication Critical patent/CN113885918A/en
Application granted granted Critical
Publication of CN113885918B publication Critical patent/CN113885918B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B64AIRCRAFT; AVIATION; COSMONAUTICS
    • B64GCOSMONAUTICS; VEHICLES OR EQUIPMENT THEREFOR
    • B64G1/00Cosmonautic vehicles
    • B64G1/10Artificial satellites; Systems of such satellites; Interplanetary vehicles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Remote Sensing (AREA)
  • Computer Security & Cryptography (AREA)
  • Astronomy & Astrophysics (AREA)
  • Aviation & Aerospace Engineering (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a method, a device, an electronic device and a storage medium for updating a program, wherein the method comprises the following steps: storing a program group to be updated into an internal memory of the artificial satellite; wherein, the program group comprises three files with the same content; when the program updating processing is carried out on the artificial satellite, three files in a memory are obtained, and data of the same preset position in the three files are compared; for each preset position, if the comparison results of at least two files in the three files at the preset position are the same, determining the data with the same comparison result as target data, and extracting the target data; and splicing all the extracted target data into a program to be updated, and controlling the program to be updated in the operating memory of the artificial satellite so as to update the program of the artificial satellite. According to the method, the stability of the operation of the artificial satellite program can be improved.

Description

Method and device for updating program, electronic equipment and storage medium
Technical Field
The present application relates to the field of satellite updating technologies, and in particular, to a method and an apparatus for updating a program, an electronic device, and a storage medium.
Background
An artificial earth satellite refers to an unmanned spacecraft that flies around the earth and orbits in space for more than one turn. Referred to as satellites for short. The artificial satellite is the spacecraft which has the largest number of launching, the widest application and the fastest development. The method is mainly used in various fields of scientific exploration and research, weather forecast, land resource survey, land utilization, area planning, communication, tracking, navigation and the like.
The artificial satellite realizes unmanned flight by executing an internal downloading program. In order to ensure that the artificial satellite flies according to the target track, a stable execution program needs to be provided for the artificial satellite. The inventor finds in research that in the prior art, when the artificial satellite flies in space, the artificial satellite is easily radiated by particles in space, and the artificial satellite program is wrong.
Disclosure of Invention
In view of this, embodiments of the present application provide a method and an apparatus for updating a program, an electronic device, and a storage medium, so as to improve the stability of the operation of an artificial satellite program.
In a first aspect, an embodiment of the present application provides a method for updating a program, where the method includes:
storing a program group to be updated into an internal memory of the artificial satellite; the program group comprises three files with the same content;
when the program updating processing is carried out on the artificial satellite, three files in the memory are obtained, and data of the same preset position in the three files are compared;
for each preset position, if the comparison results of at least two files in the three files at the preset position are the same, determining the data with the same comparison result as target data, and extracting the target data;
and splicing all the extracted target data into a program to be updated, and controlling the artificial satellite to operate the program to be updated in the memory so as to update the program of the artificial satellite.
In a possible embodiment, after comparing the data at the same preset position in the three files, the method further includes:
determining at most one file except the at least two files as a file to be repaired according to the comparison result at each preset position;
and determining the program of the file to be repaired at the preset position as error data, and modifying the error data into the target data.
In one possible embodiment, the memory includes a first region and a second region;
saving the program group to be updated into the memory of the artificial satellite, wherein the steps of:
acquiring the area of the current operating program of the artificial satellite;
if the area where the current running program is located is the first area, updating the program group to be updated to the second area;
and if the area where the currently running program is located is the second area, updating the program group to be updated to the first area.
In a possible embodiment, after controlling the satellite to run the program to be updated in the memory, the method further includes:
testing whether a program to be updated in a target area is stable; wherein the target area is an area in which the program to be updated has been updated;
if the program is stable, controlling the artificial satellite to operate the program to be updated in the target area;
if the satellite is unstable, controlling the artificial satellite to operate the program in the backup area; and the backup area is an area which does not update the program to be updated.
In a possible embodiment, after testing whether the program to be updated in the target area is stable, the method further includes:
and if the program to be updated in the target area is stable, backing up the program to be updated in the target area to the backup area.
In a possible embodiment, before saving the program group to be updated into the memory of the satellite, the method further comprises:
injecting the program group to be updated into a program cache region of the artificial satellite;
in the program cache region, determining whether the files in the program group are complete;
if the files are all complete, the program group to be updated is stored in the memory;
and if at least one of the files is incomplete, sending an instruction for reacquiring the program group to a ground control center.
In a second aspect, an embodiment of the present application further provides an apparatus for updating a program, where the apparatus includes:
the storage unit is used for storing the program group to be updated into the memory of the artificial satellite; the program group comprises three files with the same content;
the comparison unit is used for acquiring three files in the memory when the program updating processing is carried out on the artificial satellite and comparing the data of the same preset position in the three files;
the extraction unit is used for determining data with the same comparison result as target data and extracting the target data if the comparison results of at least two files in the three files at the preset positions are the same for each preset position;
and the updating unit is used for splicing all the extracted target data into a program to be updated, and controlling the artificial satellite to operate the program to be updated in the memory so as to update the program of the artificial satellite.
In one possible embodiment, the apparatus further comprises:
determining files, configured to determine, after comparing data at the same preset position in the three files, at most one file other than the at least two files as a file to be repaired with respect to a comparison result at each preset position;
and the modifying unit is used for determining the program of the file to be repaired at the preset position as error data and modifying the error data into the target data.
In one possible embodiment, the memory includes a first region and a second region;
the storage unit is used for storing the program group to be updated into the memory of the artificial satellite, and comprises the following steps:
acquiring the area of the current operating program of the artificial satellite;
if the area where the current running program is located is the first area, updating the program group to be updated to the second area;
and if the area where the currently running program is located is the second area, updating the program group to be updated to the first area.
In one possible embodiment, the apparatus further comprises:
the testing unit is used for testing whether the program to be updated in the target area is stable or not after the artificial satellite is controlled to operate the program to be updated in the memory; wherein the target area is an area in which the program to be updated has been updated;
the first operation unit is used for controlling the artificial satellite to operate the program to be updated in the target area if the program is stable;
a second operation unit for controlling the artificial satellite to operate the program in the backup area if the second operation unit is unstable; and the backup area is an area which does not update the program to be updated.
In one possible embodiment, the apparatus further comprises:
the backup unit is used for backing up the program to be updated in the target area to the backup area if the program to be updated in the target area is stable after testing whether the program to be updated in the target area is stable.
In one possible embodiment, the apparatus further comprises:
the cache unit is used for injecting the program group to be updated into a program cache region of the artificial satellite before the program group to be updated is stored into an internal memory of the artificial satellite;
the verification unit is used for determining whether the files in the program group are complete or not in the program cache region;
the transmission unit is used for storing the program group to be updated into the memory if the files are all complete;
and the acquisition unit is used for sending an instruction for acquiring the program group again to the ground control center if at least one of the files is incomplete.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating via the bus when the electronic device is running, the processor executing the machine-readable instructions to perform the steps of the method of updating a program according to any one of the first aspect.
In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the method for updating a program according to any one of the first aspect.
The embodiment of the application provides a method and a device for updating a program, electronic equipment and a storage medium. The method comprises the steps that three files containing programs to be updated and having the same content are stored in an internal memory of the artificial satellite, when the programs of the artificial satellite are updated, the three files are obtained from the internal memory, the programs in the three files at the same preset position are compared, whether data in each file change or not in the period from the updating of the programs to the storing of the programs is judged, and if the comparison results of at least two files in the three files at the preset position are the same through comparison, the data with the same comparison result are determined as target data, and the target data are extracted; and splicing all the extracted target data into a program to be updated, and updating the program in the artificial satellite according to the program to be updated. According to the method, whether the files in the three files are modified due to the radiation of particles in space can be determined, when the data of one preset position of one file is changed, the unmodified target data is determined by comparing the data of the three files at the same preset position, and the unmodified program to be updated is determined according to the target data. Compared with the method for directly running the updated program by the artificial satellite in the prior art, the method can improve the running stability of the artificial satellite program.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 shows a flowchart of a method for updating a program according to an embodiment of the present application.
Fig. 2 is a flowchart illustrating a method for saving a program group to be updated according to an embodiment of the present application.
Fig. 3 shows a schematic structural diagram of a device for updating a program according to an embodiment of the present application.
Fig. 4 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, as generally described and illustrated in the figures herein, could be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that in the embodiments of the present application, the term "comprising" is used to indicate the presence of the features stated hereinafter, but does not exclude the addition of further features.
It should be noted that the apparatuses, electronic devices, and the like according to the embodiments of the present application may be executed on a single server or may be executed in a server group. The server group may be centralized or distributed. In some embodiments, the server may be local or remote to the terminal.
The artificial satellite realizes unmanned flight by executing an internal downloading program. In order to ensure that the artificial satellite flies according to the target track, a stable execution program needs to be provided for the artificial satellite. The inventor finds in research that in the prior art, when the artificial satellite flies in space, the artificial satellite is easily radiated by particles in space, and the artificial satellite program is wrong.
Based on the above problem, fig. 1 shows a flowchart of a method for updating a program according to an embodiment of the present application, and as shown in fig. 1, the method specifically includes the following steps:
step 101, storing a program group to be updated into an internal memory of an artificial satellite; wherein, the program group comprises three files with the same content.
Specifically, in the embodiment of the present application, the memory of the satellite is an Embedded Flash (a non-volatile memory integrated in a chip); the program group to be updated is generated according to the program file of the latest version for updating the artificial satellite, which is sent by the ground control center. The program group to be updated includes a program file of the latest version and two backup files for the program file. The program group to be updated may be transmitted to the artificial satellite after being generated by the ground control center, or may be generated on the artificial satellite after receiving the latest version of the program file transmitted by the ground control center.
After the program group to be updated is obtained, three identical files in the program group to be updated are stored in the memory of the artificial satellite, the content of the three identical files is identical, and the titles of the three identical files can be different.
And 102, acquiring three files in the memory when the program updating processing is carried out on the artificial satellite, and comparing the data of the same preset position in the three files.
Specifically, after step 101, storing a program group to be updated in an internal memory of an artificial satellite, processing three files in the program group, and dividing preset positions of a target number in each file according to the same division standard; since the contents in the three files are the same, the division criteria of the preset positions are the same, and in the case where the contents in the three files are not changed, the data of the three files at each same preset position should be the same. It should be noted that the preset positions may be divided according to bytes, or may be divided according to paragraphs or functional blocks. In actual operation, the data in the file may be divided by filling the data in the byte table or the data table. All the content in the file can be divided, or part of the content in the file can be divided.
For example, when dividing part of the content in the file, the new version of the program in the file may be compared with the old version of the program currently running in the satellite to determine the updated part of the content in the file, so that only the updated part of the content in the file is divided.
When receiving a program updating instruction sent by a ground control center or triggering an internal updating condition of the artificial satellite, determining to enter program updating processing, and acquiring three files for updating the program of the artificial satellite from a memory of the artificial satellite when the program is updated. It should be noted that when the satellite is flying in space with three files containing the program to be updated, the program in each file in the memory is susceptible to local data changes due to radiation from energetic particles in space. And when determining to enter program updating processing, acquiring the three files from the memory.
After the three files are obtained, comparing the data of the same preset positions in the three files, and determining whether the data of the three files in each same preset position at the current moment are the same; if the data are the same, the programs in the three files are not modified due to particle radiation in the space; if the three files are different, the program in at least one of the three files is modified due to the particle radiation.
Step 103, for each preset position, if the comparison results of at least two of the three files at the preset position are the same, determining that the data with the same comparison result is target data, and extracting the target data.
Specifically, for each preset position, data in the preset position in the three files are taken out for comparison, and if the comparison results of at least two files in the three files in the preset position are the same, the current time is determined, and the data of the at least two files in the preset position are not modified. And taking the data which is determined to be unmodified in the preset position as target data, and extracting the target data of the preset position. In practical implementation, if the number of the preset positions is too large, the labels of the preset positions or the labels of the target data extracted from different preset positions can be labeled.
For example, in the three files, it is assumed that each file includes three preset positions, i.e., a preset position 1, a preset position 2, and a preset position 3. It is assumed that the data in the predetermined position 3 in the third of the three files is modified by exposure to particle radiation.
Then, for the data at the same preset position of each of the three files, the following comparison is performed:
for preset position 1: and for each file in the three files, taking out the data of each file in the preset position 1, comparing that the data of the three files in the preset position 1 are the same, extracting the data in the preset position 1 as target data, and carrying the label of the preset position 1.
For preset position 2: and for each file in the three files, taking out the data of each file in the preset position 2, comparing that the data of the three files in the preset position 2 are the same, extracting the data in the preset position 2 as target data, and carrying the label of the preset position 2.
For preset position 3: and for each file in the three files, taking out the data of each file in the preset position 3, comparing whether the data of the three files in the preset position 3 are the same or not, and obtaining that the data of the first file and the second file in the preset position 3 are the same, but the data of the third file is different from the data of the first file and the second file in the preset position 3, wherein the data of the first file and the second file in the preset position 3 are taken as target data and carry a label of the preset position 3.
Then, in step 103, the target data 1 with the label as the preset position 1, the target data 2 with the label as the preset position 2, and the target data 3 with the label as the preset position 3 can be obtained respectively. It should be noted that, in the above example, it is assumed that the data in the preset position 3 in the third file is modified due to particle radiation, but when the artificial satellite operates in space, the data in any preset position of each file in the memory of the artificial satellite may be modified due to particle radiation in space, for example, the data in the preset position 1 in the second file is modified, or the data in the preset position 2 in the first file is modified, and the above example only illustrates one of the cases.
And 104, splicing all the extracted target data into a program to be updated, and controlling the artificial satellite to operate the program to be updated in the memory so as to update the program of the artificial satellite.
Specifically, after the target data at the preset position is extracted in step 103, all the extracted target data are spliced to obtain target data at each preset position, so as to obtain a program to be updated, which is formed by splicing all the target data.
For example, according to the example in step 103, the target data 1 carrying the label as the preset position 1, the target data 2 carrying the label as the preset position 2, and the target data 3 carrying the label as the preset position 3 can be obtained respectively.
And splicing the target data according to the label sequence of the preset position carried by each target data to obtain a program to be updated, wherein the program to be updated is composed of the target data 1, the target data 2 and the target data 3. And taking the program to be updated as the latest program, and updating the artificial satellite according to the program to be updated, namely enabling the artificial satellite to operate the program to be updated in the memory.
The embodiment of the application provides a method for updating a program. The method comprises the steps that three files containing programs to be updated and having the same content are stored in an internal memory of the artificial satellite, when the programs of the artificial satellite are updated, the three files are obtained from the internal memory, the programs in the three files at the same preset position are compared, whether data in each file change or not in the period from the updating of the programs to the storing of the programs is judged, and if the comparison results of at least two files in the three files at the preset position are the same through comparison, the data with the same comparison result are determined as target data, and the target data are extracted; and splicing all the extracted target data into a program to be updated, and updating the program in the artificial satellite according to the program to be updated. According to the method, whether the files in the three files are modified due to the radiation of particles in space can be determined, when the data of one preset position of one file is changed, the unmodified target data is determined by comparing the data of the three files at the same preset position, and the unmodified program to be updated is determined according to the target data. Compared with the method for directly operating the updated program by the artificial satellite in the prior art, the method can improve the stability of the operation of the artificial satellite program.
In one possible embodiment, after performing step 102, the method further comprises the steps of:
step 1021, aiming at the comparison result at each preset position, determining at most one file except the at least two files as a file to be repaired.
Specifically, after comparing the data at the same preset position in the three files, the modified file to be repaired and the position of the modified data in the file to be repaired are determined according to the comparison result at each same preset position. According to the example in step 103, it can be seen that, in the three files, when only the data in the preset position 3 in the third file is modified due to the particle radiation, according to the comparison result for the preset position 3, it is known that the data in the preset position 3 of the first file and the second file are the same, but the data in the preset position 3 of the third file is different from the data in the preset position 3 of the first file and the second file, the data in the preset position 3 of the first file and the second file are extracted and are used as the target data 3, and the third file is used as the file to be repaired.
And step 1022, determining the program of the file to be repaired at the preset position as error data, and modifying the error data into the target data.
Specifically, after the third file is determined to be the file to be repaired according to step 1021, the data of the third file in the preset position 3 is used as the error data, and the error data in the third file is modified into the target data 3 according to the target data 3 extracted from the preset position 3.
In a possible implementation, the memory includes a first area and a second area, and fig. 2 is a flowchart illustrating a method for saving a program group to be updated according to an embodiment of the present application, and as shown in fig. 2, the method further includes the following steps:
step 201, acquiring an area where the current operating program of the artificial satellite is located.
Specifically, since the memory of the satellite includes the first area and the second area, the program run by the satellite may be the program of the first area or the program of the second area. After receiving the program group to be updated, it is necessary to determine at which position the program group to be updated is stored according to the area where the program currently operated by the satellite is located.
In the embodiment of the application, when the artificial satellite receives a program running instruction, the position of a target program run by the artificial satellite is determined according to parameters in the program running instruction, and a state used for representing the position is recorded in the memory. The program operating instructions may be received from a ground control center or generated according to internal operating logic of the satellite.
For example, it is assumed that the location of the specified target program in the program operation instruction is the second area in the memory, that is, the instruction issued by the program operation instruction is a program for the satellite to operate the second area in the memory. When the artificial satellite receives the program running instruction, the program in the second area in the memory is run, and the state flag of the memory is 1. Similarly, if the position of the specified target program in the program running instruction is the first area in the memory, the artificial satellite runs the program in the first area in the memory when receiving the program running instruction, and the state flag of the memory is 0.
Then the area in which the current running program of the satellite is located is obtained, that means the state of the memory in the satellite is read.
Step 202, determining whether the currently running program is in the first area.
Specifically, after the area where the current operating program of the satellite is located is obtained in step 201, the state of the memory is read according to the example in step 201. And judging whether the current running program is in the first area or not according to the state of the memory.
If the currently running program is in the first area, step 203 is entered.
If the currently running program is not in the first area, step 204 is entered.
And step 203, updating the program group to be updated to the second area.
Specifically, the first area and the second area are respectively connected with a multi-way gate, so that the program group is stored in the first area or the second area through the multi-way gate. When the currently running program is judged to be in the first area according to the step 202, the multi-way gate saves the program group to be updated to the second area.
According to the method, the program group to be updated can be stored in the memory of the artificial satellite without destroying the current operating program of the artificial satellite, so that two different versions of programs are simultaneously stored in the artificial satellite, and the old version of the operating program is not deleted when the program group is uploaded. This makes it possible to control the satellite to run the original version of the program if a problem occurs while the satellite is running the programs in the program group to be updated, ensuring stable operation of the satellite.
And 204, if the area where the currently running program is located is the second area, updating the program group to be updated to the first area.
According to step 202, if it is determined that the currently running program is not in the first area, determining whether the currently running program is in the second area according to the acquired state of the memory, and if the area where the currently running program is in is the second area, updating the program group to be updated to the first area through a multi-way gate.
In one possible embodiment, after step 104 is performed, the following steps are further included:
step 1041, testing whether the program to be updated in the target area is stable; and the target area is an area in which the program to be updated is updated.
Specifically, according to step 203 and 204, a target area is determined, and if the program group to be updated is stored in the second area according to step 203, the second area is determined as the target area; if the program group to be updated is saved to the first area according to step 204, the first area is determined as the target area. After the program group to be updated is saved in the target area, the program to be updated is obtained in the target area according to step 104.
And after controlling the artificial satellite to operate the program to be updated in the target area, determining whether the program to be updated is stable through the artificial satellite actually operating the program to be updated and parameters generated by operating the program to be updated. If so, go to step 1042; if not, go to step 1043.
And 1042, if the program is stable, controlling the artificial satellite to operate the program to be updated in the target area.
Specifically, after it is determined that the program to be updated is stable according to step 1041, if it is determined that the programs in the program group to be updated can ensure stable operation of the artificial satellite, the artificial satellite is controlled to operate the program to be updated in the target area.
Step 1043, if not, controlling the artificial satellite to operate the program in the backup area; and the backup area is an area which does not update the program to be updated.
Specifically, according to step 1041, if the second area is determined to be the target area, the first area is determined to be the backup area; and if the first area is determined as the target area, determining the second area as the backup area.
After it is determined that the program to be updated is unstable according to step 1041, it is described that the programs in the program group to be updated cannot ensure stable operation of the satellite, and the satellite cannot operate the current program to be updated, and needs to switch back to the operating program of the previous version of the program to be updated, that is, to operate the program in the backup area.
In a possible embodiment, after performing step 1041, the method further comprises the steps of:
step 1044 of backing up the program to be updated in the target area to the backup area if the program to be updated in the target area is stable.
Specifically, if the program to be updated is stable, which indicates that the programs in the program group to be updated can ensure stable operation of the satellite, the program to be updated may be backed up in the backup area, so as to ensure that the program to be updated in the backup area is operated when the program to be updated in the target area cannot be operated in an unexpected situation.
In this embodiment of the application, the program to be updated is backed up in the backup area, and the program in the original backup area (i.e., the program with the version different from that of the program to be updated) may be deleted, or the program in the original backup area may not be deleted, and a copy of the program to be updated in the target area may be backed up.
In one possible embodiment, before performing step 101, the method further comprises the steps of:
injecting the program group to be updated into a program cache region of the artificial satellite; in the program cache region, determining whether the files in the program group are complete; if the files are all complete, the program group to be updated is stored in the memory; and if at least one of the files is incomplete, sending an instruction for reacquiring the program group to a ground control center.
Specifically, the artificial satellite includes a program cache region, and determines whether the program group to be updated is complete in the program cache region, and if a program file or a program package in the program group to be updated is damaged, the program group to be updated is stored in the memory. Otherwise, the program group is considered to be damaged in the transmission process, and the program group is obtained again.
Fig. 3 is a schematic structural diagram of an apparatus for updating a program according to an embodiment of the present application, and as shown in the drawing, the apparatus includes a storage unit 301, a comparison unit 302, an extraction unit 303, and an update unit 304.
A storage unit 301, configured to store a program group to be updated in an internal memory of the satellite; wherein, the program group comprises three files with the same content.
A comparing unit 302, configured to obtain three files in the memory when performing program updating processing on the artificial satellite, and compare data in the same preset position in the three files.
The extracting unit 303 is configured to, for each preset position, determine that data with the same comparison result is target data if the comparison results of at least two of the three files at the preset position are the same, and extract the target data.
An updating unit 304, configured to splice all the extracted target data into a program to be updated, and control the artificial satellite to operate the program to be updated in the memory, so as to update the program of the artificial satellite.
In one possible embodiment, the apparatus further comprises:
and determining files, which are used for determining at most one file except the at least two files as the file to be repaired according to the comparison result of each preset position after comparing the data of the same preset position in the three files.
And the modifying unit is used for determining the program of the file to be repaired at the preset position as error data and modifying the error data into the target data.
In one possible embodiment, the memory includes a first region and a second region.
The storage unit is used for storing the program group to be updated into the memory of the artificial satellite, and comprises the following steps:
and acquiring the area of the current operating program of the artificial satellite.
And if the area where the current running program is located is the first area, updating the program group to be updated to the second area.
And if the area where the currently running program is located is the second area, updating the program group to be updated to the first area.
In one possible embodiment, the apparatus further comprises:
the testing unit is used for testing whether the program to be updated in the target area is stable or not after the artificial satellite is controlled to operate the program to be updated in the memory; and the target area is an area in which the program to be updated is updated.
And the first operation unit is used for controlling the artificial satellite to operate the program to be updated in the target area if the program is stable.
A second operation unit for controlling the artificial satellite to operate the program in the backup area if the second operation unit is unstable; and the backup area is an area which does not update the program to be updated.
In one possible embodiment, the apparatus further comprises:
the backup unit is used for backing up the program to be updated in the target area to the backup area if the program to be updated in the target area is stable after testing whether the program to be updated in the target area is stable.
In one possible embodiment, the apparatus further comprises:
and the cache unit is used for injecting the program group to be updated into a program cache region of the artificial satellite before the program group to be updated is stored into the memory of the artificial satellite.
And the checking unit is used for determining whether the files in the program group are complete in the program cache region.
And the transmission unit is used for storing the program group to be updated into the memory if the files are all complete.
And the acquisition unit is used for sending an instruction for acquiring the program group again to the ground control center if at least one of the files is incomplete.
According to the device for updating the program, three files with the same content and containing the program to be updated are stored in a memory of the artificial satellite, when the program of the artificial satellite is updated, the three files are obtained from the memory firstly, the program in the three files at the same preset position is compared, whether data in each file changes or not in the period from the updating of the program to the saving of the program is judged, and if the comparison results of at least two files in the three files at the preset position are the same through comparison, the data with the same comparison result are determined as target data, and the target data are extracted; and splicing all the extracted target data into a program to be updated, and updating the program in the artificial satellite according to the program to be updated. According to the device, whether the files in the three files are modified due to the radiation of the particles in the space can be determined, when the data of one preset position of one file is changed, the unmodified target data is determined by comparing the data of the three files in the same preset position, and therefore the unmodified program to be updated is determined according to the target data. Compared with the method for directly running the updated program by the artificial satellite in the prior art, the method can improve the running stability of the artificial satellite program.
Fig. 4 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application, including: a processor 401, a storage medium 402 and a bus 403, wherein the storage medium 402 stores machine-readable instructions executable by the processor 401, when the electronic device executes a method of updating a program as in the embodiments, the processor 401 communicates with the storage medium 402 via the bus 403, and the processor 401 executes the machine-readable instructions to perform the steps as in the embodiments.
In an embodiment, the storage medium 402 may further execute other machine-readable instructions to perform other methods as described in the embodiments, and for the method steps and principles of specific execution, reference is made to the description of the embodiments, which is not described in detail herein.
Embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor when the computer program is executed to perform the steps in the embodiments.
In the embodiments of the present application, when being executed by a processor, the computer program may further execute other machine-readable instructions to perform other methods as described in the embodiments, and for the method steps and principles of specific execution, reference is made to the description of the embodiments, and details are not repeated here.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and there may be other divisions in actual implementation, and for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or modules through some communication interfaces, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method of updating a program, the method comprising:
storing a program group to be updated into an internal memory of the artificial satellite; the program group comprises three files with the same content;
when the program updating processing is carried out on the artificial satellite, three files in the memory are obtained, and data of the same preset position in the three files are compared;
for each preset position, if the comparison results of at least two files in the three files at the preset position are the same, determining the data with the same comparison result as target data, and extracting the target data;
and splicing all the extracted target data into a program to be updated, and controlling the artificial satellite to operate the program to be updated in the memory so as to update the program of the artificial satellite.
2. The method according to claim 1, further comprising, after comparing the data at the same predetermined locations in the three files:
determining at most one file except the at least two files as a file to be repaired according to the comparison result at each preset position;
and determining the program of the file to be repaired at the preset position as error data, and modifying the error data into the target data.
3. The method of claim 1, wherein the memory comprises a first region and a second region;
saving the program group to be updated into the memory of the artificial satellite, including:
acquiring the area of the current operating program of the artificial satellite;
if the area where the current running program is located is the first area, updating the program group to be updated to the second area;
and if the area where the currently running program is located is the second area, updating the program group to be updated to the first area.
4. The method according to claim 3, further comprising, after controlling the satellite to run the program to be updated in the memory:
testing whether a program to be updated in the target area is stable; wherein the target area is an area in which the program to be updated has been updated;
if the program is stable, controlling the artificial satellite to operate the program to be updated in the target area;
if the satellite is unstable, controlling the artificial satellite to operate the program in the backup area; and the backup area is an area which does not update the program to be updated.
5. The method of claim 4, wherein after testing whether the program to be updated in the target area is stable, the method further comprises:
if the program to be updated in the target area is stable, the program to be updated in the target area is backed up in the backup area.
6. The method of claim 1, further comprising, prior to saving the set of programs to be updated to the memory of the satellite:
injecting the program group to be updated into a program cache region of the artificial satellite;
in the program cache region, determining whether the files in the program group are complete;
if the files are all complete, the program group to be updated is stored in the memory;
and if at least one of the files is incomplete, sending an instruction for reacquiring the program group to a ground control center.
7. An apparatus for updating a program, the apparatus comprising:
the storage unit is used for storing the program group to be updated into the memory of the artificial satellite; the program group comprises three files with the same content;
the comparison unit is used for acquiring three files in the memory when the program updating processing is carried out on the artificial satellite and comparing the data of the same preset position in the three files;
the extraction unit is used for determining data with the same comparison result as target data and extracting the target data if the comparison results of at least two files in the three files at the preset positions are the same for each preset position;
and the updating unit is used for splicing all the extracted target data into a program to be updated, and controlling the artificial satellite to operate the program to be updated in the memory so as to update the program of the artificial satellite.
8. The apparatus of claim 7, wherein the memory comprises a first region and a second region;
the storage unit is used for storing the program group to be updated into the memory of the artificial satellite, and comprises the following steps:
acquiring the area of the current operating program of the artificial satellite;
if the area where the current running program is located is a first area, updating the program group to be updated to the second area;
and if the area where the currently running program is located is the second area, updating the program group to be updated to the first area.
9. An electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating via the bus when the electronic device is running, the processor executing the machine-readable instructions to perform the steps of the method of updating a program according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, performs the steps of the method of updating a program according to any one of claims 1 to 6.
CN202111226608.2A 2021-10-21 2021-10-21 Method and device for updating program, electronic equipment and storage medium Active CN113885918B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111226608.2A CN113885918B (en) 2021-10-21 2021-10-21 Method and device for updating program, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111226608.2A CN113885918B (en) 2021-10-21 2021-10-21 Method and device for updating program, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113885918A CN113885918A (en) 2022-01-04
CN113885918B true CN113885918B (en) 2022-06-07

Family

ID=79004096

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111226608.2A Active CN113885918B (en) 2021-10-21 2021-10-21 Method and device for updating program, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113885918B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0387940A (en) * 1989-08-30 1991-04-12 Nec Corp File copy system
DE102012020760A1 (en) * 2012-10-23 2014-04-24 Robert Bosch Gmbh Method for constructing setting dependent release notes such as supplementary document, involves outputting information when data processing program boundary condition or pre-specified criterion boundary condition is met
CN108399074A (en) * 2018-01-30 2018-08-14 努比亚技术有限公司 A kind of update method of application program, terminal and computer readable storage medium
CN112926077A (en) * 2021-03-30 2021-06-08 中国电子信息产业集团有限公司第六研究所 Satellite reconstruction data processing method and system
CN113312114A (en) * 2021-06-29 2021-08-27 北京微纳星空科技有限公司 On-orbit reconstruction method, device, equipment and storage medium of satellite-borne software

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0387940A (en) * 1989-08-30 1991-04-12 Nec Corp File copy system
DE102012020760A1 (en) * 2012-10-23 2014-04-24 Robert Bosch Gmbh Method for constructing setting dependent release notes such as supplementary document, involves outputting information when data processing program boundary condition or pre-specified criterion boundary condition is met
CN108399074A (en) * 2018-01-30 2018-08-14 努比亚技术有限公司 A kind of update method of application program, terminal and computer readable storage medium
CN112926077A (en) * 2021-03-30 2021-06-08 中国电子信息产业集团有限公司第六研究所 Satellite reconstruction data processing method and system
CN113312114A (en) * 2021-06-29 2021-08-27 北京微纳星空科技有限公司 On-orbit reconstruction method, device, equipment and storage medium of satellite-borne software

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于卫星和5G网的双模通信终端在飞行器测控领域的应用;佟旗 等;《第十七届卫星通信学术年会》;20210708;第1-8页 *
软件升级问题的多目标优化方法;赵松辉 等;《计算机科学》;20200630;第1-5页 *

Also Published As

Publication number Publication date
CN113885918A (en) 2022-01-04

Similar Documents

Publication Publication Date Title
US10120672B2 (en) Method for offline updating virtual machine images
CN108089876B (en) On-orbit updating method for satellite-borne DSP software
US20170124103A1 (en) Method and Apparatus for Creating System Disk Snapshot of Virtual Machine
US9459967B2 (en) Cascade ordering
CN103699421A (en) Method and device for upgrading embedded device system
KR102088167B1 (en) Apparatus for updating software as an agent and patch method thereof
US10467413B2 (en) Method and apparatus of dynamic loading file extraction for an application running in an android container
CN103942066A (en) Satellite-borne embedded software module on-orbit updating method
WO2020057253A1 (en) Method and system for game updating, terminal and computer readable storage medium
CN105426293A (en) Method and system for recording kernel exception stack and vmcore file
CN104484240A (en) Method and device for storing terminal data
WO2019041891A1 (en) Method and device for generating upgrade package
CN107992325A (en) A kind of method that fileinfo is compared by feature code check
CN110209420A (en) A kind of method and device updating bootstrap loader
CN113885918B (en) Method and device for updating program, electronic equipment and storage medium
CN111338652B (en) Operating system mirror image manufacturing method, device, equipment and medium
EP3346642A1 (en) Method and device for managing network element model
CN111858173A (en) Data recovery method, device, equipment and medium
CN115617488A (en) Operating system migration method and device, computing equipment and storage medium
CN115437674A (en) Firmware upgrading method, device, medium and electronic equipment
US11231878B2 (en) Content modification control
CN111897557B (en) Updating method, device, equipment and storage medium of service system
CN103970658A (en) Method and device for testing compatibility between PMON and kernel versions
US10860533B1 (en) File size as an indicator of file properties
CN111506330A (en) Program updating method and device, star affair computer and storage medium

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
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Room 1101, 11 / F, building 4, zone 1, 81 Beiqing Road, Haidian District, Beijing

Patentee after: Beijing Weina Starry Sky Technology Co.,Ltd.

Country or region after: China

Address before: Room 1101, 11 / F, building 4, zone 1, 81 Beiqing Road, Haidian District, Beijing

Patentee before: BEIJING MINOSPACE TECHNOLOGY CO.,LTD.

Country or region before: China