Firmware upgrade method, device and equipment

By using fragmented memory in the storage server to store the target firmware upgrade package, the problem of storage resource waste is solved and the storage server service is improved.

CN114090036BActive Publication Date: 2025-09-23HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111334915.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-11
Publication Date
2025-09-23
Estimated Expiration
2041-11-11

AI Technical Summary

Technical Problem

There is fragmented memory in the storage server that is not fully utilized, resulting in a waste of storage resources. At the same time, the existing storage server service is not perfect, and the firmware version needs to be upgraded to improve the service.

Method used

When a firmware version upgrade instruction is received, the target firmware upgrade package is stored in the fragmented memory in the storage server. The sum of the storage space of the fragmented memory is greater than or equal to the storage space required for the target firmware upgrade package, and the firmware version is upgraded through the fragmented memory.

Benefits of technology

The fragmented memory in the storage server is fully utilized to achieve firmware version upgrades, thereby improving the service of the storage server.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114090036B_ABST
    Figure CN114090036B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a firmware upgrade method, apparatus, and device. When receiving a firmware version upgrade instruction, the present application can obtain a target firmware upgrade package according to the firmware version upgrade instruction, and then store the target firmware upgrade package in at least one fragmented memory, wherein the sum of the storage space of the at least one fragmented memory is greater than or equal to the storage space required for the target firmware upgrade package, so that the storage server can be upgraded according to the target firmware upgrade package stored in the fragmented memory. The present application fully utilizes the fragmented memory in the storage server by storing the target firmware upgrade package for upgrading in the fragmented memory, and at the same time realizes the upgrade of the firmware version according to the target firmware upgrade package in the fragmented memory, so as to improve the services provided by the storage server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a firmware upgrade method, device, and equipment. Background Art

[0002] The storage server can store recorded videos sent by multiple cameras, and multiple services can be set on the storage server. For example, a face detection function for performing face detection on a target object in the recorded video can be set on the storage server.

[0003] However, when a storage server stores recorded videos from multiple cameras, fragmented memory may exist between the addresses of the video files it stores. These fragmented memories are small, discontinuous, free memory blocks that cannot be used to store video files. If these fragmented memories are not fully utilized, storage resources will be wasted. Furthermore, when using the services provided by the storage server, the current storage server may not be fully functional, requiring an upgrade to the storage server's firmware to improve the services it provides. Summary of the Invention

[0004] The present application discloses a firmware upgrade method, apparatus and device to fully utilize the fragmented memory in a storage server for upgrade.

[0005] According to a first aspect of an embodiment of the present application, a firmware upgrade method is provided, which is applied to a storage server and includes:

[0006] When a firmware version upgrade instruction is received, a target firmware upgrade package is obtained according to the firmware version upgrade instruction, and the target firmware upgrade package is stored in at least one fragmented memory; the sum of the storage space of the at least one fragmented memory is greater than or equal to the storage space required for the target firmware upgrade package, and the storage space between different fragmented memories is discontinuous; the fragmented memory refers to the storage space between two adjacent used storage address blocks in the memory, or the fragmented memory refers to the storage space between the starting storage address or the ending storage address of any storage address block in the memory and the adjacent used storage address block;

[0007] The upgrade is performed according to the target firmware upgrade package.

[0008] Optionally, obtaining a target firmware upgrade package according to the firmware version upgrade instruction includes:

[0009] When it is determined according to the firmware version upgrade instruction that the currently running first firmware version is to be upgraded to the second firmware version, then the firmware package corresponding to the second firmware version is determined as the target firmware upgrade package;

[0010] When it is determined according to the firmware version upgrade instruction that a specified function in the currently running first firmware version is to be upgraded to a corresponding target function in the second firmware version, or when it is determined according to the firmware version upgrade instruction that a target function corresponding to the second firmware version is to be added to the currently running first firmware version, the firmware package corresponding to the target function in the second firmware version is determined to be the target firmware upgrade package.

[0011] Optionally, when it is determined according to the firmware version upgrade instruction that the currently running first firmware version is to be upgraded to the second firmware version, the method further includes: deleting the stored firmware package corresponding to the first firmware version.

[0012] Optionally, when it is determined according to the firmware version upgrade instruction that a specified function in the currently running first firmware version is to be upgraded to a 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, then when upgrading according to the target firmware upgrade package, the method further includes:

