Application program updating method and device, computer equipment and storage medium

By using a second application to take over service request processing during the application update process, the problem of business interruption during application updates is solved and a seamless transition of application version updates is achieved.

CN118860433APending Publication Date: 2024-10-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310474052.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-26
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

During the service version upgrade and update process of the application, the normal business services of the application may be interrupted and affect its normal operation.

Method used

By starting a second application program with a target service port number, the service request processing function of the first application program is suspended, and the pending service request is forwarded to the second application program for processing until the first application program terminates running, and then by The second application directly receives and processes service requests.

Benefits of technology

This ensures that business services will not be interrupted during the application version update process, ensuring the normal operation of the application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860433A_ABST
    Figure CN118860433A_ABST
Patent Text Reader

Abstract

The invention relates to an application program updating method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: starting a second application program for updating a first application program, wherein the second application program has a corresponding target service port number; suspending a service request processing function of the first application program, and receiving a to-be-processed service request through the first application program; forwarding the to-be-processed service request to a second application program through the first application program based on the target service port number, and processing the to-be-processed service request through the second application program; when the first application program stops running, deleting the first application program, directly receiving the service request through the second application program, and processing the service request. By adopting the method, the normal operation of the normal business service of the application program can be ensured in the process of upgrading and updating the service version of the application program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device and storage medium for updating an application. Background Art

[0002] With the development of computer technology and the continuous development of terminals such as mobile phones and tablet computers, more and more applications (APPs) are generated, and applications are easily attacked by bad code, which causes the applications to face greater network security risks. At present, when a security vulnerability is found in an application, the service version of the application can be directly upgraded and updated. However, the process of upgrading and updating the service version of the application may interrupt the normal business services of the application, thereby affecting the normal operation of the normal business services of the application. Therefore, how to ensure the normal operation of the normal business services of the application in the process of upgrading and updating the service version of the application is an urgent problem to be solved. Summary of the invention

[0003] Based on this, it is necessary to provide an application update method, device, computer equipment and storage medium that can ensure the normal operation of the normal business services of the application during the process of upgrading and updating the service version of the application to address the above technical problems.

[0004] In a first aspect, the present application provides a method for updating an application program. The method comprises:

[0005] Starting a second application program that updates the first application program, the second application program having a corresponding target service port number;

[0006] suspending a service request processing function of the first application and receiving a pending service request through the first application;

[0007] forwarding the pending service request to the second application program through the first application program based on the target service port number, and processing the pending service request through the second application program;

[0008] When the first application program is terminated, the first application program is deleted, and the service request is directly received and processed through the second application program.

[0009] In a second aspect, the present application also provides a device for updating an application program. The device comprises:

[0010] An application startup module, used to start a second application that updates the first application, the second application having a corresponding target service port number;

[0011] A service request receiving module, used to suspend the service request processing function of the first application and receive a to-be-processed service request through the first application;

[0012] A service forwarding and processing module, used to forward the pending service request to the second application program through the first application program based on the target service port number, and process the pending service request through the second application program;

[0013] The application processing module is used to delete the first application after the first application is terminated, and directly receive the service request through the second application and process the service request.

[0014] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0015] Starting a second application program that updates the first application program, the second application program having a corresponding target service port number;

[0016] suspending a service request processing function of the first application and receiving a pending service request through the first application;

[0017] forwarding the pending service request to the second application program through the first application program based on the target service port number, and processing the pending service request through the second application program;

[0018] When the first application program is terminated, the first application program is deleted, and the service request is directly received and processed through the second application program.

[0019] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0020] Starting a second application program that updates the first application program, the second application program having a corresponding target service port number;

[0021] suspending a service request processing function of the first application and receiving a pending service request through the first application;

[0022] forwarding the pending service request to the second application program through the first application program based on the target service port number, and processing the pending service request through the second application program;

[0023] When the first application program is terminated, the first application program is deleted, and the service request is directly received and processed through the second application program.

[0024] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0025] Starting a second application program that updates the first application program, the second application program having a corresponding target service port number;

[0026] suspending a service request processing function of the first application and receiving a pending service request through the first application;

[0027] forwarding the pending service request to the second application program through the first application program based on the target service port number, and processing the pending service request through the second application program;

[0028] When the first application program is terminated, the first application program is deleted, and the service request is directly received and processed through the second application program.

[0029] The above-mentioned application updating method, device, computer equipment, storage medium and computer program product first start the second application that updates the first application, the second application has a corresponding target service port number, then suspend the service request processing function of the first application, and receive the pending service request through the first application, so as to forward the pending service request to the second application based on the target service port number through the first application, and process the pending service request through the second application. Therefore, when the first application terminates, the first application is deleted, and the service request is directly received and the service request is processed through the second application. Since the above-mentioned method can suspend the service request processing function of the first application, that is, the first application is used as an intermediate proxy service to forward the service request, so that the first application can forward the service request processing to the second application for processing on the basis of not processing the service request itself, and the second application is used to update the first application, that is, the service request is processed by the updated second application, and the update of the first application is indirectly realized, thereby ensuring that in the process of updating the version of the first application, the service request processing by the second application will not interrupt the normal business service of the application, thereby ensuring the normal operation of the normal business service of the application. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 An application environment diagram of a method for updating an application program in one embodiment;

[0031] Figure 2 is a flowchart of a method for updating an application in an embodiment;

[0032] Figure 3 A partial flow chart of a method for updating an application program in one embodiment;

[0033] Figure 4 A schematic diagram of a flow chart of continuing the update of an application or terminating the update of an application by requesting a forwarding state in one embodiment;

[0034] Figure 5 is a partial flow chart of a method for updating an application in another embodiment;

[0035] Figure 6 A schematic diagram of a process for obtaining application information of a first application in one embodiment;

[0036] Figure 7 is a partial flow chart of a method for updating an application program in another embodiment;

[0037] Figure 8 A partial flow chart of a method for updating an application program in yet another embodiment;

[0038] Fig. 9 A complete flowchart of a method for updating an application program in one embodiment is shown;

[0039] Fig.10 is a flow chart of interaction between a first application and a second application in a method for updating an application in one embodiment;

[0040] Fig.11 is a structural block diagram of an application updating device in one embodiment;

[0041] Fig.12 is a structural block diagram of an application updating device in another embodiment;

[0042] Fig.13 is a structural block diagram of an application updating device in yet another embodiment;

[0043] Fig.14 A structural block diagram of an application updating device in yet another embodiment;

[0044] Fig.15 is a structural block diagram of an application updating device in the next embodiment;

[0045] Fig.16 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0047] With the development of computer technology and the continuous development of terminals such as mobile phones and tablets, more and more APPs are generated, and applications are easily attacked by bad codes, which leads to greater network security risks for applications. For example, after an open source log component is determined to have a serious high-risk remote code execution vulnerability, malicious code attacks based on this vulnerability will cause all types of online applications, open source software, cloud platforms and email services running the open source log component to face network security risks. Therefore, there are still many security risks in Java services and their applications, application services written in C++, application services written in Python, and application services written in Go. At present, when security vulnerabilities are found in applications written in different languages, you can choose to quickly fix the vulnerabilities or upgrade the service version of the application. In the case of choosing to upgrade the service version of the application, it is usually more time-saving than fixing the vulnerability. However, the normal business services of the application may be interrupted during the upgrade of the service version of the application, thereby affecting the normal operation of the normal business services of the application.

[0048] Therefore, the embodiment of the present application provides an application updating method that can ensure the normal operation of the normal business service of the application during the process of upgrading the service version of the application. Based on this, the application updating method provided by the embodiment of the present application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on the cloud or other servers.

