Application function module closing method and device, equipment and medium

By intercepting forced shutdown commands, collecting runtime status information, and determining whether the shutdown type is dynamic or static, and then shutting down modules one by one, the problem of service interruption caused by forced shutdown is solved, and the accuracy and stability of shutting down application function modules are improved.

CN121785732APending Publication Date: 2026-04-03INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-22
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In existing technologies, forcibly shutting down application function modules may lead to service interruptions and functional failures, affecting the normal operation of related modules.

Method used

Intercept forced shutdown commands, collect the running status information of application function modules, determine the dynamic or static shutdown type based on the status information, obtain the corresponding processing content, perform shutdown processing one by one, and generate service shutdown commands.

Benefits of technology

This avoids sudden interruption of application functions caused by forced shutdown commands, and improves the accuracy and stability of closing application function modules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121785732A_ABST
    Figure CN121785732A_ABST
Patent Text Reader

Abstract

The invention discloses an application function module closing method and device, equipment and a medium. The method comprises the steps that when a forced closing instruction corresponding to an application function module is intercepted, running state information corresponding to the application function module is collected; determining a closing type corresponding to the application function module according to the running state information; when the closing type comprises a dynamic closing type, acquiring a to-be-executed command corresponding to the application function module, and taking the to-be-executed command as processing content corresponding to the closing type; when the closing type comprises a static closing type, obtaining static state information corresponding to the application function module, and taking the static state information as processing content corresponding to the closing type; performing closing processing on the processing content corresponding to the closing type to obtain a closing execution result; and when the closing execution result is execution completion, generating and executing a service closing command of the application function module. According to the embodiment of the invention, the closing accuracy of the application function module can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, device, and medium for closing application function modules. Background Technology

[0002] With the rapid development of technology, the types of application software are gradually increasing. To achieve the diversity of application software functions, the types of application function modules are also gradually increasing. When an application function module is not needed, it can be turned off to reduce the application software's space usage.

[0003] Currently, application function modules can be shut down by sending a forced shutdown command to the corresponding port.

[0004] However, shutting down application modules via a forced shutdown command may cause service interruption and functional failure. Summary of the Invention

[0005] This invention provides a method, apparatus, device, and medium for closing application function modules to improve the accuracy of closing application function modules.

[0006] In a first aspect, embodiments of the present invention provide a method for disabling application function modules, the method comprising:

[0007] When the forced shutdown command corresponding to the application function module is intercepted, the running status information of the application function module is collected.

[0008] Based on the running status information, determine the shutdown type corresponding to the application function module;

[0009] When the shutdown type includes dynamic shutdown, obtain the command to be executed corresponding to the application function module and use it as the processing content corresponding to the shutdown type;

[0010] When the shutdown type includes the static shutdown type, obtain the static status information corresponding to the application function module and use it as the processing content corresponding to the shutdown type;

[0011] Perform the closing process on the corresponding content of the closing type to obtain the closing execution result;

[0012] When the execution result is "execution complete", a service shutdown command for the application function module is generated and executed.

[0013] Secondly, embodiments of the present invention also provide an application function module shut-off device, the device comprising:

[0014] The information collection module is used to collect the running status information of the application function module when the forced shutdown command corresponding to the application function module is intercepted.

[0015] The type determination module is used to determine the shutdown type of the application function module based on the running status information;

[0016] The dynamic content determination module is used to obtain the command to be executed corresponding to the application function module when the closing type includes the dynamic closing type, and use it as the processing content corresponding to the closing type.

[0017] The static content determination module is used to obtain the static status information corresponding to the application function module when the closing type includes the static closing type, and use it as the processing content corresponding to the closing type.

[0018] The result determination module is used to close the processing content corresponding to the closure type and obtain the closure execution result;

[0019] The command execution module is used to generate and execute service shutdown commands for application function modules when the shutdown execution result is "execution complete".

[0020] Thirdly, embodiments of the present invention also provide an application function module for shutting down a device, the application function module for shutting down a device including:

[0021] At least one processor; and

[0022] A memory that is communicatively connected to at least one processor; wherein,

[0023] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to execute the application function module shutdown method of any embodiment of the present invention.

[0024] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions for causing a processor to execute an application function module shutdown method according to any embodiment of the present invention.

[0025] The technical solution of this invention, when intercepting a forced shutdown command corresponding to an application function module, collects the running status information of the application function module; determines the shutdown type of the application function module based on the running status information; when the shutdown type includes a dynamic shutdown type, obtains the command to be executed corresponding to the application function module and uses it as the processing content corresponding to the shutdown type; when the shutdown type includes a static shutdown type, obtains the static status information of the application function module and uses it as the processing content corresponding to the shutdown type; performs shutdown processing on the processing content corresponding to the shutdown type to obtain a shutdown execution result; when the shutdown execution result is complete, generates and executes a service shutdown command for the application function module. By intercepting forced shutdown commands and determining the processing content corresponding to dynamic and static shutdown types based on the running status information of the application function module, different operations are performed for different types of processing content, and the processing content is shut down one by one. This avoids the sudden interruption of application functions caused by forced shutdown commands, which affects the normal operation of related modules, refines the application function module shutdown steps, and improves the accuracy of application function module shutdown.