[0013] When it is detected that the upgrade according to the target firmware upgrade package fails, the system rolls back to the designated function according to the stored firmware package corresponding to the first firmware version.

[0014] Optionally, storing the target firmware upgrade package in at least one fragmented memory includes:

[0015] Selecting a fragmented memory from the memory;

[0016] When the fragmented memory is the first selected fragmented memory, checking whether the storage space of the first fragmented memory can accommodate the target firmware upgrade package based on the size of the target firmware upgrade package; if not, returning to the step of selecting a fragmented memory from the memory; if yes, storing the target firmware upgrade package in the selected first fragmented memory;

[0017] When the fragmented memory is not the first selected fragmented memory, check whether the sum of the storage space of the fragmented memory and all previously selected fragmented memories can accommodate the target firmware upgrade package based on the size of the target firmware upgrade package. If so, store the target firmware upgrade package in all the selected fragmented memories. If not, if the fragmented memory is not the last fragmented memory, return to the step of selecting a fragmented memory from the memory. If the fragmented memory is the last fragmented memory, store a portion of the target firmware upgrade package in all the selected fragmented memories, and the storage space required for the portion of the target firmware upgrade package is equal to the sum of the storage space of all the selected fragmented memories.

[0018] Optionally, after storing a portion of the target firmware upgrade package in the selected all-fragmented memory, the method further includes: storing another portion of the target firmware upgrade package in a non-fragmented memory.

[0019] Optionally, the target firmware upgrade package includes a firmware package of at least one function;

[0020] The method further includes: recording function storage information of each function in the target firmware upgrade package, so as to perform function management and control the upgrade according to the target firmware upgrade package based on the function storage information; the function storage information at least includes the correspondence between the function identifier of the function and the storage address information of the firmware package of the function.

[0021] Optionally, the method further comprises:

[0022] Obtaining function point files corresponding to each firmware version, wherein the function point files describe each function in the firmware version corresponding to the function point files through function points, wherein each firmware version includes at least a first firmware version currently running on the server and other firmware versions different from the first firmware version;

[0023] The function point files corresponding to different firmware versions are compared, and the function points that are different between the function point files corresponding to different firmware versions are determined as difference points, and the difference points are used to instruct to generate a firmware version upgrade instruction.

[0024] According to a second aspect of an embodiment of the present application, a firmware upgrade device is provided, which is applied to a storage server and includes:

[0025] A target firmware upgrade package storage unit is configured to, upon receiving a firmware version upgrade instruction, obtain a target firmware upgrade package according to the firmware version upgrade instruction, and store the target firmware upgrade package in at least one fragmented memory; the sum of the storage space of the at least one fragmented memory is greater than or equal to the storage space required for the target firmware upgrade package, and the storage space between different fragmented memories is discontinuous; the fragmented memory refers to the storage space between two adjacent used storage address blocks in the memory, or the fragmented memory refers to the storage space between the starting storage address or the ending storage address of any storage address block in the memory and an adjacent used storage address block;

[0026] An upgrading unit is used to perform upgrading according to the target firmware upgrade package.

[0027] According to a third aspect of an embodiment of the present application, there is provided an electronic device, the electronic device comprising: a processor and a memory;

[0028] The memory is used to store machine-executable instructions;

[0029] The processor is configured to read and execute the machine executable instructions stored in the memory to implement the firmware upgrade method described above.

[0030] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:

[0031] It can be seen from the above technical solution that the storage server in the solution provided by the present application can obtain the target firmware upgrade package according to the firmware version upgrade instruction when receiving the firmware version upgrade instruction, and then store the target firmware upgrade package in at least one fragmented memory, wherein the sum of the storage space of the at least one fragmented memory is greater than or equal to the storage space required for the target firmware upgrade package, so that the storage server can be upgraded according to the target firmware upgrade package stored in the fragmented memory. The present application fully utilizes the fragmented memory in the storage server by storing the target firmware upgrade package for upgrading in the fragmented memory, and at the same time realizes the upgrade of the firmware version according to the target firmware upgrade package existing in the fragmented memory, so as to improve the services provided by the storage server.

[0032] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.

[0034] Figure 1 This is a flowchart of a firmware upgrade method provided by an embodiment of the present application;

[0035] Figure 2 This is a flowchart of storing a target firmware upgrade package provided by an embodiment of the present application;

[0036] Figure 3 is a schematic diagram of a portion of storage space including fragmented space provided in an embodiment of the present application;