[0049] Specifically, taking the server 104 as an example, the user can use the terminal 102 to operate the application, and then receive the service request for the application sent by the terminal 102 through the server 104, and process the service request to complete the response function and operation requested by the service request. Based on this, when it is found that the application has a security vulnerability, function addition or reduction, etc., and the application needs to be updated, the server can first start the second application that updates the first application, and the second application has a corresponding target service port number. Then the service request processing function of the first application is suspended, and the pending service request is received through the first application, so that the server 104 can forward the pending service request to the second application through the first application based on the target service port number, and process the pending service request through the second application. Therefore, when the first application terminates, the first application is deleted, and the service request is directly received through the second application, and the service request is processed. The update of the first application is indirectly realized, so as to ensure that in the process of updating the version of the first application, the service request processing through the second application will not interrupt the normal business service of the application, thereby ensuring the normal operation of the normal business service of the application. In actual applications, when problems occur in the operation of the second application or the results of the clear processing do not meet the requirements, the operation of the second application can be terminated and the service request processing function of the first application can be reopened to ensure the normal operation of the normal business services of the application, but this application update failed.

[0050] The terminal 102 may be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0051] In one embodiment, Figure 2 As shown, a method for updating an application is provided, which is applied to Figure 1 The server 104 in the example is used for explanation. It is understandable that the method can also be applied to the terminal 102, and can also be applied to a system including the terminal 102 and the server 104, and is implemented through the interaction between the terminal 102 and the server 104. In this embodiment, the method includes the following steps:

[0052] Step 202: Start a second application program that updates the first application program, where the second application program has a corresponding target service port number.

[0053] The first application is the application to be updated, and the second application is the application that updates the first application. For example, if the application is applied to the scenario of application version upgrade, the second application can be an application with a newer version than the first application. If the application is applied to the scenario of fixing vulnerabilities, the second application has fixed the vulnerabilities in the first application. And if the application user chooses to update the application by himself, the second application is the application corresponding to the application version selected by the user.

[0054] Secondly, the service port number is specifically the identification number of the application of the network service function. The service port number can be manually assigned by the user, or the service port number of the application has been defined when the application is written, so the service port number can be used to uniquely indicate the port of an application. Therefore, it is necessary to access a certain application, that is, it is necessary to access and process various requests based on the service port number corresponding to a certain application. Therefore, the port indicated by the target service port number is an unused port, and the second application will be started on the unused port indicated by the target service port number, that is, the second application has a corresponding target service port number, that is, when it is necessary to access the second application, it is necessary to access and process various requests based on the target service port number.

[0055] Specifically, the server needs to first determine the first application that needs to be updated, then start the second application that updates the first application, and obtain the target service port number for accessing the second application. Taking the scenario of application version upgrade as an example, that is, when the first application needs to be upgraded, the server can push relevant notifications of application upgrade to the user through communication with the terminal, and after the user determines the upgrade, it is determined that the first application needs to be upgraded, thereby starting the second application of the latest application version. Or, taking the scenario of vulnerability repair as an example, that is, when there is a security vulnerability in the first application, the server can directly determine that the first application needs to be upgraded to repair the existing security vulnerability, thereby determining the application with the fixed security vulnerability as the second application, and starting the second application. The above examples are only used to understand the scheme, and the embodiments of the present application do not specifically limit how to determine the first application and the second application.

[0056] Step 204: suspend the service request processing function of the first application, and receive a to-be-processed service request through the first application.

[0057] Among them, the service request processing function is a function for processing service requests. Specifically, since the purpose of this solution is to update the first application to the second application, and in the specific update process, if the first application receives the pending service request and directly processes the pending service request, that is, the corresponding service is still provided through the original first application, the purpose of indirectly updating the application cannot be achieved at this time. Therefore, the server needs to suspend the service request processing function of the first application first to prevent the first application from processing the received service request. Based on this, the server receives the pending service request through the first application.

[0058] Secondly, the server should also enable the intermediate proxy service function of the first application so that the first application can be used as an intermediate proxy service to forward service requests, so that the first application can forward the service request processing to the second application for processing without processing the service request itself.

[0059] Step 206: forward the pending service request to the second application program through the first application program based on the target service port number, and process the pending service request through the second application program.

[0060] Specifically, since the second application is essentially an updated application of the first application, but since the pending service request is still sent to the first application, it is necessary to access the second application based on the target service port number, so as to forward the received pending service request to the second application through the first application. Thus, by suspending the service request processing function of the first application, that is, using the first application as an intermediate proxy service to forward the service request, the first application can forward the service request to the second application for processing without processing the service request itself. It is understandable that since the second application should determine whether the received pending service request is forwarded by the first application, when forwarding the pending service request to the second application through the first application, it can also carry the port information corresponding to the first application.

[0061] Based on this, after the second application receives the pending service request forwarded by the first application, the pending service request will be processed by the second application, that is, the pending service request is essentially processed by the updated application, thereby indirectly realizing the update of the application. Therefore, when the first application and the second application are running normally, subsequent pending service requests will be forwarded based on the aforementioned similar situations so that the pending service request can be processed by the second application.

[0062] Based on this, in this embodiment, the first application is specifically used as an intermediate proxy service to forward the service request, so that the first application can forward the service request processing to the second application for processing without processing the service request itself. It can be seen that after the first application successfully forwards the pending service request to the second application, the first application can successfully forward the service request as an intermediate proxy service. Therefore, in actual applications, the first application can also send a successful forwarding message to the second application, so that after the second application receives the successful forwarding message, it is determined that the first application can successfully forward the received pending service request. On the contrary, if the first application fails to successfully forward the pending service request to the second application, it means that the first application is temporarily unable to forward the service request as an intermediate proxy service, so the second application cannot receive the service request and process the service request, that is, the first application also needs to send a forwarding failure message to the second application, thereby terminating the update of the application, and re-enabling the service request processing function of the first application, and removing the second application, so as to ensure that the service processing can be performed through the first application.

[0063] Step 208, when the first application is terminated, the first application is deleted, and the service request is directly received through the second application, and the service request is processed.

[0064] Among them, the termination of the operation of the first application at least includes: the first application is manually restarted, or the first application is manually interrupted. Specifically, when the first application is terminated, the first application is deleted, and the service request is directly received and processed through the second application. That is, at least after the first application is manually restarted, the first application will be directly deleted so that the service request issued after the restart will be directly sent to the second application, and the service request processing will be directly performed through the second application. Alternatively, after the first application is manually interrupted, the first application will also be directly deleted so that the service request issued after the restart will be directly sent to the second application, and the service request processing will be directly performed through the second application.

[0065] Based on the above embodiments, it can be known that after the first application successfully forwards the pending service request to the second application, the first application can also send a successful forwarding message to the second application, so that after the second application receives the successful forwarding message, it is determined that the first application can successfully forward the received pending service request. Based on this, only when the first application successfully sends the successful forwarding message to the second application can it be guaranteed that the pending service request is processed by the second application. Therefore, after the first application terminates, it is guaranteed that the second application can successfully process the pending service request, and the first application will be deleted, and the service request will be directly received and processed by the second application.

[0066] In the above-mentioned application update method, the service request processing function of the first application can be suspended, that is, the first application is used as an intermediate proxy service to forward the service request, so that the first application does not process the service request itself, but can also forward the service request processing to the second application for processing, and the second application is used to update the first application, that is, the service request is processed by the updated second application, thereby indirectly realizing the update of the first application, thereby ensuring that during the version update process of the first application, the service request processing by the second application will not interrupt the normal business service of the application, thereby ensuring the normal operation of the normal business service of the application.

[0067] Since in actual applications, when the second application is processing the pending service request, the efficiency of receiving the request may be low, affecting the request processing efficiency, or the request processing may fail, it is possible to consider the effect of request forwarding in the process of forwarding the pending service request from the first application to the second application, so as to avoid the problem of affecting the request processing result due to the low efficiency of request forwarding. The specific implementation method is described in detail below:

[0068] In one embodiment, Figure 3 As shown, when forwarding the pending service request to the second application through the first application, the method further includes:

[0069] Step 302: monitor request forwarding information forwarded by the first application to the second application, where the request forwarding information includes data information in multiple information dimensions.

[0070] Among them, the request forwarding information includes data information under multiple information dimensions, and the data information under the aforementioned multiple information dimensions at least includes: the number of concurrent requests, the request size of the forwarded requests, the request transmission time of the forwarded requests, the request response time of the forwarded requests, the request success rate of the forwarded requests, the central processing unit (CPU) utilization, and the disk utilization and other data information.

