Software upgrading method and related equipment thereof

By using one-way directed graph and adjacency matrix method to store compatibility relationships in software version upgrades, and obtaining and selecting the optimal upgrade path, the problem of incompatibility between cross-versions of software version upgrades is solved, and a simplified upgrade process and efficient version updates are achieved.

CN119718387AInactive Publication Date: 2025-03-28MIKAS (ZHEJIANG) TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510230472.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-03-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively solve the problem of upgrade failure caused by cross-version incompatibility in software version upgrades. It usually requires users to manually uninstall the old version and install the new version, which is a cumbersome process.

Method used

By defining each software version as the nodes in the graph, setting up a one-way directed graph, using the adjacency matrix method to store compatibility relationships, obtain multiple software upgrade paths, and select the optimal path for upgrading.

Benefits of technology

It realizes cross-version compatibility solution during the software version upgrade process, simplifies the upgrade process, avoids the tedious steps of manual uninstallation and installation, and improves the efficiency of version updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718387A_ABST
    Figure CN119718387A_ABST
Patent Text Reader

Abstract

The invention provides a software upgrading method and related equipment, and the method comprises the steps: defining each software version as a node, and setting a one-way directed graph according to each node; utilizing an adjacent matrix method to store the compatibility relationship of each node in the unidirectional directed graph; acquiring first node information corresponding to the current software version and second node information corresponding to the specified software version; according to the first node information and the second node information, utilizing a one-way directed graph to obtain a plurality of software upgrading paths; and obtaining upgrading path information of each piece of software, and selecting an optimal upgrading path to upgrade the current software version. Compared with the prior art, the software upgrading method has the advantages that the optimal upgrading path is obtained by setting the one-way directed graph, and the problem that software versions are incompatible in the upgrading process is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software, and in particular to a software upgrading method and related equipment. Background Art

[0002] like Figure 1 As shown, when the enterprise releases the latest version, no matter what version the user's current client is, it can be directly upgraded or updated to the latest version.

[0003] This upgrade method is particularly common in mobile terminal apps. It is suitable for relatively lightweight application upgrades or patching scenarios, that is, applications where the update method is relatively simple. Usually, the enterprise will repackage the entire App and release it. Then the client will actively or passively sense the existence of the new version and download the upgrade package to the local computer. The upgrade is equivalent to uninstalling the old version (of course, user data needs to be retained) and then reinstalling the updated version. For patching operations, it is also a simple resource copy and paste or overwriting.

[0004] The characteristic of this upgrade method is that it does not consider the problem of inability to upgrade due to cross-version incompatibility, because the upgrade-related functions do not depend on the software itself, but directly utilize the installation and uninstallation mechanism of the host system, and the data structure and code or data space layout related to the software system are very stable.

[0005] In addition, some clients of medium and large applications will consider version upgrade compatibility issues, especially in the field of embedded products. The characteristics of this type of software system are: software upgrades are completely completed by the upgrade modules of the software system itself. If the functions of the upgrade modules themselves change during the version evolution process, then there will be version upgrade compatibility issues.

[0006] For example, Figure 2 As shown in the figure, the upgrade process of a product A in version V1.0 is to download the installation package, then decompress the binary data, and finally burn it to the host system disk to complete the installation. However, in version V3.0, as the requirements are iterated, the installation package encryption function is added. At this time, the upgrade process becomes decryption first, then decompression, and finally burning. In this case, the subsequent versions V4.0, V5.0, etc. are all installation packages released on this basis. If a user's client is still V1.0 at this time, it cannot be directly upgraded from V1.0 to V4.0 and later versions, because these versions are encrypted, and the upgrade module of V1.0 does not have the decryption function.

[0007] In this case, there is no good solution in the existing scheme. The general solution is to either ask the customer to manually uninstall the V1.0 version and then manually install the V4.0 version. Of course, most applications currently can directly install the manual V4.0 without uninstalling V1.0 first. Because it is a manual upgrade, it will use the system mechanism to automatically complete the complete process of uninstalling the old version and installing the new version. The whole process is very cumbersome. Therefore, how to solve the compatibility problems encountered in the software version upgrade is very important. Summary of the invention