[0037] Figure 4 This is a schematic diagram of the differences between different firmware versions provided in the embodiments of the present application;

[0038] Figure 5 Schematic diagram of a firmware upgrade device provided in an embodiment of the present application;

[0039] Figure 6 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to 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.

[0041] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, 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.

[0042] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0043] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application, and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application are further described in detail below with reference to the accompanying drawings.

[0044] See also Figure 1 , Figure 1 A flowchart of a firmware upgrade method provided in an embodiment of the present application. As an embodiment, Figure 1 The process shown can be applied to a storage server. Optionally, the storage server can be used to store recorded videos uploaded by cameras, and a variety of services for detecting recorded videos can be set on the storage server, such as face detection, perimeter protection, etc.

[0045] like Figure 1 As shown, the process may include the following steps:

[0046] Step 101: When a firmware version upgrade instruction is received, a target firmware upgrade package is obtained according to the firmware version upgrade instruction, and the target firmware upgrade package is stored in at least one fragmented memory.

[0047] Step 102: Upgrade according to the target firmware upgrade package.

[0048] The following is a detailed description of the method embodiment shown in the process:

[0049] The embodiment of the present application is triggered when a firmware version upgrade instruction is received. In the embodiment of the present application, the firmware version upgrade instruction can be an automatic upgrade instruction sent by the upgrade server to the storage server after the storage server has enabled the automatic upgrade service. The automatic upgrade instruction is generated and sent to the storage device by the upgrade server when it detects a firmware package corresponding to a higher version of the firmware. The upgrade server is operated and maintained by the manufacturer, and the upgrade server is used to provide firmware packages corresponding to different firmware versions that can be installed by the storage server.

[0050] Alternatively, the firmware version upgrade instruction may also be an instruction input from the outside by the user. The firmware instruction may be generated based on the differences between different firmware versions pre-stored in the storage server. This will not be described here and will be discussed later. Figure 1 After the process shown, combine Figure 4 Describe in detail.

[0051] In an embodiment of the present application, in order to improve the efficiency of the upgrade, this embodiment can upgrade the entire currently running firmware version, such as upgrading the currently running first firmware version to the second firmware version, or it can upgrade one or more functions in the currently running firmware version, such as upgrading the currently running specified function belonging to the first firmware version upgrade to the target function of the second firmware version, or it can also add a new target function in the storage server to realize the upgrade of the currently running firmware.

[0052] As an embodiment, if the firmware version upgrade instruction determines that the currently running first firmware version is to be upgraded to the second firmware version, then in this embodiment, the firmware package corresponding to the second firmware version can be determined as the target firmware upgrade package. After the firmware package corresponding to the second firmware version is determined to be the target firmware upgrade package, a request for obtaining the firmware package corresponding to the second firmware version can be sent to the upgrade server to obtain the firmware package corresponding to the second firmware version returned by the upgrade server.

[0053] As another embodiment, if it is determined according to the firmware version upgrade instruction that a specified function in the currently running first firmware version is to be upgraded to a corresponding target function in the second firmware version, or when it is determined according to the firmware version upgrade instruction that a target function corresponding to the second firmware version is to be added to the currently running first firmware version, then this embodiment can determine that the firmware package corresponding to the target function in the second firmware version is the target firmware upgrade package.

[0054] After determining that the firmware package corresponding to the target function in the second firmware version is the target firmware upgrade package, a request for obtaining the firmware package corresponding to the target function in the second firmware version can be sent to the upgrade server to obtain the firmware package corresponding to the target function in the second firmware version returned by the upgrade server; or, if the upgrade server does not support sending the firmware package corresponding to a single function, a request for obtaining the firmware package corresponding to the second firmware version can be sent to the upgrade server. After receiving the firmware package corresponding to the second firmware version returned by the upgrade server, the firmware package corresponding to the target function can be found from the firmware package corresponding to the second firmware version based on the function identifier of the target function.

[0055] It should be noted that in this embodiment, the target firmware upgrade package includes at least a version number and a version resource. The version number refers to the version number of the firmware version to which the firmware upgrade package corresponds, and the version resource refers to the firmware program that needs to be written to memory during the upgrade. If the target firmware upgrade package corresponds to a target function, the target firmware upgrade package may also include a function identifier for the target function.

