CN114090036A - Firmware upgrading method, device and equipment - Google Patents

Firmware upgrading method, device and equipment Download PDF

Info

Publication number
CN114090036A
CN114090036A CN202111334915.2A CN202111334915A CN114090036A CN 114090036 A CN114090036 A CN 114090036A CN 202111334915 A CN202111334915 A CN 202111334915A CN 114090036 A CN114090036 A CN 114090036A
Authority
CN
China
Prior art keywords
firmware
target
memory
function
version
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111334915.2A
Other languages
Chinese (zh)
Inventor
牛启飞
高在伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202111334915.2A priority Critical patent/CN114090036A/en
Publication of CN114090036A publication Critical patent/CN114090036A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The embodiment of the application discloses a firmware upgrading method, a firmware upgrading device and firmware upgrading equipment. According to the method and the device, when a firmware version upgrading instruction is received, a target firmware upgrading packet is obtained according to the firmware version upgrading instruction, and then the target firmware upgrading packet is stored in at least one fragment memory, wherein the sum of the storage spaces of the at least one fragment memory is larger than or equal to the storage space required by the target firmware upgrading packet, so that the storage server can be upgraded according to the target firmware upgrading packet stored in the fragment memory. According to the method and the device, the target firmware upgrading packet for upgrading is stored in the fragment memory, the fragment memory in the storage server is fully utilized, and meanwhile, the upgrading of the firmware version is realized according to the target firmware upgrading packet existing in the fragment memory, so that the service provided by the storage server is perfected.

Description