[0026] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 This is a flowchart of an application function module shutdown method provided in Embodiment 1 of the present invention;

[0029] Figure 2 This is a flowchart of an application function module shutdown method provided in Embodiment 2 of the present invention;

[0030] Figure 3 This is a structural diagram of an application function module shut-off device provided according to an embodiment of the present invention;

[0031] Figure 4 This is a structural diagram illustrating the application function module for shutting down a device provided in an embodiment of the present invention. Detailed Implementation

[0032] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0034] In the technical solutions of the embodiments of the present invention, the acquisition, storage, and application of forced shutdown commands, etc., all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0035] Example 1

[0036] Figure 1 This is a flowchart illustrating an application function module shutdown method according to Embodiment 1 of the present invention. This embodiment of the invention is applicable to situations where application function modules are shut down. The method can be executed by an application function module shutdown device, which can be implemented in hardware and / or software.

[0037] See Figure 1 The methods for disabling application function modules shown include:

[0038] S101. When the forced shutdown command corresponding to the application function module is intercepted, the running status information of the application function module is collected.

[0039] Interception can be the proactive capture of instructions that would otherwise be executed directly, preventing them from taking effect. An application function module can be an independent unit within an application that implements a specific function, such as an information query module. A forced shutdown command can be initiated by the system or the user, requiring the module to terminate immediately; for example, the kill-9 command. Running status information can be the real-time running data of the application function module.

[0040] Specifically, to block forced shutdown commands, a "listener" can be preset in the application to specifically monitor forced shutdown commands targeting the application's functional modules. When a forced shutdown command is detected, the forced shutdown command or its generated forced shutdown signal is captured, preventing the forced shutdown command from triggering the default forced termination logic and pausing the default execution steps of the forced shutdown command. A status collection program is started to collect the running status information of the application's functional modules. For example, it queries whether the module has any business tasks being processed, the length of the command queue to be executed, the progress of the currently executing tasks, and the system resources used by the module (such as whether it is using port 8080 to provide services, whether there are any unreleased database connections, or whether log file handles are open, etc.). The collected running status information is then aggregated into structured data according to a preset data template.

[0041] S102. Based on the running status information, determine the shutdown type corresponding to the application function module.

[0042] The shutdown type can be the type of resource to be shut down corresponding to the application function module.

[0043] Specifically, the rules for determining the type of shutdown are preset. For example, the rules are as follows: If the running status information contains "there are dynamic business tasks being processed" (such as incomplete query, payment, or message sending tasks, or a non-empty command queue), it indicates that the resources corresponding to the dynamic type of the application function module need to be shut down, and the shutdown type is dynamic shutdown. If the running status information shows "no dynamic business tasks being processed" and only contains "static resources," such as ports, database connection information, or file handles, extract key information such as "number of occupied ports, number of unreleased database connections, and number of open file handles." This indicates that the resources corresponding to the static type of the application function module need to be shut down, and the shutdown type is static shutdown. According to preset rules, the running status information is automatically judged. First, the dynamic dimension is checked: if "there is a task being processed" or "the length of the queue to be executed is greater than 0", it is directly determined to be a dynamic shutdown type; if the dynamic dimension is "no task", the static dimension is checked. If "there is occupied static resource", it is determined to be a static shutdown type; if the dynamic dimension is "no task" and the static dimension is "no occupied resource", it can be determined to be an "empty type", and the final shutdown command is directly executed without additional processing.

[0044] S103. When the shutdown type includes dynamic shutdown type, obtain the command to be executed corresponding to the application function module and use it as the processing content corresponding to the shutdown type.

[0045] The command to be executed can be the instruction to be executed corresponding to the business task of the application function module. The processing content corresponding to the closure type can be the object that needs to be processed when executing the dynamic closure process.

[0046] Specifically, during module runtime, all dynamic business commands to be executed or currently being executed are stored in a designated location in a fixed format. For example, this storage location could be the application module's "task queue cache" (temporary storage in memory), the business middleware, or the database's "unfinished task table." All incomplete and pending commands are read from this storage location. The extraction scope includes: commands that are currently executing but not yet completed (such as a payment command that is halfway through execution) and commands that have been queued but not yet started execution (such as commands in the pending query queue). The extracted content includes: complete command information (including command identifier, business type, associated data, execution progress, and priority, etc.). After extracting the command content, "command integrity" is verified (e.g., checking for missing commands or incomplete data) to avoid errors in subsequent processing. The pending commands corresponding to the application module are obtained and used as the processing content corresponding to the closing type.

[0047] S104. When the shutdown type includes the static shutdown type, obtain the static status information corresponding to the application function module and use it as the processing content corresponding to the shutdown type.

[0048] Among them, static status information can be data on the system basic resources currently occupied by the application function modules.