[0056] After finding the target firmware upgrade package through the above embodiment, this embodiment can determine the number of fragmented memories and the capacity of each fragmented memory in the current device by obtaining the memory usage of the current device, and then use the fragmented memory to save the target firmware upgrade package based on the number of fragmented memories and the capacity of each fragmented memory in the current device.

[0057] In an embodiment of the present application, the sum of the storage space of at least one fragmented memory used to store the target firmware upgrade package in step 101 should be greater than or equal to the storage space required for the target firmware upgrade package. Fragmented memory refers to the storage space between two adjacent used storage address blocks in the memory, or fragmented memory refers to the storage space between the starting storage address or ending 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 multiple storage address blocks, each of which has a starting storage address and an ending storage address.

[0058] For example, Figure 3 This is a schematic diagram of part of the storage space of this storage device, where the three gray storage spaces are three fragmented memories (including fragmented memory 1, fragmented memory 2, and fragmented memory 3), and the other white storage spaces are storage address blocks (where Figure 2 The middle part of the storage address blocks are used to store the recording events A1, A2, B1 and B2 respectively). Figure 3As shown, fragmented memory 2 is the storage space between the address block for storing the video event A2 and the address block adjacent to the address block for storing the video event B1, and fragmented memory 3 is the storage space between the end address of the unused storage address block and the adjacent address block for storing the video event B2.

[0059] In specific implementation, this can be achieved by Figure 2 The following steps are shown to store the target firmware upgrade package in at least one fragmented memory:

[0060] Step 1011: Select a fragmented memory from the memory.

[0061] Step 1012: When the fragmented memory is the first fragmented memory selected, check whether the storage space of the first fragmented memory can accommodate the target firmware upgrade package based on the size of the target firmware upgrade package. If not, return to the step of selecting a fragmented memory from the memory. If yes, store the target firmware upgrade package in the selected first fragmented memory.

[0062] As an embodiment, if it is detected that the first selected fragmented memory can accommodate the target firmware upgrade package, it means that there is no need to select the next fragmented memory, and the entire target firmware upgrade package can be stored in the first fragmented memory.

[0063] Step 1013: When the fragmented memory is not the first selected fragmented memory, check whether the sum of the storage space of the fragmented memory and all previously selected fragmented memories can accommodate the target firmware upgrade package based on the size of the target firmware upgrade package. If so, store the target firmware upgrade package in all the selected fragmented memories. If not, when the fragmented memory is not the last fragmented memory, return to the step of selecting a fragmented memory from the memory. When the fragmented memory is the last fragmented memory, store a part of the target firmware upgrade package in all the selected fragmented memories.

[0064] In an embodiment of the present application, a fragmented memory can be selected from the memory in descending order according to the storage space size of the fragmented memory, so that the amount of fragmented memory used by the target firmware upgrade package is minimized, so as to facilitate the management of the target firmware upgrade package.

[0065] Furthermore, if the sum of the storage space of all fragmented memories in this device cannot accommodate the target firmware upgrade package, after storing a part of the target firmware upgrade package in all the selected fragmented memories, the other part of the target firmware upgrade package can be stored in non-fragmented memory, for example, the other part of the target firmware upgrade package can be stored in a continuous address block in this storage server.

[0066] After the target firmware upgrade package is saved in the fragmented memory, the firmware package corresponding to the first firmware version can be processed in two different ways in this embodiment:

[0067] Optionally, when it is determined according to the firmware version upgrade instruction that the currently running first firmware version is to be upgraded to the second firmware version, since the entire system of the storage server is upgraded at this time, in order to avoid storage redundancy, the firmware package corresponding to the stored first firmware version can be deleted.

[0068] Optionally, when it is determined according to the firmware version upgrade instruction that a specified function in the currently running first firmware version is to be upgraded to a 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, then when the upgrade is performed according to the target firmware upgrade package, the firmware package corresponding to the specified function can continue to be saved. If it is detected that the upgrade fails according to the target firmware upgrade package, the firmware package corresponding to the specified function of the first firmware version that has been stored can be rolled back to the specified function.

[0069] In the embodiment of the present application, since the firmware package corresponding to the firmware version is composed of the firmware packages corresponding to each function 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 can be recorded simultaneously, so as to perform function management based on the function storage information and control the upgrade according to the target firmware upgrade package. The function storage information at least includes the correspondence between the function identifier of the function and the storage address information of the firmware package of the function.

