A software application upgrade method and system
By identifying and sorting the component dependencies between software applications, generating update and upgrade application packages, and using two update programs to upgrade, the problem of unstandardization and automation of the upgrade process in the existing technology is solved, and the upgrade efficiency and reliability are improved .
Patent Information
- Application Number
- CN202411139566.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2044-08-20
AI Technical Summary
The existing software application upgrade process lacks standardization and automation, the upgrade process is difficult to track, it is prone to conflicts and inefficient.
By identifying the component dependencies between the applications to be upgraded, prioritize, and using differential processing and chunked insertion processing to generate update and upgrade application packages, and using two update programs to upgrade applications.
Effectively manage the dependencies between multiple applications, improve deployment efficiency, avoid upgrade conflicts, reduce data transmission volume and time, and significantly improve upgrade efficiency.
Smart Images

Figure CN118672637B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of application upgrading, and specifically relates to a software application upgrading method and system. Background Art
[0002] The existing software application upgrade process mostly relies on the following solutions: 1. Developers write upgrade scripts for specific versions and execute them manually; 2. Use version control tools such as Git to manage upgrade scripts of different versions; 3. Use database migration tools for upgrades, such as Liquibase or Flyway, which provide certain automated migration functions. The above solutions have the disadvantages of lack of standardization, low degree of automation, difficult to track the upgrade process, easy to have conflicts during upgrades, and low upgrade efficiency. Summary of the invention
[0003] In order to solve the above technical problems, the present invention provides a software application upgrading method and system, which are used to solve the technical problems in the prior art.
[0004] On the one hand, the present invention provides the following technical solution, a method for upgrading a software application, comprising:
[0005] Obtaining a list of applications to be upgraded, wherein the list of applications to be upgraded includes a plurality of applications to be upgraded;
[0006] Identifying component dependencies between the applications to be upgraded, and prioritizing the applications to be upgraded based on the component dependencies to obtain a prioritized application list;
[0007] Obtaining an upgrade application package corresponding to the application to be upgraded, and performing differential processing and block insertion processing on the application to be upgraded in sequence based on the upgrade application package to obtain an updated upgrade application package;
[0008] Based on the update upgrade application package and using a two-stage update program, the applications to be upgraded in the sorted application list are upgraded to obtain upgraded applications.
[0009] Compared with the prior art, the beneficial effects of the present invention are as follows: the present application first obtains a list of applications to be upgraded, which includes several applications to be upgraded; then identifies the component dependencies between the applications to be upgraded, and prioritizes the applications to be upgraded based on the component dependencies to obtain a sorted application list; then obtains the upgrade application packages corresponding to the applications to be upgraded, and performs differential processing and block insertion processing on the applications to be upgraded based on the upgrade application packages to obtain updated upgrade application packages; finally, based on the updated upgrade application packages and using two-stage update programs, the applications to be upgraded in the sorted application list are upgraded to obtain upgraded applications. The present invention can effectively manage the dependencies between multiple applications according to the component dependencies, especially when the number of components is relatively large, which can greatly improve the deployment efficiency, and the present invention generates a simpler updated upgrade application package, which can avoid conflicts when upgrading applications on the one hand, and reduce the amount of data transmitted, save transmission time and application upgrade time on the other hand, and greatly improve the upgrade efficiency.
[0010] Preferably, the step of identifying component dependencies between the applications to be upgraded, and prioritizing the applications to be upgraded based on the component dependencies to obtain a prioritized application list includes:
[0011] Identify component dependency relationships between the applications to be upgraded, and based on the component dependency relationships, use a depth-first search algorithm to exhaustively enumerate component dependency links of each application to be upgraded;
[0012] Converting the component dependency link into a component relationship graph of the application to be upgraded, and filtering out obsolete components in the component relationship graph to obtain a filtered relationship graph;
[0013] The upgrade priorities of the applications to be upgraded are determined based on the component dependency relationships of the filter relationship graph, and a plurality of applications to be upgraded are sorted according to the upgrade priorities to obtain a sorted application list.
[0014] Preferably, the step of determining the upgrade priority of the to-be-upgraded applications based on the filtering relationship graph, and sorting a plurality of the to-be-upgraded applications according to the upgrade priority to obtain a sorted application list includes:
[0015] Retrieving in the filtering relationship graph whether the component of the application to be upgraded is the highest version component in the component library;
[0016] If the component of the application to be upgraded is not the highest version component in the component library, the component is upgraded to the highest version component in the corresponding component library, and the component name and version size of each component in the filtering relationship diagram are identified;
[0017] Based on the component name and version size, the low-version component is transferred to the high-version component and the dependency relationship of the low-version component is transferred to the high-version component, the low-version component is deleted and the filtering relationship graph is updated to obtain an updated relationship graph;
[0018] Based on the component dependency relationship between the components in the update relationship diagram, the component priority is determined for each component, and the corresponding application to be upgraded is assigned an upgrade priority according to the component priority corresponding to the component, and the plurality of applications to be upgraded are sorted according to the upgrade priority to obtain a sorted application list.
[0019] Preferably, the step of obtaining an upgraded application package corresponding to the application to be upgraded, and performing differential processing and block insertion processing on the application to be upgraded in sequence based on the upgraded application package to obtain an updated upgraded application package includes:
[0020] Suffix-sort each character of the application to be upgraded and the upgraded application package, and use binary search to perform indexing, so as to obtain a first character sequence array and a second character sequence array respectively;
[0021] Using a binary search method to identify difference strings and added strings between the first character sequence array and the second character sequence array;
[0022] Identifying identical character strings in the first character sequence array and the second character sequence array, and performing data segmentation based on the identical character strings to obtain a plurality of data blocks;
[0023] A new character sequence array is set, and the data block is amplified and converted into a directed graph to obtain a directed graph, and an updated application package is determined based on the directed graph.
[0024] Preferably, the step of identifying identical character strings in the first character sequence array and the second character sequence array, and performing data segmentation based on the identical character strings to obtain a plurality of data blocks comprises:
[0025] Identify identical character strings in the first character sequence array and the second character sequence array, and determine whether the bytes of the identical character strings are less than a preset number of bytes;
[0026] If the bytes of the same character string are not less than a preset number of bytes, the sequence positions of the same character string in the first character sequence array and the second character sequence array are respectively used as character corresponding intervals;
[0027] The first character sequence array is divided into a plurality of data blocks based on the character corresponding intervals.
[0028] Preferably, the step of setting a new character sequence array, performing amplification processing and directed graph conversion on the data block to obtain a directed graph, and determining to update the application package based on the directed graph comprises:
[0029] Setting a new character sequence array, adding the added character string to the new character sequence array according to the position of the character corresponding area, so as to obtain an added character sequence array;
[0030] Adding the difference character string to the data block to obtain an added data block, each of the added data blocks is set to correspond to each of the character corresponding areas;
[0031] Converting the added data blocks corresponding to each character corresponding area into a directed graph, identifying a closed loop directed graph in the directed graph, and separating the smallest added data blocks in the closed loop directed graph to obtain a separated directed graph;
[0032] A topological sorting method is used to sort the added data blocks in the separated directed graph to obtain a data block writing order, and the added data blocks are sequentially inserted into the corresponding character corresponding areas according to the data block writing order to obtain an updated application package.
[0033] Preferably, the step of performing application upgrade on the applications to be upgraded in the sorted application list based on the update upgrade application package and using a two-stage update program to obtain the upgraded applications includes:
[0034] Deploy the first-stage upgrade program on the user side and deploy the second-stage upgrade program on the cloud;
[0035] Downloading the second stage upgrade program to the buffer area of the user terminal through the first stage upgrade program and starting the second stage upgrade program;
[0036] Guided by the second-stage upgrade program, the update upgrade application package is downloaded to the built-in Flash of the user terminal, the application to be upgraded in the sorted application list is upgraded by the downloaded update upgrade application package, the parameters of the cache area are initialized, and the second-stage upgrade program is deleted from the cache area;
[0037] Scan all classes that implement the upgrade interface and load historical execution records, filter out all upgrade classes that failed to execute and did not perform the upgrade and store them back into the sorted application list;
[0038] Determine whether the sorted application list is empty. If the sorted application list is empty, the upgrade process is completed and the application upgrade result is returned; if the list of applications to be upgraded is not empty, set a distributed lock for the application to be upgraded being upgraded and perform application upgrades on the remaining applications to be upgraded in the sorted application list in turn, and output the application upgrade result.
[0039] In a second aspect, the present invention provides the following technical solution, a software application upgrade system, the system comprising:
[0040] An acquisition module, used to acquire a list of applications to be upgraded, wherein the list of applications to be upgraded includes a number of applications to be upgraded;
[0041] A sorting module, used for identifying component dependencies between the applications to be upgraded, and prioritizing the applications to be upgraded based on the component dependencies to obtain a sorted application list;
[0042] A differential module, used for obtaining an upgraded application package corresponding to the application to be upgraded, and performing differential processing and block insertion processing on the application to be upgraded in sequence based on the upgraded application package to obtain an updated upgraded application package;
[0043] The upgrade module is used to upgrade the applications to be upgraded in the sorted application list based on the update upgrade application package and using a two-stage update program to obtain upgraded applications.
[0044] In a third aspect, the present invention provides the following technical solution: a computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the software application upgrade method as described above when executing the computer program.
[0045] In a fourth aspect, the present invention provides the following technical solution: a storage medium having a computer program stored thereon, wherein the computer program implements the software application upgrade method as described above when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 A flowchart of a software application upgrade method provided in Embodiment 1 of the present invention;
[0048] Figure 2A structural block diagram of a software application upgrade system provided in Embodiment 2 of the present invention;
[0049] Figure 3 A schematic diagram of the hardware structure of a computer provided in another embodiment of the present invention.
[0050] The embodiments of the present invention will be further described below with reference to the accompanying drawings. DETAILED DESCRIPTION
[0051] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the embodiments of the present invention, and should not be construed as limiting the present invention.
[0052] Embodiment 1
[0053] In the first embodiment of the present invention, Figure 1 As shown, a software application upgrade method includes:
[0054] S1. Obtain a list of applications to be upgraded, where the list includes several applications to be upgraded.
[0055] Specifically, the list of applications to be upgraded includes a number of applications to be upgraded that need to be upgraded.
[0056] S2. Identify component dependencies between the applications to be upgraded, and prioritize the applications to be upgraded based on the component dependencies to obtain a prioritized application list.
[0057] Wherein, the step S2 comprises:
[0058] S21, identifying component dependency relationships between the applications to be upgraded, and exhaustively enumerating component dependency links of each application to be upgraded using a depth-first search algorithm based on the component dependency relationships;
[0059] Specifically, the component dependencies of the application to be upgraded can be retrieved by designing a background function for maintaining component dependencies, and the component dependencies can be specifically expressed as the upgrade of one or several components depending on another or several components.
[0060] S22, converting the component dependency link into a component relationship graph of the application to be upgraded, and filtering out discarded components in the component relationship graph to obtain a filtered relationship graph;
[0061] Specifically, the component relationship diagram here is an initial relationship diagram, and in the relationship diagram, the discarded components will affect the component dependency relationship between each required component in the relationship diagram, so they need to be filtered out.
[0062] S23, determining the upgrade priority of the to-be-upgraded applications based on the component dependency relationship of the filtering relationship graph, and sorting the to-be-upgraded applications according to the upgrade priority to obtain a sorted application list;
[0063] Wherein, the step S23 comprises:
[0064] S231. Searching in the filter relationship graph whether the component of the application to be upgraded is the highest version component in the component library.
[0065] S232: If the component of the application to be upgraded is not the highest version component in the component library, the component is upgraded to the highest version component in the corresponding component library, and the component name and version size of each component in the filtering relationship diagram are identified;
[0066] Specifically, during the query process, if a component that has not been deployed in the environment is found and the component is not the highest version component in the component library, the component is upgraded to the highest version, and if a circular dependency is identified in the query, the search process is directly interrupted.
[0067] S233, based on the component name and version size, transfer the low version component to the high version component and transfer the dependency of the low version component to the high version component, delete the low version component and update the filtering relationship diagram to obtain an updated relationship diagram.
[0068] S234, determining a component priority for each component based on the component dependency relationship between the components in the update relationship diagram, assigning an upgrade priority to a corresponding application to be upgraded according to the component priority corresponding to the component, and sorting the applications to be upgraded according to the upgrade priority to obtain a sorted application list;
[0069] Specifically, when determining the upgrade priority, if there is no component dependency among the components in the application to be upgraded, the upgrade priority of the application to be upgraded is set to the highest, and when assigning upgrade priority, if the component in application A depends on the component in application B, the upgrade priority of application B is greater than the upgrade priority of application A. After sorting, a sorted application list is generated, which is specifically a deployment list. The list is a double-layer array, and the 0th element is a component list with a priority of 1, and so on. The sorted application list includes information such as component name, component mirror address, and deployment description file yml.
[0070] S3. Obtain an upgraded application package corresponding to the application to be upgraded, and perform differential processing and block insertion processing on the application to be upgraded in sequence based on the upgraded application package to obtain an updated upgraded application package.
[0071] Specifically, step S3 includes:
[0072] S31, sorting the suffixes of each character of the application to be upgraded and the upgraded application package, and indexing them using binary search to obtain a first character sequence array and a second character sequence array respectively;
[0073] Specifically, the binary search method here is a Faster Suffix Sorting algorithm, the application to be upgraded corresponds to the first character sequence array, the upgraded application package corresponds to the second character sequence array, and the upgraded application package includes information data required for upgrading the application to be upgraded.
[0074] S32, using a binary search method to identify difference strings and added strings between the first character sequence array and the second character sequence array;
[0075] Specifically, the difference string represents the difference character data between the first character sequence array and the second character sequence array, and the added string represents the characters added to the second character sequence array compared with the first character sequence array. During the application upgrade process, the added string needs to be added to the corresponding application to be upgraded.
[0076] S33, identifying identical character strings in the first character sequence array and the second character sequence array, and performing data segmentation based on the identical character strings to obtain a plurality of data blocks;
[0077] Wherein, the step S33 comprises:
[0078] S331, identifying identical character strings in the first character sequence array and the second character sequence array, and determining whether the bytes of the identical character strings are less than a preset number of bytes;
[0079] Specifically, for the conventional upgrade process, the second character sequence array is upgraded from the first character sequence array, so there will be a character string in the second character sequence array that is the same as the first character sequence array, that is, the same character string, and the preset number of bytes here is 8 bytes. If the bytes of the same character string are less than the preset number of bytes, the same character string cannot be used as a basis for identifying the corresponding interval of characters, and it may belong to the difference character string and part of the characters in the added character string.
[0080] S332: If the bytes of the same character string are not less than a preset number of bytes, the sequence positions of the same character string in the first character sequence array and the second character sequence array are respectively used as character corresponding intervals;
[0081] Specifically, the character corresponding interval can be used as a basis for generating an update and upgrade application package using the first character sequence array and the second character sequence array.
[0082] S333, dividing the first character sequence array into a plurality of data blocks based on the character corresponding interval;
[0083] Specifically, after the character corresponding interval is determined, the characters in the corresponding area of the character corresponding interval can be used as the data block.
[0084] S34, setting a new character sequence array, performing amplification processing and directed graph conversion on the data block to obtain a directed graph, and determining an updated application package based on the directed graph;
[0085] Wherein, the step S34 comprises:
[0086] S341, setting a new character sequence array, adding the added character string to the new character sequence array according to the position of the character corresponding area, so as to obtain an added character sequence array;
[0087] Specifically, before determining to update the upgrade application package, it is necessary to create an empty new character sequence array, and then insert the added string into the new character sequence array according to its sequence position in the first character sequence array, and leave a certain area between two adjacent added strings in the inserted added character sequence data, which is used to insert the added data block, that is, the corresponding area of the added character in the character sequence array.
[0088] S342, adding the difference character string to the data block to obtain an added data block, each of the added data blocks being set corresponding to each of the character corresponding areas;
[0089] Specifically, the added data block needs to be inserted into the character area in the added character sequence array.
[0090] S343, converting the added data blocks corresponding to each character corresponding area into a directed graph, identifying the closed loop directed graph in the directed graph, and separating the smallest added data block in the closed loop directed graph to obtain a separated directed graph.
[0091] S344, sorting the added data blocks in the separated directed graph using a topological sorting method to obtain a data block writing order, and inserting the added data blocks into the corresponding character corresponding areas in sequence according to the data block writing order to obtain an updated application package;
[0092] Specifically, when inserting the additional data block, since the additional data block is longer than the original data block, when inserted into the corresponding character corresponding area, there may be data overlap between the additional data block and the adjacent data block, thus causing an upgrade conflict. Therefore, by determining the data block writing order, that is, inserting the additional data block into the character corresponding area in the additional character sequence array in sequence according to the obtained data block writing order, the updated upgrade application package can be obtained.
[0093] S4. Based on the update application package, a two-stage update program is used to perform application upgrade on the applications to be upgraded in the sorted application list to obtain upgraded applications.
[0094] Wherein, the step S4 comprises:
[0095] S41, deploying the first stage upgrade program on the user end and deploying the second stage upgrade program on the cloud;
[0096] Specifically, the first stage upgrade program and the second stage upgrade program here are both BootLoader programs.
[0097] S42, downloading the second stage upgrade program to the cache area of the user terminal through the guidance of the first stage upgrade program and starting the second stage upgrade program.
[0098] S43, guiding through the second-stage upgrade program and downloading the update upgrade application package to the built-in Flash of the user terminal, performing application upgrade on the applications to be upgraded in the sorted application list through the downloaded update upgrade application package, initializing the parameters of the cache area and deleting the second-stage upgrade program from the cache area.
[0099] Specifically, through the above steps, the Flash driver and the BootLoader program can be separated, which reduces the Flash memory occupancy rate, increases the design flexibility, and does not cause damage to the built-in Flash of the user end, thereby improving the reliability of the upgrade.
[0100] S44, scanning all classes that implement the upgrade interface and loading historical execution records, filtering out all upgrade classes that failed to execute and did not execute the upgrade and storing them back into the sorted application list.
[0101] S45, determining whether the sorted application list is empty. If the sorted application list is empty, the upgrade process is completed and the application upgrade result is returned; if the list of applications to be upgraded is not empty, a distributed lock is set for the application to be upgraded being upgraded, and the remaining applications to be upgraded in the sorted application list are cycled and upgraded in turn, and the application upgrade result is output;
[0102] Specifically, successfully executed applications to be upgraded will be removed from the sorted application list, while applications to be upgraded that have not been executed or have failed to execute will remain in the sorted application list, and the upgrade process will be repeated for applications to be upgraded that have failed to execute. If the execution still fails after a certain number of cycles, the failure result will be sent to the operation and maintenance personnel, and the upgrade status will be set to upgrade identification. The upgrade status of the application to be upgraded that is being executed is upgrading, and the upgrade status of the application to be upgraded that has been successfully executed is upgrade successful.
[0103] The software application upgrade method provided in the first embodiment of the present invention first obtains a list of applications to be upgraded, which includes several applications to be upgraded; then identifies the component dependencies between the applications to be upgraded, and prioritizes the applications to be upgraded based on the component dependencies to obtain a ranked application list; then obtains upgrade application packages corresponding to the applications to be upgraded, and performs differential processing and block insertion processing on the applications to be upgraded based on the upgrade application packages to obtain updated upgrade application packages; finally, based on the updated upgrade application packages and using two-stage update programs, the applications to be upgraded in the ranked application list are upgraded to obtain upgraded applications. The present invention can effectively manage the dependencies among multiple applications according to the component dependencies, especially when the number of components is relatively large, which can greatly improve the deployment efficiency, and the present invention generates a simpler updated upgrade application package, which can avoid conflicts when upgrading applications on the one hand, and reduce the amount of data transmission, save transmission time and application upgrade time on the other hand, and greatly improve the upgrade efficiency.
[0104] Embodiment 2
[0105] like Figure 2 As shown, in the second embodiment of the present invention, a software application upgrade system is provided, and the system includes:
[0106] An acquisition module 1 is used to acquire a list of applications to be upgraded, wherein the list of applications to be upgraded includes a number of applications to be upgraded;
[0107] A sorting module 2 is used to identify component dependencies between the applications to be upgraded, and prioritize the applications to be upgraded based on the component dependencies to obtain a sorted application list;
[0108] The differential module 3 is used to obtain the upgrade application package corresponding to the application to be upgraded, and perform differential processing and block insertion processing on the application to be upgraded in sequence based on the upgrade application package to obtain the updated upgrade application package;
[0109] The upgrading module 4 is used to upgrade the applications to be upgraded in the sorted application list based on the updated application package and using a two-stage updating program to obtain upgraded applications.
[0110] The sorting module 2 comprises:
[0111] A dependency submodule, used to identify component dependency relationships between the applications to be upgraded, and based on the component dependency relationships, exhaustively enumerate component dependency links of each application to be upgraded using a depth-first search algorithm;
[0112] A conversion submodule, used to convert the component dependency link into a component relationship graph of the application to be upgraded, and filter out discarded components in the component relationship graph to obtain a filtered relationship graph;
[0113] The priority submodule is used to determine the upgrade priority of the to-be-upgraded applications based on the component dependency relationship of the filtering relationship graph, and sort the to-be-upgraded applications according to the upgrade priority to obtain a sorted application list.
[0114] The priority submodule includes:
[0115] A retrieval unit, configured to retrieve in the filter relationship graph whether the component of the application to be upgraded is the highest version component in the component library;
[0116] A version upgrade unit, configured to upgrade the component of the application to be upgraded to the component of the highest version in the corresponding component library if the component is not the component of the highest version in the component library, and to identify the component name and version size of each component in the filtering relationship diagram;
[0117] A transfer unit, used to transfer the low-version component to the high-version component based on the component name and version size and transfer the dependency of the low-version component to the high-version component, delete the low-version component and update the filtering relationship diagram to obtain an updated relationship diagram;
[0118] An assigning unit is used to determine a component priority for each component based on the component dependency relationship between the components in the update relationship diagram, assign an upgrade priority to the corresponding application to be upgraded according to the component priority corresponding to the component, and sort the multiple applications to be upgraded according to the upgrade priority to obtain a sorted application list.
[0119] The differential module 3 includes:
[0120] An indexing submodule, used to sort the suffixes of each character of the application to be upgraded and the upgraded application package, and use binary search to perform indexing, so as to obtain a first character sequence array and a second character sequence array respectively;
[0121] A search submodule, used for identifying a difference string and an added string between the first character sequence array and the second character sequence array by using a binary search method;
[0122] a segmentation submodule, configured to identify identical character strings in the first character sequence array and the second character sequence array, and perform data segmentation based on the identical character strings to obtain a plurality of data blocks;
[0123] The amplicon module is used to set a new character sequence array, perform amplification processing and directed graph conversion on the data block to obtain a directed graph, and determine the update and upgrade application package based on the directed graph.
[0124] The segmentation submodule comprises:
[0125] a byte determination unit, configured to identify identical character strings in the first character sequence array and the second character sequence array, and determine whether the bytes of the identical character strings are less than a preset number of bytes;
[0126] A sequence unit, used for taking the sequence positions of the same character string in the first character sequence array and the second character sequence array as character corresponding intervals if the bytes of the same character string are not less than a preset number of bytes;
[0127] The segmentation unit is used to segment the first character sequence array into a plurality of data blocks based on the character corresponding intervals.
[0128] The amplicon module comprises:
[0129] A setting unit, used for setting a new character sequence array, adding the added character string to the new character sequence array according to the position of the character corresponding area, so as to obtain an added character sequence array;
[0130] An adding unit, used for adding the difference character string to the data block to obtain an added data block, each of the added data blocks is set corresponding to each of the character corresponding areas;
[0131] A directed graph unit, used for converting the added data block corresponding to each character corresponding area into a directed graph, identifying a closed loop directed graph in the directed graph, and separating the smallest added data block in the closed loop directed graph to obtain a separated directed graph;
[0132] The sequence unit is used to sort the added data blocks in the separated directed graph by a topological sorting method to obtain a data block writing order, and insert the added data blocks into the corresponding character corresponding areas in sequence according to the data block writing order to obtain an updated application package.
[0133] The upgrade module includes:
[0134] A deployment submodule, used to deploy the first stage upgrade program on the user end and the second stage upgrade program on the cloud;
[0135] A startup submodule, used to download the second stage upgrade program to the buffer area of the user terminal through the first stage upgrade program and start the second stage upgrade program;
[0136] A deletion submodule, used to guide through the second-stage upgrade program and download the update upgrade application package to the built-in Flash of the user terminal, perform application upgrade on the applications to be upgraded in the sorted application list through the downloaded update upgrade application package, initialize the parameters of the cache area and delete the second-stage upgrade program from the cache area;
[0137] A scanning submodule is used to scan all classes that implement the upgrade interface and load historical execution records, filter out all upgrade classes that have failed to execute and have not been upgraded, and store them back into the sorted application list;
[0138] The list judgment submodule is used to judge whether the sorted application list is empty. If the sorted application list is empty, the upgrade process is completed and the application upgrade result is returned; if the list of applications to be upgraded is not empty, a distributed lock is set for the application to be upgraded being upgraded and the remaining applications to be upgraded in the sorted application list are cycled in turn to perform application upgrades and output the application upgrade results.
[0139] In some other embodiments of the present invention, the embodiments of the present invention provide the following technical solution: a computer, comprising a memory 102, a processor 101, and a computer program stored in the memory 102 and executable on the processor 101, wherein the processor 101 implements the software application upgrade method as described above when executing the computer program.
[0140] Specifically, the processor 101 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.
[0141] Among them, the memory 102 may include a large-capacity memory for data or instructions. By way of example and not limitation, the memory 102 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), 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 102 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 102 may be inside or outside the data processing device. In a specific embodiment, the memory 102 is a non-volatile memory. In a specific embodiment, the memory 102 includes a read-only memory (ROM) and a random access memory (RAM). 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 alterable ROM (EAROM) or a flash memory (FLASH), or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0142] The memory 102 may be used to store or cache various data files that need to be processed and / or used for communication, as well as possible computer program instructions executed by the processor 101 .
[0143] The processor 101 implements the above-mentioned software application upgrade method by reading and executing the computer program instructions stored in the memory 102 .
[0144] In some embodiments, the computer may further include a communication interface 103 and a bus 100. Figure 3 As shown, the processor 101, the memory 102, and the communication interface 103 are connected via a bus 100 and communicate with each other.
[0145] The communication interface 103 is used to implement communication between the modules, devices, units and / or equipment in the embodiment of the present invention. The communication interface 103 can also implement data communication with other components such as: external devices, image / data acquisition equipment, databases, external storage, and image / data processing workstations.
[0146] The bus 100 includes hardware, software or both, and couples the components of the computer device to each other. The bus 100 includes but is not limited to at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a local bus. By way of example and not limitation, bus 100 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel 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 Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, bus 100 may include one or more buses. Although embodiments of the present invention describe and illustrate a particular bus, the present invention contemplates any suitable bus or interconnect.
[0147] The computer can execute the software application upgrading method of the present invention based on the acquired software application upgrading system, thereby realizing the software application upgrading.
[0148] In some further embodiments of the present invention, in combination with the above-mentioned software application upgrade method, the embodiments of the present invention provide the following technical solutions: a storage medium having a computer program stored thereon, and the computer program implements the above-mentioned software application upgrade method when executed by a processor.
[0149] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0150] More specific examples of readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0151] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0152] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0153] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A software application upgrade method, characterized in that: include: Obtaining a list of applications to be upgraded, wherein the list of applications to be upgraded includes a plurality of applications to be upgraded; Identifying component dependencies between the applications to be upgraded, and prioritizing the applications to be upgraded based on the component dependencies to obtain a prioritized application list; Obtaining an upgrade application package corresponding to the application to be upgraded, and performing differential processing and block insertion processing on the application to be upgraded in sequence based on the upgrade application package to obtain an updated upgrade application package; Based on the update and upgrade application package, a two-stage update program is used to perform application upgrade on the applications to be upgraded in the sorted application list to obtain upgraded applications; The step of identifying the component dependencies between the applications to be upgraded, and prioritizing the applications to be upgraded based on the component dependencies to obtain a prioritized application list includes: Identify component dependency relationships between the applications to be upgraded, and based on the component dependency relationships, use a depth-first search algorithm to exhaustively enumerate component dependency links of each application to be upgraded; Converting the component dependency link into a component relationship graph of the application to be upgraded, and filtering out obsolete components in the component relationship graph to obtain a filtered relationship graph; Determining the upgrade priority of the to-be-upgraded applications based on the component dependency relationship of the filtering relationship graph, and sorting the to-be-upgraded applications according to the upgrade priority to obtain a sorted application list; The step of determining the upgrade priority of the to-be-upgraded applications based on the filtering relationship graph, and sorting the to-be-upgraded applications according to the upgrade priority to obtain a sorted application list includes: Retrieving in the filtering relationship graph whether the component of the application to be upgraded is the highest version component in the component library; If the component of the application to be upgraded is not the highest version component in the component library, the component is upgraded to the highest version component in the corresponding component library, and the component name and version size of each component in the filtering relationship diagram are identified; Based on the component name and version size, the low-version component is transferred to the high-version component and the dependency relationship of the low-version component is transferred to the high-version component, the low-version component is deleted and the filtering relationship diagram is updated to obtain an updated relationship diagram; Based on the component dependency relationship between the components in the update relationship diagram, the component priority is determined for each component, and the corresponding application to be upgraded is assigned an upgrade priority according to the component priority corresponding to the component, and the plurality of applications to be upgraded are sorted according to the upgrade priority to obtain a sorted application list.
2. The software application upgrade method according to claim 1, characterized in that: The step of obtaining an upgraded application package corresponding to the application to be upgraded, and performing differential processing and block insertion processing on the application to be upgraded in sequence based on the upgraded application package to obtain an updated upgraded application package includes: Suffix-sort each character of the application to be upgraded and the upgraded application package, and use binary search to perform indexing, so as to obtain a first character sequence array and a second character sequence array respectively; Using a binary search method to identify difference strings and added strings between the first character sequence array and the second character sequence array; Identifying identical character strings in the first character sequence array and the second character sequence array, and performing data segmentation based on the identical character strings to obtain a plurality of data blocks; A new character sequence array is set, and the data block is amplified and converted into a directed graph to obtain a directed graph, and an updated application package is determined based on the directed graph.
3. The software application upgrade method according to claim 2, characterized in that: The step of identifying the same character string in the first character sequence array and the second character sequence array, and performing data segmentation based on the same character string to obtain a plurality of data blocks includes: Identify identical character strings in the first character sequence array and the second character sequence array, and determine whether the bytes of the identical character strings are less than a preset number of bytes; If the bytes of the same character string are not less than a preset number of bytes, the sequence positions of the same character string in the first character sequence array and the second character sequence array are respectively used as character corresponding intervals; The first character sequence array is divided into a plurality of data blocks based on the character corresponding intervals.
4. The software application upgrade method according to claim 3, characterized in that: The step of setting a new character sequence array, performing amplification processing and directed graph conversion on the data block to obtain a directed graph, and determining to update the application package based on the directed graph comprises: Setting a new character sequence array, adding the added character string to the new character sequence array according to the position of the character corresponding area, so as to obtain an added character sequence array; Adding the difference character string to the data block to obtain an added data block, each of the added data blocks is set to correspond to each of the character corresponding areas; Converting the added data blocks corresponding to each character corresponding area into a directed graph, identifying a closed loop directed graph in the directed graph, and separating the smallest added data blocks in the closed loop directed graph to obtain a separated directed graph; A topological sorting method is used to sort the added data blocks in the separated directed graph to obtain a data block writing order, and the added data blocks are sequentially inserted into the corresponding character corresponding areas according to the data block writing order to obtain an updated application package.
5. The software application upgrade method according to claim 1, characterized in that: The step of performing application upgrade on the applications to be upgraded in the sorted application list based on the update upgrade application package and using a two-stage update program to obtain upgraded applications comprises: Deploy the first-stage upgrade program on the user side and deploy the second-stage upgrade program on the cloud; Downloading the second stage upgrade program to the buffer area of the user terminal through the first stage upgrade program and starting the second stage upgrade program; Guided by the second-stage upgrade program, the update upgrade application package is downloaded to the built-in Flash of the user terminal, the application to be upgraded in the sorted application list is upgraded by the downloaded update upgrade application package, the parameters of the cache area are initialized, and the second-stage upgrade program is deleted from the cache area; Scan all classes that implement the upgrade interface and load historical execution records, filter out all upgrade classes that failed to execute and did not perform the upgrade and store them back into the sorted application list; Determine whether the sorted application list is empty. If the sorted application list is empty, the upgrade process is completed and the application upgrade result is returned; if the list of applications to be upgraded is not empty, set a distributed lock for the application to be upgraded being upgraded and perform application upgrades on the remaining applications to be upgraded in the sorted application list in turn, and output the application upgrade result.
6. A software application upgrade system, the system adopting the software application upgrade method according to claim 1, characterized in that: The system comprises: An acquisition module, used to acquire a list of applications to be upgraded, wherein the list of applications to be upgraded includes a number of applications to be upgraded; A sorting module, used for identifying component dependencies between the applications to be upgraded, and prioritizing the applications to be upgraded based on the component dependencies to obtain a sorted application list; A differential module, used for obtaining an upgraded application package corresponding to the application to be upgraded, and performing differential processing and block insertion processing on the application to be upgraded in sequence based on the upgraded application package to obtain an updated upgraded application package; The upgrade module is used to upgrade the applications to be upgraded in the sorted application list based on the update upgrade application package and using a two-stage update program to obtain upgraded applications.
7. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the software application upgrading method according to any one of claims 1 to 5 is implemented.
8. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the software application upgrade method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Upgrading method and device
CN110162322A
Block differential upgrading method, terminal equipment and computer readable storage medium
CN114356386A
Vehicle-mounted system component upgrading method and device, equipment and storage medium
CN115686568A
Differential upgrade file generation method, electronic equipment and storage medium
CN117193835A
Software system multi-application automatic deployment method based on recursion principle
CN117289951A