[0008] In view of this, an embodiment of the present invention provides a software upgrade method and related devices, aiming to solve the technical problem of incompatibility encountered in software version upgrade.

[0009] In a first aspect, an embodiment of the present invention provides a software upgrade method, comprising: Define each software version as a node, and set up a unidirectional directed graph based on each node; Adjacency matrix method is used to store the compatibility relationship of each node in a unidirectional directed graph; Obtaining first node information corresponding to the current software version and second node information corresponding to the specified software version; Acquire multiple software upgrade paths using a unidirectional directed graph according to the first node information and the second node information; Obtain the upgrade path information for each software and select the optimal upgrade path to upgrade the current software version.

[0010] Preferably, the features of the unidirectional directed graph include: The software versions of any two adjacent nodes are compatible. as well as, Nodes with out-degree 0 correspond to the latest version of the software, and nodes with in-degree 0 correspond to the original version of the software.

[0011] Preferably, the step of storing the compatibility relationship of each node in the unidirectional directed graph using the adjacency matrix method includes: All nodes in the unidirectional directed graph are used as rows and columns of the matrix at the same time; 0 and 1 are used to represent the direct connection relationship between two nodes, where 0 indicates that it is not directly reachable and 1 indicates that it is directly reachable.

[0012] Preferably, the step of obtaining multiple software upgrade paths using a unidirectional directed graph according to the first node information and the second node information includes: Reverse upgrade from higher version software to lower version software is not allowed.

[0013] Preferably, the step of obtaining multiple software upgrade paths using a unidirectional directed graph according to the first node information and the second node information includes: All nodes between the first node and the second node are traversed, and multiple upgrade paths are generated according to the traversal results.

[0014] Preferably, the step of obtaining the upgrade path information of each software and selecting the optimal upgrade path to upgrade the current software version includes: Use insertion sort to get the shortest upgrade path; or, Use insertion sort to get the optimal upgrade path.

[0015] Preferably, the step of obtaining the upgrade path information of each software and selecting the optimal upgrade path to upgrade the current software version includes: According to each node in the upgrade path, download the software version corresponding to each node and update them to the current software version one by one; or, According to the version list provided by the upgrade path, download the corresponding software in the version list and install it at one time.

[0016] In a second aspect, an embodiment of the present invention further provides a software upgrade device, comprising: A directed graph setting module is used to define each software version as a node and set a unidirectional directed graph according to each node; An adjacency matrix setting module is used to store the compatibility relationship of each node in a unidirectional directed graph using an adjacency matrix method; A first acquisition module, used to acquire first node information corresponding to the current software version and second node information corresponding to the specified software version; A second acquisition module is used to acquire multiple software upgrade paths using a unidirectional directed graph according to the first node information and the second node information; The upgrade module is used to obtain the upgrade path information of each software and select the optimal upgrade path to upgrade the current software version.

[0017] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: at least one processor, at least one memory, and computer program instructions stored in the memory, and when the computer program instructions are executed by the processor, the above method is implemented.

[0018] In a fourth aspect, an embodiment of the present invention further provides a storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented.

[0019] In summary, the beneficial effects of the present invention are as follows: The software upgrade method and related devices provided by the embodiment of the present invention obtain the optimal upgrade path by setting a unidirectional directed graph, thereby solving the problem of incompatible software versions during the upgrade process. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the drawings required for use in the embodiment of the present invention will be briefly introduced below. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work, and these are all within the protection scope of the present invention.

[0021] Figure 1 It is a schematic diagram of software upgrade in the prior art.

[0022] Figure 2 This is a diagram showing a software upgrade failure.

[0023] Figure 3 FIG. 1 is a flow chart of a first embodiment of a software upgrading method.

[0024] Figure 4 It is a schematic diagram of a unidirectional directed graph according to an embodiment of the present invention.