[0070] Illustratively, in this embodiment, a memory management table for storing the above function storage information may be established. 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.

[0071] As an embodiment, when it is determined that the currently running first firmware version is to be upgraded to a second firmware version, and when 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 can be cleared, and the function storage information of each function in the second firmware version can be recorded in the memory management table.

[0072] After the firmware package corresponding to the second firmware version is saved to the memory, since the addresses of the functions called in the current program providing various services are still the storage addresses of the functions in the first firmware version, it is necessary to modify the addresses of the functions called in the program providing various services to the corresponding storage addresses of the functions in the second firmware version based on the function storage information of each function in the second firmware version, thereby achieving the switching of the functions called in the program providing various services and completing the upgrade from the first firmware version to the second firmware version.

[0073] As another embodiment, when it is determined according to the firmware version upgrade instruction that a specified function in the currently running first firmware version is to be upgraded to a corresponding target function in the second firmware version, or when it is determined according to the firmware version upgrade instruction that a target function corresponding to the second firmware version is to be 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, then the function storage information corresponding to the target function can be added after the function storage information of each function in the first firmware version recorded in the memory management table.

[0074] In this embodiment, after the firmware package corresponding to the target function is saved to the memory, if the target function is an upgrade of the specified function in the first firmware version, it is necessary to modify the storage address of the specified function called in the program providing services in this storage server to the storage address corresponding to the function in the function storage information, so as to complete the upgrade of the specified function in the first firmware version to the corresponding target function in the second firmware version; or, if the target function is a new function, it is necessary to create a new program that calls the target function based on the storage address corresponding to the target function in the function storage information, so that the service can be provided through the newly created program to complete the upgrade process.

[0075] So far, completed Figure 1 The process shown.

[0076] pass Figure 1 According to the process shown, when receiving a firmware version upgrade instruction, an embodiment of the present application can obtain a target firmware upgrade package according to the firmware version upgrade instruction, and then store the target firmware upgrade package in at least one fragmented memory, wherein the sum of the storage space of the at least one fragmented memory is greater than or equal to the storage space required for the target firmware upgrade package, so that the storage server can upgrade according to the target firmware upgrade package stored in the fragmented memory. The present application fully utilizes the fragmented memory in the storage server by storing the target firmware upgrade package for upgrading in the fragmented memory, and at the same time realizes the upgrade of the firmware version according to the target firmware upgrade package in the fragmented memory, so as to improve the services provided by the storage server.

[0077] The following will be combined Figure 4 Describes in detail how to instruct users to generate firmware version upgrade instructions.

[0078] First of all, it should be noted that in the relevant technology, when a firmware package corresponding to a firmware version is generated, a function point file corresponding to the firmware version will be generated at the same time. The function point file describes each function providing a service on the storage device with a function point. For each function point, the function point file records the algorithm version used by the function described by the function point in the firmware version and the various features of the function. The features here refer to the system environment supported by the function, the service capabilities of the function, and other features.

[0079] In addition, when upgrading the firmware version, not all functions in the firmware version will be changed, so that different firmware versions have both the same functions and different functions. Here, the same functions refer to functions that have the same service capabilities for the same service, and different functions refer to functions that have different service capabilities for the same service, or different functions can also refer to functions that provide new services.

[0080] For ease of description, in this embodiment, the different functions of providing the same service between different versions are described in terms of differences. The differences here may be caused by the optimization of a single algorithm in different versions. Since 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 package. 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 that can be achieved by different algorithms are generally different. Moreover, since the requirements of different algorithms for the system environment may be inconsistent, the system environment required for the operation of the functions providing the same service in different firmware versions may also be different. All of these will lead to differences in the functions providing the same service in different firmware versions. Therefore, the changes in a single algorithm in the firmware package corresponding to the function in different firmware versions can be used as the granularity to detect whether there is an addition, and / or replacement, and / or upgrade of the algorithm version in the firmware package corresponding to the function in different firmware versions. If so, it can be determined that there are differences between the functions providing the same service in different firmware versions.

[0081] For example, the face detection service function in version A uses algorithm version V1.0.0, which supports two simultaneous input and output channels. The face detection service function in version B implements this function through a new version of the algorithm (version V1.0.1), which improves the accuracy and efficiency of face detection and supports four simultaneous input and output channels. The differences between the face detection service functions in version A and version B include the algorithm version and the number of supported input and output channels.

