Method and apparatus for capturing application memory parameters
Patent Information
- Application Number
- CN202310840601.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-10
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-07-10
AI Technical Summary
但应用在实际的验收测试过程中,应用后台参数每天快速交付,而且参数散落在CMC配置中心、PaaS参数模板和数据库表各个位置,验收测试人员对于应用后台参数变化无法有效识别,而应用后台参数对交易存在深刻影响,很容易触发生产问题;交易开关、地区参数、白名单参数等参数因为直接影响交易逻辑,为覆盖大量组合场景,不同测试人员会根据自身需求频繁提变更修改CMC配置中心参数、PaaS分级参数、入库参数,由于生效依赖应用重启初始化刷新应用内存值,而为避免频繁影响测试不会立即重启,如果参数已修改为新值但尚未重启初始化,则内存中参数的实际值仍为原值,测试人员查看后会造成误解以为覆盖了目标场景,而实际并不一致
[0015]本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述应用内存参数的抓取方法。
Smart Images

Figure CN117435793B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent operation and maintenance, and in particular to a method and apparatus for capturing application memory parameters. Background Technology
[0002] This section is intended to provide background or context for the embodiments of the invention set forth in the claims. The description herein is not an admission that it is prior art simply because it is included in this section.
[0003] With the rapid development of internet finance, the types of business supported by bank channel products have gradually diversified. Application systems are undergoing rapid iterations and introducing a large number of application backend parameters to control business processes, scope of application, and transaction support. At the same time, diverse management modes, including CMC configuration center parameters, PaaS hierarchical parameters, and database entry parameters, have been introduced to further broaden and meet the operational needs of application parameters. However, in actual acceptance testing, application backend parameters are delivered rapidly every day, and these parameters are scattered across various locations in the CMC configuration center, PaaS parameter templates, and database tables. Acceptance testers cannot effectively identify changes in application backend parameters, which have a profound impact on transactions and can easily trigger production issues. Parameters such as transaction switches, region parameters, and whitelist parameters directly affect transaction logic. To cover a large number of combined scenarios, different testers frequently propose changes to CMC configuration center parameters, PaaS hierarchical parameters, and database entry parameters according to their own needs. Since the changes take effect based on the application restarting and initializing to refresh the application memory values, and to avoid frequent impacts on testing, the application is not restarted immediately. If a parameter has been modified to a new value but has not yet been restarted and initialized, the actual value of the parameter in memory will still be the original value. Testers may mistakenly believe that the target scenario has been covered when in fact it is not. Summary of the Invention
[0004] This invention provides a method for capturing application memory parameters, which visualizes changes in parameter values to avoid risks arising from the inability to identify parameter value changes. The method includes:
[0005] Identify the parameter name and parameter description value of the application's background parameters;
[0006] Parse the application initialization code, and based on the parameter name and parameter description value of the application background parameters and the parsed application initialization code, initialize the application background parameters to the class, method and memory variable name on which the memory value depends;
[0007] Build a memory value fetching page based on the class, method, and memory variable name that the memory value depends on;
[0008] The constructed memory value capture page is deployed to the context root path. In the deployed context root path, the memory value capture page is run using the permissions of the classes and methods that the memory value depends on. The changes in parameter names and parameter descriptions are identified based on the memory value capture page, and the changes in parameter names and parameter descriptions are visualized.
[0009] This invention also provides a device for capturing application memory parameters, used to visualize changes in parameter values, avoiding risks arising from the inability to identify changes in parameter values. The device includes:
[0010] The parameter name and parameter description value recognition module is used to identify the parameter name and parameter description value of the application background parameters;
[0011] The application background parameter initialization module is used to parse the application initialization code. Based on the parameter name and parameter description value of the application background parameter and the parsed application initialization code, it initializes the application background parameter to the class, method and memory variable name that the memory value depends on.
[0012] The memory value grabbing page building module is used to build a memory value grabbing page based on the class, method and memory variable name that the memory value depends on;
[0013] The module for displaying changes in parameter names and descriptions is used to deploy the constructed memory value capture page to the context root path. In the deployed context root path, the memory value capture page is run using the permissions of the classes and methods that the memory value depends on. The module identifies changes in parameter names and descriptions based on the memory value capture page and visualizes these changes.
[0014] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the above-described method for capturing application memory parameters.
[0015] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for capturing application memory parameters.
[0016] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described method for capturing application memory parameters.
[0017] In this embodiment of the invention, the parameter names and descriptions of the application background parameters are identified; the application initialization code is parsed, and based on the parameter names and descriptions of the application background parameters and the parsed application initialization code, the application background parameters are initialized to the class, method, and memory variable names that the memory values depend on; a memory value fetching page is constructed based on the class, method, and memory variable names that the memory values depend on; the constructed memory value fetching page is deployed to the context root path, and in the deployed context root path, the memory value fetching page is run using the permissions of the class and method that the memory values depend on. The changes in the parameter names and descriptions are identified based on the memory value fetching page, and the changes in the parameter names and descriptions are visualized, thereby avoiding the risks caused by the inability to identify changes in parameter values. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the 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. In the drawings:
[0019] Figure 1 This is a flowchart of the method for capturing memory parameters in an embodiment of the present invention;
[0020] Figure 2 This is a schematic diagram illustrating how the parameter key names and remarks descriptions of the CMC configuration center are used as parameter names and parameter description values in an embodiment of the present invention.
[0021] Figure 3 This is a schematic diagram illustrating the parameter variable names and variable descriptions of hierarchical parameters in the PaaS platform as parameter names and parameter description values in an embodiment of the present invention.
[0022] Figure 4 This is a schematic diagram illustrating how the parameter names and parameter descriptions in the database parameter table are used as parameter names and parameter description values in an embodiment of the present invention.
[0023] Figure 5 This is a schematic diagram of the page crawling deployment in an embodiment of the present invention;
[0024] Figure 6 This is a schematic diagram of a memory parameter capture device used in an embodiment of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0026] Figure 1 This is a flowchart of a method for capturing memory parameters in an embodiment of the present invention. The method includes:
[0027] Step 101: Identify the parameter name and parameter description value of the application background parameters;
[0028] Step 102: Parse the application initialization code. Based on the parameter name and parameter description value of the application background parameters and the parsed application initialization code, initialize the application background parameters to the class, method and memory variable name on which the memory value depends.
[0029] Step 103: Construct a memory value fetching page based on the class, method, and memory variable name that the memory value depends on;
[0030] Step 104: Deploy the constructed memory value capture page to the context root path. In the deployed context root path, run the memory value capture page using the permissions of the classes and methods that the memory value depends on. Based on the memory value capture page, identify the changes in parameter names and parameter description values, and visualize the changes in parameter names and parameter description values.
[0031] The following section provides a detailed explanation of each step.
[0032] In step 101, the parameter name and parameter description value of the application background parameters are identified.
[0033] In one embodiment, the parameter name and parameter description value of the application background parameter are identified, including one or any combination of the following:
[0034] like Figure 2 As shown, the parameter key name (Key) and the remark description information in the CMC configuration center are respectively determined as the parameter name and parameter description value of the application backend parameter;
[0035] like Figure 3 As shown, the parameter variable names and variable descriptions of the hierarchical parameters in the PaaS platform are respectively determined as the parameter names and parameter descriptions of the application backend parameters;
[0036] like Figure 4 As shown, the parameter name and parameter description information in the database parameter table are respectively determined as the parameter name and parameter description values of the application backend parameters. The database parameter table is provided by the application backend.
[0037] In step 102, the application initialization code is parsed. Based on the parameter name and parameter description value of the application background parameters and the parsed application initialization code, the application background parameters are initialized to the class, method and memory variable name on which the memory value depends.
[0038] In one embodiment, based on the parameter name and parameter description value of the application background parameter and the parsed application initialization code, the application background parameter is initialized to the class, method, and memory variable name on which the memory value depends, including:
[0039] Retrieve all classes imported by the application's backend;
[0040] Initialize the application backend parameters according to the methods corresponding to all classes.
[0041] In step 103, a memory value fetching page is constructed based on the class, method, and memory variable name that the memory value depends on.
[0042] In one embodiment, constructing a memory value fetching page includes:
[0043] The memory value fetching page is constructed using JSP and / or HTML formats.
[0044] In one embodiment, constructing a memory value fetching page includes:
[0045] Based on the classes and methods that the memory values depend on, generate the corresponding classes and methods for the JSP pages.
[0046] Based on the class and method of the JSP page, obtain the corresponding JSP page tags;
[0047] Based on the tags of the JSP page, extract the class, method, and memory variable names that the memory values depend on.
[0048] In a specific embodiment, the constructed visualization page is a JSP, and the following JSP format header declaration is generated first.
[0049] <%@page contentType="text / html;charset="utf-8"%>
[0050] <! DOCTYPE html PUBLIC"- / / W3C / / DTD HTML 4.01Transitional / / EN""http: / / www.w3.org / TR / html4 / loose.dtd">
[0051] Then, the class method import declaration section of the JSP is generated, and the following content is generated based on the dependency classes obtained from the initialization parsing.
[0052] <%@page import="ClassName1"%>
[0053] ...
[0054] <%@page import="ClassNameN"%>
[0055] Then, the main body of the JSP is generated, displaying the table section. Based on the dependency method names obtained from the initialization parsing, the table tags are mixed to generate the following content.
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066]
[0067]
[0068]
[0069] <table border="1"> ParaName ParaValue / / table header<% / / obtain variable memory object valuesString[] PARAMS = {"Variable Name 1", "Variable Name 2", "Variable Name N"};String[] PARAMSDESC = {"Variable Description 1", "Variable Description 2", "Variable Description N"};String[] VALUES = new String[PARAMS.length];for(int j = 0; j < PARAMS.length; j++){VALUES[j] = (String) initialization dependency method(PARAMS[j]);}for(int i = 0; i < PARAMS.length; i++){ / / construct table content from memory object valuesout.print(" "+PARAMSDESC[i]+" "+VALUES[i]+" ");}%>
[0070] In step 104, the constructed memory value capture page is deployed to the context root path. In the deployed context root path, the memory value capture page is run using the permissions of the classes and methods that the memory value depends on. The changes in parameter names and parameter descriptions are identified based on the memory value capture page, and the changes in parameter names and parameter descriptions are visualized.
[0071] In a specific embodiment, the memory value fetching page is automatically deployed to the application's context root path. This deployment ensures that the JSP page can run in the server's root path and has permission to use its dependent classes and methods. The effect after deployment is as follows... Figure 5 As shown, ParaName is the parameter name, and ParaValue is the parameter description value.
[0072] In one embodiment, it further includes:
[0073] Notify the user of changes in parameter names and descriptions via email, SMS, or telephone notifications, or any combination thereof.
[0074] This invention also provides an application memory parameter capture device, as described in the following embodiments. Since the principle by which this device solves the problem is similar to the application memory parameter capture method, the implementation of this device can refer to the implementation of the application memory parameter capture method; repeated details will not be elaborated further. Figure 6 As shown, the device includes:
[0075] The parameter name and parameter description value recognition module 601 is used to recognize the parameter name and parameter description value of the application background parameters;
[0076] The application background parameter initialization module 602 is used to parse the application initialization code. Based on the parameter name and parameter description value of the application background parameter and the parsed application initialization code, the application background parameter is initialized to the class, method and memory variable name on which the memory value depends.
[0077] The memory value capture page building module 603 is used to build a memory value capture page based on the class, method and memory variable name that the memory value depends on.
[0078] The parameter name and parameter description value change display module 604 is used to deploy the constructed memory value capture page to the context root path. In the deployed context root path, the memory value capture page is run using the permissions of the classes and methods that the memory value depends on. The changes in parameter name and parameter description values are identified based on the memory value capture page, and the changes in parameter name and parameter description values are displayed visually.
[0079] In one embodiment, the parameter name and parameter description value identification module 601 is specifically used for:
[0080] The parameter key name and the remark description information in the CMC configuration center are respectively determined as the parameter name and parameter description value of the application backend parameter;
[0081] The parameter variable names and variable descriptions of the hierarchical parameters in the PaaS platform are respectively determined as the parameter names and parameter description values of the application backend parameters;
[0082] The parameter name and parameter description information in the database parameter table are respectively determined as the parameter name and parameter description values of the application backend parameters. The database parameter table is provided by the application backend.
[0083] In one embodiment, the background parameter initialization module 602 is specifically used for:
[0084] Retrieve all classes imported by the application's backend;
[0085] Initialize the application backend parameters according to the methods corresponding to all classes.
[0086] In one embodiment, the memory value capture page construction module 603 is specifically used for:
[0087] The memory value fetching page is constructed using JSP and / or HTML formats.
[0088] In one embodiment, the memory value capture page construction module 603 is specifically used for:
[0089] Based on the classes and methods that the memory values depend on, generate the corresponding classes and methods for the JSP pages.
[0090] Based on the class and method of the JSP page, obtain the corresponding JSP page tags;
[0091] Based on the tags of the JSP page, extract the class, method, and memory variable names that the memory values depend on.
[0092] In one embodiment, a prompting module is also included, for:
[0093] Notify the user of changes in parameter names and descriptions via email, SMS, or telephone notifications, or any combination thereof.
[0094] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the above-described method for capturing application memory parameters.
[0095] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for capturing application memory parameters.
[0096] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described method for capturing application memory parameters.
[0097] In this embodiment of the invention, an application background parameter identification module identifies and stores the parameter names and descriptions of application background parameters. An initialization parsing module parses the application initialization code and, based on the parsed initialization code, parameter names, and descriptions, initializes the application background parameters to the classes, methods, and memory variable names that the memory values depend on. These parameter names and descriptions are provided by the application background parameter identification module. A memory value capture page generation module, based on the classes, methods, and memory variable names that the application background parameters initialize to depend on the memory values provided by the initialization parsing module, constructs a memory value capture page for visualization. A capture page deployment module deploys the constructed memory value capture page to the context root path. Within the deployed context root path, the memory value capture page runs using the permissions of the classes and methods that the memory values depend on. This visualizes the parameter values, avoiding risks arising from the inability to identify changes in parameter values.
[0098] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0099] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0100] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0101] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0102] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for capturing application memory parameters, characterized in that, include: Identify the parameter name and parameter description value of the application's background parameters; Parse the application initialization code, and based on the parameter name and parameter description value of the application background parameters and the parsed application initialization code, initialize the application background parameters to the class, method and memory variable name on which the memory value depends; Build a memory value fetching page based on the class, method, and memory variable name that the memory value depends on; The constructed memory value capture page is deployed to the context root path. In the deployed context root path, the memory value capture page is run using the permissions of the classes and methods that the memory value depends on. The changes in parameter names and parameter descriptions are identified based on the memory value capture page, and the changes in parameter names and parameter descriptions are visualized. The memory value fetching page deployed to the context root path has permission to use the classes and methods that the memory values depend on.
2. The method as described in claim 1, characterized in that, Identify the parameter name and parameter description value of the application's backend parameters, including one or more of the following: The parameter key name and the remark description information in the CMC configuration center are respectively determined as the parameter name and parameter description value of the application backend parameter; The parameter variable names and variable descriptions of the hierarchical parameters in the PaaS platform are respectively determined as the parameter names and parameter description values of the application backend parameters; The parameter name and parameter description information in the database parameter table are respectively determined as the parameter name and parameter description values of the application backend parameters. The database parameter table is provided by the application backend.
3. The method as described in claim 1, characterized in that, Based on the parameter name and description value of the application background parameters, and the parsed application initialization code, the application background parameters are initialized to the class, method, and memory variable name that the memory value depends on, including: Retrieve all classes imported by the application's backend; Initialize the application backend parameters according to the methods corresponding to all classes.
4. The method as described in claim 1, characterized in that, Build a memory value scraping page, including: The memory value fetching page is constructed using JSP and / or HTML formats.
5. The method as described in claim 4, characterized in that, Build a memory value scraping page, including: Based on the classes and methods that the memory values depend on, generate the corresponding classes and methods for the JSP pages. Based on the class and method of the JSP page, obtain the corresponding JSP page tags; Based on the tags of the JSP page, extract the class, method, and memory variable names that the memory values depend on.
6. The method as described in claim 1, characterized in that, Also includes: Notify the user of changes in parameter names and descriptions via email, SMS, or telephone notifications, or any combination thereof.
7. A device for capturing memory parameters, characterized in that, include: The parameter name and parameter description value recognition module is used to identify the parameter name and parameter description value of the application background parameters; The application background parameter initialization module is used to parse the application initialization code. Based on the parameter name and parameter description value of the application background parameter and the parsed application initialization code, it initializes the application background parameter to the class, method and memory variable name that the memory value depends on. The memory value grabbing page building module is used to build a memory value grabbing page based on the class, method and memory variable name that the memory value depends on; The module for displaying changes in parameter names and descriptions is used to deploy the constructed memory value capture page to the context root path. In the deployed context root path, the memory value capture page is run using the permissions of the classes and methods that the memory value depends on. The module identifies changes in parameter names and descriptions based on the memory value capture page and visualizes these changes. The memory value fetching page deployed to the context root path has permission to use the classes and methods that the memory values depend on.
8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1 to 6.