[0049] Specifically, the static status information corresponding to the application function modules is obtained. This static status information can include: the occupied port number, port type, port bound address, database connection pool identifier, number of unreleased connections, associated database, database identifier to be allocated, file path opened by file handle resources, file handle number, and file read / write status (read-only / writable). Different types of static resources have different storage or query paths for status information. For example, port information is queried from the operating system level or by calling the module's built-in port listening interface; database connection information is queried from the module's database connection pool configuration; and file handle information is queried from the operating system's process file descriptor directory or by reading the module's file operation log. All static status data is collected. The collected information can be verified against the actual usage (e.g., if port 8080 is collected, it needs to be confirmed that the module is indeed using that port in the operating system). If missing or incorrect information is found (e.g., the number of connections collected is inconsistent with the database side), the data is re-collected or the abnormal resource is marked (remotely handling verifiable resources). The verified static status information is then organized into structured data.

[0050] S105. Perform closing processing on the processing content corresponding to the closing type to obtain the closing execution result.

[0051] The closing execution result can be a status feedback information generated after the closing process corresponding to the closing type is completed.

[0052] Specifically, different closure types correspond to different processing content, and different closure processing operations are performed for different processing content to obtain the closure execution result for each closure type. For example, if the processing content corresponding to the closure type is a command to be executed, and there is at least one command to be executed, the urgency of each command to be executed is ranked based on its associated business importance (e.g., member orders > ordinary orders), execution progress (e.g., 80% progress > 10% progress), or expected execution time, generating a command execution sequence. Starting from the head of the command execution sequence, commands are executed one by one until the end execution condition is met, thus completing the closure processing of the commands to be executed. The command execution status is then summarized to generate the closure execution result. If the processing content corresponding to the closure type is static state information, the processing task is broken down into subtasks such as port processing or database connection processing. For the port subtask, the port used for data transmission is obtained, connected ports are disconnected, and external listening ports are closed. The port closure execution status is summarized to generate the closure execution result. For the database subtask, the connection pool closure interface is called to release active connections one by one. The database closure execution status is summarized to generate the closure execution result. If all resources are successfully released, the execution is considered complete; if any core resource fails to be released, the execution is considered incomplete and an alarm is triggered. If the closure type is empty (no processing content), a "execution complete" closure result is generated directly without any additional operations.

[0053] S106. When the execution result is "execution complete", generate and execute the service shutdown command for the application function module.

[0054] Among them, the service shutdown command can be a standardized instruction to actively terminate the application function module process or service, rather than a forced shutdown instruction.

[0055] Specifically, if the shutdown type is dynamic, it can verify whether the completion status of all processed business commands is equal to the preset status data; if the shutdown type is static, it can check whether the database connection pool calls the shutdown function and whether the port calls the shutdown function. When the shutdown execution result is completion, that is, when all core resources are shut down normally, the service shutdown command of the application function module is generated and executed. For example, the service shutdown command can be System.exit(0), which can shut down non-core resources, such as file descriptors, network sockets, or release heap memory / stack memory, etc.; it returns an exit status code 0 to the operating system, indicating "process exited normally", and the operating system reclaims the resources (memory or CPU, etc.) occupied by the process.

[0056] The technical solution of this invention, when intercepting a forced shutdown command corresponding to an application function module, collects the running status information of the application function module; determines the shutdown type of the application function module based on the running status information; when the shutdown type includes a dynamic shutdown type, obtains the command to be executed corresponding to the application function module and uses it as the processing content corresponding to the shutdown type; when the shutdown type includes a static shutdown type, obtains the static status information of the application function module and uses it as the processing content corresponding to the shutdown type; performs shutdown processing on the processing content corresponding to the shutdown type to obtain a shutdown execution result; when the shutdown execution result is complete, generates and executes a service shutdown command for the application function module. By intercepting forced shutdown commands and determining the processing content corresponding to dynamic and static shutdown types based on the running status information of the application function module, different operations are performed for different types of processing content, and the processing content is shut down one by one. This avoids the sudden interruption of application functions caused by forced shutdown commands, which affects the normal operation of related modules, refines the application function module shutdown steps, and improves the accuracy of application function module shutdown.

[0057] Example 2

[0058] Figure 2 This is a flowchart illustrating a method for closing an application function module according to Embodiment 2 of the present invention. Based on the above embodiments, this embodiment optimizes and improves the application function module closing operation.

[0059] Furthermore, the process of "obtaining the command to be executed corresponding to the application function module and using it as the processing content corresponding to the shutdown type" is refined to "obtaining the command sequence corresponding to the application function module, the command sequence including at least one command to be executed; for each command to be executed, determining the command weight corresponding to the command to be executed based on the command to be executed function information; sorting the command weights corresponding to each command to be executed to obtain the update sequence; and determining the update sequence as the processing content corresponding to the shutdown type", in order to improve the operation of shutting down the application function module.

[0060] It should be noted that for parts not described in detail in the embodiments of the present invention, please refer to the descriptions in other embodiments.

[0061] See Figure 2 The methods for disabling application function modules shown include:

[0062] S201. When the forced shutdown command corresponding to the application function module is intercepted, the running status information of the application function module is collected.

[0063] S202. Based on the running status information, determine the shutdown type corresponding to the application function module.

[0064] S203. Obtain the command sequence corresponding to the application function module. The command sequence includes at least one command to be executed.