[0071] Specifically, each time the server forwards a pending service request to the second application through the first application, it will count the data information of the forwarded pending service request in multiple information dimensions, that is, it will statistically monitor the number of concurrent requests, request size, request transmission time, request response time, request success rate, CPU utilization, and disk utilization of the forwarded pending service request.

[0072] Based on this, the aforementioned number of concurrent requests describes the total number of pending service requests forwarded this time. If pending service request A1, pending service request A2 and pending service request A3 are specifically forwarded this time, then the number of concurrent requests is 3. Secondly, the request size is used to describe: the request size of each pending service request. The request transmission time is used to describe: the time interval between the timestamp of each pending service request sent from the first application and the timestamp received by the second application. The request response time is used to describe: the time interval between the timestamp of the pending service request received by the second application and the timestamp of the second application responding to process the pending service request. The request success rate is the ratio of the total number of pending service requests forwarded to the second application to the total number of pending service requests successfully processed by the second application, for example. The first application forwards a total of 100 pending service requests to the second application, and the second application successfully processes a total of 85 pending service requests, then the request success rate is 85% (85 / 100*100%). The CPU utilization and the disk utilization are specifically used to describe: the CPU utilization and the disk utilization when the first application forwards the pending service request, and the CPU utilization and the disk utilization when the second application processes the pending service request.

[0073] Step 304: Based on the request forwarding information, the random forest model is used to output information classification results corresponding to the data information under each information dimension. The information classification results are used to describe whether the data information is abnormal data information or normal data information.

[0074] Among them, the information classification result is used to describe whether the data information is abnormal data information or normal data information. Specifically, the server outputs the information classification results corresponding to the data information under each information dimension through the random forest model based on the request forwarding information. Based on this, the server can specifically output the prediction classification results corresponding to the data information under each information dimension through multiple decision trees in the random forest model based on the request forwarding information, and then determine the information classification results under each information dimension based on the prediction classification results under each information dimension output by each decision tree. That is, when the server requests forwarding information for prediction, the request forwarding information is input into the random forest model. Since multiple decision trees are constructed in the random forest model, each decision tree in the random forest model can obtain a corresponding prediction classification result for the request forwarding information, and can output the prediction classification results corresponding to the data information under each information dimension respectively. The aforementioned prediction classification result is that the data information is abnormal data information, or the data information is normal data information. Based on this, the server selects the final result from the prediction classification results output by each decision tree respectively through the voting method, and the final result is the information classification result corresponding to the data information under each information dimension.

[0075] Furthermore, since the random forest model can ensure the randomness of samples and the randomness of feature extraction, it is ensured that multiple decision trees in the random forest model have both similarities and differences, and multiple decision trees in the random forest model can be trained in parallel, so the random forest model has high operating efficiency and high accuracy. Due to the randomness of samples and the randomness of feature extraction, even if there are high-dimensional features, there is no need to reduce the dimensionality of sample features, thereby providing a method for measuring the importance of features. The specific training method of the random forest model is introduced in detail below. The initial random forest model can be trained with the relevant data of the requests processed by the first application to be updated within the historical time interval. The aforementioned historical time interval can be: 7 days, 10 days, 15 days, etc., which is not limited here. A random forest model that can accurately classify normal data information and abnormal data information is obtained. The unbiased estimation method is specifically used in the tree construction process of each decision tree in the random forest model, so that the obtained random forest model has a good algorithm for processing missing values. Based on this, after obtaining the aforementioned random forest model, when the first application forwards the request to the second application, the random forest model can output the information classification results corresponding to the data information under each information dimension, so as to perform anomaly detection on request forwarding and request processing through the random forest model.

[0076] Step 306: determine the request forwarding status based on the information classification results, and continue the update of the application or terminate the update of the application according to the request forwarding status.

[0077] Among them, the request forwarding state may at least include: request forwarding abnormality and request forwarding normal. For example: if the data information under at least half of the information dimensions is abnormal data information, then the request forwarding state is determined to be request forwarding abnormality. Alternatively, the CPU utilization and the disk utilization both reach the abnormal threshold, and the request forwarding state is directly determined to be request forwarding abnormality. Alternatively, the request success rate is less than the minimum request success rate, indicating that there are many request failures, and the request forwarding state can also be determined to be request forwarding abnormality. Secondly, the request forwarding state can also be divided into more fine-grained levels, such as the first-level state, the second-level state and the third-level state. The first-level state is that the classification results of each information are described, and the data information under each information dimension is request forwarding normal data information. The second-level state is that the data information under a small part of the information dimension is abnormal data information, such as the CPU utilization and the disk utilization reaching the abnormal threshold, and the third-level state is that the data information under most of the information dimensions is abnormal data information, or the data information under the important information dimension is abnormal data information, such as the request success rate is less than the minimum request success rate, or 80% of the data information under the information dimension is abnormal data information.

[0078] Specifically, the server determines the request forwarding status based on the classification results of each information, and continues the update of the application or terminates the update of the application through the request forwarding status. If the request forwarding status can at least include: request forwarding abnormality and request forwarding normal, then when the request forwarding status is determined to be request forwarding abnormality, the update of the application can be terminated, that is, at this time, directly stop forwarding the pending service request through the first application, and reopen the service request processing function of the first application to process the service request through the first application. Conversely, when the request forwarding status is determined to be request forwarding normal, the update of the application can continue to maintain the continued operation steps of the aforementioned embodiment.

[0079] Furthermore, if the request forwarding status is a level one status, a level two status, and a level three status, if the request forwarding status is a level one status, the application can be updated to maintain the continued operation steps of the aforementioned embodiment. Secondly, if the request forwarding status is a level two status, the application can be updated, but an alarm notification is made, that is, a problem occurs during the forwarding process. Thirdly, if the request forwarding status is a level three status, the application update can be terminated, that is, the forwarding of pending service requests through the first application is stopped directly, and the service request processing function of the first application is reopened to process the service request through the first application.

[0080] It can be understood that the above examples are used to understand the present solution, but should not be understood as specific limitations of the present solution.

[0081] In this embodiment, the random forest model can ensure the randomness of samples and feature extraction, thereby ensuring that multiple decision trees in the random forest model have both similarities and differences, thereby ensuring that the information classification results corresponding to the data information under the information dimension can be obtained efficiently and accurately, and the request forwarding status is determined by each information classification result, which can avoid continuous forwarding in the presence of a large amount of abnormal data information, so as to ensure the reliability of request processing and thus improve the reliability of business service processing.

[0082] In one embodiment, Figure 4 As shown, continuing the update of the application or terminating the update of the application by requesting the forwarding state includes:

[0083] Step 402: If the request forwarding status is that the request forwarding is normal, continue to forward the pending service request to the second application through the first application.

[0084] Among them, request forwarding is normal is used to describe: the process of forwarding the pending service request from the first application to the second application is normal, or abnormal information that can be received occurs. Specifically, when the request forwarding status is that the request forwarding is normal, the server continues to forward the pending service request to the second application through the first application. If the data information under each information dimension is the request forwarding normal data information, it is determined that the request forwarding status is that the request forwarding is normal. At this time, the server continues to forward the pending service request to the second application through the first application, that is, the application can continue to be updated to maintain the continued operation steps of the aforementioned embodiment.

[0085] Alternatively, when the data information under a small number of information dimensions is abnormal data information, such as when the CPU utilization and disk utilization reach abnormal thresholds, the pending service request can continue to be forwarded to the second application through the first application, that is, the application can continue to be updated, but an alarm notification can be issued at this time to notify that a problem has occurred in the forwarding process, so that the monitoring personnel can pay attention to the real-time request forwarding status.

[0086] Optionally, in step 404, if the request forwarding status is request forwarding exception, the first application terminates forwarding the pending service request to the second application, terminates the update of the application, and reopens the service request processing function of the first application.