[0025] Figure 5 Schematic diagram of the adjacency matrix method according to an embodiment of the present invention.

[0026] Figure 6 Schematic diagram of the algorithm of software upgrade path 1 according to an embodiment of the present invention.

[0027] Figure 7 Schematic diagram of the algorithm of software upgrade path 4 according to an embodiment of the present invention.

[0028] Figure 8 It is a structural diagram of a software upgrading device according to an embodiment of the present invention.

[0029] Fig. 9 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and Examples. It should be understood that the specific embodiments described herein are only configured to explain the present invention and are not configured to limit the present invention. For those skilled in the art, the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention.

[0031] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0032] Reference Figures 3 to 7 The present invention provides a software upgrade method, which comprises: S1: Define each software version as a node, and set up a unidirectional directed graph based on each node; S2: Use the adjacency matrix method to store the compatibility relationship of each node in the unidirectional directed graph; S3: Obtain first node information corresponding to the current software version and second node information corresponding to the specified software version; S4: Acquire multiple software upgrade paths using a unidirectional directed graph according to the first node information and the second node information; S5: Obtain the upgrade path information of each software, and select the optimal upgrade path to upgrade the current software version.

[0033] In the embodiment of the present invention, illustratively, there are 6 different software versions from V1.0 to V6.0 in the software version list. Each software version is defined as a node, and a unidirectional directed graph is set according to each node, such as Figure 4 As shown. In an embodiment of the present invention, a "graph" is a nonlinear data structure, which is composed of "nodes" and "edges" connecting the nodes, denoted as G=(V, E), where G represents the graph, node V is a finite non-empty set, and E is a finite set of relationships between any two nodes, and the relationship is realized through edges. If the edge between any two nodes in the graph is a directed edge (that is, an edge with a direction), then the graph is a directed graph. For directed graphs, there is also a concept of degree. Pointing from a node to another node is called out-degree, and conversely, pointing from other nodes to this node is called in-degree. For example, Figure 4As shown, the node in-degree of V1.0 is 0 and the out-degree is 1. The node in-degree of V6.0 is 2 and the out-degree is 0. The in-degree and out-degree of other intermediate nodes must be greater than or equal to 1. Among them, the node with out-degree 0 corresponds to the latest version of the software, and the node with in-degree 0 corresponds to the original version of the software. In a directed graph, the software versions corresponding to any two adjacent nodes are compatible, such as the software versions corresponding to V1.0 and V2.0 are compatible, and V2.0 is compatible with the software versions corresponding to V3.0, V4.0 and V5.0 respectively. Combined Figure 4 , the definition of unidirectional in a unidirectional directed graph means that the software version can only be upgraded in one direction. For example, version V1.0 can be directly upgraded to version V2.0, but cannot be directly upgraded to other versions. Version V2.0 can be directly upgraded to V3.0, V4.0, and V5.0, but cannot be directly upgraded to V6.0. Version V3.0 can be directly upgraded to V4.0, but cannot be directly upgraded to V5.0 and V6.0. Version V4.0 can be directly upgraded to V5.0 and V6.0. Version V5.0 can be directly upgraded to version V6.0; if version V1.0 wants to be upgraded to V3.0, it must first be upgraded to V2.0, and then upgraded from V2.0 to V3.0.

[0034] In the embodiment of the present invention, the adjacency matrix method is used to store the compatibility relationship of each node in the unidirectional directed graph. Specifically, all nodes in the unidirectional directed graph are used as rows and columns of the matrix to generate the following Figure 5 The matrix shown uses 0 and 1 to represent the direct connection relationship (i.e., compatible relationship) between two nodes, where 0 represents inaccessible (i.e., incompatible) and 1 represents accessible (i.e., compatible). Since this upgrade method does not support reverse upgrade, i.e., reverse upgrade from a higher version to a lower version, the lower half of the matrix is ​​hidden with a shadow. In combination with the characteristics of the present invention, according to the matrix diagram, it can be seen that the number of 1s in the vertical direction of the matrix represents the in-degree of the node of that version, such as the in-degrees of V2.0 and V3.0 are both 1, and the in-degree of V4.0 is 2 (i.e., two "1s"). The number of 1s in the horizontal direction of the matrix represents the out-degree of the node of that version, such as the out-degree of V1.0 is 1, and the out-degree of V2.0 is 3 (i.e., three "1s").