[0065] Specifically, the command extraction scope is first defined to ensure that only commands to be executed from application functional modules are retrieved, covering all core business instructions. The extraction scope includes: commands that are currently being executed but not yet completed, and commands that have been queued but not yet started execution; the exclusion scope includes: historical commands that have been completed or commands marked as "obsolete / invalid". The command sequence corresponding to the application functional modules is extracted according to the extraction and exclusion rules. The final number of extracted commands can be greater than or equal to 1. If the initially extracted commands are empty, an alarm should be triggered, and it should be checked whether the command extraction location is missing. If a location is missing, it indicates that there is a command storage location where commands have not been extracted; in this case, commands stored at that location are extracted. If no location is missing, it indicates that there is no command storage location where commands have not been extracted; in this case, a prompt message is generated and sent to the user.

[0066] S204. For each command to be executed, determine the command weight corresponding to the command to be executed based on the command to be executed function information.

[0067] The pending function information can be a set of business function attributes and execution status attributes corresponding to the pending command, which serves as the basis for calculating the weight. The command weight can be a quantitative indicator that measures the priority of the pending command. Commands with higher weights are executed earlier in the closing processing phase and are given higher priority in ensuring completion.

[0068] Specifically, the "function information to be executed" for each command to be executed is first broken down into quantifiable scoring dimensions. The core dimensions are as follows: Business type: The higher the core level of the business function corresponding to the command, the greater the weight (core business of the module > ordinary business > non-core business). Execution progress: The current execution stage of the command (the higher the execution progress, the closer to completion, and the higher the priority). Urgency: The business timeout risk of the command (the greater the loss after timeout, the higher the urgency). Importance of associated data: The value of the data associated with the command (involving funds / core data > ordinary data > no key data). The command weight calculation formula is: Command weight = Business type weight + Execution progress weight + Urgency weight + Importance of associated data weight + Custom dimension weight (optional). If information in a certain dimension is missing, that dimension is scored as 0, which does not affect the overall formula execution. Each command to be executed in the command sequence is traversed, its function information to be executed is extracted, the scores of each dimension are matched, and the scores of each dimension are substituted into the calculation formula to obtain the weight value of the command.

[0069] S205. Sort the command weights corresponding to each command to be executed to obtain the update sequence.

[0070] The update sequence can be a new command sequence generated by sorting each command to be executed according to its command weight.

[0071] Specifically, the primary sorting direction is descending order of command weight (the higher the weight value, the higher the sorting position). If multiple commands have the same weight value (e.g., two commands both score 90), the following rules must be used to supplement the sorting: Second key: command execution progress (the higher the execution progress, the higher the sorting position, e.g., execution progress 80% > 30%); Third key: command reception time (the most recently received command is sorted higher; if the weight, execution progress, and reception time are all the same, they are sorted in ascending order by command alphabetical / numerical order). Based on preset rules, the set of commands to be executed with calculated weights is sorted, arranging the commands from highest to lowest weight value. The sorting result is organized into a structured "update sequence," replacing the original command sequence, as the basis for subsequent closure processing.

[0072] S206. Determine the update sequence as the processing content corresponding to the closing type.

[0073] Specifically, the mapping relationship is written into the system configuration: the processing content of the dynamic shutdown type is the update sequence, ensuring that all process nodes can recognize this association. A unique tag "Dynamic Shutdown Processing Content" is added to the update sequence to avoid confusion with the processing content of the static shutdown type; version marking is applied to the update sequence, and modification is prohibited after locking the content. If adjustments are needed, the commands to be executed in the update sequence must be reordered. A unique association is established between the update sequence and the "Dynamic Shutdown Type," clearly stating that "the dynamic shutdown processing content of this module is this update sequence."

[0074] S207. When the shutdown type includes the static shutdown type, obtain the static status information corresponding to the application function module and use it as the processing content corresponding to the shutdown type.

[0075] S208. Perform closing processing on the processing content corresponding to the closing type to obtain the closing execution result.

[0076] S209. When the execution result is "execution complete", generate and execute the service shutdown command for the application function module.

[0077] This invention provides an embodiment of the invention that obtains a command sequence corresponding to an application function module, the command sequence including at least one command to be executed; for each command to be executed, the command weight corresponding to the command to be executed is determined according to the function information to be executed corresponding to the command to be executed; the command weights corresponding to each command to be executed are sorted to obtain an update sequence; the update sequence is determined as the processing content corresponding to the shutdown type; the processing priority of each command to be executed is sorted according to the function information to be executed corresponding to each command to be executed; and each command to be executed is executed according to the processing priority, ensuring the integrity of the core command execution and improving the accuracy of the shutdown function.

[0078] Optionally, based on the information of the functions to be executed corresponding to the command to be executed, the command weight corresponding to the command to be executed is determined, including: based on the information of the functions to be executed corresponding to the command to be executed, determining the associated module and the expected execution time of the command to be executed; based on the associated module, querying to obtain the first weight corresponding to the associated module; based on the expected execution time, determining the second weight corresponding to the associated module; and based on the first weight and the second weight, calculating the command weight corresponding to the command to be executed.