[0087] Among them, request forwarding exception is used to describe: many abnormal situations occur in the process of forwarding pending service requests to the second application through the first application. For example: the data information under at least half of the information dimensions is abnormal data information, then the request forwarding status is determined to be request forwarding exception. Alternatively, the CPU utilization and disk utilization both reach the abnormal threshold, and the request forwarding status is directly determined to be request forwarding exception. Alternatively, the request success rate is less than the minimum request success rate, indicating that there are many request failures. At this time, the request forwarding status can also be determined to be request forwarding exception. Specifically, when the request forwarding status is request forwarding exception, it means that there is a problem in the process of processing the request through request forwarding, which may affect the normal operation of the service. Therefore, the server will cause the first application to terminate forwarding the pending service request to the second application to terminate the application update, and reopen the service request processing function of the first application to perform service request processing through the first application.

[0088] In this embodiment, by using different processing flows for the request forwarding status when the request forwarding is normal and when the request forwarding is abnormal, it is possible to avoid continuing to forward in the presence of a large amount of abnormal data information, further ensuring the reliability of request processing, that is, further improving the reliability of business service processing.

[0089] In the specific process of updating the application, information such as the running status may also be considered to avoid updating the wrong application or the application that has stopped running. In one embodiment, Figure 5 As shown, the application updating method further includes:

[0090] Step 502: Obtain application information of the first application, where the application information at least includes: an application name, an application version number, and an application running status.

[0091] Among them, the application information includes at least: application name, application version number and application running status. The application name is the specific name of the application, which can be a digital identifier or a combination of English and numbers, such as the application name of the first application is B1, or the application name of the first application is 111. Secondly, the application version number is used to indicate the specific application version under the application name, such as 2023111101, 2023111103V1, etc. And the application running status is used to describe the specific running status of the application, specifically: normal operation or abnormal operation.

[0092] Specifically, after determining that the first application needs to be updated, the server first obtains the application information of the first application. The server can directly request the application information from the first application through the second application. If the second application successfully sends a request to the first application, that is, the first application can obtain the application name and application version number of the first application from the configuration file of the first application, and further determine the application running status of the first application at this time, and then return the application information to the second application through the first application.

[0093] Based on this, suspending the service request processing function of the first application and receiving the to-be-processed service request through the first application includes:

[0094] Step 504: If the verification result corresponding to the application information is verification passed, the service request processing function of the first application is suspended, and the to-be-processed service request is received through the first application.

[0095] Furthermore, after obtaining the application information of the first application, the application information needs to be further verified, and the verification strategy at least includes: verifying whether the application name in the application information of the first application matches the application name of the second application. And verifying whether the application version indicated by the application version number of the first application can be updated to the application version indicated by the application version number of the second application. And verifying whether the application running status of the first application is normal operation.

[0096] The verification result is the verification result of the application information based on the verification strategies of multiple dimensions, and the verification result can be a verification pass or a verification failure. A verification pass means that the results of the verification of the application information by the verification strategies of multiple dimensions are all verification passes, and a verification failure means that there is at least one verification failure result under multiple dimensions.

[0097] Specifically, the verification result corresponding to the application information is verification passed, indicating that the update can be started, at which time the service request processing function of the first application is suspended, and the service request to be processed is received through the first application. That is, the server verifies that the application name in the application information of the first application matches the application name of the second application, and verifies that the application version indicated by the application version number of the first application can be updated to the application version indicated by the application version number of the second application. And it is determined that the application running status of the first application is normal operation, thereby determining that the verification result is verification passed.

[0098] On the contrary, if there is a verification failure in the aforementioned verification process, such as inconsistent application name matching, or the application version indicated by the application version number of the first application cannot be updated to the application version indicated by the application version number of the second application, or the application running status of the first application is abnormal, the verification result is determined to be a verification failure. At this time, the application update process will be terminated and subsequent request forwarding processing and other steps will not be performed.

[0099] In this embodiment, the application is updated by considering information such as the running status, so as to avoid updating the wrong application or the application that has stopped running, so as to ensure the reliability and accuracy of the application.

[0100] Considering the data security issue, data encryption can be performed during the acquisition of application information to reduce the possibility of data tampering and ensure the security of data acquisition. Based on this, in one embodiment, Figure 6 As shown, obtaining application information of the first application includes:

[0101] Step 602: Request application information from the first application via the second application.

[0102] Specifically, the server specifically requests the application information from the first application through the second application. That is, the server specifically requests the application information from the first application through the second application. If the second application successfully sends a request to the first application, the first application can obtain the application name and application version number of the first application from the configuration file of the first application, and further determine the application running state of the first application at this time, so that the first application obtains its own application information.

[0103] Optionally, if the second application fails to request the application information from the first application, the application update is terminated, the service request processing function of the first application is restarted, and the second application is removed. That is, if the second application fails to successfully send a request to the first application, the application update process will be terminated at this time, and subsequent request forwarding processing and other steps will not be performed. Or if a transmission problem occurs during the process of the second application sending a request to the first application, the application update will also be terminated at this time, the service request processing function of the first application will be restarted, and the second application will be removed.

[0104] Step 604: The first application encrypts the application information based on a preset key to obtain encrypted application information, and returns the encrypted application information to the second application.

[0105] Among them, the preset key can be a key of preset length, such as a key of 128 bits in length, or the preset key can also be a key pre-configured based on the application. Based on this, the encryption processing can be symmetric encryption processing or asymmetric encryption processing, and the algorithms for symmetric encryption processing can at least include: DES, 3DES, AES, etc., and the algorithms for asymmetric processing can at least include: RSA, DSA, etc. No specific limitation is made here. And the preset key and the algorithm for encryption processing are both pre-configured to ensure that the algorithm can be matched smoothly for encryption processing.

[0106] Specifically, after the server successfully requests application information from the first application through the second application, the first application obtains its own application information, and then encrypts the application information based on a preset key through the first application to obtain encrypted application information, and then returns the encrypted application information to the second application through the first application.

[0107] Step 606: Decrypt the encrypted application information based on the preset key through the second application to obtain the application information.

[0108] Among them, the decryption process corresponds to the encryption process, that is, the specific algorithm used by the first application to encrypt the application information should also be used when the second application decrypts to ensure the successful decryption process. If the first application encrypts the application information based on the preset key and DES, then after receiving the returned encrypted application information, the second application should also decrypt the encrypted application information based on the preset key and DES to obtain the application information. Specifically, the server receives the returned encrypted application information through the second application, and then decrypts the encrypted application information based on the preset key through the second application to obtain the application information.

[0109] Optionally, if the second application fails to decrypt the encrypted application information, it indicates that there may be security issues such as tampering. That is, the second application cannot successfully obtain the application information of the first application. At this time, the application update should be terminated, the service request processing function of the first application should be reopened, and the second application should be removed.

[0110] In this embodiment, data encryption is performed during the process of obtaining application information to reduce security issues such as data tampering during data transmission, thereby improving the security and reliability of data transmission and ensuring the reliability of the obtained application information.

[0111] After receiving the application information through the second application, it should also be considered whether the application information matches. Therefore, this embodiment also provides a method for verifying the application information: In one embodiment, if Figure 7 As shown, the application updating method further includes:

[0112] Step 702: Verify the application information through the second application to obtain a verification result.

[0113] The verification result is the verification result of the application information based on the verification strategies of multiple dimensions, and the verification result can be a verification pass or a verification failure. A verification pass means that the results of the verification of the application information by the verification strategies of multiple dimensions are all verification passes, and a verification failure means that there is at least one verification failure result under multiple dimensions.

[0114] Specifically, the server verifies the application information through the second application to obtain a verification result. Based on the above embodiments, the application information at least includes: application name, application version number, and application running status, that is, the server needs to verify the application name, application version number, and application running status through the second application. It can be understood that the order of verifying the application name, application version number, and application running is not limited here.

[0115] Based on this, the information verification of the application name is specifically: verifying whether the application name in the application information of the first application matches the application name of the second application. And the information verification of the application version number is specifically: whether the application version indicated by the application version number of the first application can be updated to the application version indicated by the application version number of the second application. And the information verification of the application operation is specifically: verifying whether the application operation status of the first application is normal operation.