[0082] See below Figure 4 , Figure 4 The function points in each firmware version are represented by the implementation boxes in the dotted box, and the function points are marked with different marks to represent the differences between different firmware versions. Figure 4 As shown, Figure 4 In the figure, the difference points between version A and version B are displayed by mark 1, where there are a total of 4 difference points between version A and version B; the difference points between version A and version C are displayed by mark 2, where there are a total of 3 difference points between version A and version C; the difference points between version B and version C are displayed by mark 3, where there are a total of 4 difference points between version B and version C.

[0083] As an embodiment, before executing this embodiment, this storage server can obtain the function point files corresponding to each firmware version (including at least version A, version B and version C) from the upgrade server used to provide the firmware package corresponding to the firmware version, and create a function point file corresponding to the firmware version currently running on this storage server.

[0084] In the embodiment of the present application, after obtaining each function point file corresponding to each firmware version, the storage server can determine the difference points between different firmware versions by comparing different function point files, and record the difference points in a pre-established configuration table. Further, the difference points between different firmware versions can be displayed through the interface according to the configuration table, so that the user can view the difference points (such as the difference points) presented on the interface. Figure 4 Enter the firmware upgrade command.

[0085] In specific implementation, for example, when the device is already running version A, but the specified function in version A cannot currently meet the user's needs, then when receiving the user input instruction to display the difference points between version A and at least one other firmware version different from version A, the difference points between version A and the other firmware versions can be found from the above configuration table (if there are multiple other firmware versions, the difference points between multiple other firmware versions can be further found from the above configuration table), and the difference points are displayed on the interface, so that the user can determine the target function that can meet the user's needs based on the difference points between version A and the other firmware versions, as well as the firmware version corresponding to the target function (assuming it is version B), and input a firmware version upgrade instruction to upgrade the currently running version A to version B, or input a firmware version upgrade instruction to upgrade the specified function of version A to the target function or add a new target function.

[0086] Furthermore, if a firmware upgrade command is input to upgrade the currently running version A to version B, after the currently running version A is upgraded to version B, this embodiment will update the function point file corresponding to the currently running firmware version in the storage server, and update the information of each function in version A recorded in the function point file to the information of each function in version B. During this upgrade process, the user can choose which firmware version to upgrade to based on the differences between different firmware versions, facilitating the upgrade to the firmware version required by the user.

[0087] If a firmware upgrade instruction is entered to upgrade a specified function of version A to a target function or to add a new target function, after the specified function of the currently running version A is upgraded to the target function of version B, this embodiment will update the function point file corresponding to the currently running firmware version in this storage server, and update the information of the specified function in the function point file to the information of the target function. Through this upgrade process, this embodiment only needs to upgrade the function points that differ between version A and version B to meet user needs, without having to upgrade all resources in version B, further improving the efficiency of firmware version upgrades.

[0088] The above describes the method provided by the embodiment of the present application. The following describes the firmware upgrade device provided by the embodiment of the present application:

[0089] See also Figure 5 , Figure 5 This is a schematic diagram of a firmware upgrade device provided in an embodiment of the present application, which is applied to a storage server. The device includes:

[0090] The target firmware upgrade package storage unit 501 is configured to, upon receiving a firmware version upgrade instruction, obtain a target firmware upgrade package according to the firmware version upgrade instruction, and store the target firmware upgrade package in at least one fragmented memory; the sum of the storage space of the at least one fragmented memory is greater than or equal to the storage space required for the target firmware upgrade package, and the storage space between different fragmented memories is discontinuous; the fragmented memory refers to the storage space between two adjacent used storage address blocks in the memory, or the fragmented memory refers to the storage space between the starting storage address or the ending storage address of any storage address block in the memory and an adjacent used storage address block;

[0091] The upgrading unit 502 is configured to perform upgrading according to the target firmware upgrade package.

[0092] Optionally, the target firmware upgrade package storage unit 501 obtains the target firmware upgrade package according to the firmware version upgrade instruction, including:

[0093] When it is determined according to the firmware version upgrade instruction that the currently running first firmware version is to be upgraded to the second firmware version, then the firmware package corresponding to the second firmware version is determined as the target firmware upgrade package;

[0094] When it is determined according to the firmware version upgrade instruction that a specified function in the currently running first firmware version is to be upgraded to a corresponding target function in the second firmware version, or when it is determined according to the firmware version upgrade instruction that a target function corresponding to the second firmware version is to be added to the currently running first firmware version, the firmware package corresponding to the target function in the second firmware version is determined to be the target firmware upgrade package.

