Remote upgrade path searching method
By establishing a software upgrade package database on the server side and using directed graph construction technology, the problem of difficulty in quickly finding upgrade paths in the existing technology is solved, and efficient upgrade path search and client upgrade package download are achieved.
Patent Information
- Application Number
- CN202411565848.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-02-25
AI Technical Summary
It is difficult for the existing technology to quickly find the upgrade path matching the software upgrade request, resulting in inefficient client downloading upgrade packages.
By establishing and maintaining the software upgrade package database on the server side, using directed graph construction and upgrade path search technology, the upgrade path from the source version number to the target version number is found according to the client's upgrade request.
It shortens the server running time, reduces the client waiting time, and improves the efficiency and user experience of upgrading path search.
Smart Images

Figure CN119520270A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of software upgrade path search, and in particular relates to a remote upgrade path search method. Background Art
[0002] As technology continues to develop, software version upgrades have become an important task for major companies and ordinary users. Whether it is an operating system, application, framework, or library, software version upgrades are not only a key step to improve security and performance, but also a necessary step to ensure compatibility with new technologies and new devices.
[0003] Therefore, for a software, there are often multiple different software versions at the same time. When the client sends different software upgrade requests, how to quickly find the upgrade path that matches the software upgrade request so that the client can download different software upgrade packages according to the upgrade path is a key problem that needs to be solved at present. Summary of the invention
[0004] In view of the defects in the prior art, the present invention provides a method for searching a remote upgrade path, which can effectively solve the above problems.
[0005] The technical solution adopted by the present invention is as follows:
[0006] The present invention provides a method for searching a remote upgrade path, comprising the following steps:
[0007] Step S1, the server establishes and maintains a software upgrade package database; the software upgrade package database stores and updates in real time the software upgrade packages of all versions of the target software, and the file name of each version of the software upgrade package has a software version number; specifically, if the software upgrade package is a full package, its software version number is the upgraded software version number; if the software upgrade package is a differential package, its software version number is expressed as: the upgraded software version number V 新 - Software version number before upgrade V 旧 ;
[0008] Step S2: When the server receives an upgrade request for the target software from the client, the upgrade request carries the source version number V of the target software. s and the target version number V to be upgraded T , the server searches the software upgrade package database and establishes a directed graph associated with the upgrade request;
[0009] Step S3: the server generates a new version number V according to the source version number V. s and the target version number V T , search the directed graph and obtain the source version number V s To target version number VT Upgrade path
[0010] Step S4: the server returns the upgrade path to the client.
[0011] Preferably, in step S1, whenever a new software upgrade package appears in the target software, the new software upgrade package is added to the software upgrade package database;
[0012] Whenever an existing old software upgrade package of the target software is retired, the corresponding software upgrade package is deleted from the software upgrade package database.
[0013] Preferably, step S2 specifically comprises:
[0014] Step S2.1, the server traverses each software upgrade package in the software upgrade package database and selects the software upgrade package that meets the following conditions;
[0015] If it is a full package, filter out the software version number that is in the source version number V s and the target version number V T If it is a differential package, filter out the upgraded software version number V 新 Lower than or equal to the target version number V T At the same time, the software version number before the upgrade is V 旧 Higher than or equal to the source version number V s Software upgrade package for
[0016] Step S2.2, analyzing the software version number in the file name of the software upgrade package screened out in step S2.1, and establishing a directed graph:
[0017] Step S2.2.1, first establish a source version number V in the graph s The source node P s , and represents the target version number V T The target node P T ;
[0018] Step S2.2.2: for each software upgrade package screened out, parse the software version number from its file name and perform the following steps:
[0019] If the parsed software version number is a single software version number, it means that the software upgrade package is a full package. It is determined whether a node representing the software version number already exists in the directed graph. If not, the node representing the software version number is newly added to the directed graph, and an arrow pointing to itself is added to indicate that the type of the node is a full package node type.
[0020] If the parsed software version number is the upgraded software version number V新 - Software version number before upgrade V 旧 The differential form indicates that the software upgrade package is used to upgrade the software from V 旧 Upgrade to V 新 The difference packet is used to determine whether the software version number V after the upgrade already exists in the directed graph. 新 Node P 新 , and V represents the software version number before the upgrade 旧 Node P 旧 If not, then add a new version number V to the directed graph representing the upgraded software version. 新 Node P 新 , and V represents the software version number before the upgrade 旧 Node P 旧 , and add node P 新 Point to node P 旧 The path, and at node P 新 Add a path to node P in the path list 旧 Path;
[0021] Step S2.2.3: After each screened software upgrade package executes step S2.2.2, a directed graph associated with the upgrade request is constructed.
[0022] Preferably, step S3 specifically comprises:
[0023] Step S3.1, setting an initially empty upgrade path table;
[0024] Step S3.2: In the directed graph, first set the target version number V T The target node P T is the current search node C;
[0025] Step S3.3, record the current search node C into the upgrade path table;
[0026] Step S3.4, determine whether the software version number represented by the current search node C is the same as the source version number V to be upgraded on the client. s If they are the same, the upgrade path search process ends and step S3.7 is executed; if they are not the same, step S3.5 is executed;
[0027] Step S3.5, determine whether the current search node C is a full package node type. If so, the upgrade path search process ends and executes step S3.7; if not, execute step S3.6;
[0028] Step S3.6, perform the path search process for the current search node C, the method is:
[0029] Step S3.6.1, read the path list of the current search node C, and for each path in the path list, execute steps S3.6.2-S3.6.3:
[0030] Step S3.6.2, point the path to the node P 旧 , as a child node of the current search node C, is recorded in the upgrade path table;
[0031] Step S3.6.3, determine the node P to which the path points 旧 Represents the software version number V 旧 , whether it is the same as the source version number V of the client to be upgraded s If they are the same, the upgrade path search process ends and step S3.7 is executed; if they are not the same, the node P pointed to by the path is 旧 As the current search node C, return to execute step S3.5;
[0032] Step S3.7, in the upgrade path table, obtain the s To the target node P T Or, get the upgrade path from a full package node to the target node P T Upgrade path.
[0033] The remote upgrade path search method provided by the present invention has the following advantages:
[0034] The present invention provides a remote upgrade path search method, which has the following advantages:
[0035] The present invention shortens the server running time from two aspects of directed graph construction and upgrade path search, thereby reducing the client waiting time, efficiently and timely returns the found optimal upgrade path to the client, and improves the user experience of the client user. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A flowchart of a remote upgrade path search method provided by the present invention;
[0037] Figure 2 A schematic diagram of a directed graph established according to the present invention. DETAILED DESCRIPTION
[0038] In order to make the technical problems, technical solutions and beneficial effects solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0039] like Figure 1As shown, the present invention provides a method for searching a remote upgrade path, comprising the following steps:
[0040] Step S1, the server establishes and maintains a software upgrade package database; the software upgrade package database stores and updates in real time the software upgrade packages of all versions of the target software, and the file name of each version of the software upgrade package has a software version number; specifically, if the software upgrade package is a full package, its software version number is the upgraded software version number; if the software upgrade package is a differential package, its software version number is expressed as: the upgraded software version number V 新 - Software version number before upgrade V 旧 .
[0041] Specifically, the server maintains the software upgrade package database in the following manner to ensure that all currently valid software upgrade packages are stored in the software upgrade package database: whenever a new software upgrade package appears in the target software, the new software upgrade package is added to the software upgrade package database; whenever an existing old software upgrade package of the target software is cleared, the corresponding software upgrade package is deleted from the software upgrade package database.
[0042] In the present invention, the software upgrade package includes two types, namely full package and differential package; its specific meaning is: differential package: compare the target version complete package of the target software with the source version complete package, and generate a software upgrade package using the difference between the target version complete package and the source version complete package. Only when the version number of the target software on the target device is the source version number of the differential package, can this differential package be used to upgrade to the target version corresponding to this differential package. Full package: no differentiation is done, it is the target version complete package of the target software, and the target software on the target device can be directly upgraded to the version corresponding to this full package.
[0043] Step S2: When the server receives an upgrade request for the target software from the client, the upgrade request carries the source version number V of the target software. s and the target version number V to be upgraded T , the server searches the software upgrade package database and establishes a directed graph associated with the upgrade request;
[0044] Step S2 is specifically as follows:
[0045] Step S2.1, the server traverses each software upgrade package in the software upgrade package database and selects the software upgrade package that meets the following conditions;
[0046] If it is a full package, filter out the software version number that is in the source version number V s and the target version number V TIf it is a differential package, filter out the upgraded software version number V 新 Lower than or equal to the target version number V T At the same time, the software version number before the upgrade is V 旧 Higher than or equal to the source version number V s Software upgrade package for
[0047] Step S2.2, analyzing the software version number in the file name of the software upgrade package screened out in step S2.1, and establishing a directed graph:
[0048] Step S2.2.1, first establish a source version number V in the graph s The source node P s , and represents the target version number V T The target node P T ;
[0049] Step S2.2.2: for each software upgrade package screened out, parse the software version number from its file name and perform the following steps:
[0050] If the parsed software version number is a single software version number, it means that the software upgrade package is a full package. It is determined whether a node representing the software version number already exists in the directed graph. If not, the node representing the software version number is newly added to the directed graph, and an arrow pointing to itself is added to indicate that the type of the node is a full package node type.
[0051] If the parsed software version number is the upgraded software version number V 新 - Software version number before upgrade V 旧 The differential form indicates that the software upgrade package is used to upgrade the software from V 旧 Upgrade to V 新 The difference packet is used to determine whether the software version number V after the upgrade already exists in the directed graph. 新 Node P 新 , and V represents the software version number before the upgrade 旧 Node P 旧 If not, then add a new version number V to the directed graph representing the upgraded software version. 新 Node P 新 , and V represents the software version number before the upgrade 旧 Node P 旧 , and add node P 新 Point to node P 旧 The path, and at node P 新 Add a path to node P in the path list 旧 Path;
[0052] Step S2.2.3: After each screened software upgrade package executes step S2.2.2, a directed graph associated with the upgrade request is constructed.
[0053] As an example, Figure 2 As shown in FIG. 1 , a schematic diagram of a directed graph is established. Among them, node V0 represents the source version number V s The source node P s , node V5 represents the target version number V T The target node P T ; Node V3 is a full package node type, which means that there is a full package corresponding to the software version number represented by node V3 in the software upgrade package database; Node V1, Node V2, and Node V4 represent different software version numbers, and in the software upgrade package database there is a differential package V5-V2 from the software version number represented by node V2 to the software version number represented by node V5; similarly, there is a differential package V5-V4; there is a differential package V4-V3; there is a differential package V3-V0.
[0054] Step S3: the server generates a new version number V according to the source version number V. s and the target version number V T , search the directed graph and obtain the source version number V s To target version number V T Upgrade path
[0055] Step S3 is specifically as follows:
[0056] Step S3.1, setting an initially empty upgrade path table;
[0057] Step S3.2: In the directed graph, first set the target version number V T The target node P T is the current search node C;
[0058] Step S3.3, record the current search node C into the upgrade path table;
[0059] Step S3.4, determine whether the software version number represented by the current search node C is the same as the source version number V to be upgraded on the client. s If they are the same, the upgrade path search process ends and step S3.7 is executed; if they are not the same, step S3.5 is executed;
[0060] Step S3.5, determine whether the current search node C is a full package node type. If so, the upgrade path search process ends and executes step S3.7; if not, execute step S3.6;
[0061] Step S3.6, perform the path search process for the current search node C, the method is:
[0062] Step S3.6.1, read the path list of the current search node C, and for each path in the path list, execute steps S3.6.2-S3.6.3:
[0063] Step S3.6.2, point the path to the node P 旧 , as a child node of the current search node C, is recorded in the upgrade path table;
[0064] Step S3.6.3, determine the node P to which the path points 旧 Represents the software version number V 旧 , whether it is the same as the source version number V of the client to be upgraded s If they are the same, the upgrade path search process ends and step S3.7 is executed; if they are not the same, the node P pointed to by the path is 旧 As the current search node C, return to execute step S3.5;
[0065] Step S3.7, in the upgrade path table, obtain the s To the target node P T Or, get the upgrade path from a full package node to the target node P T Upgrade path.
[0066] Step S4: the server returns the upgrade path to the client.
[0067] The present invention provides a remote upgrade path search method, which has the following advantages:
[0068] (1) In the present invention, the software upgrade package database stores all currently valid software upgrade packages, including full packages and differential packages, and the number of software upgrade packages is relatively large. Therefore, in the present invention, for each specific upgrade request of the client to the target software, a directed graph corresponding to the specific upgrade request is established, rather than a directed graph for all software upgrade packages in the software upgrade package database, thereby simplifying the complexity of the directed graph construction process and shortening the directed graph construction time; further, when the directed graph corresponding to the specific upgrade request is used to search for the upgrade path, the upgrade path search time can be shortened and the upgrade path search efficiency can be improved.
[0069] Therefore, from the two aspects of directed graph construction and upgrade path search, the server running time is shortened, thereby reducing the client waiting time, and the optimal upgrade path found is returned to the client efficiently and timely, improving the client user experience.
[0070] (2) When constructing a directed graph, the present invention considers both the full package and the differential package. In particular, for the full package, an arrow pointing to itself is added as a path. Therefore, when searching for an upgrade path, a path that can be upgraded from the source version to the target version is searched starting from the target version number. When a full package is encountered during the search process, it means that the upgrade path search is successful and there is no need to continue searching, thereby improving the search efficiency.
[0071] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be considered as the scope of protection of the present invention.
Claims
1. A method for searching a remote upgrade path, characterized in that: The following steps are involved: Step S1, the server establishes and maintains a software upgrade package database; the software upgrade package database stores and updates in real time the software upgrade packages of all versions of the target software, and the file name of each version of the software upgrade package has a software version number; specifically, if the software upgrade package is a full package, its software version number is the upgraded software version number; if the software upgrade package is a differential package, its software version number is expressed as: the upgraded software version number V 新 - Software version number before upgrade V 旧 ; Step S2: When the server receives an upgrade request for the target software from the client, the upgrade request carries the source version number V of the target software. s and the target version number V to be upgraded T , the server searches the software upgrade package database and establishes a directed graph associated with the upgrade request; Step S3: the server generates a new version number V according to the source version number V. s and the target version number V T , search the directed graph and obtain the source version number V s To target version number V T Upgrade path Step S4: the server returns the upgrade path to the client.
2. A remote upgrade path search method according to claim 1, characterized in that: In step S1, whenever a new software upgrade package appears in the target software, the new software upgrade package is added to the software upgrade package database; Whenever an existing old software upgrade package of the target software is retired, the corresponding software upgrade package is deleted from the software upgrade package database.
3. A remote upgrade path search method according to claim 1, characterized in that: Step S2 is specifically as follows: Step S2.1, the server traverses each software upgrade package in the software upgrade package database and selects the software upgrade package that meets the following conditions; If it is a full package, filter out the software version number that is in the source version number V s and the target version number V T Software upgrade packages between; If it is a differential package, filter out the upgraded software version number V 新 Lower than or equal to the target version number V T At the same time, the software version number before the upgrade is V 旧 Higher than or equal to the source version number V s Software upgrade package for Step S2.2, analyzing the software version number in the file name of the software upgrade package screened out in step S2.1, and establishing a directed graph: Step S2.2.1, first establish a source version number V in the graph s The source node P s , and represents the target version number V T The target node P T ; Step S2.2.2: for each screened software upgrade package, parse the software version number from its file name and perform the following steps: If the parsed software version number is a single software version number, it means that the software upgrade package is a full package. It is determined whether a node representing the software version number already exists in the directed graph. If not, the node representing the software version number is newly added to the directed graph, and an arrow pointing to itself is added to indicate that the type of the node is a full package node type. If the parsed software version number is the upgraded software version number V 新 - Software version number before upgrade V 旧 The differential form indicates that the software upgrade package is used to upgrade the software from V 旧 Upgrade to V 新 The difference packet is used to determine whether the software version number V after the upgrade already exists in the directed graph. 新 Node P 新 , and V represents the software version number before the upgrade 旧 Node P 旧 If not, then add a new version number V to the directed graph representing the upgraded software version. 新 Node P 新 , and V represents the software version number before the upgrade 旧 Node P 旧 , and add node P 新 Point to node P 旧 The path, and at node P 新 Add a path to node P in the path list 旧 Path; Step S2.2.3: After each screened software upgrade package executes step S2.2.2, a directed graph associated with the upgrade request is constructed.
4. A remote upgrade path search method according to claim 3, characterized in that: Step S3 is specifically as follows: Step S3.1, setting an initially empty upgrade path table; Step S3.2: In the directed graph, first set the target version number V T The target node P T is the current search node C; Step S3.3, record the current search node C into the upgrade path table; Step S3.4, determine whether the software version number represented by the current search node C is the same as the source version number V to be upgraded on the client. s If they are the same, the upgrade path search process ends and step S3.7 is executed; if they are not the same, step S3.5 is executed; Step S3.5, determine whether the current search node C is a full package node type. If so, the upgrade path search process ends and executes step S3.7; if not, execute step S3.6; Step S3.6, perform the path search process for the current search node C, the method is: Step S3.6.1, read the path list of the current search node C, and for each path in the path list, execute steps S3.6.2-S3.6.3: Step S3.6.2, point the path to the node P 旧 , as a child node of the current search node C, is recorded in the upgrade path table; Step S3.6.3, determine the node P to which the path points 旧 Represents the software version number V 旧 , whether it is the same as the source version number V of the client to be upgraded s If they are the same, the upgrade path search process ends and step S3.7 is executed; if they are not the same, the node P pointed to by the path is 旧 As the current search node C, return to execute step S3.5; Step S3.7, in the upgrade path table, obtain the s To the target node P T Or, get the upgrade path from a full package node to the target node P T Upgrade path.
Citation Information
Cited By
Software upgrading method and related equipment thereof
CN119718387A