[0116] Therefore, if the results of the information verification of the application name, application version number, and application operation by the second application are all successful, the verification result can be determined as passed. On the contrary, if there is at least one failed result in the information verification of the application name, application version number, and application operation by the second application, that is, the verification result is determined to be failed, the application update process will be terminated at this time, and subsequent request forwarding processing and other steps will not be performed.

[0117] Based on this, if the verification result corresponding to the application information is verification passed, suspending the service request processing function of the first application, and receiving the to-be-processed service request through the first application, including:

[0118] Step 704: If the verification result is passed, a service switch request is sent to the first application through the second application. The service switch request carries the target service port number, and the service switch request is used to describe the functional status of the service request processing function of the second application.

[0119] The service switch request carries the target service port number, and the service switch request is used to describe the functional status of the service request processing function of the second application, that is, whether the service request processing function of the second application can operate normally can be obtained through the service request. Specifically, when the verification result is verification passed, it means that the application name in the application information of the first application matches the application name of the second application, and the application version indicated by the application version number of the first application can be updated to the application version indicated by the application version number of the second application, and the first application operates normally, so the server will send a service switch request to the first application through the second application, and the service switch request can describe whether the service request processing function of the second application can operate normally.

[0120] It is understandable that even if the verification result is passed, if the server does not send a service switch request to the first application through the second application, the application update should be terminated, the service request processing function of the first application should be reopened, and the second application should be removed.

[0121] Step 706: suspending the service request processing function of the first application based on the service switch request through the first application, and receiving the to-be-processed service request through the first application.

[0122] Specifically, the server suspends the service request processing function of the first application based on the service switch request through the first application, and receives the pending service request through the first application. That is, first determine whether the service request processing function of the second application can operate normally based on the service switch request. If so, it means that the service request processing function of the second application has been turned on, that is, the second application has been started normally and can process the service request. At this time, the server will suspend the service request processing function of the first application through the first application, and receive the pending service request through the first application.

[0123] It is understandable that if the service request processing function of the second application described in the service switch request cannot operate normally, that is, the second application is not started normally, the application update process will also be ended at this time, that is, the service request processing function of the first application will not be suspended, but the service request will still be processed by the first application without forwarding.

[0124] In this embodiment, after receiving the application information through the second application, it should also be considered whether the application information matches to ensure that the second application can upgrade the first application and the second application can run normally, further ensuring the reliability of the application upgrade.

[0125] In one embodiment, Figure 8 As shown, when the pending service request is processed by the second application, the method further includes:

[0126] Step 802, obtaining service processing information, the service processing information at least includes: the processing result of the second application program on the pending service request, and the business operation status of other businesses when the second application program processes the pending service request.

[0127] Among them, the service processing information at least includes: the processing result of the second application processing the service request to be processed, and the business operation status of other businesses when the second application processes the service request to be processed. The aforementioned processing result can be determined by the information classification results corresponding to the data information under each information dimension output by the random forest model introduced in the aforementioned embodiment, that is, the processing result of the second application processing the service request to be processed is judged by each information classification result. Secondly, the business operation status is used to describe the operation status of other businesses when processing the service request to be processed, that is, the business operation status may include: normal operation and abnormal operation.

[0128] Based on the aforementioned embodiments, it can be known that the data information under multiple information dimensions at least includes: the number of concurrent requests, the request size of the forwarded request, the request transmission time of the forwarded request, the request response time of the forwarded request, the request success rate of the forwarded request, the CPU utilization rate, and the disk utilization rate and other data information. Therefore, the processing result of the second application program for the service request to be processed can be specifically determined by: the information classification results corresponding to the data information under the aforementioned multiple information dimensions. If all the information classification results are normal data information, the processing result can be determined as normal processing. Secondly, if there is abnormal data information in each information classification result, the processing result can be determined as abnormal processing.

[0129] Specifically, when the server processes the pending service request through the second application, it will further obtain the processing result of the second application processing the pending service request, as well as the business operation status of other businesses when the second application processes the pending service request, thereby obtaining service processing information.

[0130] Step 804: If the service processing information satisfies the exception processing information, the first application stops forwarding the pending service request to the second application, and reopens the service request processing function of the first application.

[0131] Among them, the exception handling information includes: the processing result is exception handling, or the business operation status of other services is abnormal. Specifically, if the service processing information meets the exception handling information, that is, the processing result of the second application for the pending service request is exception handling, then it means that the result of the second application processing the service request does not meet expectations, such as more request processing failures or low request processing efficiency, etc. At this time, the first application stops forwarding the pending service request to the second application, and reopens the service request processing function of the first application. Alternatively, when the second application processes the pending service request, the business operation status of other services is abnormal, which means that the second application affects the normal operation of other services when processing the service request. Therefore, the server will still cause the first application to stop forwarding the pending service request to the second application, and reopen the service request processing function of the first application. Based on this, the server will re-process the service request through the first application to achieve the purpose of application rollback, thereby ensuring the normal processing of the service.

[0132] Furthermore, if the service processing information satisfies the exception processing information, the second application sends a rollback request to the first application, and then the first application stops forwarding the pending service request to the second application based on the rollback request, and reopens the service request processing function of the first application. That is, the server shuts down the intermediate proxy service function of the first application based on the rollback request, so that the first application stops forwarding the pending service request to the second application, and reopens the service request processing function of the first application, so that the pending service request will not be forwarded, but will be directly processed by the first application.

[0133] Optionally, if the first application successfully reopens the service request processing function of the first application and successfully stops forwarding pending service requests to the second application, the first application sends a successful rollback message to the second application and stops running the second application. Conversely, if the first application fails to reopen the service request processing function of the first application and fails to stop forwarding pending service requests to the second application, it means that both the first application and the second application cannot process the service request normally at this time. At this time, the first application sends a failure message to the second application, stops running the first application and the second application, and in this case, both the first application and the second application will stop running, and it is necessary to wait for the application-related personnel to troubleshoot the problem to ensure that either application can provide normal services.

[0134] In this embodiment, application rollback is performed to avoid providing services even when the result of the second application processing the user request does not meet expectations or affects the normal operation of other businesses. This avoids situations that affect the normal operation of the service and further ensures the reliability and practicality of application updates.

[0135] Based on the detailed introduction of the above embodiments, the complete process of the method for updating the application in the embodiments of the present application will be described below. In one embodiment, Fig. 9 As shown, a method for updating an application is provided, which is applied to Figure 1 The server 104 in the example is used for explanation. It is understandable that the method can also be applied to the terminal 102, and can also be applied to a system including the terminal 102 and the server 104, and is implemented through the interaction between the terminal 102 and the server 104. In this embodiment, the method includes the following steps:

[0136] Step 901: Start a second application program that updates a first application program.

[0137] Among them, the first application is the application to be updated, and the second application is the application that updates the first application. Secondly, the service port number is specifically the identification number of the application of the network service function, so that the port indicated by the target service port number is an unused port, and the second application will be started on the unused port indicated by the target service port number, that is, the second application has a corresponding target service port number, that is, when the second application needs to be accessed, it is specifically necessary to access and process various requests based on the target service port number.

[0138] Specifically, the server first determines a first application program that needs to be updated, then starts a second application program that updates the first application program, and obtains a target service port number for accessing the second application program.

[0139] Step 902: Request application information from the first application via the second application.

[0140] Specifically, the server can directly request application information from the first application through the second application. If the second application successfully sends a request to the first application, the first application can obtain the application name and application version number of the first application from the configuration file of the first application, and further determine the application running status of the first application at this time, and then return the application information to the second application through the first application.

[0141] Optionally, if the second application fails to request the application information from the first application, the application update is terminated, the service request processing function of the first application is restarted, and the second application is removed. That is, if the second application fails to successfully send a request to the first application, the application update process will be terminated at this time, and subsequent request forwarding processing and other steps will not be performed. Or if a transmission problem occurs during the process of the second application sending a request to the first application, the application update will also be terminated at this time, the service request processing function of the first application will be restarted, and the second application will be removed.

[0142] Step 903: The first application encrypts the application information based on a preset key to obtain encrypted application information, and returns the encrypted application information to the second application.