[0095] Optionally, when it is determined according to the firmware version upgrade instruction that the currently running first firmware version is to be 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.

[0096] Optionally, when it is determined according to the firmware version upgrade instruction that a specified function in the currently running first firmware version is to be upgraded to a 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, then when the upgrading unit 502 performs the upgrade according to the target firmware upgrade package, the method further includes:

[0097] When it is detected that the upgrade according to the target firmware upgrade package fails, the system rolls back to the designated function according to the stored firmware package corresponding to the first firmware version.

[0098] Optionally, the target firmware upgrade package storage unit 501 stores the target firmware upgrade package in at least one fragmented memory, including:

[0099] Selecting a fragmented memory from the memory;

[0100] When the fragmented memory is the first selected fragmented memory, checking whether the storage space of the first fragmented memory can accommodate the target firmware upgrade package based on the size of the target firmware upgrade package; if not, returning to the step of selecting a fragmented memory from the memory; if yes, storing the target firmware upgrade package in the selected first fragmented memory;

[0101] When the fragmented memory is not the first selected fragmented memory, check whether the sum of the storage space of the fragmented memory and all previously selected fragmented memories can accommodate the target firmware upgrade package based on the size of the target firmware upgrade package. If so, store the target firmware upgrade package in all the selected fragmented memories. If not, if the fragmented memory is not the last fragmented memory, return to the step of selecting a fragmented memory from the memory. If the fragmented memory is the last fragmented memory, store a portion of the target firmware upgrade package in all the selected fragmented memories, and the storage space required for the portion of the target firmware upgrade package is equal to the sum of the storage space of all the selected fragmented memories.

[0102] After storing a portion of the target firmware upgrade package in all the selected fragmented memories, the target firmware upgrade package storing unit 501 is further configured to store another portion of the target firmware upgrade package in a non-fragmented memory.

[0103] Optionally, the target firmware upgrade package includes a firmware package of at least one function;

[0104] The device further includes: a function storage information unit for recording the function storage information of each function in the target firmware upgrade package, so as to perform function management and control the upgrade according to the target firmware upgrade package based on the function storage information; the function storage information at least includes the correspondence between the function identifier of the function and the storage address information of the firmware package of the function.

[0105] Optionally, the device further comprises:

[0106] a difference point determination unit, configured to obtain 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 function points, wherein each firmware version includes at least a first firmware version currently running on the server and other firmware versions different from the first firmware version;

[0107] The function point files corresponding to different firmware versions are compared, and the function points that are different between the function point files corresponding to different firmware versions are determined as difference points, and the difference points are used to instruct to generate a firmware version upgrade instruction.

[0108] Correspondingly, the embodiment of the present application also provides a hardware structure diagram of an electronic device, as shown in FIG. Figure 6 As shown, the electronic device may be a device implementing the above-mentioned firmware upgrade method. Figure 6 As shown, the hardware structure includes: a processor and a memory.

[0109] Wherein, the memory is used to store machine-executable instructions;

[0110] The processor is configured to read and execute the machine executable instructions stored in the memory to implement the corresponding firmware upgrade method embodiment shown above.

[0111] As an embodiment, the memory can be any electronic, magnetic, optical, or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, the memory can be a volatile memory, a non-volatile memory, or a similar storage medium. Specifically, the memory can be RAM (Random Access Memory), flash memory, a storage drive (such as a hard disk drive), a solid-state drive, any type of storage disk (such as a CD, DVD, etc.), or a similar storage medium, or a combination thereof.

[0112] So far, completed Figure 6 Description of the electronic device shown.

[0113] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A firmware upgrade method, characterized in that: The method is applied to a storage server and includes: When a firmware version upgrade instruction is received, a target firmware upgrade package is obtained according to the firmware version upgrade instruction, and the target firmware upgrade package is stored in at least one fragmented memory; the sum of the storage space of the at least one fragmented memory is greater than or equal to the storage space required for the target firmware upgrade package, and the storage space between different fragmented memories is discontinuous; the fragmented memory refers to the storage space between two adjacent used storage address blocks in the memory, or the fragmented memory refers to the storage space between the starting storage address or the ending storage address of any storage address block in the memory and the adjacent used storage address block; The upgrade is performed according to the target firmware upgrade package.