[0035] In an embodiment of the present invention, the first node information corresponding to the current software version and the second node information corresponding to the specified software version are obtained. Exemplarily, if the software version needs to be upgraded from V1.0 to V6.0, the node information corresponding to V1.0 and the node information corresponding to V6.0 are obtained. Based on the two, a unidirectional directed graph is used to obtain multiple software upgrade paths from V1.0 to V6.0. Specifically, all nodes between V1.0 and V6.0 are traversed to generate multiple upgrade paths. The upgrade path list is as follows: Path 1: V1.0 V2.0 V3.0 V4.0 V5.0 V6.0, path length is 5; Path 2: V1.0 V2.0 V3.0 V4.0 V6.0, path length is 4; Path 3: V1.0 V2.0 V4.0 V5.0 V6.0, path length is 4; Path 4: V1.0 V2.0 V4.0 V6.0, path length is 3; Path 5: V1.0 V2.0 V5.0 V6.0, the path length is 3.

[0036] In order to calculate the path between nodes, we make the following definition: the path from one node of the adjacency matrix to another node is a reachable path for lateral movement. The requirement for being movable is that the value of the target matrix point must be 1. The path length is the number of steps for lateral movement, and vertical movement is not counted in the number of steps.

[0037] According to the above definition, the algorithms of path 1 and path 4 are as follows: Figure 6 and 7 shown.

[0038] Therefore, we only need to traverse the paths between nodes, and then use the insertion sort method to easily find the shortest / optimal path. The purpose of the shortest upgrade path is to make version updates more efficient, especially when the version evolution history is long and the version relationship is complex. Finally, upgrade the current software version according to the optimal upgrade path.

[0039] Through the above method, the improvement of this solution has at least the following three beneficial effects: The software version evolution method that supports nonlinear relationships, that is, allows the software version to evolve in a free manner. Version iteration only needs to consider the smooth transition between adjacent versions, and does not need to consider the smooth transition across versions. For example: V1.0 can smoothly upgrade to V2.0, V2.0 can smoothly upgrade to V3.0, and V3.0SP01 can smoothly patch V3.0, but it is not required to support V1.0 to be directly upgraded to V3.0SP01. This can not only support more complex version requirement iteration processes, but also greatly reduce the difficulty of R&D and project management. Moreover, as long as it is artificially guaranteed, there is an unreliable risk.

[0040] Second, it supports the existence of branch versions, and as long as it is within the scope of a one-way directed graph, it can manage infinitely complex version branch relationships clearly. This requirement is difficult to ensure reliability if it is managed manually. Moreover, graphs can have subgraphs, and managing branch versions through subgraphs is clearer than using any other data structure.

[0041] Third, for those private network layout application software or software systems, because they cannot stay online normally and cannot connect to the software version management server in real time, they often miss the normal version upgrade rhythm. For example, the application manufacturer has released V3.0 and V4.0 on the server, but the user is still using V1.0. However, due to the existence of graphical management, it can be guaranteed that as long as the user is willing, he can access the network at any time to seek upgrades or updates, without worrying about how many versions he has missed in the middle, because there is always an optimal upgrade path to reach the latest version.

[0042] Reference Figure 8 The present invention provides a software upgrading device, comprising: A directed graph setting module 1 is used to define each software version as a node, and to set a unidirectional directed graph according to each node; The adjacency matrix setting module 2 is used to store the compatibility relationship of each node in the unidirectional directed graph using the adjacency matrix method; A first acquisition module, used to acquire first node information corresponding to the current software version and second node information corresponding to the specified software version; A second acquisition module, configured to acquire a plurality of software upgrade paths using the unidirectional directed graph according to the first node information and the second node information; The upgrade module is used to obtain the upgrade path information of each software and select the optimal upgrade path to upgrade the current software version.