[0143] Among them, the preset key can be a key of preset length, such as a key of 128 bits in length, or the preset key can also be a key pre-configured based on the application. Based on this, the encryption processing can be symmetric encryption processing or asymmetric encryption processing, and the algorithms for symmetric encryption processing can at least include: DES, 3DES, AES, etc., and the algorithms for asymmetric processing can at least include: RSA, DSA, etc. No specific limitation is made here. And the preset key and the algorithm for encryption processing are both pre-configured to ensure that the algorithm can be matched smoothly for encryption processing.

[0144] Specifically, after the server successfully requests application information from the first application through the second application, the first application obtains its own application information, and then encrypts the application information based on a preset key through the first application to obtain encrypted application information, and then returns the encrypted application information to the second application through the first application.

[0145] Step 904: Decrypt the encrypted application information based on the preset key through the second application to obtain the application information.

[0146] The decryption process corresponds to the encryption process, that is, the specific algorithm used by the first application to encrypt the application information should also be used by the second application to decrypt it, so as to ensure the successful decryption process. Specifically, the server receives the encrypted application information returned by the second application, and then decrypts the encrypted application information based on the preset key through the second application to obtain the application information.

[0147] Optionally, if the second application fails to decrypt the encrypted application information, it indicates that there may be security issues such as tampering. That is, the second application cannot successfully obtain the application information of the first application. At this time, the application update should be terminated, the service request processing function of the first application should be reopened, and the second application should be removed.

[0148] Step 905: Verify the application information through the second application to obtain a verification result.

[0149] The verification result is the verification result of the application information based on the verification strategies of multiple dimensions, and the verification result can be a verification pass or a verification failure. A verification pass means that the results of the verification of the application information by the verification strategies of multiple dimensions are all verification passes, and a verification failure means that there is at least one verification failure result under multiple dimensions.

[0150] Specifically, the server verifies the application information through the second application to obtain a verification result. Based on the above embodiments, the application information at least includes: application name, application version number, and application running status, that is, the server needs to verify the application name, application version number, and application running status through the second application. It can be understood that the order of verifying the application name, application version number, and application running is not limited here.

[0151] Step 906: If the verification result is that the verification is passed, a service switch request is sent to the first application through the second application.

[0152] The service switch request carries the target service port number, and the service switch request is used to describe the functional status of the service request processing function of the second application, that is, whether the service request processing function of the second application can operate normally can be obtained through the service request. Specifically, when the verification result is verification passed, it means that the application name in the application information of the first application matches the application name of the second application, and the application version indicated by the application version number of the first application can be updated to the application version indicated by the application version number of the second application, and the first application operates normally, so the server will send a service switch request to the first application through the second application, and the service switch request can describe whether the service request processing function of the second application can operate normally.

[0153] It is understandable that even if the verification result is passed, if the server does not send a service switch request to the first application through the second application, the application update should be terminated, the service request processing function of the first application should be reopened, and the second application should be removed.

[0154] Step 907: suspending the service request processing function of the first application based on the service switch request through the first application, and receiving the to-be-processed service request through the first application.

[0155] Specifically, the server suspends the service request processing function of the first application based on the service switch request through the first application, and receives the pending service request through the first application. That is, first determine whether the service request processing function of the second application can operate normally based on the service switch request. If so, it means that the service request processing function of the second application has been turned on, that is, the second application has been started normally and can process the service request. At this time, the server will suspend the service request processing function of the first application through the first application, and receive the pending service request through the first application.

[0156] It is understandable that if the service request processing function of the second application described in the service switch request cannot operate normally, that is, the second application is not started normally, the application update process will also be ended at this time, that is, the service request processing function of the first application will not be suspended, but the service request will still be processed by the first application without forwarding.

[0157] Step 908: forward the pending service request to the second application program through the first application program based on the target service port number, and process the pending service request through the second application program.

[0158] Specifically, since the second application is essentially an updated application of the first application, but since the pending service request is still sent to the first application, it is necessary to access the second application based on the target service port number, so as to forward the received pending service request to the second application through the first application. Based on this, after the second application receives the pending service request forwarded by the first application, it will process the pending service request through the second application, that is, it essentially processes the pending service request through the updated application, thereby indirectly realizing the update of the application. Therefore, when the first application and the second application are both running normally, subsequent pending service requests will be forwarded based on the aforementioned similar situations, so that the pending service request can be processed by the second application.

[0159] Based on this, in this embodiment, the first application is specifically used as an intermediate proxy service to forward the service request, so that the first application can forward the service request processing to the second application for processing without processing the service request itself. It can be seen that after the first application successfully forwards the pending service request to the second application, the first application can successfully forward the service request as an intermediate proxy service. Therefore, in actual applications, the first application can also send a successful forwarding message to the second application, so that after the second application receives the successful forwarding message, it is determined that the first application can successfully forward the received pending service request. On the contrary, if the first application fails to successfully forward the pending service request to the second application, it means that the first application is temporarily unable to forward the service request as an intermediate proxy service, so the second application cannot receive the service request and process the service request, that is, the first application also needs to send a forwarding failure message to the second application, thereby terminating the update of the application, and re-enabling the service request processing function of the first application, and removing the second application, so as to ensure that the service processing can be performed through the first application.

[0160] Step 909: When the to-be-processed service request is forwarded from the first application to the second application, monitoring the request forwarding information forwarded from the first application to the second application.

[0161] Specifically, each time the server forwards a pending service request to the second application through the first application, it will count the data information of the forwarded pending service request in multiple information dimensions, that is, it will statistically monitor the number of concurrent requests, request size, request transmission time, request response time, request success rate, CPU utilization, and disk utilization of the forwarded pending service request.

[0162] Step 910: Based on the request forwarding information, the random forest model is used to output information classification results corresponding to the data information in each information dimension.

[0163] The information classification result is used to describe whether the data information is abnormal data information or normal data information. Specifically, the server forwards the information based on the request, and outputs the information classification results corresponding to the data information under each information dimension through a random forest model.

[0164] Based on this, the server can specifically output the prediction classification results corresponding to the data information under each information dimension through multiple decision trees in the random forest model based on the request forwarding information, and then determine the information classification results under each information dimension based on the prediction classification results under each information dimension output by each decision tree. That is, when the server requests forwarding information for prediction, the request forwarding information is input into the random forest model. Since multiple decision trees are constructed in the random forest model, each decision tree in the random forest model can obtain a corresponding prediction classification result for the request forwarding information, and can output the prediction classification results corresponding to the data information under each information dimension respectively. The aforementioned prediction classification results are that the data information is abnormal data information, or the data information is normal data information. Based on this, the server selects the final result from the prediction classification results output by each decision tree respectively through voting, and the final result is the information classification result corresponding to the data information under each information dimension. Step 911, determine the request forwarding status based on each information classification result.

[0165] The request forwarding status may include at least: request forwarding abnormality and request forwarding normal. Specifically, the server determines the request forwarding status based on the information classification results, and continues or terminates the update of the application program according to the request forwarding status.

[0166] Step 912: If the request forwarding status is that the request forwarding is normal, continue to forward the pending service request to the second application through the first application.

[0167] Among them, request forwarding is normal is used to describe: the process of forwarding the pending service request from the first application to the second application is normal, or there is an abnormal information that can be received. Specifically, when the request forwarding status is request forwarding is normal, the server continues to forward the pending service request from the first application to the second application.

[0168] Step 913: If the request forwarding status is request forwarding exception, the first application terminates forwarding the pending service request to the second application, terminates the update of the application, and reopens the service request processing function of the first application.

[0169] Among them, request forwarding exception is used to describe: many abnormal situations occur in the process of forwarding pending service requests from the first application to the second application. Specifically, when the request forwarding status is request forwarding exception, it means that there is a problem in the process of processing the request through request forwarding, which may affect the normal operation of the service. Therefore, the server will cause the first application to stop forwarding the pending service request to the second application to terminate the update of the application, and reopen the service request processing function of the first application to process the service request through the first application.