Firmware upgrading method, device and equipment
Technical Field
The present application relates to the field of computers, and in particular, to a firmware upgrading method, apparatus, and device.
Background
The storage server may store the video videos sent by the multiple cameras, and set multiple services on the storage server, for example, a face detection function for performing face detection on a target object in the video videos may be set on the storage server.
However, when the storage server stores the video files sent by the plurality of cameras, there may be fragmented memories between addresses of the video files stored by the storage server, and these fragmented memories are some small discontinuous free memories and cannot be used for storing the video files, but if these fragmented memories are not fully utilized, a waste of storage resources will be caused. Meanwhile, in the process of using the service provided by the storage server, the service provided by the current storage server may not be perfect, and the firmware version operated by the storage server needs to be upgraded to perfect the service provided by the storage server.
Disclosure of Invention
The application discloses a firmware upgrading method, a firmware upgrading device and firmware upgrading equipment, which are used for upgrading by fully utilizing a fragmented memory in a storage server.
According to a first aspect of embodiments of the present application, there is provided a firmware upgrade method, which is applied to a storage server, and includes:
when a firmware version upgrading instruction is received, obtaining a target firmware upgrading packet according to the firmware version upgrading instruction, and storing the target firmware upgrading packet to at least one fragment memory; the sum of the storage spaces of the at least one fragmented memory is greater than or equal to the storage space required by the target firmware upgrade package, and the storage spaces among different fragmented memories are discontinuous; the fragment memory refers to a storage space between two used adjacent storage address blocks in the memory, or the fragment memory refers to a storage space between a starting storage address or an ending storage address of any storage address block in the memory and an adjacent used storage address block;
and upgrading according to the target firmware upgrading package.
Optionally, obtaining the target firmware upgrade package according to the firmware version upgrade instruction includes:
when determining to upgrade the currently running first firmware version to a second firmware version according to the firmware version upgrading instruction, determining a firmware package corresponding to the second firmware version as the target firmware upgrading package;
when the specified function in the currently running first firmware version is determined to be upgraded to a corresponding target function in the second firmware version according to the firmware version upgrading instruction, or when the target function corresponding to the target function in the second firmware version is determined to be newly added in the currently running first firmware version according to the firmware version upgrading instruction, the firmware package corresponding to the target function in the second firmware version is determined to be a target firmware upgrading package.
Optionally, when it is determined according to the firmware version upgrade instruction that the currently running first firmware version is upgraded to the second firmware version, the method further includes: and deleting the firmware package corresponding to the stored first firmware version.
Optionally, when it is determined according to the firmware version upgrade instruction that the specified function in the currently running first firmware version is upgraded to the target function corresponding to the target function in the second firmware version, and it is determined that the target firmware upgrade package is the firmware package corresponding to the target function in the second firmware version, the method further includes, when the target firmware upgrade package is upgraded according to the target firmware upgrade package:
and when the upgrading failure according to the target firmware upgrading package is detected, backing to the specified function according to the stored firmware package corresponding to the first firmware version.
Optionally, the storing the target firmware upgrade package into at least one fragmented memory includes:
selecting one fragmented memory from the memories;
when the fragmented memory is the first selected fragmented memory, checking whether the storage space of the first fragmented memory contains the target firmware upgrade packet according to the size of the target firmware upgrade packet, if not, returning to the step of selecting one fragmented memory from the memory, and if so, storing the target firmware upgrade packet to the first selected fragmented memory;
when the fragmented memory is not the first fragmented memory selected, checking whether the sum of the storage spaces of the fragmented memory and all the fragmented memories selected before contains the target firmware upgrade package according to the size of the target firmware upgrade package, if so, storing the target firmware upgrade package to all the fragmented memories selected, if not, returning to the step of selecting one fragmented memory from the memories when the fragmented memory is not the last fragmented memory, and storing a part of the target firmware upgrade package to all the fragmented memories selected when the fragmented memory is the last fragmented memory, wherein the storage space required by the part of the target firmware upgrade package is equal to the sum of the storage spaces of all the fragmented memories selected.
Optionally, after storing a part of the target firmware upgrade package in all the selected fragmented memories, the method further includes: and storing the other part of the target firmware upgrade package in a non-fragmented memory.
Optionally, the target firmware upgrade package includes a firmware package of at least one function;
the method further comprises the following steps: recording function storage information of each function in the target firmware upgrade package, so as to perform function management according to the function storage information and control upgrading according to the target firmware upgrade package; the function storage information at least comprises a corresponding relation between a function identifier of the function and storage address information of a firmware package of the function.
Optionally, the method further comprises:
acquiring a function point file corresponding to each firmware version, wherein the function point file describes each function in the firmware version corresponding to the function point file through a function point, and each firmware version at least comprises a first firmware version currently operated by the server and other firmware versions different from the first firmware version;
and comparing the function point files corresponding to different firmware versions, and determining the function points with differences among the function point files corresponding to different firmware versions as difference points, wherein the difference points are used for indicating the generation of firmware version upgrading instructions.
According to a second aspect of the embodiments of the present application, there is provided a firmware upgrade apparatus, which is applied to a storage server, and includes:
the target firmware upgrade package storage unit is used for obtaining a target firmware upgrade package according to a firmware version upgrade instruction when the firmware version upgrade instruction is received, and storing the target firmware upgrade package to at least one fragment memory; the sum of the storage spaces of the at least one fragmented memory is greater than or equal to the storage space required by the target firmware upgrade package, and the storage spaces among different fragmented memories are discontinuous; the fragment memory refers to a storage space between two used adjacent storage address blocks in the memory, or the fragment memory refers to a storage space between a starting storage address or an ending storage address of any storage address block in the memory and an adjacent used storage address block;
and the upgrading unit is used for upgrading according to the target firmware upgrading package.
According to a third aspect of embodiments of the present application, there is provided an electronic apparatus including: a processor and a memory;
the memory for storing machine executable instructions;
the processor is used for reading and executing the machine executable instructions stored in the memory so as to realize the firmware upgrading method.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
according to the technical scheme, when the storage server in the scheme provided by the application receives the firmware version upgrading instruction, the target firmware upgrading packet can be obtained according to the firmware version upgrading instruction, and then the target firmware upgrading packet is stored in the at least one fragment memory, wherein the sum of the storage spaces of the at least one fragment memory is larger than or equal to the storage space required by the target firmware upgrading packet, so that the storage server can be upgraded according to the target firmware upgrading packet stored in the fragment memory. According to the method and the device, the target firmware upgrading packet for upgrading is stored in the fragment memory, the fragment memory in the storage server is fully utilized, and meanwhile, the upgrading of the firmware version is realized according to the target firmware upgrading packet existing in the fragment memory, so that the service provided by the storage server is perfected.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present specification and together with the description, serve to explain the principles of the specification.
Fig. 1 is a flowchart of a method for upgrading firmware according to an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating a target firmware upgrade package storage according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a portion of a storage space including a fragmentation space provided by an embodiment of the present application;
FIG. 4 is a diagram illustrating differences between different firmware versions according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of an apparatus for upgrading firmware provided by an embodiment of the present application;
fig. 6 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In order to make the technical solutions provided in the embodiments of the present application better understood and make the above objects, features and advantages of the embodiments of the present application more comprehensible, the technical solutions in the embodiments of the present application are described in further detail below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart of a method for upgrading firmware according to an embodiment of the present application. As an embodiment, the process shown in fig. 1 may be applied to a storage server, and optionally, the storage server may be used to store the video uploaded by the camera, and the storage server may be provided with a plurality of services for detecting the video, such as face detection, perimeter precaution, and the like.
As shown in fig. 1, the process may include the following steps:
step 101, when a firmware version upgrading instruction is received, obtaining a target firmware upgrading packet according to the firmware version upgrading instruction, and storing the target firmware upgrading packet to at least one fragmented memory.
And 102, upgrading according to the target firmware upgrading package.
The method embodiments shown in this scheme are detailed below:
in the embodiment of the present application, the firmware version upgrade instruction may be an automatic upgrade instruction that is sent to the storage server by the received upgrade server after the storage server starts the automatic upgrade service. The automatic upgrade instruction is generated and sent to the storage device by an upgrade server when detecting a firmware package corresponding to a higher-version firmware version, the upgrade server is operated and maintained by a manufacturer, and the upgrade server is used for providing the firmware packages corresponding to different firmware versions which can be installed by the storage server.
Alternatively, the firmware version upgrading instruction may also be an instruction input by a user from the outside, where the firmware instruction may be generated according to a difference point between different firmware versions stored in the storage server in advance, which is not described herein again, and details will be described after the flow shown in fig. 1 is introduced, with reference to fig. 4.
In this embodiment of the present application, in order to improve the upgrading efficiency, in this embodiment, the whole currently running firmware version may be upgraded, for example, the currently running first firmware version is upgraded to the second firmware version, or one or more functions in the currently running firmware version may also be upgraded, for example, a specified function that is currently running and belongs to the upgrade of the first firmware version is upgraded to a target function of the second firmware version, or a target function may also be newly added to the storage server to upgrade the currently running firmware.
As an embodiment, if it is determined according to the firmware version upgrade instruction that the currently running first firmware version is upgraded to the second firmware version, the firmware package corresponding to the second firmware version may be determined to be the target firmware upgrade package in this embodiment. After the firmware package corresponding to the second firmware version is determined to be the target firmware upgrade package, the firmware package corresponding to the second firmware version returned by the upgrade server may be obtained by sending an obtaining request of the firmware package corresponding to the second firmware version to the upgrade server.
As another embodiment, if it is determined according to the firmware version upgrade instruction that the specified function in the currently running first firmware version is upgraded to the corresponding target function in the second firmware version, or if it is determined according to the firmware version upgrade instruction that the corresponding target function in the second firmware version is newly added to the currently running first firmware version, the embodiment may determine that the firmware package corresponding to the target function in the second firmware version is the target firmware upgrade package.
After determining that the firmware package corresponding to the target function in the second firmware version is the target firmware upgrade package, obtaining the firmware package corresponding to the target function in the second firmware version returned by the upgrade server by sending an obtaining request of the firmware package corresponding to the target function in the second firmware version to the upgrade server; or, if the upgrade server does not support sending the firmware package corresponding to a single function, the request for obtaining the firmware package corresponding to the second firmware version may be sent to the upgrade server, and after receiving the firmware package corresponding to the second firmware version returned by the upgrade server, the firmware package corresponding to the target function may be found from the firmware package corresponding to the second firmware version according to the function identifier of the target function.
It should be noted that, in this embodiment, the target firmware upgrade package at least includes a version number and a version resource, where the version number refers to a version number of a firmware version to which the firmware package corresponding to the firmware upgrade package belongs, and the version resource refers to a firmware program that needs to be written into the memory during upgrade. If the target firmware upgrade package is a firmware package corresponding to the target function, the target firmware upgrade package may further include a function identifier of the target function.
After the target firmware upgrade package is found through the above embodiment, the embodiment may determine the number of the fragmented memories and the capacity of each fragmented memory in the current device by obtaining the memory usage of the current device, and further store the target firmware upgrade package by using the fragmented memories according to the number of the fragmented memories and the capacity of each fragmented memory in the current device.
In this embodiment, the sum of the storage spaces of the at least one fragmented memory used for storing the target firmware upgrade package in step 101 should be greater than or equal to the storage space required by the target firmware upgrade package. The fragmentation memory refers to a storage space between two used adjacent storage address blocks in the memory, or the fragmentation memory refers to a storage space between a start storage address or an end storage address of any storage address block in the memory and an adjacent used storage address block. The memory of the storage server in this embodiment includes a plurality of storage address blocks, and each storage address block has a starting storage address and an ending storage address.
For example, fig. 3 is a schematic diagram of a part of storage space of the storage device, where in the schematic diagram, the 3 blocks are marked with gray and the storage space is 3 fragment memories (including fragment memory 1, fragment memory 2, and fragment memory 3), and the other white storage spaces are storage address blocks (where the part of storage address blocks in fig. 2 are used for storing video recording events a1, a2, B1, and B2, respectively). As shown in fig. 3, the fragmentation memory 2 is a storage space between an address block for storing the video recording event a2 and an address block for storing the video recording event B1 adjacent to the address block, and the fragmentation memory 3 is a storage space between the end address of an unused storage address block and an adjacent address block for storing the video recording event B2.
In a specific implementation, the target firmware upgrade package may be stored in at least one fragmented memory by the following steps as shown in fig. 2:
step 1011: selecting one fragmented memory from the memories.
Step 1012: when the fragmented memory is the first fragmented memory selected, checking whether the storage space of the first fragmented memory contains the target firmware upgrade packet according to the size of the target firmware upgrade packet, if not, returning to the step of selecting one fragmented memory from the memory, and if so, storing the target firmware upgrade packet to the first fragmented memory selected.
As an embodiment, if it is detected that the selected first fragmented memory can accommodate the target firmware upgrade packet, it indicates that the next fragmented memory does not need to be selected any more, and the entire target firmware upgrade packet may be stored in the first fragmented memory.
Step 1013: when the fragment memory is not the first selected fragment memory, checking whether the sum of the storage spaces of the fragment memory and all the fragment memories selected before contains the target firmware upgrade packet according to the size of the target firmware upgrade packet, if so, storing the target firmware upgrade packet to all the selected fragment memories, if not, returning to the step of selecting one fragment memory from the memories when the fragment memory is not the last fragment memory, and storing a part of the target firmware upgrade packet to all the selected fragment memories when the fragment memory is the last fragment memory.
In the embodiment of the application, one fragmented memory can be selected from the memories according to the size of the storage space of the fragmented memory from large to small, so that the number of the fragmented memories used by the target firmware upgrade package is the minimum, and the target firmware upgrade package is convenient to manage.
Further, if the sum of the storage spaces of all the fragmented memories in the device cannot accommodate the target firmware upgrade package, after storing a part of the target firmware upgrade package in all the selected fragmented memories, another part of the target firmware upgrade package may be stored in a non-fragmented memory, for example, another part of the target firmware upgrade package is stored in a continuous address block in the storage server.
After the fragmented memory is used to store the target firmware upgrade package, in this embodiment, the firmware package corresponding to the first firmware version may be processed in two different ways:
optionally, when it is determined according to the firmware version upgrade instruction that the currently running first firmware version is upgraded to the second firmware version, since the upgrade is performed on the entire system of the storage server at this time, in order to avoid storage redundancy, the stored firmware package corresponding to the first firmware version may be deleted.
Optionally, when it is determined according to the firmware version upgrade instruction that the specified function in the currently running first firmware version is upgraded to the corresponding target function in the second firmware version, and it is determined that the target firmware upgrade package is the firmware package corresponding to the target function in the second firmware version, the firmware package corresponding to the specified function may be continuously saved when the firmware package corresponding to the specified function is upgraded according to the target firmware upgrade package, and if it is detected that the upgrade according to the target firmware upgrade package fails, the firmware package corresponding to the specified function according to the stored first firmware version is backed up to the specified function.
In this embodiment of the application, since the firmware package corresponding to the firmware version is composed of the firmware packages corresponding to the functions in the firmware version, the target firmware upgrade package includes the firmware package of at least one function. Therefore, in this embodiment, when the target firmware upgrade package is stored in at least one fragmented memory, the function storage information of each function in the target firmware upgrade package may be recorded at the same time, so as to perform function management according to the function storage information and control upgrading according to the target firmware upgrade package. The function storage information at least comprises a corresponding relation between a function identifier of the function and storage address information of a firmware package of the function.
For example, in this embodiment, a memory management table for storing the function storage information may be established, and when the currently running first firmware version is not upgraded, the memory management table stores the function storage information of each function in the first firmware version.
As an embodiment, when it is determined that the currently running first firmware version is upgraded to the second firmware version, and it is determined that the firmware package corresponding to the second firmware version is the target firmware upgrade package, the information recorded in the memory management table may be cleared, and the function storage information of each function in the second firmware version is recorded in the memory management table.
After the firmware package corresponding to the second firmware version is saved in the memory, because the address of each function called in the program currently providing various services is also the storage address of each function in the first firmware version, the address of each function called in the program providing various services needs to be modified into the corresponding storage address of each function in the second firmware version according to the function storage information of each function in the second firmware version, so that the switching of each function called in the program providing various services is realized, and the upgrading from the first firmware version to the second firmware version is completed.
As another embodiment, when it is determined according to the firmware version upgrade instruction that the specified function in the currently running first firmware version is upgraded to the corresponding target function in the second firmware version, or when it is determined according to the firmware version upgrade instruction that the corresponding target function in the second firmware version is newly added to the currently running first firmware version, and it is determined that the firmware package corresponding to the target function in the second firmware version is the target firmware upgrade package, the function storage information corresponding to the target function may be added behind the function storage information of each function in the first firmware version recorded in the memory management table.
In this embodiment, after the firmware package corresponding to the target function is saved in the memory, if the target function is the upgrade of the specified function in the first firmware version, the storage address of the specified function called in the program providing the service in the storage server needs to be modified to the storage address corresponding to the winning function in the function storage information, so as to complete the upgrade of the specified function in the first firmware version to the target function corresponding to the second firmware version; or, if the target function is a newly added function, a new program for calling the target function is required to be created according to the storage address corresponding to the target function in the function storage information, so that the service can be provided through the new program, and the upgrading process is completed.
Thus, the flow shown in fig. 1 is completed.
Through the process shown in fig. 1, in the embodiment of the present application, when a firmware version upgrade instruction is received, a target firmware upgrade package is obtained according to the firmware version upgrade instruction, and then the target firmware upgrade package is stored in at least one fragmented memory, where a sum of storage spaces of the at least one fragmented memory is greater than or equal to a storage space required by the target firmware upgrade package, so that a storage server can upgrade according to the target firmware upgrade package stored in the fragmented memory. According to the method and the device, the target firmware upgrading packet for upgrading is stored in the fragment memory, the fragment memory in the storage server is fully utilized, and meanwhile, the upgrading of the firmware version is realized according to the target firmware upgrading packet existing in the fragment memory, so that the service provided by the storage server is perfected.
How to instruct the user to generate the firmware version-up instruction will be described in detail below with reference to fig. 4.
First, it should be noted that, in the related art, when a firmware package corresponding to a firmware version is generated, a function point file corresponding to the firmware version is generated at the same time, where each function providing service on a storage device is described by a function point, and for each function point, an algorithm version used by the function described by the function point in the firmware version and each feature of the function are recorded in the function point file, where the feature refers to features such as a system environment supported by the function and a service capability of the function.
In addition, when the firmware version is upgraded, the functions in the firmware version are not all changed, so that the same function and different functions exist between different firmware versions, where the same function refers to a function that can have the same service capability for the same service, the different functions refer to functions that can have different service capabilities for the same service, or the different functions refer to functions that provide new services.
For convenience of description, in the present embodiment, different functions providing the same service between different versions are described by using a difference point, where the difference point may be caused by optimization of a single algorithm in different versions. Because each firmware package corresponding to each firmware version is actually the sum of various algorithm packages, correspondingly, for the functions in each firmware version, the firmware package corresponding to the function is also composed of the corresponding algorithm packages, the firmware packages corresponding to the functions providing the same service in different firmware versions are generally composed of different algorithm packages, the service capabilities which can be realized by different algorithms are generally different, and because the requirements of different algorithms on the system environment may be inconsistent, the system environments required for the function providing the same service in different firmware versions to operate may also be different, which will cause the difference of the functions providing the same service in different firmware versions. Therefore, the change of a single algorithm in the firmware package corresponding to the function in different firmware versions can be used as granularity to detect whether the firmware package corresponding to the function in different firmware versions has algorithm addition and/or replacement and/or algorithm version upgrade, and if so, the difference between the functions providing the same service in different firmware versions can be determined.
For example, with respect to the function of providing the face detection service in version a, the used algorithm version is V1.0.0, which supports 2-way simultaneous input and output, and the function of providing the face detection service in version B realizes the function through the new version of algorithm (version V1.0.1), which improves the accuracy and efficiency of face detection, and supports 4-way simultaneous input and output, the difference between the functions of providing the face detection service in version a and version B includes the algorithm version and the number of ways of supported input and output.
Referring now to fig. 4, the function points in each firmware version are represented by the implementation blocks as shown in the dashed boxes in fig. 4, and are labeled with different labels to represent the difference points between the different firmware versions. As shown in fig. 4, the difference points between version a and version B are shown by the label 1 in fig. 4, wherein there are 4 difference points between version a and version B in total; displaying difference points between the version A and the version C by a mark 2, wherein 3 difference points exist between the version A and the version C in total; the disparity points between version B and version C are shown by the label 3, where there are 4 disparity points in total between version B and version C.
As an embodiment, before the execution of this embodiment, the storage server may obtain, from an upgrade server for providing a firmware package corresponding to a firmware version, each function point file corresponding to each firmware version (including at least version a, version B, and version C), and create one function point file corresponding to a firmware version currently running by the storage server.
In this embodiment of the application, after obtaining each function point file corresponding to each firmware version, the storage server may determine a difference point between different firmware versions by comparing different function point files, and record the difference point in a pre-established configuration table, and further may display the difference point between different firmware versions through an interface according to the configuration table, so that a user may input a firmware version upgrade instruction according to the difference point (as shown in fig. 4) presented on the interface.
In a specific implementation, for example, when the device has run version a, but a specific function in version a cannot meet a user requirement at present, when receiving an instruction input by a user to display a difference point between version a and at least one other firmware version different from version a, the difference point between version a and the other firmware version may be found from the configuration table (if there are multiple other firmware versions, the difference point between the multiple other firmware versions may be further found from the configuration table), the difference point is displayed on the interface, so that the user determines a target function that can meet the user requirement and a firmware version (assumed to be version B) corresponding to the target function according to the difference point between version a and the other firmware versions, and inputs a firmware version upgrade instruction to upgrade the currently running version a to version B, or, a firmware version upgrading instruction for upgrading the specified function of the version A to the target function or adding a new target function is input.
Further, if a firmware version upgrade instruction for upgrading the currently running version a to the version B is input, after the currently running version a is upgraded to the version B, in this embodiment, the function point file corresponding to the version a for recording the currently running firmware in the storage server is updated, and the information of each function in the version a recorded in the function point file is updated to the information of each function in the version B. In the upgrading process, a user can select which firmware version is upgraded according to the difference between different firmware versions, so that the firmware version can be conveniently upgraded to the version required by the user.
If a firmware version upgrade instruction for upgrading the specified function of the version a to the target function or adding a new target function is input, after the specified function of the currently running version a is upgraded to the target function of the version B, in this embodiment, the function point file corresponding to the firmware version used for recording the current running in the storage server is updated, and the information of the specified function in the function point file is updated to the information of the target function. Through the upgrading process, the requirements of users can be met only by upgrading the function points with the difference between the version A and the version B in the embodiment, all resources in the version B do not need to be upgraded, and the upgrading efficiency of the firmware version is further improved.
The method provided by the embodiment of the application is described above. The following describes a firmware upgrading apparatus provided in an embodiment of the present application:
referring to fig. 5, fig. 5 is a schematic diagram of an apparatus for upgrading firmware according to an embodiment of the present application, where the embodiment of the apparatus is applied to a storage server. The device includes:
a target firmware upgrade package storage unit 501, configured to, when a firmware version upgrade instruction is received, obtain a target firmware upgrade package according to the firmware version upgrade instruction, and store the target firmware upgrade package to at least one fragmented memory; the sum of the storage spaces of the at least one fragmented memory is greater than or equal to the storage space required by the target firmware upgrade package, and the storage spaces among different fragmented memories are discontinuous; the fragment memory refers to a storage space between two used adjacent storage address blocks in the memory, or the fragment memory refers to a storage space between a starting storage address or an ending storage address of any storage address block in the memory and an adjacent used storage address block;
an upgrade unit 502, configured to upgrade according to the target firmware upgrade package.
Optionally, the obtaining, by the target firmware upgrade package storage unit 501 according to the firmware version upgrade instruction, a target firmware upgrade package includes:
when determining to upgrade the currently running first firmware version to a second firmware version according to the firmware version upgrading instruction, determining a firmware package corresponding to the second firmware version as the target firmware upgrading package;
when the specified function in the currently running first firmware version is determined to be upgraded to a corresponding target function in the second firmware version according to the firmware version upgrading instruction, or when the target function corresponding to the target function in the second firmware version is determined to be newly added in the currently running first firmware version according to the firmware version upgrading instruction, the firmware package corresponding to the target function in the second firmware version is determined to be a target firmware upgrading package.
Optionally, when it is determined according to the firmware version upgrading instruction that the currently running first firmware version is upgraded to the second firmware version, the target firmware upgrade package storage unit 501 is further configured to delete the stored firmware package corresponding to the first firmware version.
Optionally, when it is determined according to the firmware version upgrade instruction that the specified function in the currently running first firmware version is upgraded to the target function corresponding to the target function in the second firmware version, and it is determined that the target firmware upgrade package is the firmware package corresponding to the target function in the second firmware version, the method further includes, when the upgrade unit 502 upgrades according to the target firmware upgrade package:
and when the upgrading failure according to the target firmware upgrading package is detected, backing to the specified function according to the stored firmware package corresponding to the first firmware version.
Optionally, the storing the target firmware upgrade package in the target firmware upgrade package storing unit 501 stores the target firmware upgrade package in at least one fragmented memory, including:
selecting one fragmented memory from the memories;
when the fragmented memory is the first selected fragmented memory, checking whether the storage space of the first fragmented memory contains the target firmware upgrade packet according to the size of the target firmware upgrade packet, if not, returning to the step of selecting one fragmented memory from the memory, and if so, storing the target firmware upgrade packet to the first selected fragmented memory;
when the fragmented memory is not the first fragmented memory selected, checking whether the sum of the storage spaces of the fragmented memory and all the fragmented memories selected before contains the target firmware upgrade package according to the size of the target firmware upgrade package, if so, storing the target firmware upgrade package to all the fragmented memories selected, if not, returning to the step of selecting one fragmented memory from the memories when the fragmented memory is not the last fragmented memory, and storing a part of the target firmware upgrade package to all the fragmented memories selected when the fragmented memory is the last fragmented memory, wherein the storage space required by the part of the target firmware upgrade package is equal to the sum of the storage spaces of all the fragmented memories selected.
After storing a portion of the target firmware upgrade package to all the selected fragmented memories, the target firmware upgrade package storing unit 501 is further configured to: and storing the other part of the target firmware upgrade package in a non-fragmented memory.
Optionally, the target firmware upgrade package includes a firmware package of at least one function;
the apparatus further comprises: the function storage information unit is used for recording function storage information of each function in the target firmware upgrade package so as to carry out function management according to the function storage information and control upgrading according to the target firmware upgrade package; the function storage information at least comprises a corresponding relation between a function identifier of the function and storage address information of a firmware package of the function.
Optionally, the apparatus further comprises:
a difference point determining unit, configured to obtain a function point file corresponding to each firmware version, where the function point file describes, through a function point, each function in the firmware version corresponding to the function point file, and each firmware version at least includes a first firmware version currently running in the server and another firmware version different from the first firmware version;
and comparing the function point files corresponding to different firmware versions, and determining the function points with differences among the function point files corresponding to different firmware versions as difference points, wherein the difference points are used for indicating the generation of firmware version upgrading instructions.
Correspondingly, an embodiment of the present application further provides a hardware structure diagram of an electronic device, and specifically, as shown in fig. 6, the electronic device may be the device for implementing the firmware upgrade method. As shown in fig. 6, the hardware structure includes: a processor and a memory.
Wherein the memory is to store machine executable instructions;
the processor is configured to read and execute the machine executable instructions stored in the memory to implement the corresponding firmware upgrade method embodiments as shown above.
For one embodiment, the memory may be any electronic, magnetic, optical, or other physical storage device that may contain or store information such as executable instructions, data, and the like. For example, the memory may be: volatile memory, non-volatile memory, or similar storage media. In particular, the Memory may be a RAM (random Access Memory), a flash Memory, a storage drive (e.g., a hard disk drive), a solid state disk, any type of storage disk (e.g., an optical disk, a DVD, etc.), or similar storage medium, or a combination thereof.
So far, the description of the electronic apparatus shown in fig. 6 is completed.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