[0043] In the embodiment of the present invention, illustratively, there are 6 different software versions from V1.0 to V6.0 in the software version list. Each software version is defined as a node, and a unidirectional directed graph is set according to each node, such as Figure 4 As shown. In an embodiment of the present invention, a "graph" is a nonlinear data structure, which consists of "nodes" and "edges" connecting the nodes, denoted as G=(V, E), where G represents the graph, node V is a finite non-empty set, E is a finite set of relationships between any two nodes, and the relationship is realized through edges. If the edge between any two nodes in the graph is a directed edge (that is, an edge with a direction), then the graph is a directed graph. For directed graphs, there is also a concept of degree. Pointing from a node to another node is called out-degree, and conversely, pointing from other nodes to this node is called in-degree. For example, Figure 4 As shown, the node in-degree of V1.0 is 0 and the out-degree is 1. The node in-degree of V6.0 is 2 and the out-degree is 0. The in-degree and out-degree of other intermediate nodes must be greater than or equal to 1. Among them, the node with out-degree 0 corresponds to the latest version of the software, and the node with in-degree 0 corresponds to the original version of the software. In a directed graph, the software versions corresponding to any two adjacent nodes are compatible, such as the software versions corresponding to V1.0 and V2.0 are compatible, and V2.0 is compatible with the software versions corresponding to V3.0, V4.0 and V5.0 respectively. Combined Figure 4 , the definition of unidirectional in a unidirectional directed graph means that the software version can only be upgraded in one direction. For example, version V1.0 can be directly upgraded to version V2.0, but cannot be directly upgraded to other versions. Version V2.0 can be directly upgraded to V3.0, V4.0, and V5.0, but cannot be directly upgraded to V6.0. Version V3.0 can be directly upgraded to V4.0, but cannot be directly upgraded to V5.0 and V6.0. Version V4.0 can be directly upgraded to V5.0 and V6.0. Version V5.0 can be directly upgraded to version V6.0; if version V1.0 wants to be upgraded to V3.0, it must first be upgraded to V2.0, and then upgraded from V2.0 to V3.0.

[0044] In the embodiment of the present invention, the adjacency matrix method is used to store the compatibility relationship of each node in the unidirectional directed graph. Specifically, all nodes in the unidirectional directed graph are used as rows and columns of the matrix to generate the following Figure 5 The matrix shown uses 0 and 1 to represent the direct connection relationship (i.e., compatible relationship) between two nodes, where 0 represents inaccessible (i.e., incompatible) and 1 represents accessible (i.e., compatible). Since this upgrade method does not support reverse upgrade, i.e., reverse upgrade from a higher version to a lower version, the lower half of the matrix is ​​hidden with a shadow. In combination with the characteristics of the present invention, according to the matrix diagram, it can be seen that the number of 1s in the vertical direction of the matrix represents the in-degree of the node of that version, such as the in-degrees of V2.0 and V3.0 are both 1, and the in-degree of V4.0 is 2 (i.e., two "1s"). The number of 1s in the horizontal direction of the matrix represents the out-degree of the node of that version, such as the out-degree of V1.0 is 1, and the out-degree of V2.0 is 3 (i.e., three "1s").

[0045] In an embodiment of the present invention, the first node information corresponding to the current software version and the second node information corresponding to the specified software version are obtained. Exemplarily, if the software version needs to be upgraded from V1.0 to V6.0, the node information corresponding to V1.0 and the node information corresponding to V6.0 are obtained. Based on the two, a unidirectional directed graph is used to obtain multiple software upgrade paths from V1.0 to V6.0. Specifically, all nodes between V1.0 and V6.0 are traversed to generate multiple upgrade paths. The upgrade path list is as follows: Path 1: V1.0 V2.0 V3.0 V4.0 V5.0 V6.0, path length is 5; Path 2: V1.0 V2.0 V3.0 V4.0 V6.0, path length is 4; Path 3: V1.0 V2.0 V4.0 V5.0 V6.0, path length is 4; Path 4: V1.0 V2.0 V4.0 V6.0, path length is 3; Path 5: V1.0 V2.0 V5.0 V6.0, the path length is 3.