[0170] Step 914: when the second application is processing the pending service request, service processing information is obtained.

[0171] The service processing information at least includes: the processing result of the second application program on the service request to be processed, and the business operation status of other services when the second application program processes the service request to be processed. Specifically, when the server processes the service request to be processed through the second application program, it further obtains the processing result of the second application program on the service request to be processed, and the business operation status of other services when the second application program processes the service request to be processed, thereby obtaining the service processing information.

[0172] Step 915: If the service processing information satisfies the exception processing information, the first application stops forwarding the pending service request to the second application, and reopens the service request processing function of the first application.

[0173] Among them, the exception handling information includes: the processing result is exception handling, or the business operation status of other services is abnormal. Specifically, if the service processing information meets the exception handling information, that is, the processing result of the second application for the pending service request is exception handling, then it means that the result of the second application processing the service request does not meet expectations, such as more request processing failures or low request processing efficiency, etc. At this time, the first application stops forwarding the pending service request to the second application, and reopens the service request processing function of the first application. Alternatively, when the second application processes the pending service request, the business operation status of other services is abnormal, which means that the second application affects the normal operation of other services when processing the service request. Therefore, the server will still cause the first application to stop forwarding the pending service request to the second application, and reopen the service request processing function of the first application. Based on this, the server will re-process the service request through the first application to achieve the purpose of application rollback, thereby ensuring the normal processing of the service.

[0174] Furthermore, if the service processing information satisfies the exception processing information, the second application sends a rollback request to the first application, and then the first application stops forwarding the pending service request to the second application based on the rollback request, and reopens the service request processing function of the first application. That is, the server shuts down the intermediate proxy service function of the first application based on the rollback request, so that the first application stops forwarding the pending service request to the second application, and reopens the service request processing function of the first application, so that the pending service request will not be forwarded, but will be directly processed by the first application.

[0175] Optionally, if the first application successfully reopens the service request processing function of the first application and successfully stops forwarding pending service requests to the second application, the first application sends a successful rollback message to the second application and stops running the second application. Conversely, if the first application fails to reopen the service request processing function of the first application and fails to stop forwarding pending service requests to the second application, it means that both the first application and the second application cannot process the service request normally at this time. At this time, the first application sends a failure message to the second application, stops running the first application and the second application, and in this case, both the first application and the second application will stop running, and it is necessary to wait for the application-related personnel to troubleshoot the problem to ensure that either application can provide normal services.

[0176] Step 916, when the first application is terminated, the first application is deleted, and the service request is directly received through the second application, and the service request is processed.

[0177] Among them, the termination of the operation of the first application at least includes: the first application is manually restarted, or the first application is manually interrupted. Specifically, when the first application is terminated, the first application is deleted, and the service request is directly received and processed through the second application. That is, at least after the first application is manually restarted, the first application will be directly deleted so that the service request issued after the restart will be directly sent to the second application, and the service request processing will be directly performed through the second application. Alternatively, after the first application is manually interrupted, the first application will also be directly deleted so that the service request issued after the restart will be directly sent to the second application, and the service request processing will be directly performed through the second application.

[0178] Based on the above embodiments, it can be known that after the first application successfully forwards the pending service request to the second application, the first application can also send a successful forwarding message to the second application, so that after the second application receives the successful forwarding message, it is determined that the first application can successfully forward the received pending service request. Based on this, only when the first application successfully sends the successful forwarding message to the second application can it be guaranteed that the pending service request is processed by the second application. Therefore, after the first application terminates, it is guaranteed that the second application can successfully process the pending service request, and the first application will be deleted, and the service request will be directly received and processed by the second application.

[0179] It should be understood that the specific implementations of steps 901 to 916 are similar to those of the aforementioned embodiments and will not be described in detail here.

[0180] For ease of understanding, Fig.10 As shown, a flowchart of the interaction between the first application and the second application in an application update method is provided. During the operation of the first application, the second application for updating the first application is started, and then the application information is requested from the first application through the second application, so that the first application encrypts the application information and returns the encrypted application information to the second application, so that the second application can decrypt the obtained encrypted application information to obtain the application information, and then the second application verifies the application information obtained after the decryption to obtain a verification result. It can be understood that in the aforementioned process summary, if the second application fails to request the application information from the first application, the upgrade is stopped and the second application is removed. If the second application fails to decrypt the encrypted application information, the upgrade will also be stopped and the second application will be removed. And if the verification result is a verification failure, the upgrade will also be stopped and the second application will be removed.

[0181] Furthermore, based on the verification result being successful, the second application is officially started, and a service switch request is sent to the first application through the second application. If the service switch request fails to be sent or the second application is not successfully started, the upgrade will also be stopped and the second application will be removed. Based on this, when the first application successfully receives the service switch request and determines that the second application is successfully started, the service request processing function of the first application will be suspended, and the pending service request will be received through the first application, and the pending service request will be forwarded to the second application. Then the second application will check whether the first application has successfully forwarded the pending service request. If it fails, the upgrade will still be stopped and the second application will be removed. On the contrary, if it succeeds, the pending service request will be processed by the second application in the future.

[0182] And in the process of the second application processing the pending service request, if the obtained service processing information satisfies the exception handling information, the rollback starts, that is, the second application sends a rollback request to the first application, so that the first application stops forwarding the pending service request to the second application, and reopens the service request processing function of the first application. If the above steps are successfully completed, the first application sends a successful rollback message to the second application, so that the second application determines that the first application is running normally, thereby stopping the second application to complete the rollback. If the first application does not successfully complete the above steps, the first application sends a failed rollback message to the second application. At this time, the first application and the second application will be stopped, waiting for the application-related personnel to troubleshoot the problem to ensure that the application can provide normal services. The specific implementation methods of the above steps are similar to those of the above embodiments and will not be repeated here.

[0183] It should be understood that, although the steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0184] Based on the same inventive concept, the embodiment of the present application also provides an application updating device for implementing the application updating method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the updating device for one or more applications provided below can refer to the limitations of the application updating method above, and will not be repeated here.

[0185] In one embodiment, Fig.11 As shown, an application updating device is provided, including: an application starting module 1102, a service request receiving module 1104, a service forwarding and processing module 1106 and an application processing module 1108, wherein:

[0186] An application program starting module 1102, used for starting a second application program that updates the first application program, the second application program having a corresponding target service port number;

[0187] The service request receiving module 1104 is used to suspend the service request processing function of the first application and receive a to-be-processed service request through the first application;

[0188] The service forwarding and processing module 1106 is used to forward the pending service request to the second application program through the first application program based on the target service port number, and process the pending service request through the second application program;

[0189] The application processing module 1108 is used to delete the first application after the first application is terminated, directly receive the service request through the second application, and process the service request.

[0190] In one embodiment, Fig.12 As shown, the application program update device further includes a monitoring module 1202 and an information classification module 1204;

[0191] A monitoring module, used for monitoring request forwarding information forwarded by the first application to the second application when the service forwarding and processing module 1106 forwards the pending service request to the second application through the first application, wherein the request forwarding information includes data information under multiple information dimensions;

[0192] An information classification module 1204 is used to output information classification results corresponding to data information under each information dimension through a random forest model based on the request forwarding information, and the information classification results are used to describe whether the data information is abnormal data information or normal data information;

[0193] The application processing module 1108 is further used to determine the request forwarding status based on the information classification results, and continue the update of the application or terminate the update of the application according to the request forwarding status.

[0194] In one embodiment, the information classification module 1204 is specifically used to output the prediction classification results corresponding to the data information under each information dimension respectively through multiple decision trees in the random forest model based on the request forwarding information; and determine the information classification results under each information dimension based on the prediction classification results under each information dimension output by each decision tree.

[0195] In one embodiment, the application processing module 1108 is further configured to continue forwarding the pending service request to the second application through the first application if the request forwarding status is that the request forwarding is normal.

[0196] In one embodiment, the application processing module 1108 is also used to terminate the forwarding of the pending service request to the second application by the first application if the request forwarding status is a request forwarding exception, terminate the update of the application, and reopen the service request processing function of the first application.