1. A firmware upgrading method is applied to a storage server and comprises the following steps:
when a firmware version upgrading instruction is received, obtaining a target firmware upgrading packet according to the firmware version upgrading instruction, and storing the target firmware upgrading packet to at least one fragment memory; the sum of the storage spaces of the at least one fragmented memory is greater than or equal to the storage space required by the target firmware upgrade package, and the storage spaces among different fragmented memories are discontinuous; the fragment memory refers to a storage space between two used adjacent storage address blocks in the memory, or the fragment memory refers to a storage space between a starting storage address or an ending storage address of any storage address block in the memory and an adjacent used storage address block;
and upgrading according to the target firmware upgrading package.
2. The method of claim 1, wherein obtaining a target firmware upgrade package according to the firmware version upgrade instructions comprises:
when determining to upgrade the currently running first firmware version to a second firmware version according to the firmware version upgrading instruction, determining a firmware package corresponding to the second firmware version as the target firmware upgrading package;
when the specified function in the currently running first firmware version is determined to be upgraded to a corresponding target function in the second firmware version according to the firmware version upgrading instruction, or when the target function corresponding to the target function in the second firmware version is determined to be newly added in the currently running first firmware version according to the firmware version upgrading instruction, the firmware package corresponding to the target function in the second firmware version is determined to be a target firmware upgrading package.
3. The method of claim 2, wherein when it is determined according to the firmware version upgrade instruction that the first firmware version currently running is upgraded to the second firmware version, the method further comprises: and deleting the firmware package corresponding to the stored first firmware version.
4. The method according to claim 2, wherein when it is determined according to the firmware version upgrade instruction that the specified function in the currently running first firmware version is upgraded to the corresponding target function in the second firmware version, and it is determined that the target firmware upgrade package is the firmware package corresponding to the target function in the second firmware version, the method further includes, when the upgrade is performed according to the target firmware upgrade package:
and when the upgrading failure according to the target firmware upgrading package is detected, backing to the specified function according to the stored firmware package corresponding to the first firmware version.
5. The method of claim 1, wherein depositing the target firmware upgrade package to at least one fragmented memory comprises:
selecting one fragmented memory from the memories;
when the fragmented memory is the first selected fragmented memory, checking whether the storage space of the first fragmented memory contains the target firmware upgrade packet according to the size of the target firmware upgrade packet, if not, returning to the step of selecting one fragmented memory from the memory, and if so, storing the target firmware upgrade packet to the first selected fragmented memory;
when the fragmented memory is not the first fragmented memory selected, checking whether the sum of the storage spaces of the fragmented memory and all the fragmented memories selected before contains the target firmware upgrade package according to the size of the target firmware upgrade package, if so, storing the target firmware upgrade package to all the fragmented memories selected, if not, returning to the step of selecting one fragmented memory from the memories when the fragmented memory is not the last fragmented memory, and storing a part of the target firmware upgrade package to all the fragmented memories selected when the fragmented memory is the last fragmented memory, wherein the storage space required by the part of the target firmware upgrade package is equal to the sum of the storage spaces of all the fragmented memories selected.
6. The method of claim 5, wherein after storing a portion of the target firmware upgrade package to all of the selected fragmented memory, the method further comprises: and storing the other part of the target firmware upgrade package in a non-fragmented memory.
7. The method of claim 1, wherein the target firmware upgrade package comprises a firmware package of at least one function;
the method further comprises the following steps: recording function storage information of each function in the target firmware upgrade package, so as to perform function management according to the function storage information and control upgrading according to the target firmware upgrade package; the function storage information at least comprises a corresponding relation between a function identifier of the function and storage address information of a firmware package of the function.
8. The method of any one of claims 1 to 7, further comprising:
acquiring a function point file corresponding to each firmware version, wherein the function point file describes each function in the firmware version corresponding to the function point file through a function point, and each firmware version at least comprises a first firmware version currently operated by the server and other firmware versions different from the first firmware version;
and comparing the function point files corresponding to different firmware versions, and determining the function points with differences among the function point files corresponding to different firmware versions as difference points, wherein the difference points are used for indicating the generation of firmware version upgrading instructions.
9. A firmware upgrading device is applied to a storage server and comprises the following components:
the target firmware upgrade package storage unit is used for obtaining a target firmware upgrade package according to a firmware version upgrade instruction when the firmware version upgrade instruction is received, and storing the target firmware upgrade package to at least one fragment memory; the sum of the storage spaces of the at least one fragmented memory is greater than or equal to the storage space required by the target firmware upgrade package, and the storage spaces among different fragmented memories are discontinuous; the fragment memory refers to a storage space between two used adjacent storage address blocks in the memory, or the fragment memory refers to a storage space between a starting storage address or an ending storage address of any storage address block in the memory and an adjacent used storage address block;
and the upgrading unit is used for upgrading according to the target firmware upgrading package.
10. An electronic device, comprising: a processor and a memory;
the memory for storing machine executable instructions;
the processor is configured to read and execute the machine executable instructions stored by the memory to implement the method of any one of claims 1 to 8.
CN202111334915.2A 2021-11-11 2021-11-11 Firmware upgrading method, device and equipment Pending CN114090036A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111334915.2A CN114090036A (en) 2021-11-11 2021-11-11 Firmware upgrading method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111334915.2A CN114090036A (en) 2021-11-11 2021-11-11 Firmware upgrading method, device and equipment