[0046] In order to calculate the path between nodes, we make the following definition: the path from one node of the adjacency matrix to another node is a reachable path for lateral movement. The requirement for being movable is that the value of the target matrix point must be 1. The path length is the number of steps for lateral movement, and vertical movement is not counted in the number of steps.

[0047] According to the above definition, the algorithms of path 1 and path 4 are as follows: Figure 6 and 7 shown.

[0048] Therefore, we only need to traverse the paths between nodes, and then use the insertion sort method to easily find the shortest / optimal path. The purpose of the shortest upgrade path is to make version updates more efficient, especially when the version evolution history is long and the version relationship is complex. Finally, upgrade the current software version according to the optimal upgrade path.

[0049] Through the above method, the improvement of this solution has at least the following three beneficial effects: The software version evolution method that supports nonlinear relationships, that is, allows the software version to evolve in a free manner. Version iteration only needs to consider the smooth transition between adjacent versions, and does not need to consider the smooth transition across versions. For example: V1.0 can smoothly upgrade to V2.0, V2.0 can smoothly upgrade to V3.0, and V3.0SP01 can smoothly patch V3.0, but it is not required to support V1.0 to be directly upgraded to V3.0SP01. This can not only support more complex version requirement iteration processes, but also greatly reduce the difficulty of R&D and project management. Moreover, as long as it is artificially guaranteed, there is an unreliable risk.

[0050] Second, it supports the existence of branch versions, and as long as it is within the scope of a one-way directed graph, it can manage infinitely complex version branch relationships clearly. This requirement is difficult to ensure reliability if it is managed manually. Moreover, graphs can have subgraphs, and managing branch versions through subgraphs is clearer than using any other data structure.

[0051] Third, for those private network layout application software or software systems, because they cannot stay online normally and cannot connect to the software version management server in real time, they often miss the normal version upgrade rhythm. For example, the application manufacturer has released V3.0 and V4.0 on the server, but the user is still using V1.0. However, due to the existence of graphical management, it can be guaranteed that as long as the user is willing, he can access the network at any time to seek upgrades or updates, without worrying about how many versions he has missed in the middle, because there is always an optimal upgrade path to reach the latest version.

[0052] In addition, combined Fig. 9 The software upgrade method of the described embodiment of the present invention can be implemented by an electronic device. Fig. 9 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention is shown.

[0053] The electronic device may include a processor and a memory storing computer program instructions.

[0054] Specifically, the processor may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.

[0055] The memory may include a large capacity memory for data or instructions. By way of example and not limitation, the memory may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory may include a removable or non-removable (or fixed) medium. Where appropriate, the memory may be inside or outside the data processing device. In a particular embodiment, the memory is a non-volatile solid-state memory. In a particular embodiment, the memory includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.

[0056] The processor implements any one of the software upgrade methods in the above embodiments by reading and executing computer program instructions stored in the memory.

[0057] In one example, the electronic device may further include a communication interface and a bus. Fig. 9 As shown, the processor, memory, and communication interface are connected via a bus and communicate with each other.

[0058] The communication interface is mainly used to implement communication between the modules, devices, units and / or equipment in the embodiments of the present invention.

[0059] The bus includes hardware, software or both, and the components of the electronic device are coupled to each other. For example, but not limitation, the bus may include an accelerated graphics port (AGP) or other graphics bus, an enhanced industrial standard architecture (EISA) bus, a front-side bus (FSB), a hypertransport (HT) interconnection, an industrial standard architecture (ISA) bus, an infinite bandwidth interconnection, a low pin count (LPC) bus, a memory bus, a microchannel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standard association local (VLB) bus or other suitable buses or a combination of two or more of these. Where appropriate, the bus may include one or more buses. Although the embodiments of the present invention describe and illustrate a specific bus, the present invention contemplates any suitable bus or interconnection.