[0079] In this context, the associated module can be a business module that depends on the command to be executed, and the execution result of the command affects whether the associated module can function normally. The expected execution time can be the latest time the command needs to be completed, reflecting the urgency of the command. The first weight can be a basic weight value determined by the business priority of the associated module. The second weight can be a weight value determined by the urgency of the expected execution time.

[0080] Specifically, firstly, the two key dimensions of "related modules" and "expected execution time" are precisely extracted from the functional information of each command to be executed. Based on the functional information of the command to be executed, the related modules affected by the command are determined. If the command is related to multiple modules, the module with the highest priority is used as the basis for calculating the first weight. The expected execution time is extracted by parsing the command's "latest completion time" from the functional information. If there is no expected execution time in the functional information, it is treated as "no urgent requirement" by default (second weight is 0). The first weight is determined based on the preset mapping relationship between related modules and weights. The second weight is determined based on the preset mapping relationship between expected execution time and weights. The command weight is the sum of the first weight and the second weight. According to a preset formula, the first weight and the second weight are combined to obtain the final weight of each command to be executed.

[0081] By determining the associated modules and expected execution time of the command to be executed based on the information of the functions to be executed, the first weight of the associated module is obtained based on the associated module; the second weight of the associated module is determined based on the expected execution time; and the command weight of the command to be executed is calculated based on the first and second weights. By determining the command weight through multi-dimensional data, the accuracy of command weight determination is improved.

[0082] Optionally, when the processing content is an update sequence, the processing content corresponding to the closure type is closed to obtain the closure execution result, including: filtering the currently executed command in the update sequence and executing it to determine the command execution time; comparing the command execution time with a time threshold to determine the threshold comparison result; when the threshold comparison result is that the command execution time is greater than or equal to the time threshold, clearing the update sequence; when the threshold comparison result is that the command execution time is less than the time threshold, reselecting the command to be executed in the update sequence and executing it to obtain the update time, and updating the command execution time using the update time.

[0083] Here, the currently executing command can be the command to be executed at the current time in the update sequence; no other commands are processed until the current command is completed. The command execution time can be the cumulative execution time of the command. The time threshold can be a preset maximum allowed execution time for the command. The threshold comparison result can be a comparison between the command execution time and the time threshold. The update time can be the execution time of the command, which needs to be added to the command execution time.

[0084] Specifically, the first command from the head of the update sequence is selected as the "current execution command" (the command with the highest weight), and this command is locked as the sole execution target. The business execution logic corresponding to the command is invoked, and switching or interruption is prohibited during execution. A timer is started when the command execution begins and stops when execution is completed, and the "command execution time" is recorded. A time threshold is obtained, and the command execution time is compared with the time threshold to determine the comparison result. If the execution time is greater than or equal to the threshold, it indicates that the command execution time has timed out; if the execution time is less than the threshold, it indicates that it has not timed out. If the time has expired, the remaining commands to be executed in the update sequence are no longer executed, and the update sequence is directly cleared. If the time has not expired, a command is reselected from the update sequence and executed, and the currently executing command is deleted from the update sequence. After the command is executed, the update time is recorded. The "update time" is added to the original "command execution time" to form a new cumulative execution time: new command execution time = original execution time + update time. The timeout judgment process is executed repeatedly until the timeout condition is triggered.

[0085] The system determines the command execution time by filtering and executing currently executing commands in the update sequence; it then compares the command execution time with a time threshold to determine the threshold comparison result; when the threshold comparison result indicates that the command execution time is greater than or equal to the time threshold, the update sequence is cleared; when the threshold comparison result indicates that the command execution time is less than the time threshold, the system reselects and executes the command to be executed in the update sequence to obtain the update time, and updates the command execution time accordingly. A timeout reminder is added to the update sequence, allowing the highest priority command to be executed first within a preset time range, thus improving the accuracy of the shutdown operation.

[0086] Optionally, the static status information corresponding to the application function module is obtained and used as the processing content corresponding to the shutdown type, including: when the static shutdown type is a port type, the service port corresponding to the application function module is obtained, and the service port is determined as the processing content corresponding to the shutdown type. The service port includes connected ports and external ports; when the static shutdown type is a database type, the database connection information corresponding to the application function module is obtained, and the data pool identifier and the database to be allocated identifier are determined based on the database connection information and used as the processing content corresponding to the shutdown type.

[0087] Specifically, when the static closure type is a port type, the port types to be acquired are defined. For example, external ports, i.e., message request ports, can be added by application function modules. Related modules can send message acquisition requests to application function modules through the newly added connection ports to obtain the corresponding data from the application function modules. Connected ports, i.e., message listening ports, are ports in the application function modules that already have connection relationships with other modules. Application function modules can listen to data from other modules through these connection ports. The service port corresponding to the application function module is acquired and used as the processing content corresponding to the closure type. When the static closure type is a database type, the database connection information corresponding to the application function module is acquired. The data pool identifier and the identifier of the database to be allocated for the database connection corresponding to the application function module are searched within the database connection information, and these identifiers are used as the processing content corresponding to the closure type.