Publications (1)

Publication Number Publication Date
CN114090036A true CN114090036A (en) 2022-02-25

Family

ID=80300016

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111334915.2A Pending CN114090036A (en) 2021-11-11 2021-11-11 Firmware upgrading method, device and equipment

Country Status (1)

Country Link
CN (1) CN114090036A (en)

Similar Documents

Publication Publication Date Title
US8239648B2 (en) Reclamation of thin provisioned disk storage
US9223657B2 (en) Self-rescue method and device for damaged file system
US8065466B2 (en) Library apparatus, library system and method for copying logical volume to disk volume in cache disk with smallest access load
CN107562367B (en) Method and device for reading and writing data based on software storage system
CN109407971A (en) The method and device of staging disk lock
US11861349B2 (en) Modular firmware updates in an information handling system
US10620867B2 (en) System and method for performing wear leveling at a non-volatile firmware memory
CN114153394A (en) Data storage management method, device and equipment
US9009430B2 (en) Restoration of data from a backup storage volume
CN114090036A (en) Firmware upgrading method, device and equipment
CN114443058A (en) Method for creating private mirror image in public cloud and related equipment
US20100115503A1 (en) Image processing apparatus and control method thereof
CN112825098A (en) Data protection method and device, computing equipment and storage medium
CN109508140B (en) Storage resource management method and device, electronic equipment and system
WO2018028321A1 (en) Method and apparatus for managing virtual external storage device, and terminal
CN111399753B (en) Method and device for writing pictures
CN115080309A (en) Data backup system, method, storage medium, and electronic device
CN111190549A (en) Method, device, equipment and medium for acquiring available capacity of shared volume
CN113867947A (en) Heterogeneous memory allocation method and device and electronic equipment
CN101008908B (en) Synchronous data copy system and method
CN110943871B (en) Resource interval adjusting method and device
CN111435342A (en) Poster updating method, poster updating system and poster management system
US8112609B2 (en) Data management apparatus and method
JP6287055B2 (en) Information processing apparatus, information collection method, and information collection program
US11782639B2 (en) Automated datastore unavailability handling

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