[0197] In one embodiment, Fig.13 As shown, the application updating device further includes an application information obtaining module 1302;

[0198] The application information acquisition module 1302 is used to acquire application information of the first application, where the application information at least includes: application name, application version number, and application running status;

[0199] The service request receiving module 1104 is specifically configured to suspend the service request processing function of the first application if the verification result corresponding to the application information is verification passed, and receive a to-be-processed service request through the first application.

[0200] In one embodiment, the application information acquisition module 1302 is specifically used to request application information from the first application through the second application; encrypt the application information based on a preset key by the first application to obtain encrypted application information, and return the encrypted application information to the second application; decrypt the encrypted application information based on the preset key by the second application to obtain the application information.

[0201] In one embodiment, the application processing module 1108 is further used to terminate the update of the application if the second application fails to request the application information from the first application, and to reopen the service request processing function of the first application and remove the second application.

[0202] In one embodiment, the application processing module 1108 is also used to terminate the update of the application if the second application fails to decrypt the encrypted application information, and to reopen the service request processing function of the first application and remove the second application.

[0203] In one embodiment, Fig.14 As shown, the application program update device further includes an information verification module 1402;

[0204] An information verification module 1402, configured to verify the application information through a second application to obtain a verification result;

[0205] The service request receiving module 1104 is specifically used to send a service switch request to the first application through the second application if the verification result is verification passed. The service switch request carries the target service port number, and the service switch request is used to describe the functional status of the service request processing function of the second application; through the first application, suspend the service request processing function of the first application based on the service switch request, and receive the pending service request through the first application.

[0206] In one embodiment, Fig.15 As shown, the application program update device further includes a service processing information acquisition module 1502;

[0207] The service processing information acquisition module 1502 is used to acquire service processing information when the service forwarding and processing module 1106 processes the pending service request through the second application program, and the service processing information at least includes: the processing result of the second application program on the pending service request, and the business operation status of other businesses when the second application program processes the pending service request;

[0208] The application processing module 1108 is also used to, if the service processing information satisfies the exception processing information, cause the first application to stop forwarding the pending service request to the second application and to reopen the service request processing function of the first application.

[0209] In one embodiment, the application processing module 1108 is further configured to cause the second application to send a rollback request to the first application if the service processing information satisfies the exception processing information; the first application terminates forwarding the pending service request to the second application based on the rollback request, and reopens the service request processing function of the first application.

[0210] In one embodiment, the application processing module 1108 is also used to send a failure message to the second application and stop running the first application and the second application if the first application fails to reopen the service request processing function of the first application and fails to terminate forwarding the pending service request to the second application.

[0211] Each module in the above-mentioned application program update device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0212] In one embodiment, a computer device is provided. The computer device may be a server or a terminal. In this embodiment, the computer device is described as a server as an example. The internal structure diagram thereof may be as follows: Fig.16 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store relevant data such as random forest models. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for updating an application is implemented.

[0213] Those skilled in the art will understand that Fig.16 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0214] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0215] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0216] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0217] It should be noted that the object information (including but not limited to object device information, object personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0218] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0219] The technical feature information of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical feature information in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical feature information, they should be considered to be within the scope of this specification.

[0220] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for updating an application, characterized in that: include: Starting a second application program that updates the first application program, wherein the second application program has a corresponding target service port number; suspending a service request processing function of the first application and receiving a pending service request through the first application; forwarding the pending service request to the second application program through the first application program based on the target service port number, and processing the pending service request through the second application program; When the first application program is terminated, the first application program is deleted, and the service request is directly received and processed through the second application program.

2. The method according to claim 1, characterized in that When forwarding the to-be-processed service request to the second application through the first application, the method further includes: Monitoring request forwarding information forwarded by the first application to the second application, wherein the request forwarding information includes data information under multiple information dimensions; Based on the request forwarding information, outputting information classification results corresponding to the data information under each of the information dimensions respectively through a random forest model, wherein the information classification results are used to describe that the data information is abnormal data information or that the data information is normal data information; A request forwarding status is determined based on each of the information classification results, and the update of the application is continued or terminated according to the request forwarding status.

3. The method according to claim 2, characterized in that The information classification results corresponding to the data information under each information dimension are outputted based on the request forwarding information through a random forest model, including: Based on the request forwarding information, outputting prediction classification results corresponding to the data information under each of the information dimensions respectively through multiple decision trees in the random forest model; Based on the predicted classification results under each of the information dimensions respectively output by each of the decision trees, the information classification results under each of the information dimensions are determined.

4. The method according to claim 2, characterized in that: The continuing the update of the application program or terminating the update of the application program by forwarding the request status includes: If the request forwarding status is that the request forwarding is normal, continue to forward the pending service request to the second application through the first application; If the request forwarding status is request forwarding exception, the first application terminates forwarding the pending service request to the second application, terminates the update of the application, and reopens the service request processing function of the first application.

5. The method according to claim 1, characterized in that The method further comprises: Acquire application information of the first application, the application information including at least: an application name, an application version number, and an application running status; The suspending the service request processing function of the first application and receiving a to-be-processed service request through the first application includes: If the verification result corresponding to the application information is verification passed, the service request processing function of the first application is suspended, and the to-be-processed service request is received through the first application.

6. The method according to claim 5, characterized in that The obtaining the application information of the first application includes: requesting the application information from the first application through the second application; encrypting the application information based on a preset key by the first application to obtain encrypted application information, and returning the encrypted application information to the second application; The encrypted application information is decrypted by the second application based on the preset key to obtain the application information.

7. The method according to claim 6, characterized in that The method further comprises: If the second application fails to request the first application for the application information, terminating the application update, re-enabling the service request processing function of the first application, and removing the second application; If the second application fails to decrypt the encrypted application information, the update of the application is terminated, the service request processing function of the first application is reopened, and the second application is removed.

8. The method according to claim 5, characterized in that The method further comprises: Verifying the application information by the second application to obtain the verification result; If the verification result corresponding to the application information is that the verification is passed, suspending the service request processing function of the first application, and receiving the to-be-processed service request through the first application, includes: If the verification result is that the verification is passed, sending a service switch request to the first application through the second application, the service switch request carries the target service port number, and the service switch request is used to describe the functional state of the service request processing function of the second application; The service request processing function of the first application is suspended based on the service switch request through the first application, and the to-be-processed service request is received through the first application.

9. The method according to claim 1, characterized in that: When the to-be-processed service request is processed by the second application, the method further includes: Acquire service processing information, the service processing information including at least: a processing result of the second application program processing the pending service request, and a business operation status of other businesses when the second application program processes the pending service request; If the service processing information satisfies the exception processing information, the first application stops forwarding the pending service request to the second application and reopens the service request processing function of the first application.

10. The method according to claim 9, characterized in that If the service processing information satisfies the exception processing information, the first application stops forwarding the pending service request to the second application, and reopens the service request processing function of the first application, including: If the service processing information satisfies the exception processing information, the second application sends a rollback request to the first application; Based on the rollback request, the first application stops forwarding the pending service request to the second application and reopens the service request processing function of the first application.

11. The method according to claim 10, characterized in that The method according to claim 10, further comprising: If the first application successfully reopens the service request processing function of the first application and successfully stops forwarding the pending service request to the second application, the first application sends a successful rollback message to the second application and stops running the second application; If the first application fails to reopen the service request processing function of the first application and fails to terminate forwarding the pending service request to the second application, the first application sends a failure message to the second application and stops running the first application and the second application.

12. An application updating device, characterized in that: The device comprises: An application startup module, used to start a second application that updates the first application, wherein the second application has a corresponding target service port number; A service request receiving module, used to suspend the service request processing function of the first application and receive a to-be-processed service request through the first application; A service forwarding and processing module, configured to forward the pending service request to the second application program through the first application program based on the target service port number, and process the pending service request through the second application program; The application processing module is used to delete the first application after the first application is terminated, and directly receive the service request through the second application and process the service request.

13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

Citation Information

Cited By

  • Multi-service application program operation and maintenance management method and system based on low-voltage intelligent circuit breaker

    CN119938074A