[0088] When the static shutdown type is port-based, the service port corresponding to the application function module is obtained, and the service port is determined as the processing content corresponding to the shutdown type. The service port includes connected ports and external ports. When the static shutdown type is database-based, the database connection information corresponding to the application function module is obtained. Based on the database connection information, the data pool identifier and the identifier of the database to be allocated are determined and used as the processing content corresponding to the shutdown type. By determining the processing content through multi-dimensional data, the types of resources to be shut down are refined, and the comprehensiveness of the shutdown operation is improved.

[0089] Optionally, when the processing content is a connected port and an external port, the processing content corresponding to the closure type is closed to obtain a closure execution result, including: generating a port disconnect command based on the connected port and sending it to the connected port to obtain a first closure result; generating a closure prompt message based on the external port and sending it to the external port to obtain a second closure result; and determining the closure result of the parameter item based on the first closure result and the second closure result.

[0090] Specifically, based on the connected port, a port disconnect command is generated and sent to the connected port to change the data transmission status of the connected port from transmittable to non-transmittable. This prevents the application module from transmitting data through the connected port to the corresponding module, resulting in a first closure result. Based on the external port, a closure prompt message is generated and sent to the external port to prevent the module corresponding to the external port from sending message requests to the application module through that port, resulting in a second closure result. If both the first and second closure results are successful (meaning the message transmission status of both the external port and the connected port is non-transmittable), the parameter item closure result is determined to be successful. If either the first or second closure result is unsuccessful (meaning the message transmission status of both the external port and the connected port is transmittable), the parameter item closure result is determined to be unsuccessful.

[0091] By generating a port disconnect command based on the connected port and sending it to the connected port, a first shutdown result is obtained; by generating a shutdown prompt message based on the external port and sending it to the external port, a second shutdown result is obtained; based on the first shutdown result and the second shutdown result, the shutdown result of the parameter item is determined. The shutdown processing of static shutdown type resources can be realized through multi-dimensional data, which improves the accuracy of static shutdown data shutdown operation.

[0092] Optionally, when the processing content is a data pool identifier and a database identifier to be allocated, the processing content corresponding to the closing type is closed to obtain a closing execution result, including: obtaining the data table identifier corresponding to the application function module; filtering the data table identifier in the data pool corresponding to the data pool identifier according to the data pool identifier, deleting the data table identifier to obtain a first deletion result; deleting the data table identifier in the database to be allocated corresponding to the database identifier of the associated business module to obtain a second deletion result; and determining the closing execution result based on the first deletion result and the second deletion result.

[0093] Specifically, the process involves: obtaining the data table identifier corresponding to the application function module; filtering the data table identifiers in the data pool corresponding to the data pool identifier based on the data pool identifier, deleting the data table identifiers, disconnecting the connection between the data table and the data pool, and canceling the association configuration between the data table and the data pool, resulting in the first deletion result; deleting the data table identifiers in the database to be allocated corresponding to the database identifiers of the associated business modules, so that the associated business modules no longer allocate storage data for the data tables corresponding to the data table identifiers, resulting in the second deletion result; retrying the deletion twice (with a 5-second interval) for the table identifiers that failed to be deleted, to avoid failures caused by temporary network or lock issues; if both the first and second deletion results are successful, the closure execution result is determined to be successful; if either the first or second deletion result is a deletion failure, the closure execution result is determined to be a failure.

[0094] The process involves obtaining the data table identifiers corresponding to the application function modules; filtering the data table identifiers in the data pool corresponding to the data pool identifier based on the data pool identifier, and deleting the data table identifiers to obtain the first deletion result; deleting the data table identifiers in the database to be allocated corresponding to the associated business modules to obtain the second deletion result; and determining the closure execution result based on the first and second deletion results. By performing data table deletion operations on databases corresponding to different identifiers, the connection relationship deletion operation is refined, improving the accuracy of the closure process.

[0095] Example 3

[0096] Figure 3 This is a schematic diagram of an application function module shutdown device provided in Embodiment 3 of the present invention. This embodiment of the present invention is applicable to situations where application function modules are shut down. This device can execute an application function module shutdown method and can be implemented in hardware and / or software.

[0097] See Figure 3 The application function module shutdown device shown includes: an information acquisition module 301, an information acquisition module 302, a dynamic content determination module 303, a static content determination module 304, a result determination module 305, and a command execution module 306, wherein...

[0098] The information collection module 301 is used to collect the running status information of the application function module when the forced shutdown command corresponding to the application function module is intercepted.

[0099] The type determination module 302 is used to determine the shutdown type corresponding to the application function module based on the running status information;

[0100] The dynamic content determination module 303 is used to obtain the command to be executed corresponding to the application function module when the closing type includes the dynamic closing type, and use it as the processing content corresponding to the closing type;

[0101] The static content determination module 304 is used to obtain the static status information corresponding to the application function module when the closing type includes the static closing type, and use it as the processing content corresponding to the closing type.

[0102] The result determination module 305 is used to close the processing content corresponding to the closure type and obtain the closure execution result;

[0103] Command execution module 306 is used to generate and execute service shutdown commands for application function modules when the shutdown execution result is "execution complete".

