Offline upgrading method and device based on research and judgment system and electronic equipment
By uploading and decompressing the upgrade package at the target terminal of the analysis system, generating incremental upgrade packages for system upgrade, and merging database scripts for database upgrade, the problem of low offline upgrade efficiency and high abnormal rate of target terminal is solved, and an efficient and reliable upgrade process is achieved.
Patent Information
- Application Number
- CN202510072217.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-12-27
- Filing Date
- 2025-01-17
- Publication Date
- 2025-05-06
AI Technical Summary
When the target terminal of the system is not connected to the network, how to efficiently complete the offline upgrade of the system and database to reduce the abnormality rate.
Upload the upgrade package through the target page, including system code and database scripts, decompress and generate incremental upgrade packages for system upgrade, and merge database scripts for database upgrade.
It improves the efficiency of system and database upgrades, reduces the abnormality rate, and ensures smooth upgrades without connecting to the network.
Smart Images

Figure CN119938103A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of analysis and judgment systems, and in particular relates to an offline upgrade method, device and electronic equipment based on the analysis and judgment system. Background Art
[0002] The research and judgment system is a system used for research and judgment, mainly used for in-depth analysis and decision support of certain matters. Specifically, the research and judgment system can be applied to multiple fields, for example, it can be applied to various case trials, public security information research and judgment, network security research and judgment, etc.
[0003] Since the process of using the analysis and judgment system to conduct in-depth analysis and decision-making support on certain matters usually requires confidentiality, convenience, and speed, the target terminal installed with the analysis and judgment system needs to be disconnected from the network and facilitate data import and analysis.
[0004] Furthermore, the users of the target terminal are usually case handlers rather than professional computer personnel. Therefore, when the target terminal is not connected to the network, how to efficiently complete the offline upgrade of the target terminal is an urgent problem to be solved. Summary of the invention
[0005] The purpose of the present invention is to efficiently complete the offline upgrade of a target terminal and reduce the abnormality rate of the offline upgrade process.
[0006] In a first aspect, an embodiment of the present invention provides an offline upgrade method based on a research and judgment system, which is applied to a target terminal, the target terminal is installed with a research and judgment system, and the target terminal is not connected to a network, and the method includes:
[0007] Acquire an upgrade package uploaded by a target user through a target page, wherein the target page is a page in the target terminal for uploading the upgrade package, and the upgrade package includes: a system code for upgrading the system and a script for upgrading the database;
[0008] The upgrade package is stored according to the storage path corresponding to the upgrade package, and the upgrade package is decompressed to obtain the decompressed upgrade package;
[0009] Determine a first system code corresponding to the first system version number, and determine a second system code corresponding to the second system version number in the decompressed upgrade package, wherein the first system version number is the version number of the current version of the system, and the second system version number is the version number of the version to be upgraded;
[0010] Determine a target system code between the first system code and the second system code, generate an incremental upgrade package based on the target system code, and upgrade the system through the incremental upgrade package, wherein the target system code is a different system code between the first system code and the second system code;
[0011] Determine a first database script corresponding to a first database version number, and determine a second database script corresponding to a second database version number and a third database script corresponding to a third database version number in the decompressed upgrade package, wherein the first database version number is the version number of the current version of the database, the third database version number is the version number of the version of the database to be upgraded, and the second database version number is a database version number between the first database version number and the third database version number;
[0012] The first database script, the second database script and the third database script are merged in the order of database version numbers from low to high to obtain an upgrade file, and the database is upgraded through the upgrade file.
[0013] Optionally, the browser interface of the target terminal is provided with a first virtual button for downloading log data and operation and maintenance data, and the method further comprises:
[0014] When receiving a browser login operation, displaying the browser interface;
[0015] receiving a trigger operation on the first virtual button, and downloading log data and operation and maintenance data through a target command;
[0016] Saving the log data and the operation and maintenance data into a target file;
[0017] The target file is compressed and encrypted to obtain a compressed and encrypted target file.
[0018] Optionally, the browser interface of the target terminal is provided with a second virtual button for deleting log data and operation and maintenance data, and the method further comprises:
[0019] Before receiving the trigger operation on the first virtual key and downloading the log data and the operation and maintenance data through the target command, receiving the trigger operation on the second virtual key;
[0020] Delete the existing files used to store log data and operation and maintenance data.
[0021] Optionally, the method further includes:
[0022] After the system is upgraded through the incremental upgrade package and the database is upgraded through the merged script, the service startup script is executed;
[0023] Monitor the startup status of each service. The startup status of a service includes startup success and startup failure.
[0024] If a target service that fails to start is detected, restart the target service.
[0025] Optionally, services include microservices and monolithic services;
[0026] The monitoring of the startup of each service includes:
[0027] If the service is a microservice, the service discovery mechanism is called periodically to pull the interface of the microservice, and when the interface of the microservice is pulled, it is determined that the microservice is started successfully;
[0028] If the service is a single service, a preset command is used to query whether the process of the single service exists, and when it is found that the process of the single service exists, it is determined that the single service is started successfully.
[0029] Optionally, the method further includes:
[0030] The total number of microservices that need to be started is counted as the first number, and the total number of single services that need to be started is counted as the second number;
[0031] Count the number of started microservices as the first startup number, and count the total number of started single services as the second startup number;
[0032] Calculating a total startup quantity of the service based on the first startup quantity and the second startup quantity, and calculating a total quantity of the service based on the first quantity and the second quantity;
[0033] Based on the total startup quantity and the total quantity, a service startup rate is calculated, and the service startup rate is displayed in a browser interface.
[0034] In a second aspect, an embodiment of the present invention provides an offline upgrade device based on a research and judgment system, which is applied to a target terminal, the target terminal is installed with a research and judgment system, and the target terminal is not connected to a network, and the device includes:
[0035] An upgrade package acquisition module, used to acquire an upgrade package uploaded by a target user through a target page, wherein the target page is a page in the target terminal for uploading the upgrade package, and the upgrade package includes: a system code for upgrading the system and a script for upgrading the database;
[0036] An upgrade package decompression module, used to store the upgrade package according to the storage path corresponding to the upgrade package, and decompress the upgrade package to obtain the decompressed upgrade package;
[0037] a system code determination module, configured to determine a first system code corresponding to a first system version number, and to determine a second system code corresponding to a second system version number in the decompressed upgrade package, wherein the first system version number is the version number of a current system version, and the second system version number is the version number of a system version to be upgraded;
[0038] a system upgrade module, configured to determine a target system code between the first system code and the second system code, generate an incremental upgrade package based on the target system code, and upgrade the system through the incremental upgrade package, wherein the target system code is a different system code between the first system code and the second system code;
[0039] a database script determination module, configured to determine a first database script corresponding to a first database version number, and determine a second database script corresponding to a second database version number and a third database script corresponding to a third database version number in the decompressed upgrade package, wherein the first database version number is the version number of the current version of the database, the third database version number is the version number of the version of the database to be upgraded, and the second database version number is a database version number between the first database version number and the third database version number;
[0040] The database upgrade module is used to merge the first database script, the second database script and the third database script in the order of database version numbers from low to high to obtain an upgrade file, and upgrade the database through the upgrade file.
[0041] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0042] at least one processor;
[0043] a memory for storing the at least one processor-executable instruction;
[0044] The at least one processor is configured to execute the instructions to implement the method described in the first aspect.
[0045] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in the first aspect.
[0046] In a fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0047] The technical solution provided by the embodiment of the present invention is that the target terminal installed with the analysis and judgment system is not connected to the network. When the system and database of the target terminal are upgraded offline, the target user can upload an upgrade package through the target page, and the upgrade package includes a system code for upgrading the system and a script for upgrading the database. When upgrading the system, the system code corresponding to the current version number of the system is compared with the system code corresponding to the version number of the system to be upgraded to form an incremental upgrade package. The system upgrade can be completed through an incremental upgrade package, which improves the efficiency of the system upgrade and reduces the abnormality rate of the system upgrade process. In addition, when upgrading the database, in the order of the version numbers from high to low, the script corresponding to the current version number of the database, the script corresponding to the version number between the current version number and the version number to be upgraded, and the script corresponding to the version of the database to be upgraded are appended to the upgrade file. The database upgrade can be completed through an upgrade file, which improves the efficiency of the database upgrade and reduces the abnormality rate of the database upgrade process. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A flowchart of an offline upgrade method based on a judgment system provided by an embodiment of the present invention;
[0049] Figure 2 A flowchart of another offline upgrade method based on the analysis and judgment system provided by an embodiment of the present invention;
[0050] Figure 3 A schematic diagram of the structure of an offline upgrade device based on a judgment system provided by an embodiment of the present invention;
[0051] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The present invention will be described in detail below through examples.
[0053] The research and judgment system is a system used for research and judgment, mainly used for in-depth analysis and decision support of certain matters. Specifically, the research and judgment system can be applied to multiple fields, for example, it can be applied to various case trials, public security information research and judgment, network security research and judgment, etc.
[0054] Since the process of using the analysis and judgment system to conduct in-depth analysis and decision-making support on certain matters usually requires confidentiality, convenience, and speed, the target terminal installed with the analysis and judgment system needs to be disconnected from the network and facilitate data import and analysis.
[0055] In addition, the target terminal is continuously iterated and upgraded, and the users of the target terminal are usually case handlers, not professional computer personnel. Therefore, when the target terminal is not connected to the network, how to efficiently complete the offline upgrade of the target terminal is an urgent problem to be solved. Moreover, if an abnormality occurs during the use of the target terminal, how to allow the case handler to quickly extract the operating data of the target terminal and transmit the extracted operating data back to the professional computer personnel for analysis is also an urgent problem to be solved.
[0056] For the offline upgrade problem of the target terminal, the embodiment of the present invention introduces the idea of merging upgrade packages. When upgrading the target terminal, based on the current version of the system and database of the target terminal and the highest version to be upgraded, cross-version upgrade can be performed. Specifically, the system code corresponding to the current version of the system and the system code of the highest version of the system can be combined and merged, and the script corresponding to the current version of the database and the script of the highest version of the database can be merged to form an upgrade package. In this way, only one upgrade package needs to be upgraded, thereby improving the efficiency of offline upgrades and reducing the abnormality rate during the upgrade process.
[0057] For extracting the operation data of the target terminal, the embodiment of the present invention is based on the browser interface operation, and makes the common log data and operation data download function, and the log data and operation data can be viewed and downloaded without logging into the browser, which is convenient for case handlers to process the log data and operation data, or the log data and operation data can be transmitted to professional computer personnel for analysis. Therefore, case handlers do not need to use professional software to download log data and operation data, which improves the download efficiency of log data and operation data.
[0058] And, after the offline upgrade is completed, the service startup script is executed to start the service. During the service startup process, the service startup status will be monitored to improve the service startup rate and determine that the target terminal is running normally.
[0059] After explaining the overall concept of the embodiment of the present invention, the technical solution of the embodiment of the present invention will be explained in detail below.
[0060] In the first aspect, an embodiment of the present invention provides an offline upgrade method based on an analysis and judgment system, which is applied to a target terminal, which is a terminal installed with an analysis and judgment system. Since the analysis and judgment system is used to conduct in-depth analysis and decision support on certain matters, there are usually requirements for confidentiality, convenience, and speed, so the target terminal is not connected to the network.
[0061] An offline upgrade method based on a judgment system is provided in an embodiment of the present invention. Figure 1As shown, the following steps may be included:
[0062] S110, obtaining the upgrade package uploaded by the target user through the target page.
[0063] The target page is a page in the target terminal for uploading the upgrade package, and the upgrade package includes: system code for upgrading the system and scripts for upgrading the database. The target user may be a case officer who uses the analysis and judgment system.
[0064] Specifically, the case handler can upload the upgrade package through the target page of the target terminal, so that the target terminal can obtain the upgrade package, which may include system code for upgrading the system and scripts for upgrading the database, so that the subsequent steps can upgrade the system through the system code and upgrade the database through the script.
[0065] S120, storing the upgrade package according to the storage path corresponding to the upgrade package, and decompressing the upgrade package to obtain the decompressed upgrade package.
[0066] Specifically, after receiving the upgrade package, the target terminal may store the upgrade package according to the storage path corresponding to the upgrade package. Since the upgrade package uploaded through the target page is usually a compressed package, the upgrade package may be decompressed to obtain the decompressed upgrade package.
[0067] S130, determining a first system code corresponding to the first system version number, and determining a second system code corresponding to the second system version number in the decompressed upgrade package.
[0068] The first system version number is the version number of the current system version, and the second system version number is the version number of the system version to be upgraded.
[0069] Specifically, the current version of the system and the version to be upgraded may be cross-version systems. When upgrading the system, it is necessary to compare the changes in the system codes of the two versions. Therefore, the first system version number of the current version of the system can be recorded, for example, the current SVN (Subversion Number) number of the system can be recorded as the first system version number, where the SVN number is an identifier used to identify changes in software or project versions and is part of the version control system. It is also necessary to record the second system version number of the version to be upgraded, for example, record the SVN number of the version to be upgraded as the second system version number.
[0070] When the system is upgraded, it is necessary to compare the differences between the system codes corresponding to the versions before and after the upgrade. Therefore, it is necessary to determine the first system code corresponding to the first system version number, and determine the second system code corresponding to the second system version number in the decompressed upgrade package.
[0071] S140, determining a target system code between the first system code and the second system code, generating an incremental upgrade package based on the target system code, and upgrading the system through the incremental upgrade package.
[0072] The target system code is a different system code between the first system code and the second system code.
[0073] Specifically, the system code is stored in a jar file, and the first system code and the second system code are stored in different jar files. The jar file of the first system code and the jar file of the second system code can be compared through the diff command in Linux to extract the different system codes in the first system code and the second system code, generate an incremental upgrade package, and use the incremental upgrade package to upgrade the system.
[0074] It can be seen that when the target terminal upgrades the system across versions, it is not necessary to upgrade multiple upgrade packages in series. For example, when the system is upgraded from version 1.0 to version 3.0, it is not necessary to upgrade from version 1.0 to version 2.0 through the first upgrade package, and then upgrade from version 2.0 to version 3.0 through the second upgrade package as in the prior art. Instead, the system code corresponding to version 1.0 is directly compared with the system code corresponding to version 3.0 to obtain the different system codes between the two, and generate an incremental upgrade package. In this way, only the incremental upgrade package is needed to achieve the system upgrade, so that there will be no redundant upgrade packages during the upgrade process, shortening the system upgrade time and improving the system upgrade efficiency. In addition, in the prior art, if the upgrade package is omitted during the serial upgrade of multiple upgrade versions, it may cause an abnormality in the system upgrade. The embodiment of the present invention only needs one upgrade package to complete the system upgrade, reducing the abnormality rate during the system upgrade process.
[0075] S150, determining a first database script corresponding to the first database version number, and determining a second database script corresponding to the second database version number and a third database script corresponding to the third database version number in the decompressed upgrade package.
[0076] The first database version number is the version number of the current version of the database, the third database version number is the version number of the database version to be upgraded, and the second database version number is the database version number between the first database version number and the third database version number.
[0077] In practical applications, the database can be a MySQL database or a Postgresql database.
[0078] S160, merging the first database script, the second database script, and the third database script in the order of the database version numbers from low to high to obtain an upgrade file, and upgrading the database through the upgrade file.
[0079] Specifically, when upgrading a database through a database upgrade script, the version number of the current version of the database and the version number of the version to be upgraded can be determined, and then the cat command in Linux appends the database scripts corresponding to multiple version numbers of the database to the same file according to the order of the version numbers from low to high, to obtain an upgrade file, and then the database is upgraded through the upgrade file. For example, to upgrade a database from version 1.0 to version 3.0, the database script corresponding to version 1.0, the database script corresponding to version 2.0, and the database script corresponding to version 3.0 are stored in the same file in order to obtain an upgrade file, and the database upgrade can be achieved only through the upgrade file.
[0080] It can be seen that when the target terminal upgrades the database across versions, it is not necessary to upgrade multiple upgrade packages in series. For example, when the database is upgraded from version 1.0 to version 3.0, it is not necessary to upgrade from version 1.0 to version 2.0 through the first upgrade package, and then upgrade from version 2.0 to version 3.0 through the second upgrade package as in the prior art. Instead, the database script corresponding to version 1.0, the database script corresponding to version 2.0, and the database script corresponding to version 3.0 are appended to the same file to obtain the upgrade file. In this way, only one upgrade file is needed to realize the database upgrade, so that there will be no redundant upgrade packages in the upgrade process, which shortens the database upgrade time and improves the database upgrade efficiency. In addition, in the prior art, if the upgrade package is omitted during the serial upgrade of multiple upgrade versions, it may cause an abnormality in the database upgrade. The embodiment of the present invention only needs one upgrade file to complete the database upgrade, which reduces the abnormality rate in the database upgrade process.
[0081] In actual applications, if you update views and materialized views in the Postgresql database, you can directly update the old versions of the views and materialized views through the latest versions of the views and materialized views.
[0082] The technical solution provided by the embodiment of the present invention is that the target terminal installed with the analysis and judgment system is not connected to the network. When the system and database of the target terminal are upgraded offline, the target user can upload an upgrade package through the target page, and the upgrade package includes a system code for upgrading the system and a script for upgrading the database. When upgrading the system, the system code corresponding to the current version number of the system is compared with the system code corresponding to the version number of the system to be upgraded to form an incremental upgrade package. The system upgrade can be completed through an incremental upgrade package, which improves the efficiency of the system upgrade and reduces the abnormality rate of the system upgrade process. In addition, when upgrading the database, in the order of the version numbers from high to low, the script corresponding to the current version number of the database, the script corresponding to the version number between the current version number and the version number to be upgraded, and the script corresponding to the version of the database to be upgraded are appended to the upgrade file. The database upgrade can be completed through an upgrade file, which improves the efficiency of the database upgrade and reduces the abnormality rate of the database upgrade process.
[0083] exist Figure 1 Based on the embodiment shown, in one implementation, the browser interface of the target terminal can be provided with a first virtual button for downloading log data and operation and maintenance data, so that the target user, i.e., the case handler, only needs to click the first virtual button to download the log data and operation and maintenance data conveniently and quickly. Figure 2 As shown, the offline upgrade method of the analysis and judgment system may also include the following steps:
[0084] S170, when a browser login operation is received, display the browser interface.
[0085] Specifically, when the target user wants to download log data and operation and maintenance data, he can log in to the browser interface, that is, log in to the browser homepage.
[0086] S180, receiving a trigger operation on the first virtual button, and downloading log data and operation and maintenance data through a target command.
[0087] After logging into the browser interface, the target user can perform a trigger operation on the first virtual key, and the trigger operation can be a click operation, a double-click operation, etc. The embodiment of the present invention does not specifically limit the trigger operation. After the target terminal receives the trigger operation on the first virtual key, the log data and operation and maintenance data can be downloaded through the target command. Specifically, the following Linux command can be used to view the system operation status, download the log data and operation and maintenance data, and save the downloaded log data and operation and maintenance data to the corresponding file.
[0088] 1. Use the top command to download the CPU and memory status of the system. The specific command is top-nl, and save the data downloaded by the top command to a file named top.log.
[0089] 2. Use the df command to download the system's storage capacity and distribution. The specific command is df -h, and save the data downloaded by the df command to a file named df.log.
[0090] 3. Use the docker ps command to download the running status of the database and other middleware, and save the data downloaded by the docker ps command to a file named docker_ps.log.
[0091] 4. Use the jps command to download the operation status of the business service, and save the data downloaded by the jps command to a file named jps.log.
[0092] 5. Use the find command to copy the operation log, configuration file, etc. of the business service, filter the required files according to time or folder, and save the required files to a folder named logs in the log folder, and save the configuration file information as opt.log.
[0093] 6. Download the information of the key configuration table through the docker command, store the information of the key configuration table into the relational database through the docker exec command, and then transfer it to the corresponding table.
[0094] S190, saving the log data and operation and maintenance data into a target file.
[0095] From the above description, it can be seen that the log data and operation and maintenance data are downloaded into different files through different commands, and then all the files are archived into the files of the path: / u01 / infomation.zip to obtain the target file for saving the log data and operation and maintenance data.
[0096] S1100, compressing and encrypting the target file to obtain a compressed and encrypted target file.
[0097] After obtaining the target file, the target file can be compressed and encrypted to obtain the compressed and encrypted target file, and the browser can download the compressed and encrypted target file to the client.
[0098] It can be seen that by setting the first virtual button for downloading log data and operation and maintenance data on the browser interface, the target user can download the log data and operation and maintenance data conveniently and efficiently as long as the first virtual button is triggered.
[0099] exist Figure 2Based on the embodiment shown, in one implementation, the browser interface of the target terminal is provided with a second virtual button for deleting log data and operation and maintenance data. The offline upgrade method based on the judgment system may further include the following steps, namely, step a1 and step a2:
[0100] Step a1, before receiving a trigger operation on the first virtual key and downloading log data and operation and maintenance data through a target command, receiving a trigger operation on the second virtual key.
[0101] Step a2: Delete the existing files used to store log data and operation and maintenance data.
[0102] Specifically, in order to reduce the impact of redundant log data and operation and maintenance data on the running speed of the target terminal, the browser interface is set with a second virtual button for deleting log data and operation and maintenance data. Before downloading the latest log data and operation and maintenance data through the first virtual button, the second virtual button can be triggered to delete the existing local files for storing log data and operation and maintenance data.
[0103] Based on the above embodiment, in one implementation, the offline upgrade method based on the analysis and judgment system may further include the following steps, namely, step b1 to step b3:
[0104] Step b1, after the system is upgraded through the incremental upgrade package and the database is upgraded through the merged script, the service startup script is executed;
[0105] Step b2, monitoring the startup status of each service, where the startup status of a service includes startup success and startup failure;
[0106] Step b3: if it is monitored that there is a target service that fails to start, restart the target service.
[0107] Specifically, the target terminal shuts down the service during the offline upgrade process, and executes the service startup script after completing the offline upgrade. In addition, during the service startup process, the startup status of each service can be monitored. If the startup status of a service fails, the service can be restarted to ensure the normal operation of each service.
[0108] Based on the above embodiment, in one implementation, the service includes a microservice and a monolithic service.
[0109] At this time, monitoring the startup status of each service may include the following steps, namely step c1 and step c2:
[0110] Step c1: If the service is a microservice, the service discovery mechanism is called periodically to pull the interface of the microservice, and when the interface of the microservice is pulled, it is determined that the microservice is started successfully.
[0111] In step c2, if the service is a single service, a preset command is used to query whether the process of the single service exists, and when it is found that the process of the single service exists, it is determined that the single service is started successfully.
[0112] Specifically, in actual applications, if the service is a microservice, the service discovery mechanism of nacos can be called periodically to pull the interface of the service list. If the interface of the microservice is pulled, it means that the registration has been completed, that is, the service has been started successfully. Otherwise, it is judged that the service startup has failed.
[0113] If the service is a single service, you can use the jps command that comes with Java to query whether the process of the single service exists. If a single service process exists, it is determined that the single service has been started successfully; otherwise, it is determined that the service has failed to start.
[0114] It can be seen that during the service startup process, by monitoring the service startup status, it is possible to detect services that fail to start, so as to restart the services that fail to start and ensure the normal operation of the services.
[0115] Based on the above embodiment, in one implementation, the offline upgrade method based on the analysis and judgment system may further include the following steps, namely, step d1 to step d4:
[0116] Step d1, counting the total number of microservices that need to be started as a first number, and counting the total number of single services that need to be started as a second number.
[0117] Step d2, counting the number of started microservices as the first startup number, and counting the total number of started single services as the second startup number.
[0118] Step d3, calculating the total startup quantity of the service based on the first startup quantity and the second startup quantity, and calculating the total quantity of the service based on the first quantity and the second quantity.
[0119] Step d4, calculating the service activation rate based on the total activation quantity and the total quantity, and displaying the service activation rate in the browser interface.
[0120] Specifically, assuming that there are 10 microservices in total, then the first number is 10, and there are 2 single services in total, then the second number is 2. There are 8 started microservices, then the first start number is 8, and there are 2 started single services, then the second start number is 2. The calculated service start rate is (8+2) / (10+2)=83%. By calculating the service start rate and displaying it in the browser interface, the target user can intuitively understand the service start rate for analysis and processing.
[0121] In a second aspect, an embodiment of the present invention provides an offline upgrade device 30 based on a judgment system, which is applied to a target terminal, wherein the judgment system is installed on the target terminal, and the target terminal is not connected to a network, such as Figure 3 As shown, the device comprises:
[0122] The upgrade package acquisition module 310 is used to acquire the upgrade package uploaded by the target user through the target page, wherein the target page is a page in the target terminal for uploading the upgrade package, and the upgrade package includes: a system code for upgrading the system and a script for upgrading the database;
[0123] The upgrade package decompression module 320 is used to store the upgrade package according to the storage path corresponding to the upgrade package, and decompress the upgrade package to obtain the decompressed upgrade package;
[0124] The system code determination module 330 is used to determine a first system code corresponding to a first system version number, and to determine a second system code corresponding to a second system version number in the decompressed upgrade package, wherein the first system version number is the version number of the current system version, and the second system version number is the version number of the system version to be upgraded;
[0125] A system upgrade module 340, configured to determine a target system code between the first system code and the second system code, generate an incremental upgrade package based on the target system code, and upgrade the system using the incremental upgrade package, wherein the target system code is a system code that is different between the first system code and the second system code;
[0126] A database script determination module 350 is used to determine a first database script corresponding to a first database version number, and determine a second database script corresponding to a second database version number and a third database script corresponding to a third database version number in the decompressed upgrade package, wherein the first database version number is the version number of the current version of the database, the third database version number is the version number of the version of the database to be upgraded, and the second database version number is a database version number between the first database version number and the third database version number;
[0127] The database upgrade module 360 is used to merge the first database script, the second database script and the third database script in the order of database version numbers from low to high to obtain an upgrade file, and upgrade the database through the upgrade file.
[0128] The technical solution provided by the embodiment of the present invention is that the target terminal installed with the analysis and judgment system is not connected to the network. When the system and database of the target terminal are upgraded offline, the target user can upload an upgrade package through the target page, and the upgrade package includes a system code for upgrading the system and a script for upgrading the database. When upgrading the system, the system code corresponding to the current version number of the system is compared with the system code corresponding to the version number of the system to be upgraded to form an incremental upgrade package. The system upgrade can be completed through an incremental upgrade package, which improves the efficiency of the system upgrade and reduces the abnormality rate of the system upgrade process. In addition, when upgrading the database, in the order of the version numbers from high to low, the script corresponding to the current version number of the database, the script corresponding to the version number between the current version number and the version number to be upgraded, and the script corresponding to the version of the database to be upgraded are appended to the upgrade file. The database upgrade can be completed through an upgrade file, which improves the efficiency of the database upgrade and reduces the abnormality rate of the database upgrade process.
[0129] Optionally, the browser interface of the target terminal is provided with a first virtual button for downloading log data and operation and maintenance data, and the device further comprises:
[0130] A browser interface display module, used to display the browser interface when receiving a browser login operation;
[0131] A data download module, used to receive a trigger operation on the first virtual key, and download log data and operation and maintenance data through a target command;
[0132] A data saving module, used to save the log data and the operation and maintenance data into a target file;
[0133] The file processing module is used to compress and encrypt the target file to obtain a compressed and encrypted target file.
[0134] Optionally, the browser interface of the target terminal is provided with a second virtual button for deleting log data and operation and maintenance data, and the device further comprises:
[0135] a trigger operation receiving module, configured to receive a trigger operation on the second virtual key before receiving the trigger operation on the first virtual key and downloading the log data and the operation and maintenance data through a target command;
[0136] The file deletion module is used to delete existing files used to store log data and operation and maintenance data.
[0137] Optionally, the device further comprises:
[0138] A script execution module, used to execute a service startup script after the system is upgraded through the incremental upgrade package and the database is upgraded through the merged script;
[0139] The service startup monitoring module is used to monitor the startup status of each service. The startup status of a service includes startup success and startup failure.
[0140] The service restart module is used to restart the target service if a target service that fails to start is monitored.
[0141] Optionally, services include microservices and monolithic services;
[0142] The service startup monitoring module is specifically used for:
[0143] If the service is a microservice, the service discovery mechanism is called periodically to pull the interface of the microservice, and when the interface of the microservice is pulled, it is determined that the microservice is started successfully;
[0144] If the service is a single service, a preset command is used to query whether the process of the single service exists, and when it is found that the process of the single service exists, it is determined that the single service is started successfully.
[0145] Optionally, the device further comprises:
[0146] A first quantity statistics module is used to count the total number of microservices that need to be started as a first number, and to count the total number of single services that need to be started as a second number;
[0147] The second quantity counting module is used to count the number of started microservices as the first startup number, and to count the total number of started single services as the second startup number;
[0148] a quantity calculation module, configured to calculate a total startup quantity of a service based on the first startup quantity and the second startup quantity, and to calculate a total quantity of a service based on the first quantity and the second quantity;
[0149] The service activation rate calculation module is used to calculate the service activation rate based on the total activation quantity and the total quantity, and display the service activation rate in the browser interface.
[0150] In a third aspect, an embodiment of the present invention provides an electronic device 400, such as Figure 4 As shown, including:
[0151] at least one processor 401;
[0152] a memory 402 for storing the at least one processor executable instruction;
[0153] The at least one processor is configured to execute the instructions to implement the method described in the first aspect.
[0154] The technical solution provided by the embodiment of the present invention is that the target terminal installed with the analysis and judgment system is not connected to the network. When the system and database of the target terminal are upgraded offline, the target user can upload an upgrade package through the target page, and the upgrade package includes a system code for upgrading the system and a script for upgrading the database. When upgrading the system, the system code corresponding to the current version number of the system is compared with the system code corresponding to the version number of the system to be upgraded to form an incremental upgrade package. The system upgrade can be completed through an incremental upgrade package, which improves the efficiency of the system upgrade and reduces the abnormality rate of the system upgrade process. In addition, when upgrading the database, in the order of the version numbers from high to low, the script corresponding to the current version number of the database, the script corresponding to the version number between the current version number and the version number to be upgraded, and the script corresponding to the version of the database to be upgraded are appended to the upgrade file. The database upgrade can be completed through an upgrade file, which improves the efficiency of the database upgrade and reduces the abnormality rate of the database upgrade process.
[0155] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in the first aspect.
[0156] The technical solution provided by the embodiment of the present invention is that the target terminal installed with the analysis and judgment system is not connected to the network. When the system and database of the target terminal are upgraded offline, the target user can upload an upgrade package through the target page, and the upgrade package includes a system code for upgrading the system and a script for upgrading the database. When upgrading the system, the system code corresponding to the current version number of the system is compared with the system code corresponding to the version number of the system to be upgraded to form an incremental upgrade package. The system upgrade can be completed through an incremental upgrade package, which improves the efficiency of the system upgrade and reduces the abnormality rate of the system upgrade process. In addition, when upgrading the database, in the order of the version numbers from high to low, the script corresponding to the current version number of the database, the script corresponding to the version number between the current version number and the version number to be upgraded, and the script corresponding to the version of the database to be upgraded are appended to the upgrade file. The database upgrade can be completed through an upgrade file, which improves the efficiency of the database upgrade and reduces the abnormality rate of the database upgrade process.
[0157] In a fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0158] The technical solution provided by the embodiment of the present invention is that the target terminal installed with the analysis and judgment system is not connected to the network. When the system and database of the target terminal are upgraded offline, the target user can upload an upgrade package through the target page, and the upgrade package includes a system code for upgrading the system and a script for upgrading the database. When upgrading the system, the system code corresponding to the current version number of the system is compared with the system code corresponding to the version number of the system to be upgraded to form an incremental upgrade package. The system upgrade can be completed through an incremental upgrade package, which improves the efficiency of the system upgrade and reduces the abnormality rate of the system upgrade process. In addition, when upgrading the database, in the order of the version numbers from high to low, the script corresponding to the current version number of the database, the script corresponding to the version number between the current version number and the version number to be upgraded, and the script corresponding to the version of the database to be upgraded are appended to the upgrade file. The database upgrade can be completed through an upgrade file, which improves the efficiency of the database upgrade and reduces the abnormality rate of the database upgrade process.
[0159] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention without departing from the principles and intent of the present invention.
Claims
1. An offline upgrade method based on a research and judgment system, characterized in that: Applied to a target terminal, the target terminal is equipped with a research and judgment system, and the target terminal is not connected to a network, the method includes: Acquire an upgrade package uploaded by a target user through a target page, wherein the target page is a page in the target terminal for uploading the upgrade package, and the upgrade package includes: a system code for upgrading the system and a script for upgrading the database; The upgrade package is stored according to the storage path corresponding to the upgrade package, and the upgrade package is decompressed to obtain the decompressed upgrade package; Determine a first system code corresponding to the first system version number, and determine a second system code corresponding to the second system version number in the decompressed upgrade package, wherein the first system version number is the version number of the current version of the system, and the second system version number is the version number of the version to be upgraded; Determine a target system code between the first system code and the second system code, generate an incremental upgrade package based on the target system code, and upgrade the system through the incremental upgrade package, wherein the target system code is a different system code between the first system code and the second system code; Determine a first database script corresponding to a first database version number, and determine a second database script corresponding to a second database version number and a third database script corresponding to a third database version number in the decompressed upgrade package, wherein the first database version number is the version number of the current version of the database, the third database version number is the version number of the version of the database to be upgraded, and the second database version number is a database version number between the first database version number and the third database version number; The first database script, the second database script and the third database script are merged in the order of database version numbers from low to high to obtain an upgrade file, and the database is upgraded through the upgrade file.
2. The method according to claim 1, characterized in that The browser interface of the target terminal is provided with a first virtual key for downloading log data and operation and maintenance data, and the method further comprises: When receiving a browser login operation, displaying the browser interface; receiving a trigger operation on the first virtual button, and downloading log data and operation and maintenance data through a target command; Saving the log data and the operation and maintenance data into a target file; The target file is compressed and encrypted to obtain a compressed and encrypted target file.
3. The method according to claim 2, characterized in that The browser interface of the target terminal is provided with a second virtual key for deleting log data and operation and maintenance data, and the method further comprises: Before receiving the trigger operation on the first virtual key and downloading the log data and the operation and maintenance data through the target command, receiving the trigger operation on the second virtual key; Delete the existing files used to store log data and operation and maintenance data.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: After the system is upgraded through the incremental upgrade package and the database is upgraded through the merged script, the service startup script is executed; Monitor the startup status of each service. The startup status of a service includes startup success and startup failure. If a target service that fails to start is detected, restart the target service.
5. The method according to claim 4, characterized in that Services include microservices and monolithic services; The monitoring of the startup of each service includes: If the service is a microservice, the service discovery mechanism is called periodically to pull the interface of the microservice, and when the interface of the microservice is pulled, it is determined that the microservice is started successfully; If the service is a single service, a preset command is used to query whether the process of the single service exists, and when it is found that the process of the single service exists, it is determined that the single service is started successfully.
6. The method according to claim 5, characterized in that The method further comprises: The total number of microservices that need to be started is counted as the first number, and the total number of single services that need to be started is counted as the second number; Count the number of started microservices as the first startup number, and count the total number of started single services as the second startup number; Calculating a total startup quantity of the service based on the first startup quantity and the second startup quantity, and calculating a total quantity of the service based on the first quantity and the second quantity; Based on the total startup quantity and the total quantity, a service startup rate is calculated, and the service startup rate is displayed in a browser interface.
7. An offline upgrade device based on a research and judgment system, characterized in that: Applied to a target terminal, the target terminal is equipped with a research and judgment system, the target terminal is not connected to a network, and the device includes: An upgrade package acquisition module, used to acquire an upgrade package uploaded by a target user through a target page, wherein the target page is a page in the target terminal for uploading the upgrade package, and the upgrade package includes: a system code for upgrading the system and a script for upgrading the database; An upgrade package decompression module, used to store the upgrade package according to the storage path corresponding to the upgrade package, and decompress the upgrade package to obtain the decompressed upgrade package; a system code determination module, configured to determine a first system code corresponding to a first system version number, and to determine a second system code corresponding to a second system version number in the decompressed upgrade package, wherein the first system version number is the version number of a current system version, and the second system version number is the version number of a system version to be upgraded; a system upgrade module, configured to determine a target system code between the first system code and the second system code, generate an incremental upgrade package based on the target system code, and upgrade the system through the incremental upgrade package, wherein the target system code is a system code that is different between the first system code and the second system code; a database script determination module, configured to determine a first database script corresponding to a first database version number, and determine a second database script corresponding to a second database version number and a third database script corresponding to a third database version number in the decompressed upgrade package, wherein the first database version number is the version number of the current version of the database, the third database version number is the version number of the version of the database to be upgraded, and the second database version number is a database version number between the first database version number and the third database version number; The database upgrade module is used to merge the first database script, the second database script and the third database script in the order of database version numbers from low to high to obtain an upgrade file, and upgrade the database through the upgrade file.
8. An electronic device, characterized in that: include: at least one processor; a memory for storing the at least one processor-executable instruction; The at least one processor is configured to execute the instructions to implement the method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.