2. The method according to claim 1, characterized in that Obtaining a target firmware upgrade package according to the firmware version upgrade instruction includes: When it is determined according to the firmware version upgrade instruction that the currently running first firmware version is to be upgraded to the second firmware version, then the firmware package corresponding to the second firmware version is determined as the target firmware upgrade package; When it is determined according to the firmware version upgrade instruction that a specified function in the currently running first firmware version is to be upgraded to a corresponding target function in the second firmware version, or when it is determined according to the firmware version upgrade instruction that a target function corresponding to the second firmware version is to be added to the currently running first firmware version, the firmware package corresponding to the target function in the second firmware version is determined to be the target firmware upgrade package.

3. The method according to claim 2, characterized in that When it is determined according to the firmware version upgrade instruction that the currently running first firmware version is to be upgraded to the second firmware version, the method further includes: deleting the stored firmware package corresponding to the first firmware version.

4. The method according to claim 2, characterized in that When it is determined according to the firmware version upgrade instruction that a specified function in the currently running first firmware version is to be upgraded to a 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, then when performing the upgrade according to the target firmware upgrade package, the method further includes: When it is detected that the upgrade according to the target firmware upgrade package fails, the system rolls back to the designated function according to the stored firmware package corresponding to the first firmware version.

5. The method according to claim 1, wherein The storing the target firmware upgrade package in at least one fragmented memory includes: Selecting a fragmented memory from the memory; When the fragmented memory is the first selected fragmented memory, checking whether the storage space of the first fragmented memory can accommodate the target firmware upgrade package based on the size of the target firmware upgrade package; if not, returning to the step of selecting a fragmented memory from the memory; if yes, storing the target firmware upgrade package in the selected first fragmented memory; When the fragmented memory is not the first selected fragmented memory, check whether the sum of the storage space of the fragmented memory and all previously selected fragmented memories can accommodate the target firmware upgrade package based on the size of the target firmware upgrade package. If so, store the target firmware upgrade package in all the selected fragmented memories. If not, if the fragmented memory is not the last fragmented memory, return to the step of selecting a fragmented memory from the memory. If the fragmented memory is the last fragmented memory, store a portion of the target firmware upgrade package in all the selected fragmented memories, and the storage space required for the portion of the target firmware upgrade package is equal to the sum of the storage space of all the selected fragmented memories.

6. The method according to claim 5, characterized in that After storing a portion of the target firmware upgrade package in the selected all-fragmented memory, the method further includes: storing another portion of the target firmware upgrade package in a non-fragmented memory.

7. The method according to claim 1, characterized in that The target firmware upgrade package includes a firmware package of at least one function; The method further includes: recording function storage information of each function in the target firmware upgrade package, so as to perform function management and control the upgrade according to the target firmware upgrade package based on the function storage information; the function storage information at least includes the correspondence between the function identifier of the function and the storage address information of the firmware package of the function.

8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: Obtaining function point files corresponding to each firmware version, wherein the function point files describe each function in the firmware version corresponding to the function point files through function points, wherein each firmware version includes at least a first firmware version currently running on the server and other firmware versions different from the first firmware version; The function point files corresponding to different firmware versions are compared, and the function points that are different between the function point files corresponding to different firmware versions are determined as difference points, and the difference points are used to instruct to generate a firmware version upgrade instruction.

9. A firmware upgrade device, characterized in that: The device is applied to a storage server and includes: A target firmware upgrade package storage unit is configured to, upon receiving a firmware version upgrade instruction, obtain a target firmware upgrade package according to the firmware version upgrade instruction, and store the target firmware upgrade package in at least one fragmented memory; the sum of the storage space of the at least one fragmented memory is greater than or equal to the storage space required for the target firmware upgrade package, and the storage space between different fragmented memories is discontinuous; the fragmented memory refers to the storage space between two adjacent used storage address blocks in the memory, or the fragmented memory refers to the storage space between the starting storage address or the ending storage address of any storage address block in the memory and an adjacent used storage address block; An upgrading unit is used to perform upgrading according to the target firmware upgrade package.

10. An electronic device, characterized in that: The electronic device includes: a processor and a memory; The memory is used to store machine-executable instructions; The processor is configured to read and execute the machine-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Memory dynamic allocation method and device in firmware upgrading, computer device and storage medium

    CN110704084A