[0104] The technical solution of this invention, when intercepting a forced shutdown command corresponding to an application function module, collects the running status information of the application function module; determines the shutdown type of the application function module based on the running status information; when the shutdown type includes a dynamic shutdown type, obtains the command to be executed corresponding to the application function module and uses it as the processing content corresponding to the shutdown type; when the shutdown type includes a static shutdown type, obtains the static status information of the application function module and uses it as the processing content corresponding to the shutdown type; performs shutdown processing on the processing content corresponding to the shutdown type to obtain a shutdown execution result; when the shutdown execution result is complete, generates and executes a service shutdown command for the application function module. By intercepting forced shutdown commands and determining the processing content corresponding to dynamic and static shutdown types based on the running status information of the application function module, different operations are performed for different types of processing content, and the processing content is shut down one by one. This avoids the sudden interruption of application functions caused by forced shutdown commands, which affects the normal operation of related modules, refines the application function module shutdown steps, and improves the accuracy of application function module shutdown.

[0105] Optionally, the dynamic content determination module 303 includes:

[0106] The command acquisition unit is used to acquire the command sequence corresponding to the application function module. The command sequence includes at least one command to be executed.

[0107] The weight determination unit is used to determine the command weight corresponding to each command to be executed based on the execution function information corresponding to the command to be executed.

[0108] The weight sorting unit is used to sort the command weights corresponding to each command to be executed to obtain the update sequence;

[0109] The processing content determination unit is used to determine the update sequence as the processing content corresponding to the closing type.

[0110] Optional, weight determination unit, specifically used for:

[0111] Based on the information of the functions to be executed corresponding to the command to be executed, determine the associated module and the expected execution time of the command to be executed;

[0112] Based on the associated modules, the first weight corresponding to the associated modules is obtained by querying.

[0113] Determine the second weight corresponding to the associated module based on the expected execution time;

[0114] The command weight corresponding to the command to be executed is calculated based on the first weight and the second weight.

[0115] Optionally, the result determination module 305 is specifically used for:

[0116] Filter the currently executing commands in the update sequence and execute them to determine the command execution time;

[0117] Compare the command execution time with a time threshold to determine the threshold comparison result;

[0118] When the threshold comparison result indicates that the command execution time is greater than or equal to the time threshold, the update sequence is cleared.

[0119] When the threshold comparison result shows that the command execution time is less than the time threshold, the command to be executed is reselected from the update sequence and executed to obtain the update time. The command execution time is then updated using the update time.

[0120] Optionally, the static content determination module 304 includes:

[0121] The port acquisition unit is used to acquire the service port corresponding to the application function module when the static shutdown type is port type, and determine the service port as the processing content corresponding to the shutdown type. The service port includes connected ports and external ports.

[0122] The database acquisition unit is used to acquire the database connection information corresponding to the application function module when the static closure type is database type, and determine the data pool identifier and the database to be allocated identifier based on the database connection information, and use them as the processing content corresponding to the closure type.

[0123] Optional, port acquisition unit, specifically used for:

[0124] Based on the connected port, generate a port disconnect command and send it to the connected port to obtain the first shutdown result;

[0125] Based on the external port, generate a shutdown prompt message, send it to the external port, and obtain the second shutdown result;

[0126] Based on the first and second closing results, determine the closing result of the parameter item.

[0127] Optional, database retrieval unit, specifically used for:

[0128] Obtain the data table identifier corresponding to the application function module;

[0129] Based on the data pool identifier, filter the data table identifier in the data pool corresponding to the data pool identifier, delete the data table identifier, and obtain the first deletion result;

[0130] Delete the data table identifier in the database to be allocated corresponding to the database identifier of the associated business module to obtain the second deletion result;

[0131] Based on the first deletion result and the second deletion result, determine the result of closing the execution.

[0132] The application function module closing device provided in this embodiment of the invention can execute the application function module closing method provided in any embodiment of the invention, and has the corresponding function modules and beneficial effects of executing the application function module closing method.

[0133] Example 4

[0134] Figure 4 A schematic diagram of the structure of the application function module shutting down device 400, which can be used to implement an embodiment of the present invention, is shown.

[0135] like Figure 4 As shown, the application function module shutdown device 400 includes at least one processor 401 and a memory, such as a read-only memory (ROM) 402 and a random access memory (RAM) 403, communicatively connected to the at least one processor 401. The memory stores computer programs executable by the at least one processor. The processor 401 can perform various appropriate actions and processes based on the computer program stored in the ROM 402 or loaded from storage unit 408 into the RAM 403. The RAM 403 may also store various programs and data required for the operation of the application function module shutdown device 400. The processor 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0136] The application function module shutdown device 400 connects to multiple components of the I / O interface 405, including: an input unit 406, such as a keyboard or mouse; an output unit 407, such as various types of displays or speakers; a storage unit 408, such as a disk or optical disk; and a communication unit 409, such as a network card, modem, or wireless transceiver. The communication unit 409 allows the application function module shutdown device 400 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0137] Processor 401 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 401 performs the various methods and processes described above, such as the application function module shutdown method.