[0060] In addition, in combination with the software upgrade method in the above embodiment, the embodiment of the present invention can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the software upgrade methods in the above embodiment is implemented.

[0061] In summary, the embodiments of the present invention provide a software upgrade method and related devices.

[0062] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.

[0063] The functional blocks shown in the structural block diagram described above can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier. "Machine-readable medium" may include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0064] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.

[0065] The above is only a specific implementation of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system, module and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.

Claims

1. A software upgrade method, characterized in that: include: Each software version is defined as a node, and a unidirectional directed graph is set according to each of the nodes; Using an adjacency matrix method to store the compatibility relationship of each of the nodes in the unidirectional directed graph; Obtaining first node information corresponding to the current software version and second node information corresponding to the specified software version; Acquire multiple software upgrade paths using the unidirectional directed graph according to the first node information and the second node information; Obtain the upgrade path information of each software, and select the optimal upgrade path to upgrade the current software version.

2. The software upgrade method according to claim 1, characterized in that: The characteristics of the unidirectional directed graph include: The software versions of any two adjacent nodes are compatible. as well as, The node with an out-degree of 0 corresponds to the latest version of the software, and the node with an in-degree of 0 corresponds to the original version of the software.

3. The software upgrade method according to claim 1 or 2, characterized in that: The step of storing the compatibility relationship of each node in the unidirectional directed graph by using the adjacency matrix method includes: All the nodes in the unidirectional directed graph are used as rows and columns of a matrix at the same time; 0 and 1 are used to represent the direct connection relationship between the two nodes, wherein 0 indicates that the nodes are not directly accessible, and 1 indicates that the nodes are directly accessible.

4. The software upgrade method according to claim 3, characterized in that: The step of acquiring multiple software upgrade paths using the unidirectional directed graph according to the first node information and the second node information includes: Reverse upgrade from higher version software to lower version software is not allowed.

5. The software upgrade method according to claim 4, characterized in that: The step of acquiring multiple software upgrade paths using the unidirectional directed graph according to the first node information and the second node information includes: All the nodes between the first node and the second node are traversed, and multiple upgrade paths are generated according to the traversal results.

6. The software upgrade method according to claim 5, characterized in that: The step of obtaining the upgrade path information of each software and selecting the optimal upgrade path to upgrade the current software version includes: Use insertion sort to get the shortest upgrade path; or, The insertion sort method is used to obtain the optimal upgrade path.

7. The software upgrade method according to claim 6, characterized in that: The step of obtaining the upgrade path information of each software and selecting the optimal upgrade path to upgrade the current software version includes: According to each of the nodes in the upgrade path, download the software version corresponding to each of the nodes, and update them to the current software version one by one; or, According to the version list provided by the upgrade path, the corresponding software in the version list is downloaded and installed at one time.

8. A software upgrade device, characterized in that: include: A directed graph setting module, used to define each software version as a node, and to set a unidirectional directed graph according to each of the nodes; An adjacency matrix setting module, used for storing the compatibility relationship of each of the nodes in the unidirectional directed graph using an adjacency matrix method; A first acquisition module, used to acquire first node information corresponding to the current software version and second node information corresponding to the specified software version; A second acquisition module, configured to acquire a plurality of software upgrade paths using the unidirectional directed graph according to the first node information and the second node information; The upgrade module is used to obtain the upgrade path information of each software and select the optimal upgrade path to upgrade the current software version.

9. An electronic device, characterized in that: include: At least one processor, at least one memory and computer program instructions stored in the memory, which implement the method according to any one of claims 1 to 7 when the computer program instructions are executed by the processor.

10. A storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • System upgrading method and device, storage medium and electronic equipment

    CN115827028A

  • File reconstruction method and system based on directed graph and medium

    CN117971259A

  • Data migration and upgrading method based on multi-node parallelism

    CN119396558A

  • Remote upgrade path searching method

    CN119520270A

  • Systems and methods for incrementally updating an image in flash memory

    US20020034105A1