[0138] In some embodiments, the application function module shutdown method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed onto the application function module shutdown device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by processor 401, one or more steps of the application function module shutdown method described above may be performed. Alternatively, in other embodiments, processor 401 may be configured to perform the application function module shutdown method by any other suitable means (e.g., by means of firmware).

[0139] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0140] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0141] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0142] To provide user interaction, the systems and techniques described herein can be implemented on an application function module shutdown device, which includes: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the application function module shutdown device. Other types of devices can also be used to provide user interaction; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0143] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0144] A computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system. It addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server) services, such as high management difficulty and weak business scalability.

[0145] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0146] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for closing an application function module, characterized in that, The method includes: When the forced shutdown command corresponding to the application function module is intercepted, the running status information of the application function module is collected. Based on the running status information, determine the shutdown type corresponding to the application function module; When the shutdown type includes the dynamic shutdown type, the command to be executed corresponding to the application function module is obtained and used as the processing content corresponding to the shutdown type; When the shutdown type includes a static shutdown type, the static status information corresponding to the application function module is obtained and used as the processing content corresponding to the shutdown type; The processing content corresponding to the closed type is closed to obtain the closed execution result; When the shutdown execution result is "execution complete", a service shutdown command for the application function module is generated and executed.

2. The method according to claim 1, characterized in that, When the shutdown type includes a dynamic shutdown type, obtaining the command to be executed corresponding to the application function module and using it as the processing content corresponding to the shutdown type includes: Obtain the command sequence corresponding to the application function module, wherein the command sequence includes at least one command to be executed; For each of the commands to be executed, the command weight corresponding to the command to be executed is determined based on the function information to be executed corresponding to the command to be executed; The command weights corresponding to each of the commands to be executed are sorted to obtain the update sequence; The update sequence is determined as the processing content corresponding to the shutdown type.

3. The method according to claim 2, characterized in that, The step of determining the command weight corresponding to the command to be executed based on the function information to be executed includes: Based on the pending function information corresponding to the pending command, determine the associated module and expected execution time of the pending command; Based on the associated module, the first weight corresponding to the associated module is obtained by querying; Based on the expected execution time, determine the second weight corresponding to the associated module; The command weight corresponding to the command to be executed is calculated based on the first weight and the second weight.

4. The method according to claim 2, characterized in that, When the processing content is an update sequence, the closing process is performed on the processing content corresponding to the closing type to obtain the closing execution result, including: Filter the currently executing commands from the update sequence and execute them to determine the command execution time; The command execution time is compared with a time threshold to determine the threshold comparison result; When the threshold comparison result indicates that the command execution time is greater than or equal to the time threshold, the update sequence is cleared; When the threshold comparison result indicates that the command execution time is less than the time threshold, a new command to be executed is selected from the update sequence and executed to obtain the update time, and the command execution time is updated using the update time.

5. The method according to claim 1, characterized in that, The step of obtaining the static state information corresponding to the application function module and using it as the processing content corresponding to the shutdown type includes: When the static shutdown type is a port type, the service port corresponding to the application function module is obtained, and the service port is determined as the processing content corresponding to the shutdown type. The service port includes connected ports and external ports. When the static shutdown type is a database type, obtain the database connection information corresponding to the application function module, and determine the data pool identifier and the database to be allocated identifier based on the database connection information, and use them as the processing content corresponding to the shutdown type.

6. The method according to claim 5, characterized in that, When the processing content involves connected ports and external ports, the closing process is performed on the processing content corresponding to the closing type to obtain the closing execution result, including: Based on the connected port, a port disconnect command is generated and sent to the connected port to obtain the first shutdown result; Based on the external port, a shutdown prompt message is generated and sent to the external port to obtain a second shutdown result; Based on the first closing result and the second closing result, determine the closing result of the parameter item.

7. The method according to claim 5, characterized in that, When the processing content is a data pool identifier and a library identifier to be allocated, the closing processing is performed on the processing content corresponding to the closing type to obtain the closing execution result, including: Obtain the data table identifier corresponding to the application function module; Based on the data pool identifier, filter the data table identifier in the data pool corresponding to the data pool identifier, delete the data table identifier, and obtain the first deletion result; Delete the data table identifier in the database to be allocated corresponding to the database identifier of the associated business module to obtain the second deletion result; Based on the first deletion result and the second deletion result, the shutdown execution result is determined.

8. An application function module shut-off device, characterized in that, The device includes: The information collection module is used to collect the running status information of the application function module when the forced shutdown command corresponding to the intercepted application function module is blocked. The type determination module is used to determine the shutdown type corresponding to the application function module based on the running status information. The dynamic content determination module is used to obtain the command to be executed corresponding to the application function module when the closing type includes the dynamic closing type, and use it as the processing content corresponding to the closing type; The static content determination module is used to obtain the static status information corresponding to the application function module when the closing type includes the static closing type, and use it as the processing content corresponding to the closing type; The result determination module is used to close the processing content corresponding to the closing type and obtain the closing execution result; The command execution module is used to generate and execute the service shutdown command of the application function module when the shutdown execution result is completion.

9. An application function module for shutting down a device, characterized in that, The application function module for shutting down the device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the application function module shutdown method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the application function module shutdown method according to any one of claims 1-7.